Two different scanning techniques One passing The other showing TLE.

My first solution CodeChef: Practical coding for everyone in which i use cin cout gets passed while the other one in which i use printf scanf show TLE: CodeChef: Practical coding for everyone .Please help.

1 Like

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.

1 Like

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…

http://www.codechef.com/viewsolution/2302389

thanks maybe long long int was the culprit