Submission #552519

#TimeUsernameProblemLanguageResultExecution timeMemory
552519PiejanVDCVision Program (IOI19_vision)C++17
33 / 100
4 ms976 KiB
#include<bits/stdc++.h> using namespace std; #include "vision.h" void construct_network(int H, int W, int K) { auto valid = [&] (int x, int y) -> bool { return x >= 0 && x < H && y >= 0 && y < W; }; int last = H * W; for(int i = 0 ; i < H ; i++) { for(int j = 0 ; j < W ; j++) { int cnt = 0; for(int k = 0 ; k < H ; k++) { int idx = K - abs(i-k); if(idx < 0) continue; if(idx == 0) cnt++; if(cnt == 2) break; if(valid(k, j + idx)) { add_and({(i)*W + j, (k)*W + j + idx}); last++; } } } } vector<int>R; for(int i = H*W ; i < last ; i++) R.push_back(i); add_or(R); }
#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...