# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
422682 | 2021-06-10T10:19:02 Z | SSRS | Vision Program (IOI19_vision) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K){ assert(H <= 30 && W <= 30); int cnt = H * W; vector<int> A; 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(x2 - x1) + abs(y2 - y1) == K){ int a = x1 * H + y1; int b = x2 * H + y2; if (a < b){ vector<int> id = {a, b}; add_and(id); cnt++; } } } } } } vector<int> id; for (int i = H * W; i < cnt; i++){ id.push_back(i); } add_or(id); }