Re: [algogeeks] SPOJ problem : CANDY

2012-06-21 Thread Bhavesh agrawal
in this prob also for i=0, i to k read cand rem=(rem+cand)%k if (rem) then no else yes -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send

Re: [algogeeks] SPOJ problem : CANDY

2012-06-21 Thread Mayank Singh
my code is running perfectly well but giving WA in spoj.. #includestdio.h #includestdlib.h int main() { int cand,sum; int T,N,i,j,temp[10]; scanf(%d,T); sum = 0; for(i=0;iT;i++) { scanf(%d,N); for(j=0;jN;j++) { scanf(%d,cand);

Re: [algogeeks] SPOJ problem : CANDY

2012-06-21 Thread Bhavesh agrawal
i think you should try to give output for each test case rather to use any temp array -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email

[algogeeks] SPOJ problem : CANDY III

2012-06-21 Thread Mayank Singh
here is my code : #includestdio.h #includestdlib.h int main() { long long cand,sum; int T,N,i,j,*temp; scanf(%d,T); temp= (int*)calloc(T, sizeof( int)); sum = 0; for(i=0;iT;i++) { scanf(%d,N); for(j=0;jN;j++) { scanf(%lld,cand);

Re: [algogeeks] SPOJ problem : CANDY III

2012-06-21 Thread romil bansal
Initialize sum as zero for all test cases ie inside 1st for loop. On Jun 21, 2012 5:22 PM, Mayank Singh singh13490may...@gmail.com wrote: here is my code : #includestdio.h #includestdlib.h int main() { long long cand,sum; int T,N,i,j,*temp; scanf(%d,T); temp=

Re: [algogeeks] SPOJ problem : CANDY III

2012-06-21 Thread amrit harry
@Mayank coding style not seems gud.. try this... int main() { int testCases; scanf(%d,testCases); while(testCases--0) { //perform ur logic //print output for each test case here instead of storing it into an array. } } return 0; } On Thu, Jun 21, 2012 at 10:35 PM,

[algogeeks] SPOJ problem : CANDY

2012-06-20 Thread Mayank Singh
i am using long long but still getting WA. here's my code #includestdio.h #includeconio.h int main() { long long cand,sum; int T,N,i,j,temp[10]; scanf(%d,T); sum = 0; for(i=0;iT;i++) { scanf(%d,N); for(j=0;jN;j++) {

Re: [algogeeks] SPOJ problem : CANDY

2012-06-20 Thread Bhavesh agrawal
long long not require in this que . try it again.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] SPOJ problem : CANDY

2012-06-20 Thread Mayank Singh
still getting the WA . is there any test case i am getting wrong? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] SPOJ problem : CANDY

2012-06-20 Thread Bhavesh agrawal
here is my code u can check that.. http://ideone.com/Gii1d -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] SPOJ problem : CANDY

2012-06-20 Thread Krishnan
@mayank: For each testcase sum is not zero make sum=0 inside the for loop -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] SPOJ problem : CANDY

2012-06-20 Thread Mayank Singh
oh i am really sorry the problem is CANDY III can you help me regarding that once again sorry -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from