Notes
This function is in beta test. Please help improve it in the issues
here.
/in/lab4.c:100:40: runtime error: index -1 out of bounds for type 'int [120]' ================================================================= ==49464==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd3fd3079c at pc 0x558713b04e39 bp 0x7ffd3fd30440 sp 0x7ffd3fd30430 READ of size 4 at 0x7ffd3fd3079c thread T0 #0 0x558713b04e38 in RVPcalculation (/out/package/lab4+0x9e38) #1 0x558713b01a33 in main (/out/package/lab4+0x6a33) #2 0x7f5a8e31fb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x558713b01f49 in _start (/out/package/lab4+0x6f49) Address 0x7ffd3fd3079c is located in stack of thread T0 at offset 540 in frame #0 0x558713b0203f in RVPcalculation (/out/package/lab4+0x703f) This frame has 5 object(s): [32, 512) 'helper' [544, 1024) 'priority' <== Memory access at offset 540 underflows this variable [1056, 2016) 'RVP' [2048, 3008) 'stack' [3040, 4000) 'num_restore' HINT: this may be a false positive if your program uses some custo
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
2.000000 0.000250 -0.250000 0.888889 -3.777800 777.375000 64.000000 4.160000 2.550000 128.000000