Record Case Detail

Notes

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

Stderr

=================================================================
==22925==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd04f8e860 at pc 0x55e062aaf852 bp 0x7ffd04f8d1b0 sp 0x7ffd04f8d1a0
READ of size 8 at 0x7ffd04f8e860 thread T0
    #0 0x55e062aaf851 in taking_command(Stack<int>&, Queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int*, bool) (/out/package/sam_mem+0x8851)
    #1 0x55e062aa9fa4 in main (/out/package/sam_mem+0x2fa4)
    #2 0x7f5a5ba8db96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x55e062aaaad9 in _start (/out/package/sam_mem+0x3ad9)

Address 0x7ffd04f8e860 is located in stack of thread T0 at offset 5600 in frame
    #0 0x55e062aab31f in taking_command(Stack<int>&, Queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, int*, bool) (/out/package/sam_mem+0x431f)

  This frame has 26 object(s):
    [32, 33) '<unknown>'
    [96, 97) '<unknown>'
    [160, 161) '<unknown>'
    [224,

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

POP

JOJ Answer

POP
68303003 10504706 31500431 92014888 26857265 36590364 21887082 5003718 70989741 40740462 44173995 29434395 60050901 99289747 44851789 38571783 935946 80270648 48307451 2296027 70438236 85857594 48774507 93702914 68009406 12959254 
NOOP ADD POP PUSHI 5 LOAD POP ADD POP ADD PUSHI 514403241 NOOP NOR NOOP PUSHI 1203030042 PUSHI 12 LOAD IFZ 19 NOR PUSHI 1143530261 PUSHI 15 STORE PUSHI 15 LOAD IFZ 12 PUSHI 7 STORE PUSHI 0 IFZ 18 ADD HALT POP IFZ 5 NOR POP LOAD STORE LOAD POP HALT STORE POP ADD NOOP IFZ 29 ADD NOOP NOR NOR IFZ 13 POP PUSHI 1283812859 PUSHI 432295147 IFZ 17 PUSHI 433825714 PUSHI 8 STORE PUSHI 11 LOAD NOR PUSHI 6 LOAD PUSHI 1 STORE NOOP POP PUSHI 15 STORE PUSHI 9 STORE ADD NOR NOR NOR NOR NOOP NOOP PUSHI 484356928 NOR POP PUSHI 3 LOAD NOR PUSHI 0 STORE POP PUSHI 6 STORE POP PUSHI 305884821 PUSHI 5 LOAD NOOP POP PUSHI 6 STORE POP NOR PUSHI 11 STORE NOOP PUSHI 555982179 NOOP PUSHI 1356401537 PUSHI 513375311 PUSHI 0 IFZ 1 PUSHI 244360028 PUSHI 9 STORE NOR IFZ 19 PUSHI 1 LOAD PUSHI 14 LOAD IFZ 15 PU