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

Tests(60/60):


#include<bits/stdc++.h> #define int long long using namespace std; signed main() { //freopen("relax.in","r",stdin); //freopen("relax.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); int n,m; cin>>n>>m; int pre=m; int suf=max(0ll,m-n+1); int num=min(n,m+1); int ans=(pre+suf)*num/2; //cout<<ans; int sum=n*m; //cout<<ans<<" "<<sum<<'\n'; int now=__gcd(ans,sum); cout<<ans/now<<'/'<<sum/now; }


测评信息: