Is there something wrong with this problem?


  • 0
    Z

    This problem is supposed to be simple DP, right?
    I wrote my own version of code, and got Runtime Error on the following case:
    [[0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,0,0,1,0,0],[0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,1],[0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,1,0,0,1,0,0],[0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0],[1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1],[0,0,0,0,1,0,0,1,0,1,1,1,0,0,0,1,0,0,1,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0],[1,0,1,0,1,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,0],[0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,1],[0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0],[1,0,0,0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,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0]]

    After debugging and rewriting the code over and over, I decided to try others' code to see if the problem itself was bugged.
    So I picked several C++ solutions posted before and submitted every one of them, then they all got the same Runtime Error as I did.
    They're supposed to be Accepted already, aren't they?

    What's wrong? Has anybody encountered the same error?


  • 0
    Z

    I got a reply from leetcode admin.
    They've just updated their C++ compiler settings to detect integer overflow(which would usually be just ignored and wrapped around).

    So the runtime error is caused by integer overflow.
    Reference:
    http://en.cppreference.com/w/cpp/error/overflow_error


  • 0
    F

    I had same issue yesterday. The result of last test case did not exceed INT_MAX in c++ int. Also all other numbers were all positive and no greater than the return value.


  • 0
    F

    The issue is gone now. I just tried the same code as before and it passed OJ.


  • 0
    Z

    @fantasy Yeah, admin has removed overflow detection from compiler settings.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.