# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
612251 | l_reho | Vision Program (IOI19_vision) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
void construct_network(int H, int W, int K) {
/*
std::vector<int> Ns;
Ns = {0, 1};
int a = add_and(Ns);
Ns = {0, a};
int b = add_or(Ns);
Ns = {0, 1, b};
int c = add_xor(Ns);
add_not(c);
* */
int r1 = -1, c1 = -1, r2 = -1, c2 = -1;
int mx = W*H-1;
vector<vector<bool>> visited(H, vector<bool>(W, 0));
int ni = 0;
for(int i = 0; i < H; i++){
for(int j = 0; j < W; j++){
int curr = i*W+j;
for(int a = 0; a < K; a++){
int b = K-a;
int pos1 = (i+a)*W+(j+b);
int pos2 = (i+-a)*W+(j+b);
int pos3 = (i+a)*W+(j+-b);
int pos4 = (i+-a)*W+(j+-b);
if(pos1 >= 0 && pos1 <= mx) add_and(vector<int>{curr, pos1}), ni++;
if(pos2 >= 0 && pos2 <= mx) add_and(vector<int>{curr, pos2}), ni++;
if(pos3 >= 0 && pos3 <= mx) add_and(vector<int>{curr, pos3}), ni++;
if(pos4 >= 0 && pos4 <= mx) add_and(vector<int>{curr, pos4}), ni++;
}
// come trovo le posizioni di distanza K da cord
}
}
vector<int> OR;
for(int i = W*H; i < W*H+ni; i++){
OR.push_back(i);
}
if(OR.size() != 0)
add_or(OR);
else add_not(1);
}