INTEST c++ getting Time limit exceeded error

Hi iam a beginner in coding and this is my soution for Problem code: INTEST.http://www.codechef.com/viewsolution/5253317. Iam getting a time limit exceeded error. Can anyone give me some references for minimizing time consumption of code in competitive coding.

1 Like

cin will give TLE in this problem. Use scanf instead for getting AC. Use getchar_unlocked() for best results.

1 Like

can i get a complete reference for reducing time elaped by the code?.

well, thanks. I found a guide on google

1 Like

you can compare results here

1 Like