Lately, Ive been trying many questions.For some fairly simple questions, I end up with the correct algorithm and code. It gives the correct answer for many test cases.(even the boundaries) but when i submit i get wrong answer. Ive seen many people (using same alto) get wrong answers and then finally correct it. What is that you people do. Is there anything special other than using % when dealing with modulus 10^9+7, and which data type do you use to handle very very large integers in c/ c++. Im using long long (%lld). Please give me suggestions as how you correct the wrong answer. Its been really frustrating?
For example DBOY :http://www.codechef.com/viewsolution/1593046