Submission #281585

#TimeUsernameProblemLanguageResultExecution timeMemory
281585NONAMEVision Program (IOI19_vision)C++14
44 / 100
174 ms3092 KiB
#include "vision.h" void construct_network(int H, int W, int K) { std::vector <int> res, res1; if ((H == 1) || (W == 1)) { for (int x1 = 0; x1 < H; ++x1) for (int y1 = 0; y1 < W; ++y1) for (int x2 = 0; x2 < H; ++x2) for (int y2 = 0; y2 < W; ++y2) { if ((abs(x1 - x2) + abs(y1 - y2)) != K) continue; add_and({x1 * W + y1, x2 * W + y2}); res.push_back(H * W + (int)(res.size())); } add_or(res); } else { int cnt = 0; for (int x1 = 0; x1 < H; ++x1) for (int y1 = 0; y1 < W; ++y1) { std::vector <int> cur; for (int x2 = 0; x2 < H; ++x2) for (int y2 = 0; y2 < W; ++y2) { if ((abs(x1 - x2) + abs(y1 - y2)) != K) continue; cur.push_back(x2 * W + y2); } if (cur.empty()) continue; add_or(cur); res.push_back(H * W + cnt); ++cnt; add_and({x1 * W + y1, res.back()}); res1.push_back(H * W + cnt); ++cnt; } add_or(res1); } }
#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...