Submission #144396

#TimeUsernameProblemLanguageResultExecution timeMemory
144396LyestriaVision Program (IOI19_vision)C++14
100 / 100
20 ms1792 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; vector<int>r,c; vector<int>ans; int zero; void pe(int x){ for(int i=0;i<9;i++){ int val=add_xor({ans[i],x}); int car=add_and({ans[i],x}); ans[i]=val; x=car; } } void construct_network(int h, int w, int k) { int i,j; zero=add_and({0,add_not(0)}); for(i=0;i<h;i++){ vector<int>v; for(j=0;j<w;j++)v.push_back(i*w+j); r.push_back(add_xor(v)); } for(i=0;i<w;i++){ vector<int>v; for(j=0;j<h;j++)v.push_back(j*w+i); c.push_back(add_xor(v)); } ans.resize(9,zero); pe(r[0]),pe(c[0]); for(i=1;i<h;i++)r[i]=add_xor({r[i-1],r[i]}),pe(r[i]); for(i=1;i<w;i++)c[i]=add_xor({c[i-1],c[i]}),pe(c[i]); for(i=0;i<9;i++)if(!((k>>i)&1))ans[i]=add_not(ans[i]); add_and(ans); }
#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...