Submission #1233201

#TimeUsernameProblemLanguageResultExecution timeMemory
1233201hq77Vision Program (IOI19_vision)C++20
Compilation error
0 ms0 KiB
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 'int dis(int, int, int)':
vision.cpp:5:12: error: 'abs' was not declared in this scope
    5 |     return abs(x1-x2)+abs(y1-y2);
      |            ^~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int>check;
      |     ^~~~~~
vision.cpp:9:12: error: expected primary-expression before 'int'
    9 |     vector<int>check;
      |            ^~~
vision.cpp:13:24: error: expected primary-expression before 'int'
   13 |                 vector<int>x={i,j};
      |                        ^~~
vision.cpp:14:25: error: 'x' was not declared in this scope
   14 |                 add_and(x);
      |                         ^
vision.cpp:14:17: error: 'add_and' was not declared in this scope
   14 |                 add_and(x);
      |                 ^~~~~~~
vision.cpp:15:17: error: 'check' was not declared in this scope
   15 |                 check.push_back(h*w+cnt);
      |                 ^~~~~
vision.cpp:20:12: error: 'check' was not declared in this scope
   20 |     add_or(check);
      |            ^~~~~
vision.cpp:20:5: error: 'add_or' was not declared in this scope
   20 |     add_or(check);
      |     ^~~~~~