# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
742278 | 2023-05-16T04:03:37 Z | t6twotwo | 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) { if (min(H, W) == 1) { if (H != 1) { swap(H, W); } vector<int> v; for (int i = 0; i + K < W; i++) { add_and({i, i + K}); v.push_back(i + W); } add_or(v); return; } vector<int> v; for (int i = 0; i <= K; i++) { if (i < H && K - i < W) { add_add({0, i * W + K - i}); v.push_back(H * W + v.size()); } } add_or(v); }