My first solution http://www.codechef.com/viewsolution/2302310 in which i use cin cout gets passed while the other one in which i use printf scanf show TLE: http://www.codechef.com/viewsolution/2302323 .Please help.
The second solution link you have mentioned it not a TLE.
It is a WA.
scanf and printf are almost 3 times faster than cin and cout.
Its not possible that you get acc using cin and cout while you get TLE with scanf and printf.
Don’t know what’s wrong with your second code.
But after removing long long in your code it works fine. You can check the solution here. Hope it helps.
sorry dude i shared the wrong link.Now i have rectified it.
Thats the wierd part how iam getting TLE.
There must be something wrong with your second code.
But scanf and printf part works absolutely fine.
I took your acc code
replaced cin and cout by scanf and printf and it was accepted…
thanks maybe long long int was the culprit