Record Case Detail

Notes

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

Stderr

/in/sam.cpp:73:58: runtime error: index 999 out of bounds for type 'int [16]'
/in/sam.cpp:73:58: runtime error: load of address 0x7ffe8c5ec6bc with insufficient space for an object of type 'int'
0x7ffe8c5ec6bc: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
/in/DlistImpl.h:87:9: runtime error: member access within null pointer of type 'struct node'
ASAN:DEADLYSIGNAL
=================================================================
==33678==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55fbb3dd365c bp 0x603000000010 sp 0x7ffe8c5eb4c0 T0)
==33678==The signal is caused by a WRITE memory access.
==33678==Hint: address points to the zero page.
    #0 0x55fbb3dd365b in Dlist<int>::removeBack() (/out/package/sam_mem+0x1565b)
    #1 0x55fbb3dce6ba in main (/out/package/sam_mem+0x106ba)
    #2 0x7fe1b29b5b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x55fbb3dd04d9 in _sta

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 0
1 2 3 4 0 
LOAD PUSHI 1 LOAD PUSHI 1 LOAD NOR PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
LOAD
1 2 3 4 999 
PUSHI 1 LOAD PUSHI 1 LOAD NOR PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
PUSHI 1
1 2 3 4 999 1 
LOAD PUSHI 1 LOAD NOR PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
LOAD
1 2 3 4 999 888 
PUSHI 1 LOAD NOR PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
PUSHI 1
1 2 3 4 999 888 1 
LOAD NOR PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
LOAD
1 2 3 4 999 888 888 
NOR PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
NOR
1 2 3 4 999 -889 
PUSHI 1 ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
PUSHI 1
1 2 3 4 999 -889 1 
ADD ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0 0 0 0 0 0 0 0 1 
ADD
1 2 3 4 999 -888 
ADD PUSHI 2 STORE NOOP HALT 
999 888 1 2 0 0 0 0