hubert322's blog

By hubert322, history, 8 years ago, In English

Can someone explain this runtime error? Here's my code: http://ideone.com/pCBf77 Thanks!

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

»
8 years ago, # |
Rev. 2   Vote: I like it +19 Vote: I do not like it
  • Step 1 — repeat the problem on your computer.
  • Step 2 — learn to debug your code (using any method that doesn't involve asking someone to do it in your place).
  • Step 3 — find the bug in your code. It is a very simple mistake and you should be able to do it.

If you have problems with steps 1-2 ask a question.

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

    Sorry, but it compiles fine on my computer, and I really can't find the error. Can you please tell me the problem?

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

      And did you tried running it on the testcase that Codeforces report causing a runtime error? In the very unlikely case that it really works on your computer, you have an option to use online services like ideone or Codeforces custom invocation.

»
8 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Your program crashes at test where n = 1. Also, there is no need to use setw. 20105764