QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#450479#2880. Letters Q and FHuangHanShengCompile Error//C++981.4kb2024-06-22 14:04:562024-06-22 14:04:57

Details

answer.code: In function ‘int main()’:
answer.code:10:25: error: ‘>>’ should be ‘> >’ within a nested template argument list
   10 |     vector<pair<int, int>> q(10);
      |                         ^~
      |                         > >
answer.code:11:78: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   11 |     q = {{0,0}, {0,1}, {0,2}, {1,0}, {2,0}, {2,1}, {2,2}, {1,2}, {3,2}, {4,2}};
      |                                                                              ^
answer.code:11:78: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
answer.code:11:78: error: no match for ‘operator=’ (operand types are ‘std::vector<std::pair<int, int> >’ and ‘<brace-enclosed initializer list>’)
In file included from /usr/include/c++/13/vector:72,
                 from /usr/include/c++/13/queue:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157,
                 from answer.code:1:
/usr/include/c++/13/bits/vector.tcc:210:5: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]’
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<std::pair<int, int> >&’
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
answer.code:12:25: error: ‘>>’ should be ‘> >’ within a nested template argument list
   12 |     vector<pair<int, int>> f(8);
      |                         ^~
      |                         > >
answer.code:13:64: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   13 |     f = {{0,0}, {0,1}, {0,2}, {1,0}, {2,0}, {3,0}, {4,0}, {2,1}};
      |                                                                ^
answer.code:13:64: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
answer.code:13:64: error: no match for ‘operator=’ (operand types are ‘std::vector<std::pair<int, int> >’ and ‘<brace-enclosed initializer list>’)
/usr/include/c++/13/bits/vector.tcc:210:5: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]’
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<std::pair<int, int> >&’
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
answer.code:24:22: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   24 |                 auto [x, y] = q[w];
      |                      ^
answer.code:24:22: error: ISO C++ forbids declaration of ‘structured binding’ with no type [-fpermissive]
   24 |                 auto [x, y] = q[w];
      |                      ^~~~~~
answer.code:24:22: error: structured binding declaration cannot be C++98 ‘auto’
answer.code:24:22: error: structured binding declaration cannot have type ‘int’
answer.code:24:22: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’
answer.code:35:22: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   35 |                 auto [x, y] = f[w];
      |                      ^
answer.code:35:22: error: ISO C++ forbids declaration of ‘structured binding’ with no type [-fpermissive]
   35 |                 auto [x, y] = f[w];
      |                      ^~~~~~
answer.code:35:22: error: structured binding declaration cannot be C++98 ‘auto’
answer.code:35:22: error: structured binding declaration cannot have type ‘int’
answer.code:35:22: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’