Borderou de evaluare (job #3132627)
Utilizator | Data | 23 mai 2023 12:16:22 | |
---|---|---|---|
Problema | Range minimum query | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'void Build(std::vector<int>&, int)':
main.cpp:18:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
18 | sparse[i][0]=v[i];
| ^
main.cpp:24:22: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
24 | sparse[i][j]=min(sparse[i][j-1],sparse[i+(1<<(j-1))][j-1]);
| ^
main.cpp:24:39: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
24 | sparse[i][j]=min(sparse[i][j-1],sparse[i+(1<<(j-1))][j-1]);
| ^
main.cpp:24:65: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
24 | sparse[i][j]=min(sparse[i][j-1],sparse[i+(1<<(j-1))][j-1]);
| ^
main.cpp: In function 'int Query(int, int)':
main.cpp:32:25: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
32 | return min(sparse[l][lg[length]],sparse[l+length-(1<<lg[length])][lg[length]]);
| ^
main.cpp:32:70: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
32 | return min(sparse[l][lg[length]],sparse[l+length-(1<<lg[length])][lg[length]]);
| ^
main.cpp: In function 'int main()':
main.cpp:44:18: error: no matching function for call to 'std::vector<int>::resize(int, std::vector<int>)'
44 | sparse.resize(n+1,vector<int>(lg[n]+1));
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/vector:64,
from main.cpp:2:
/usr/include/c++/12.2.1/bits/stl_vector.h:1008:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]'
1008 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:1008:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/12.2.1/bits/stl_vector.h:1029:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int; value_type = int]'
1029 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:1029:54: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
1029 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !