Submission #1026743

#TimeUsernameProblemLanguageResultExecution timeMemory
1026743ach00Vision Program (IOI19_vision)C++14
0 / 100
9 ms1960 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; int h,w,k; bool bounds(int y, int x) { if(y >= 0 && x >= 0 && y < h && x < w) return true; return false; } void construct_network(int H, int W, int K) { h = H; w = W; k = K; int index = H*W; vector<int> and_indices; for(int y = 0; y < H; y++) { for(int x = 0; x < W; x++) { vector<int> P; for(int i = 0; i <= K; i++) { int fdir = i; int sdir = K-i; if(bounds(y+fdir, x+sdir)) P.push_back((y+fdir)*W + x+sdir); if(bounds(y+fdir, x-sdir)) P.push_back((y+fdir)*W + x-sdir); if(bounds(y-fdir, x+sdir)) P.push_back((y-fdir)*W + x+sdir); if(bounds(y-fdir, x-sdir)) P.push_back((y-fdir)*W + x-sdir); } add_or(P); index++; and_indices.push_back(index); add_and({y*W + x, index-1}); index++; } } add_or(and_indices); }
#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...