Submission #223754

#TimeUsernameProblemLanguageResultExecution timeMemory
223754rama_pangVision Program (IOI19_vision)C++14
44 / 100
80 ms7416 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; int IsExist(int H, int W, int K) { // Check whether there exists one of the values >= K vector<vector<int>> diagL(H + W - 1); // from topleft vector<vector<int>> diagR(H + W - 1); // from topright for (int x = 0; x < H; x++) { for (int y = 0; y < W; y++) { diagL[x + y].emplace_back(x * W + y); diagR[x + W - y - 1].emplace_back(x * W + y); } } vector<int> prefL; // diagonal prefix from topleft vector<int> prefR; // diagonal prefix from topright vector<int> check; // check for diagonal_distance >= K from either topleft or topright for (int d = K; d < H + W - 1; d++) { prefL.insert(end(prefL), begin(diagL[d - K]), end(diagL[d - K])); prefR.insert(end(prefR), begin(diagR[d - K]), end(diagR[d - K])); check.emplace_back(add_and({add_or(diagL[d]), add_or(prefL)})); check.emplace_back(add_and({add_or(diagR[d]), add_or(prefR)})); } return add_or(check); } void construct_network(int H, int W, int K) { if (K == H + W - 2) { IsExist(H, W, K); } else { add_and({IsExist(H, W, K), add_not(IsExist(H, W, K + 1))}); } }
#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...