Problem queuecutting
User JoshJuice
Submission Time 2024-06-27 09:33:17
Score 0
Max Time N/A
Max Memory N/A

Compile Error

queuecutting.cpp: In function ‘int main()’:
queuecutting.cpp:29:26: error: no match for ‘operator[]’ (operand types are ‘std::deque<int>’ and ‘std::deque<int>::iterator’ {aka ‘std::_Deque_iterator<int, int&, int*>’})
29 | cout << queue[queue.begin()] << endl;
| ^
In file included from /usr/include/c++/9/deque:67,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:68,
from queuecutting.cpp:2:
/usr/include/c++/9/bits/stl_deque.h:1400:7: note: candidate: ‘std::deque<_Tp, _Alloc>::reference std::deque<_Tp, _Alloc>::operator[](std::deque<_Tp, _Alloc>::size_type) [with _Tp = int; _Alloc = std::allocator<int>; std::deque<_Tp, _Alloc>::reference = int&; std::deque<_Tp, _Alloc>::size_type = long unsigned int]’
1400 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/9/bits/stl_