Submission #299493

#TimeUsernameProblemLanguageResultExecution timeMemory
299493TMJNVision Program (IOI19_vision)C++17
58 / 100
15 ms1404 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { vector<int>h,w,v; int h_xor,w_xor; for(int i=0;i<H;i++){ vector<int>t; for(int j=0;j<W;j++){ t.push_back(W*i+j); } h.push_back(add_or(t)); } for(int i=0;i<W;i++){ vector<int>t; for(int j=0;j<H;j++){ t.push_back(W*j+i); } w.push_back(add_or(t)); } h_xor=add_xor(h); w_xor=add_xor(w); for(int i=0;i+K<W;i++){ v.push_back(add_and({h_xor,w[i],w[i+K]})); } for(int i=0;i+K<H;i++){ v.push_back(add_and({w_xor,h[i],h[i+K]})); } for(int i=1;i<K;i++){ if(H<=i||W<=K-i)continue; vector<int>tmpvec; int p,q; p=i; q=K-i; if(p>=q){ for(int j=0;j+p<H;j++){ tmpvec.push_back(add_and({h[j],h[j+p]})); } int t=add_or(tmpvec); for(int j=0;j+q<W;j++){ v.push_back(add_and({t,w[j],w[j+q]})); } } else{ for(int j=0;j+q<W;j++){ tmpvec.push_back(add_and({w[j],w[j+q]})); } int t=add_or(tmpvec); for(int j=0;j+p<H;j++){ v.push_back(add_and({t,h[j],h[j+p]})); } } } add_xor(v); }
#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...