# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424094 | 2021-06-11T16:36:23 Z | madlogic | Vision Program (IOI19_vision) | C++17 | 0 ms | 0 KB |
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { int cur = (H - 1) * W + W - 1; vector<int> v; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { for (int x = 0; x <= K; x++) { int y = K - x; for (int ys : {-y, y}) { int dx = i + x; int dy = j + ys; if (dx >= 0 && dx < H && dy >= 0 && dy < W) { int xx = i * W + j; int yy = dx * W + dy; add_and(xx, yy); ++cur; v.push_back(cur); } } } } } if (!v.empty()) add_or(v); }