# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
416722 | 2021-06-02T20:37:28 Z | peuch | 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) { vector<int> finalAnswer; if(H * W <= 200){ for(int i = 0; i < H * W; i++){ for(int j = i + 1; j < H * W; j++){ int xi = i / W, yi = i % W; int xj = j / W, yj = j % W; vector<int> question (2); question[0] = i; question[1] = j; if(abs(xi - xj) + abs(yi - yj) == K) finalAnswer.push_back(add_and(question)); } } } else{ for(int i = 0; i < H * W; i++){ int xi = i / W, yi = i % W; if(xi + yi == k) finalAnswer.push_back(i); } } add_or(finalAnswer); }