Submission #825624

#TimeUsernameProblemLanguageResultExecution timeMemory
825624tomrukVision Program (IOI19_vision)C++17
100 / 100
10 ms1404 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K){ vector<int> ans; vector<int> a(H+W-1); vector<int> b(H+W-1); for(int i = 0;i<H+W-1;i++){ vector<int> v1,v2; for(int x = 0;x<H;x++){ int y = i - x; if(0 <= y && y < W){ v1.push_back(x * W + y); } y = -(i - (W-1) - x); if(0 <= y && y < W) v2.push_back(x * W + y); } a[i] = add_or(v1); b[i] = add_or(v2); // cout << i << ' ' << a[i] << ' ' << b[i] << endl; } int pos0 = add_and({0,add_not(0)}); for(int k = K-1;k<=K;k++){ int now = -1; vector<int> tmp; tmp.push_back(pos0); int cnt = 0; for(int j = H+W-k-3;j>=0;j--){ if(now == -1){ now = a[H+W-2-cnt]; } else{ now = add_or({now,a[H+W-2-cnt]}); } tmp.push_back(add_and({a[j],now})); cnt++; } int pos1 = add_or(tmp); // cout << pos1 << endl; now = -1; tmp.clear(); tmp.push_back(pos0); cnt = 0; for(int j = H+W-k-3;j>=0;j--){ if(now == -1){ now = b[H+W-2-cnt]; } else{ now = add_or({now,b[H+W-2-cnt]}); } tmp.push_back(add_and({b[j],now})); cnt++; } pos1 = add_or({pos1,add_or(tmp)}); ans.push_back(add_not(pos1)); // cout << ans.back() << endl; } add_xor(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...