Record Case Detail

Notes

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

Stderr

10 double
0 print
1 sort inc
/in/correct/dlist.c:117:9: runtime error: variable length array bound evaluates to non-positive value 0
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /in/correct/dlist.c:117:9 in 
2 append yZfqS2EMpb 0.3993577152006793
3 append SWoJwK1C6EzH 0.1536454957613631
4 append sK2FyT 0.11269829725799929
5 sort dec
6 sort inc
7 append IEL2KtGpsCr 0.7957063358982038
8 append iRVsWglay7 0.8639012165969916
9 print
=================================================================
==456==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000000020 at pc 0x00000051703a bp 0x7fff197fbb50 sp 0x7fff197fbb48
READ of size 8 at 0x603000000020 thread T0
    #0 0x517039  (/out/package/main+0x517039)
    #1 0x5153eb  (/out/package/main+0x5153eb)
    #2 0x7fa75f469b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x41cac9  (/out/package/main+0x41cac9)

0x603000000020 is located 16 bytes inside of 24-byte region [0x603000000010,0x603000000028)
freed by thread T0 here:
    #0 0x4dc7b0

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

0
1
2
3
4
5
yZfqS2EMpb=0.399358
SWoJwK1C6EzH=0.153645
sK2FyT=0.112698
yZfqS2EMpb=0.399358
SWoJwK1C6EzH=0.153645
sK2FyT=0.112698
6
yZfqS2EMpb=0.399358
SWoJwK1C6EzH=0.153645
sK2FyT=0.112698
sK2FyT=0.112698
SWoJwK1C6EzH=0.153645
yZfqS2EMpb=0.399358
7
8
9
yZfqS2EMpb=0.399358
SWoJwK1C6EzH=0.153645
sK2FyT=0.112698
IEL2KtGpsCr=0.795706
iRVsWglay7=0.863901
sK2FyT=0.112698
SWoJwK1C6EzH=0.153645
yZfqS2EMpb=0.399358