标签:csdn enter mod iss out content == namespace chmod
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 798 Accepted Submission(s): 527
#include<iostream> #include<cmath> #include<stdio.h> using namespace std; typedef long long int ll; ll n,m; ll fenzi,fenmu; ll tmp; ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); } int main() { while(~scanf("%lld%lld",&n,&m)&&(n*m)) { fenzi=n*(m-1); fenmu=m*m; tmp=gcd(fenzi,fenmu); fenzi/=tmp; fenmu/=tmp; printf("%lld/%lld\n",fenzi,fenmu); } return 0; }
博客园首页新随笔联系管理订阅 随笔- 524 文章- 0 评论- 20 hdu-5810 Balls and Boxes(概率期望)
标签:csdn enter mod iss out content == namespace chmod
原文地址:http://www.cnblogs.com/stepping/p/7169700.html