QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#251698#7640. Colorful Cyclesucup-team2277Compile Error//C++145.1kb2023-11-14 23:47:012024-07-04 23:04:02

详细

answer.code: In function ‘int main()’:
answer.code:159:20: error: no matching function for call to ‘std::vector<std::array<int, 3> >::push_back(<brace-enclosed initializer list>)’
  159 |             edgs.pb({a,b,c-1});
      |             ~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/13/vector:66,
                 from answer.code:2:
/usr/include/c++/13/bits/stl_vector.h:1278:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::array<int, 3>; _Alloc = std::allocator<std::array<int, 3> >; value_type = std::array<int, 3>]’
 1278 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:35: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<std::array<int, 3> >::value_type&’ {aka ‘const std::array<int, 3>&’}
 1278 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1295:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::array<int, 3>; _Alloc = std::allocator<std::array<int, 3> >; value_type = std::array<int, 3>]’
 1295 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1295:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<std::array<int, 3> >::value_type&&’ {aka ‘std::array<int, 3>&&’}
 1295 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
answer.code:169:26: error: variable ‘std::array<int, 3> color_cnt’ has initializer but incomplete type
  169 |             array<int,3> color_cnt{};
      |                          ^~~~~~~~~
answer.code:173:34: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  173 |                 color_cnt[edgs[j][2]]++;
      |                                  ^
answer.code:174:36: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  174 |                 vert.insert(edgs[j][0]);
      |                                    ^
answer.code:175:36: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  175 |                 vert.insert(edgs[j][1]);
      |                                    ^
answer.code:176:29: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  176 |                 cadj[edgs[j][0]].push_back({edgs[j][1], j});
      |                             ^
answer.code:176:52: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  176 |                 cadj[edgs[j][0]].push_back({edgs[j][1], j});
      |                                                    ^
answer.code:177:29: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  177 |                 cadj[edgs[j][1]].push_back({edgs[j][0], j});
      |                             ^
answer.code:177:52: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  177 |                 cadj[edgs[j][1]].push_back({edgs[j][0], j});
      |                                                    ^
answer.code:184:34: error: variable ‘std::array<int, 3> curr’ has initializer but incomplete type
  184 |                     array<int,3> curr{};
      |                                  ^~~~
answer.code:185:31: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
  185 |                     for(auto& [to, ed]:cadj[j]) {
      |                               ^
answer.code:186:38: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 3> >, std::array<int, 3> >::value_type’ {aka ‘std::array<int, 3>’} and ‘int’)
  186 |                         curr[edgs[ed][2]]++;
      |                                      ^
answer.code:189:51: error: no matching function for call to ‘max(<brace-enclosed initializer list>)’
  189 |                     if(curr[0]+curr[1]+curr[2]>max({curr[0], curr[1], curr[2]})) {
      |                                                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/...