# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
398570 | ly20 | Vision Program (IOI19_vision) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210;
vector <int> resp;
vector <int> col[MAXN], ln[MAXN];
int d0c, d0l;
int idc[MAXN], idl[MAXN];
int d1l, d1c;
void construct_network(int h, int w, int k) {
for(int i = 0; i < h; i++) {
for(int j = 0; j < w; j++) {
int id = i * w + j;
col[j].push_back(id);
ln[i].push_back(id);
}
}
for(int i = 0; i < h; i++) idl[i] = add_or(ln[i]);
for(int i = 0; i < w; i++) idc[i] = add_or(col[i]);
vector <int> cl, l;
for(int i = 0; i < h; i++) l.push_back(idl[i]);
for(int i = 0; i < w; i++) cl.push_back(idc[i]);
d0c = add_not(add_xor(cl)); d0l = add_not(add_xor(l));
cl.clear(); l.clear();
for(int i = 0; i < h - 1; i++) {
vector <int> t;
t.push_back(idl[i]); t.push_back(idl[i + 1]);
l.push_back(add_and(t));
}
d1l = add_or(l);
for(int i = 0; i < w - 1; i++) {
vector <int> t;
t.push_back(idc[i]); t.push_back(idc[i + 1]);
cl.push_back(add_and(t));
}
add_or({add_and(d0c, d1l), add_and(d0l, d1c)});
}