Submission #828902

#TimeUsernameProblemLanguageResultExecution timeMemory
828902BaytoroVision Program (IOI19_vision)C++17
100 / 100
11 ms1804 KiB
#include "vision.h" //#include "grader.cpp" #include <bits/stdc++.h> #define pb push_back #define fr first #define sc second using namespace std; const int N=405; vector<int> g1[N],g2[N]; int p[2][N]; void construct_network(int H, int W, int K) { for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ g1[i+j].pb(i*W+j); g2[i-j+W-1].pb(i*W+j); } } vector<int> a,b; for(int i=0;i<H+W-1;i++){ int x=add_or(g1[i]),y=add_or(g2[i]); if(i) p[0][i]=add_or({p[0][i-1],x}),p[1][i]=add_or({p[1][i-1],y}); else p[0][i]=add_or({x}),p[1][i]=add_or({y}); if(i>=K){ a.pb(add_and({x,p[0][i-K]})); a.pb(add_and({y,p[1][i-K]})); } if(i>=K+1){ b.pb(add_and({x,p[0][i-K-1]})); b.pb(add_and({y,p[1][i-K-1]})); } } if(!b.empty()) add_xor({add_or(a),add_or(b)}); else add_or(a); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...