khem_404's blog

By khem_404, history, 5 weeks ago, In English

Why am I getting TLE.

[Problem C] https://codeforces.com/contest/1574/submission/129400187 Can Anyone explain please!!!

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it
Auto comment: topic has been updated by khem_404 (previous revision, new revision, compare).
»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

There are few things which you should always do/try ,
1. Use Fast I/O

2. Avoid declaring new variable every time you run a loop , you can declare at the very beginning and use it .

3. Use "\n" in place of "endl"
Your accepted code with the following changes