[algogeeks] [SPOJ] ZSUM

2011-10-05 Thread hashd
I'm getting WA on the question : ZSUM-SPOJhttps://www.spoj.pl/problems/ZSUM/ Here is my code: Let me know if you can find the problem with the code #includecstdio #define MOD 1007 typedef unsigned long long u64; using namespace std; u64 modExp(u64 x, u64 y){ if(x==0) return 0;

[algogeeks] Re: informatica pattern and question of interview

2011-09-09 Thread hashd
For question 2 I guess finding the minimum element's index should suffice (considering all elements are positive integer). No need to even calculate n! as it might cause overflow in case the arrary is big. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: EOF

2011-09-08 Thread hashd
@Anurag: The input is said to be of unknown and large length ... read it one character at a time using a loop like while((c=getchar())!=EOF){ //body } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit