Submission #755690

#TimeUsernameProblemLanguageResultExecution timeMemory
755690Rafi22Vision Program (IOI19_vision)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define ll long long ll mod=1000000007; int inf=1000000007; ll infl=1000000000000000007; int it; /* int add_not(int x) { it++; cout<<it<<endl; cout<<"NOT "<<x<<endl; return it; } int add_or(vector<int>x) { it++; cout<<it<<endl; cout<<"OR "; for(auto a:x) cout<<a<<" "; cout<<endl; return it; } int add_xor(vector<int>x) { it++; cout<<it<<endl; cout<<"XOR "; for(auto a:x) cout<<a<<" "; cout<<endl; return it; } int add_and(vector<int>x) { it++; cout<<it<<endl; cout<<"AND "; for(auto a:x) cout<<a<<" "; cout<<endl; return it; } */ vector<int>add(vector<int>V,int k) { vector<int>res; res.pb(add_xor({V[0],k})); int w=add_and({V[0],k}); for(int i=1;i<=8;i++) { res.pb(add_xor({V[i],w})); w=add_and({V[i],w}); } return res; } void construct_network(int n,int m,int k) { it=n*m-1; add_not(0); for(int i=0;i<n;i++) { vector<int>V; for(int j=0;j<m;j++) V.pb(i*m+j); add_or(V); } add_and({0,n*m}); for(int i=0;i<n;i++) add_xor({n*m+n+i+1,n*m+1+i}); for(int j=0;j<m;j++) { vector<int>V; for(int i=0;i<n;i++) V.pb(i*m+j); add_or(V); } add_and({0,n*m}); for(int j=0;j<m;j++) add_xor({n*m+2*n+m+2+j,n*m+2*n+2+j}); vector<int>ans; for(int i=0;i<=8;i++) ans.pb(add_and({0,n*m})); for(int i=1;i<=n;i++) ans=add(ans,n*m+n+i+1); for(int j=1;j<=m;j++) ans=add(ans,n*m+2*n+m+j+2); int Z=add_and({0,n*m}),O=add_not(Z); vector<int>wyn; for(int i=0;i<=8;i++) { if(k&(1<<i)) wyn.pb(add_xor({Z,ans[i]})); else wyn.pb(add_xor({O,ans[i]})); } add_and(wyn); } /* int main() { construct_network(2,3,2); return 0; } */

Compilation message (stderr)

vision.cpp: In function 'std::vector<int> add(std::vector<int>, int)':
vision.cpp:56:12: error: 'add_xor' was not declared in this scope
   56 |     res.pb(add_xor({V[0],k}));
      |            ^~~~~~~
vision.cpp:57:11: error: 'add_and' was not declared in this scope
   57 |     int w=add_and({V[0],k});
      |           ^~~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:69:5: error: 'add_not' was not declared in this scope
   69 |     add_not(0);
      |     ^~~~~~~
vision.cpp:74:9: error: 'add_or' was not declared in this scope
   74 |         add_or(V);
      |         ^~~~~~
vision.cpp:76:5: error: 'add_and' was not declared in this scope
   76 |     add_and({0,n*m});
      |     ^~~~~~~
vision.cpp:77:26: error: 'add_xor' was not declared in this scope
   77 |     for(int i=0;i<n;i++) add_xor({n*m+n+i+1,n*m+1+i});
      |                          ^~~~~~~
vision.cpp:82:9: error: 'add_or' was not declared in this scope
   82 |         add_or(V);
      |         ^~~~~~
vision.cpp:85:26: error: 'add_xor' was not declared in this scope
   85 |     for(int j=0;j<m;j++) add_xor({n*m+2*n+m+2+j,n*m+2*n+2+j});
      |                          ^~~~~~~
vision.cpp:94:29: error: 'add_xor' was not declared in this scope
   94 |         if(k&(1<<i)) wyn.pb(add_xor({Z,ans[i]}));
      |                             ^~~~~~~
vision.cpp:95:30: error: 'O' was not declared in this scope
   95 |         else wyn.pb(add_xor({O,ans[i]}));
      |                              ^
vision.cpp:95:21: error: 'add_xor' was not declared in this scope
   95 |         else wyn.pb(add_xor({O,ans[i]}));
      |                     ^~~~~~~