Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37989 | 氩_wjy | 【S】T1 | C++ | 通过 | 100 | 0 MS | 244 KB | 318 | 2025-06-08 15:01:37 |
#include<bits/stdc++.h> #define int long long using namespace std; int H,M; inline int gcd(int a,int b){return !b?a:gcd(b,a%b);} signed main(){ cin>>H>>M; int U=0,D=H*M; if(H<=M)U=D-(H-1)*H/2; else U=M*(M+1)/2; int G=gcd(U,D); U/=G,D/=G; cout<<U<<"/"<<D<<endl; return 0; }