Submission #1233202

#TimeUsernameProblemLanguageResultExecution timeMemory
1233202hq77Vision Program (IOI19_vision)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> int dis(int a, int b, int w){ int x1,y1,x2,y2; x1=a/w,y1=a%w; x2=b/w,y2=b%w; return abs(x1-x2)+abs(y1-y2); } void construct_network(int h, int w, int k){ int cnt=0; vector<int>check; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(dis(i,j,w)==k){ vector<int>x={i,j}; add_and(x); check.push_back(h*w+cnt); cnt++; } } } add_or(check); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:10:5: error: 'vector' was not declared in this scope
   10 |     vector<int>check;
      |     ^~~~~~
vision.cpp:10:5: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from vision.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from vision.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
vision.cpp:10:12: error: expected primary-expression before 'int'
   10 |     vector<int>check;
      |            ^~~
vision.cpp:14:24: error: expected primary-expression before 'int'
   14 |                 vector<int>x={i,j};
      |                        ^~~
vision.cpp:15:25: error: 'x' was not declared in this scope
   15 |                 add_and(x);
      |                         ^
vision.cpp:15:17: error: 'add_and' was not declared in this scope
   15 |                 add_and(x);
      |                 ^~~~~~~
vision.cpp:16:17: error: 'check' was not declared in this scope
   16 |                 check.push_back(h*w+cnt);
      |                 ^~~~~
vision.cpp:21:12: error: 'check' was not declared in this scope
   21 |     add_or(check);
      |            ^~~~~
vision.cpp:21:5: error: 'add_or' was not declared in this scope
   21 |     add_or(check);
      |     ^~~~~~