# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
423756 | 2021-06-11T12:23:09 Z | aymanrs | 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){ vector<int> O; for(int i = 0;i < H;i++){ for(int j = 0;j < W;j++){ vector<int> o; for(int x = -K; x <= K;x++){ if(j + x < 0 || j + x >= W) continue; if(i - K + abs(x) > 0) o.push_back((i - K + abs(x)) * W + j + x); if(i + K - abs(x) < H) o.push_back((i + K - abs(x)) * W + j + x); } O.push_back(add_and({add_or(o), i * W + j})); } } add_or(O); }