Submission #722317

#TimeUsernameProblemLanguageResultExecution timeMemory
722317FatihSolakVision Program (IOI19_vision)C++17
100 / 100
98 ms5588 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; int pos1 = -1,pos0 = -1; int calc(int n,int m,int k,int coef){ vector<int> cands; map<int,vector<int>> mp; for(int i = 0;i<n;i++){ for(int j = 0;j<m;j++){ mp[i+coef*j].push_back(i * m + j); } } map<int,int> idx; for(auto u:mp){ idx[u.first] = add_or(u.second); } for(auto u:mp){ vector<int> pos; for(auto c:mp){ if(u.first + k < c.first){ pos.push_back(idx[c.first]); } } if(pos.empty())continue; int tmp1 = idx[u.first]; int tmp2 = add_or(pos); cands.push_back(add_and({tmp1,tmp2})); } if(cands.empty()){ return pos0; } return add_or(cands); } int get(int n,int m,int k){ int p1 = calc(n,m,k,1); int p2 = calc(n,m,k,-1); return add_and({add_not(p1),add_not(p2)}); } void construct_network(int H, int W, int K) { pos1 = add_or({0,add_not(0)}); pos0 = add_not(pos1); int ans1 = get(H,W,K); int ans2 = get(H,W,K-1); ans2 = add_not(ans2); add_and({ans1,ans2}); }
#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...