Record Case Detail

Notes

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

Stderr

=================================================================
==27293==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffecb8211d0 at pc 0x55fa0af0c852 bp 0x7ffecb81fb20 sp 0x7ffecb81fb10
READ of size 8 at 0x7ffecb8211d0 thread T0
    #0 0x55fa0af0c851 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 0x55fa0af06fa4 in main (/out/package/sam_mem+0x2fa4)
    #2 0x7fa123ebeb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x55fa0af07ad9 in _start (/out/package/sam_mem+0x3ad9)

Address 0x7ffecb8211d0 is located in stack of thread T0 at offset 5600 in frame
    #0 0x55fa0af0831f 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

NOR

JOJ Answer

NOR
93180588 53515141 42568661 14129092 9298915 96248587 44944310 53880501 98355984 84222140 93992653 63629501 66042518 88488684 51125851 37920855 65062089 20620620 43519219 46953676 84108375 76879852 71503070 51547448 62415788 17439474 5187854 87061720 66525047 93326794 39140258 6461312 78672915 -90569980 
NOOP PUSHI 6 LOAD ADD PUSHI 713544042 POP IFZ 15 NOOP NOR PUSHI 0 IFZ 5 ADD STORE NOOP POP LOAD PUSHI 10 STORE PUSHI 4 LOAD POP POP POP NOOP NOOP ADD PUSHI 3 LOAD PUSHI 554459755 NOOP PUSHI 1580286484 PUSHI 5 STORE IFZ 16 PUSHI 1819880699 PUSHI 6 STORE POP PUSHI 8 STORE PUSHI 8 LOAD NOR PUSHI 2 LOAD PUSHI 13 LOAD PUSHI 2119072701 IFZ 0 POP PUSHI 1 STORE PUSHI 623345146 NOOP POP PUSHI 0 IFZ 25 HALT HALT LOAD NOR ADD LOAD PUSHI 1212838840 PUSHI 883731696 LOAD NOOP NOR POP PUSHI 1164914762 PUSHI 1525324784 ADD ADD STORE NOR POP ADD IFZ 30 NOR NOR ADD LOAD PUSHI 1168530389 NOOP PUSHI 3 LOAD NOOP POP PUSHI 0 IFZ 18 NOOP STORE NOR POP NOOP IFZ 6 POP NOR STORE NOOP STORE IFZ 1 ADD HALT PUSHI 1765334898 LOAD POP