Submission #922429

#TimeUsernameProblemLanguageResultExecution timeMemory
922429ttamxVision Program (IOI19_vision)C++14
Compilation error
0 ms0 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { vector<int> res; for(int xi=0;xi<H;xi++){ for(int yi=0;yi<W;yi++){ for(int xj=0;x<=xi;xj++){ for(int yj=0;yj<=yi;yj++){ if(xi-xj+yi-yj==K){ res.push_back({xi*W+yi,xj*W+yj}); } } } } } add_or(res); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:10:23: error: 'x' was not declared in this scope; did you mean 'xj'?
   10 |          for(int xj=0;x<=xi;xj++){
      |                       ^
      |                       xj
vision.cpp:13:53: error: no matching function for call to 'std::vector<int>::push_back(<brace-enclosed initializer list>)'
   13 |                      res.push_back({xi*W+yi,xj*W+yj});
      |                                                     ^
In file included from /usr/include/c++/10/vector:67,
                 from vision.h:5,
                 from vision.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const int&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~