Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

dicfore's blog

By dicfore, history, 8 years ago, In English

53378157 well there s not much to be said i just dont get the error ,i ve tested it out on my compiler and it outputs '387420489' what do they mean by runtime error?

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

| Write comment?
»
8 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

You have an out-of-bounds array access on this line: t[j].number = aux;. Check the value of your j variable.

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

    it works on my compiler that's why i got confused, thanks a lot :D

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

      You should learn how to use a debugger which can help you find bugs like this one in the future.

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

        Can you tell what debugger do you mean? I use custom invocation's Clang C++ Diagnostics to debug such cases. Did you mean gdb?

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

          I use the Visual Studio debugger which catches a lot of things like this. The diagnostics are probably even better at finding memory issues in particular.