[algogeeks] Spoj AMR10D

2013-08-31 Thread emmy
http://www.spoj.com/problems/AMR10D/ A number is a multiple of 11, when its digits are given alternate signs (starting with positive from right) and added w.r.t the signs gives a number modulo 11. The question is asking to partition the given numbers into two groups say S1 and S2 such that

[algogeeks] Spoj FARIDA

2013-05-21 Thread emmy
problem : http://www.spoj.com/problems/FARIDA/ what is wrong with this code? The algorithm is pretty straight forward #includestdio.h #includestdlib.h int main(void) { int t,n,i; scanf(%d,t); long long int s1,s2,s=0,a,temp; int c=1; while(t--) { scanf(%d,n);

[algogeeks] Re: Horrible Queries on spoj

2013-02-27 Thread emmy
I saw other solutions which were accepted with long long int. So apart from the constraints is the algorithm correct? On Tuesday, February 26, 2013 12:24:44 PM UTC+5:30, emmy wrote: Problem statement http://www.spoj.com/problems/HORRIBLE/ Here http://ideone.com/NhDuYo is my code. I am using

[algogeeks] Re: Horrible Queries on spoj

2013-02-27 Thread emmy
Thank you very much! that helped. On Tuesday, February 26, 2013 12:24:44 PM UTC+5:30, emmy wrote: Problem statement http://www.spoj.com/problems/HORRIBLE/ Here http://ideone.com/NhDuYo is my code. I am using segment trees + Lazy propagation. Please help me figure out my mistake. I am

[algogeeks] Re: Horrible Queries on spoj

2013-02-26 Thread emmy
please help On Tuesday, February 26, 2013 12:24:44 PM UTC+5:30, emmy wrote: Problem statement http://www.spoj.com/problems/HORRIBLE/ Here http://ideone.com/NhDuYo is my code. I am using segment trees + Lazy propagation. Please help me figure out my mistake. I am getting a WA Note

[algogeeks] Horrible Queries on spoj

2013-02-25 Thread emmy
Problem statement http://www.spoj.com/problems/HORRIBLE/ Here http://ideone.com/NhDuYo is my code. I am using segment trees + Lazy propagation. Please help me figure out my mistake. I am getting a WA Note: invariant : l = p =q = r l and r are the limits of that node p and q is the query range.

[algogeeks] DP equation for interval problem

2013-01-24 Thread emmy
please help me with the following problem: http://www.spoj.com/problems/JUICE/ bit mask will require very large memory. If I sort the intervals in decreasing order of their start time.. I still cant make it to a dp If I sort the intervals in decreasing order of their finish times I am still not