Submission #546463

#TimeUsernameProblemLanguageResultExecution timeMemory
546463krit3379Vision Program (IOI19_vision)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define N 205 int a[N][N]; vector<int> l[2*N],r[2*N],tl,tr,qsl,qsr; int sol(int k,int h,int w){ int i; vector<int> t; for(i=0;i+k<h+w-1;i++){ t.push_back(add_and({qsl[i],tl[i+k]})); t.push_back(add_and({qsr[i],tr[i+k]})); } return add_or(t); } void construct_network(int h, int w, int k){ int i,j,sz=0; for(i=0;i<h;i++){ for(j=0;j<w;j++){ a[i][j]=sz++; } } for(i=0;i<h;i++){ for(j=0;j<w;j++){ l[i+j].push_back(a[i][j]); r[h-i-1+j].push_back(a[i][j]); } } for(i=0;i<h+w-1;i++){ tl.push_back(add_or(l[i])); qsl.push_back(add_or(tl)); tr.push_back(add_or(r[i])); qsr.push_back(add_or(tr)); } if(k==h+w-2)sol(k,h,w); else add_and({sol(k,h,w),add_not(sol(k+1,h,w))}); }

Compilation message (stderr)

vision.cpp: In function 'int sol(int, int, int)':
vision.cpp:12:21: error: 'add_and' was not declared in this scope
   12 |         t.push_back(add_and({qsl[i],tl[i+k]}));
      |                     ^~~~~~~
vision.cpp:15:12: error: 'add_or' was not declared in this scope
   15 |     return add_or(t);
      |            ^~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:32:22: error: 'add_or' was not declared in this scope
   32 |         tl.push_back(add_or(l[i]));
      |                      ^~~~~~
vision.cpp:38:30: error: 'add_not' was not declared in this scope
   38 |     else add_and({sol(k,h,w),add_not(sol(k+1,h,w))});
      |                              ^~~~~~~
vision.cpp:38:10: error: 'add_and' was not declared in this scope
   38 |     else add_and({sol(k,h,w),add_not(sol(k+1,h,w))});
      |          ^~~~~~~