Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==85326==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc4d484910 at pc 0x0000004a8f89 bp 0x7ffc4d483ef0 sp 0x7ffc4d4836a0 WRITE of size 4 at 0x7ffc4d484910 thread T0 #0 0x4a8f88 (/out/package/ex4+0x4a8f88) #1 0x4aa217 (/out/package/ex4+0x4aa217) #2 0x4aa2f6 (/out/package/ex4+0x4aa2f6) #3 0x515897 (/out/package/ex4+0x515897) #4 0x514fe7 (/out/package/ex4+0x514fe7) #5 0x7f4c39384b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #6 0x41cab9 (/out/package/ex4+0x41cab9) Address 0x7ffc4d484910 is located in stack of thread T0 at offset 2032 in frame #0 0x5150ff (/out/package/ex4+0x5150ff) This frame has 4 object(s): [32, 2032) 'matrix' (line 7) <== Memory access at offset 2032 overflows this variable [2160, 2760) 'arow' (line 8) [2896, 3496) 'tmp' (line 13) [3632, 1003632) 'result' (line 14) HINT: this may be a false positive if your program uses some custom stack unwind mechani
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
STDOUT START 158 -41 -77 -122 95 121 -33 9 44 56 136 -77 -21 108 -8 -29 -41 83 63 122 -168 89 30 69 -117 -84 -170 78 16 -52 -93 -40 -144 3 -17 -14 2 -82 -27 133 -2 51 33 57 51 134 -72 7 68 45 154 70 40 124 -26 -53 -50 11 -1 66 16 31 104 22 -126 -100 62 -37 85 -30 131 -107 179 -190 -41 122 34 113 32 38 -9 -56 54 26 90 115 50 -97 -146 -103 18 106 0 -134 103 -5 83 79 111 -101 66 -15 -49 -101 48 70 11 -66 89 35 77 43 5 109 -34 -47 65 88 -88 -23 45 118 -121 -131 2 4 -5 -1 -14 55 -60 -143 -118 -140 -148 -90 -8 3 -27 -30 -57 -98 26 108 -67 -5 -72 -102 -92 38 32 0 72 -35 -96 -138 133 55 41 -31 -117 -156 105 23 -96 -24 110 -147 14 -25 125 -146 -150 154 -72 -27 173 69 -27 14 -89 87 113 -113 -56 101 -169 -19 12 -24 30 80 -45 -75 -62 -198 98 18 -51 -17 -45 32 13 -17 -119 22 133 -69 43 39 16 109 -64 -31 54 55 -178 112 -169 10 -86 97 -36 -104 -115 -80 89 32 -89 128 -34 168 45 -75 127 75 140 20 -151 44 81 3 -127 -58 -32 -143 -162 -21 31 1 69 28 66 -129 82 -135 18 26 30 144 92 -2 81 -84 -1 64 -71 -132 -74 -34 -162 100 5