Rahul3006's blog

By Rahul3006, history, 2 months ago, In English

Problem Link

using vector to solve the problem lands me to TLE but the same logic used by the array got accepted. WHY?

SOLN (by vector): (https://codeforces.com/problemset/submission/1747/184215576). SOLN (by array): (https://codeforces.com/problemset/submission/1747/184217645)

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

»
2 months ago, # |
  Vote: I like it +13 Vote: I do not like it

Your debug define seems to be wrong. It uses ifndef. So now on the judge you are debugging the vector each time. I don't know why that is so slow, but at least it's not what you intended.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -10 Vote: I do not like it

    Please could you suggest a good debug function .. No need to explain the functionality behind it. Just how its used would be sufficient.

    I lack a good snippet of Debugging. I would be grateful if you could point me towards a good one. Thank you.