Please read the new rule regarding the restriction on the use of AI tools. ×

hasanraj3100's blog

By hasanraj3100, history, 8 months ago, In English

I was looking at this problem A. Laptops and I found an accepted solution : https://codeforces.me/contest/456/submission/19548093.

but I don't see how it got accepted.

This solution shouldn't work for this testcase:

$$$ \\ 3\\ 1\;2\\ 2\;3 \\ 3\;4\\ $$$

Am I missing something here? Sorry if it's too noobish to ask.

  • Vote: I like it
  • -15
  • Vote: I do not like it

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by hasanraj3100 (previous revision, new revision, compare).

»
8 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Look at the constraints. $$$1 \leq a_i, b_i \leq n$$$. Your test case violates this constraint.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Right! Thank you very much. I didn't realize constraint is the game changer here :p