Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

/in/ex3.cpp:12:9: runtime error: index 25000 out of bounds for type 'int [25000]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/ex3.cpp:12:9 in 
=================================================================
==40161==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe5b7a6f30 at pc 0x00000051d774 bp 0x7ffe5b5a5c70 sp 0x7ffe5b5a5c68
WRITE of size 4 at 0x7ffe5b7a6f30 thread T0
    #0 0x51d773  (/out/package/ex3+0x51d773)
    #1 0x51ad3a  (/out/package/ex3+0x51ad3a)
    #2 0x7fd095007b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x41e129  (/out/package/ex3+0x41e129)

Address 0x7ffe5b7a6f30 is located in stack of thread T0 at offset 2101776 in frame
    #0 0x51b7bf  (/out/package/ex3+0x51b7bf)

  This frame has 6 object(s):
    [32, 552) 'f1'
    [688, 1200) 'f2'
    [1264, 1001264) 'arr1'
    [1001520, 2001520) 'arr2'
    [2001776, 2101776) 'temp' <== Memory access at offset 2101776 overflows this variable
    [2102032, 2102036) 'num'
HINT: this may be a false positive if yo

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.

Please double check your code to solve this problem and try again.

Your Answer


        

JOJ Answer

-32 65 26 -39 -2 59 -35 -111 128 16 -31 63 -57 72 100 -16 31 70 170 80 9 -66 -147 -52 -88 -19 122 134 100 -38 34 -159 -96 47 40 -19 5 -72 25 -58 -61 -130 91 107 -51 85 65 95 -42 46 -56 -57 82 -75 74 9 75 -17 60 25 104 -134 10 70 63 -138 115 82 15 73 -42 103 -25 -76 -42 -144 13 14 -50 59 -96 89 -107 62 105 -48 -79 36 -133 -86 -90 72 74 -36 0 36 29 -116 32 -60 -41 -104 -70 56 59 31 10 -42 -121 54 24 -96 20 91 142 144 -8 25 57 -39 -14 -7 32 -139 -14 36 80 -132 8 -122 73 181 88 36 -13 143 -13 62 -123 -37 37 -76 -6 -54 115 116 -176 85 -40 -98 67 -39 14 95 -47 -5 1 -34 75 19 -163 -109 -17 -3 74 126 -119 58 80 -80 75 -120 -50 161 -42 3 -53 149 112 69 -115 112 -43 -1 34 46 126 -88 -31 98 -19 161 -51 -127 53 -88 21 79 20 60 74 107 20 68 6 -61 97 -50 46 -6 -27 -23 -8 108 -37 -77 -12 41 23 -152 41 123 -81 -3 58 35 -56 60 30 113 -36 -63 -60 1 -10 -145 6 21 -106 12 64 90 -148 -46 -125 -40 -80 84 169 0 -52 -88 24 -97 23 29 -19 -66 44 15 80 -96 40 -107 44 -113 7 96 -9 56 93 -15 72 -131 101 -110 57 -25 141 -110 38 60 1 124 -