Problem rollercoaster
User BuiNgocDuc
Submission Time 2025-06-20 16:33:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

rollercoaster.cpp: In function ‘int main()’:
rollercoaster.cpp:14:25: error: request for member ‘back’ in ‘arr’, which is of non-class type ‘long long int [n]’
14 | cout << arr.back() - arr.front() << " ";
| ^~~~
rollercoaster.cpp:14:38: error: request for member ‘front’ in ‘arr’, which is of non-class type ‘long long int [n]’
14 | cout << arr.back() - arr.front() << " ";
| ^~~~~
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from rollercoaster.cpp:1:
/usr/include/c++/9/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
/usr/include/c++/9/bits/stl_algo.h:1890:25: requ