Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请大牛帮忙看看,怎么是RE呢

Posted by dreamone at 2007-08-01 15:04:11 on Problem 3219
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator