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:G++ AC 0MS,C++ TLE。。。哪位指教下这是什么原因?In Reply To:G++ AC 0MS,C++ TLE。。。哪位指教下这是什么原因? Posted by:Sasuke_SCUT at 2009-07-30 23:43:14 我也是,不知道为什么,你0ms??我怎么16ms-_- ! #include <cstdio> #include <cstring> #define MAXN 35000 char num[MAXN]; int main() { while(scanf("%s",num)!=EOF) { int sum=0,n=-1,temp; for(unsigned int i=0;i<strlen(num);++i) { if(num[i]<='9' && num[i]>='0')temp=num[i]-'0'; else if(num[i]>='A' && num[i]<='Z')temp=num[i]-'A'+10; else temp=num[i]-'a'+36; sum+=temp; if(temp>n)n=temp; } for(;n<=62;++n) if(sum%n==0) break; if(n>=62)printf("such number is impossible!\n"); else printf("%d\n",n+1); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator