| ||||||||||
| 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 | |||||||||
为什么Output Limit Exceeded?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator