Search found 1 match

by happy_dayz
Wed Dec 07, 2011 8:02 am
Forum: Volume 117 (11700-11799)
Topic: 11728 - Alternate Task
Replies: 5
Views: 3301

Re: 11728 - Alternate Task

I got TLE for 11728....what's wrong with my code.... #include<stdio.h> int main() { long i,j,k=0,n,s,m=-1,max; while(scanf("%ld",&n)==1) { k++; if(n==0) break; max=-1; for(i=1;i<=n;i++) { s=0; for(j=1;j<=i;j++) { if(i%j==0) { s+=j; } } if(n==s) { if(i>max) { max=i; } } } printf("Case %ld: %ld\n",k,m...

Go to advanced search