Submission #602748

#TimeUsernameProblemLanguageResultExecution timeMemory
602748misteg168Vision Program (IOI19_vision)C++17
Compilation error
0 ms0 KiB
#include "vision.h" #include <bits/stdc++.h> typedef long long ll; ll dist(ll a, ll b,ll W){ return abs(a%W-b%W) + abs(a/W-b/W); } void construct_network(int H, int W, int K) { vector<int> Ns; ll it = 0; for(int i = 0; i < W*H){ for(int j = 0; j < W*H; j++){ if(dist(i, j) == k) add_and({i, j}), it++; } } for(int i = H*W; i < H*W+it; i++) NS.push_back(i); add_or(NS); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:10:2: error: 'vector' was not declared in this scope
   10 |  vector<int> Ns;
      |  ^~~~~~
vision.cpp:10:2: note: suggested alternatives:
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:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from vision.h:5,
                 from vision.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
vision.cpp:10:9: error: expected primary-expression before 'int'
   10 |  vector<int> Ns;
      |         ^~~
vision.cpp:12:24: error: expected ';' before ')' token
   12 |  for(int i = 0; i < W*H){
      |                        ^
      |                        ;
vision.cpp:14:16: error: too few arguments to function 'll dist(ll, ll, ll)'
   14 |    if(dist(i, j) == k) add_and({i, j}), it++;
      |                ^
vision.cpp:5:4: note: declared here
    5 | ll dist(ll a, ll b,ll W){
      |    ^~~~
vision.cpp:14:21: error: 'k' was not declared in this scope
   14 |    if(dist(i, j) == k) add_and({i, j}), it++;
      |                     ^
vision.cpp:17:36: error: 'NS' was not declared in this scope
   17 |  for(int i = H*W; i < H*W+it; i++) NS.push_back(i);
      |                                    ^~
vision.cpp:18:9: error: 'NS' was not declared in this scope
   18 |  add_or(NS);
      |         ^~