Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请大牛帮忙看看,怎么是RE呢#include<iostream.h> #include<string.h> #include<stdio.h> __int64 gcd(__int64 m,__int64 n) { __int64 t; if(m<n) { t=m; m=n; n=t; } if(n==0)return m; else return gcd(n,m%n); } int main() { __int64 m,n,a[1000],b[1000],c,i,j,k; while(scanf("%I64d%I64d",&n,&m)!=EOF) { c=1; for(i=1;i<=m;i++) a[i]=i; for(i=1;i<=m;i++) b[i]=n-i+1; for(i=1;i<=m;i++) for(j=1;j<=m;j++) { k=gcd(b[i],a[j]); b[i]=b[i]/k; a[j]=a[j]/k; } for(i=1;i<=m;i++) c=c*b[i]; if(c%2==0) cout<<"0"<<endl; else cout<<"1"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator