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

为什么Output Limit Exceeded?

Posted by power721 at 2009-09-27 09:36:14 on Problem 1775
#include<stdio.h>
int a[]={1,1,2,6,24,120,720,5040,40320,362880};
main()
{
int n,i;
while(scanf("%d",&n)&&n!=-1)
{i=10;
if(!n)
	{puts("NO");continue;}
while(i--&&n)
	if(n>=a[i])
		n-=a[i];
if(n)
	puts("NO");
else
	puts("YES");
}		
}

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