gamegame's blog

By gamegame, history, 7 years ago, In English

https://mirror.codeforces.com/contest/1185/submission/55779719

I'm getting ILE and i don't know why.

My code doesn't work on this test.

I tested it a lot of times and it works

LGMs and reds pls help :))

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

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

Honestly I have seen such post from only greys and greens

  • »
    »
    7 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +64 Vote: I do not like it

    I believe that he wants an explanation for the Idleness Limit Exceeded verdict on a NON-INTERACTIVE problem, which is highly irregular.

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

Probably, it is because of undefined behavior in your code. Try to run it with valgrind or similar.

»
7 years ago, hide # |
 
Vote: I like it +23 Vote: I do not like it

When I run it locally i also get ILE. The problem seems to be that you made the add function return an int but you don't have a return statement in it and you don't use the return value; changing it to void made it work.

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

<=greens: 'debug this code' --> negative contribution

blues and purples: 'debug this code' --> actual answers

IGMs: 'debug this code' --> CF admin response :o

»
7 years ago, hide # |
 
Vote: I like it +35 Vote: I do not like it
if(g==1) add(dp[j][a+1][b][c],dp[j-ti][a][b][c]);

You're trying to access index 16 when your array is dp[226][16][16][16].

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

    Yes, but i was surprised that this would make the program fail to detect a runtime error. I thought this would always return RTE

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

"Idleness limit exceeded on pretest 8"

I have never seen a solution have this outcome, ever. What is this ?

»
7 years ago, hide # |
 
Vote: I like it +41 Vote: I do not like it

If you used Java, you wouldn't have these problems.

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

If you use g++, you can compile with the following options.
It helps you to catch undefined behavior when you test locally.
g++ -fsanitize=undefined a.cpp

Learn more here

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

Plot twist- a grey guy hacked a red guy's account so that he can ask doubts