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 0x7fffa9950dcc with insufficient space for an object of type 'int'
0x7fffa9950dcc: 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:94:9: runtime error: member access within null pointer of type 'struct node'
ASAN:DEADLYSIGNAL
=================================================================
==27876==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55845aa56ecc bp 0x603000000010 sp 0x7fffa994fbd0 T0)
==27876==The signal is caused by a WRITE memory access.
==27876==Hint: address points to the zero page.
    #0 0x55845aa56ecb in Dlist<int>::removeBack() (/out/package/sam_mem+0x15ecb)
    #1 0x55845aa51fa2 in main (/out/package/sam_mem+0x10fa2)
    #2 0x7f29538aeb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x55845aa53c69 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