Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
37970 andy2025 【S】T1 C++ 通过 100 0 MS 268 KB 457 2025-06-08 13:56:27

Tests(60/60):


#include <bits/stdc++.h> using namespace std; #define ll long long ll h,m,ans; int main() { //freopen("relax.in","r",stdin); //freopen("relax.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> h >> m; ll tot = h * m; if(h <= m) ans = (m + m - h + 1) * h / 2ll; else ans = (m + 1) * m / 2ll; ll s = __gcd(tot,ans); tot /= s; ans /= s; cout << ans << "/" << tot; return 0; }


测评信息: