# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
226401 | 2020-04-23T17:54:12 Z | AaronNaidu | 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) { int totSum = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { for (int x = i; x < h; x++) { for (int y = 0; y < w; y++) { if (abs(i-x) + abs(j-y) == k) { totSum++; add_and({i*w + j, x*w + y}); } } } } } vector<int> last; for (int i = 0; i < totSum; i++) { last.push_back(i + h * w); } add_or(last); }