M.A.H.M.O.O.D's blog

By M.A.H.M.O.O.D, history, 7 years ago, In English

Hello everyone.

I have been trying to solve 455D - Serega and Fun for a long while now and I really need some help.

I can't figure out what's wrong in my solution could someone please help me or at least give a test case where my solution will fail.

Note: I'm using SQ-RT decomposition to solve this problem and when I change the value of SQ I get WA on a different test each time.

Here's my submission : 27521539

Please help I going crazy because of this problem.

Thank you for reading.

  • Vote: I like it
  • +2
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

how much would you pay

  • »
    »
    7 years ago, # ^ |
    Rev. 2   Vote: I like it -9 Vote: I do not like it

    maybe debugging other people's uncommented competitive programming code is fun as a freelance job

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

If you get different outputs each time, then most likely, the problem is that somewhere in your code you access some undefined memory zone. Try asserting every memory access you do to see where the program is failing.

»
7 years ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

http://codeforces.me/contest/455/submission/27531234

Now debug manually.

If your code is correct it will give correct answer for any value of SQ even though it might be slow.