Record Case Detail

Notes

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

Stderr

ASAN:DEADLYSIGNAL
=================================================================
==69464==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f685e622634 bp 0x7ffe385095e0 sp 0x7ffe38508d50 T0)
==69464==The signal is caused by a READ memory access.
==69464==Hint: address points to the zero page.
    #0 0x7f685e622633  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79633)
    #1 0x5564aa000c8d in std::char_traits<char>::copy(char*, char const*, unsigned long) (/out/package/ex3+0x14c8d)
    #2 0x5564aa0030a9 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy(char*, char const*, unsigned long) (/out/package/ex3+0x170a9)
    #3 0x5564aa001d4e in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (/out/package/ex3+0x15d4e)
    #4 0x5564aa00105f in _node::operator=(_node&&) (/out/package/ex3+0x1505f)
    #5 0x5564a9fff174 in Station::bus

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

Bus S1 comes!
Bus S2 comes!
Bus S3 comes!
Bus S1 leaves!
Bus S4 comes!
Welcome to the station!
Current number of buses: 3
Error: too many passengers getting on
Bus S5 comes!
Bus S2 leaves!
Bus S3 leaves!
Bus S4 leaves!
Bus S5 leaves!
Error: Station is empty!
Error: Station is empty!