Problem vectorindexing
User stefiewefieslays
Submission Time 2026-06-24 09:32:37
Score 0
Max Time N/A
Max Memory N/A

Compile Error

vectorindexing.cpp: In function ‘int main()’:
vectorindexing.cpp:20:12: error: no match for ‘operator[]’ (operand types are ‘std::vector<long long int>’ and ‘std::vector<long long int>’)
20 | cout << A[X];
| ^
In file included from /usr/include/c++/9/vector:67,
from vectorindexing.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:1040:7: note: candidate: ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::reference = long long int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
1040 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1040:28: note: no known conversion for argument 1 from ‘std::vector<long long int>’ to ‘std::vector<long long