Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==24338==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffce2475950 at pc 0x55584cf97bc8 bp 0x7ffce24750d0 sp 0x7ffce24750c0 WRITE of size 4 at 0x7ffce2475950 thread T0 #0 0x55584cf97bc7 in main (/out/package/sam_mem+0x5bc7) #1 0x7f3e59e66b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #2 0x55584cf98169 in _start (/out/package/sam_mem+0x6169) Address 0x7ffce2475950 is located in stack of thread T0 at offset 2000 in frame #0 0x55584cf9422f in main (/out/package/sam_mem+0x222f) This frame has 23 object(s): [32, 33) '<unknown>' [96, 100) 'opsize' [160, 164) 'instsize' [224, 228) 'temp' [288, 292) '<unknown>' [352, 356) '<unknown>' [416, 420) 'temp2' [480, 484) 'temp1' [544, 576) '__tmp' [608, 640) '__tmp' [672, 704) '__tmp' [736, 768) '__tmp' [800, 832) '__tmp' [864, 896) '__tmp' [928, 960) '__tmp' [992, 1024) '__tmp' [1056, 113
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
PUSHI 2 98095241 86080281 36881268 49624697 79203006 69422869 33385773 84407039 31178022 5630953 32390696 2 LOAD NOR PUSHI 0 IFZ 29 HALT NOOP HALT ADD STORE STORE NOR PUSHI 1920698278 HALT ADD NOOP NOR NOR NOOP NOR ADD ADD IFZ 18 NOOP IFZ 6 LOAD NOR NOR NOOP POP IFZ 25 HALT LOAD IFZ 8 NOR ADD POP NOOP NOOP ADD PUSHI 0 IFZ 19 IFZ 17 IFZ 8 IFZ 26 NOR PUSHI 1801720149 PUSHI 1745548261 NOR POP STORE STORE POP IFZ 5 STORE STORE HALT POP HALT NOOP STORE NOR POP NOOP PUSHI 14 STORE PUSHI 5 STORE NOR NOOP NOOP NOOP PUSHI 14 STORE NOOP PUSHI 3 STORE NOOP NOOP NOOP NOOP PUSHI 326001145 PUSHI 15 STORE NOOP NOOP PUSHI 658062153 PUSHI 2 LOAD NOR PUSHI 11 LOAD NOR PUSHI 2 LOAD PUSHI 6 STORE NOOP PUSHI 0 IFZ 3 ADD IFZ 1 IFZ 0 PUSHI 1 LOAD NOR PUSHI 0 LOAD PUSHI 7 STORE IFZ 25 PUSHI 2138204861 PUSHI 0 IFZ 26 POP PUSHI 446256260 LOAD PUSHI 1252739383 NOOP IFZ 27 PUSHI 781444651 NOOP NOOP NOR STORE IFZ 17 LOAD ADD IFZ 23 LOAD LOAD POP NOR PUSHI 1616590112 HALT LOAD HALT POP LOAD NOR POP NOOP PUSHI 1107579743 PUSHI 3 LOAD PUSH