Search found 2 matches

by blckhrt
Mon Aug 22, 2011 8:36 pm
Forum: Volume 106 (10600-10699)
Topic: 10656 - Maximum Sum (II)
Replies: 52
Views: 16514

Re: 10656 - Maximum Sum (II)

pls help..um continuosly getting wa in this code..wat's wrong??? #include<stdio.h> int main() { long long int n,i,j,k,flag,num[10000]; while(scanf("%lld",&n)==1) { if(n==0) break; flag=0; for(i=0;i<n;i++) { scanf("%lld",&num ); if(num ==0) { flag++; } } if(flag==n) printf("0\n"); else { for(j=0;j<n;...
by blckhrt
Wed May 04, 2011 8:35 pm
Forum: Volume 119 (11900-11999)
Topic: 11970 - Lucky Numbers
Replies: 7
Views: 3659

Re: 11970 - Lucky Numbers

here is my code..got tle..help meeee #include<stdio.h> #include<math.h> int main() { unsigned long int c,i,n,q,d,j,m,ruh[100],sq; while(scanf("%lu",&c)==1) { for(j=1;j<=c;j++) { scanf("%lu",&n); printf("\nCase %lu:",j); sq=(long int)sqrt(n); for(i=sq;i<n;i++) { q=n-i; d=(long int)sqrt(q); if((q==d*d...

Go to advanced search