# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1063664 | aaaaaarroz | Vision Program (IOI19_vision) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
bool limites(int x, int y, int h, int w) {
return x >= 0 && x < h && y >= 0 && y < w;
}
void construct_network(int H, int W, int K) {
map<int,pair<int, int>> numero;
int pos = 0;
vector<int>black;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
numero[pos] = {i,j};
bool is_bl=add_or({pos});
if(is_bl){
black.push_back(pos;)
}
pos++;
}
}
int dist=abs(numero[black[0]].first-numero[black[1]].first)+abs(numero[black[0]].second-numero[black[1]].second);
if(dist==K){
add_or({black[0]});
return;
}
else{
for(int i=0;i<H*W;i++){
if(black[0]!=i&&black[1]!=i){
add_or({i});
return;
}
}
}
}