# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
795894 | 2023-07-27T20:40:04 Z | APROHACK | Vision Program (IOI19_vision) | C++17 | 0 ms | 0 KB |
#include "vision.h" #include <bits/stdc++.h> #define pb push_back using namespace std; int h, w, k; int getPos(int x, int y){ return x*w + y; } void construct_network(int H, int W, int K) { h = H; w = W; k = K; vector<int>todos; for(int i = 0 ; i < H ; i ++){ for(int j = 0 ; j < W ; j ++){ vector<int>cuales; for(int xi = 0 ; xi < H ; xi ++){ for(int xj = 0; xj < W ; xj ++){ if(abs(xi-i) + abs(xj-j) == k)cuales.pb(getPos(xi, xj)); } } if(cuales.empty()){ continue; } int idxOr = add_or(cuales) todos.pb(add_and({idxOr, getPos(i, j)})); } } add_or(todos); }