QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#327057#6715. Масив i ще кiлька масивiвZhangYiDeCompile Error//C++201.5kb2024-02-14 18:31:382024-02-14 18:31:38

Details

answer.code: In function ‘int main()’:
answer.code:39:18: error: request for member ‘reserve’ in ‘a.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   39 |             a[i].reserve(l+1);
      |                  ^~~~~~~
answer.code:9:13: error: request for member ‘emplace_back’ in ‘a.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
    9 | #define emb emplace_back
      |             ^~~~~~~~~~~~
answer.code:40:18: note: in expansion of macro ‘emb’
   40 |             a[i].emb(0);
      |                  ^~~
answer.code:9:13: error: request for member ‘emplace_back’ in ‘a.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
    9 | #define emb emplace_back
      |             ^~~~~~~~~~~~
answer.code:45:24: note: in expansion of macro ‘emb’
   45 |                   a[i].emb(num);
      |                        ^~~
answer.code:50:23: error: request for member ‘begin’ in ‘a.std::vector<int>::operator[](1)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   50 |             sort(a[1].begin()+1, a[1].end());
      |                       ^~~~~
answer.code:50:39: error: request for member ‘end’ in ‘a.std::vector<int>::operator[](1)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   50 |             sort(a[1].begin()+1, a[1].end());
      |                                       ^~~
answer.code:52:25: error: invalid types ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]’ for array subscript
   52 |             int d = a[1][1] - 1;
      |                         ^
answer.code:54:27: error: invalid types ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]’ for array subscript
   54 |                   if( a[1][i] - i != d ) {
      |                           ^