| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 152111 | stefdasca | Vision Program (IOI19_vision) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
/*
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 Line1 = -1, Line2 = -1;
int Column1 = -1, Column2 = -1;
for(int i = 0; i < H; ++i)
{
vector<int>v;
for(int j = 0; j < W; ++j)
v.pb(i * W + j);
int ans = add_or(v);
if(ans == 1)
{
if(Line1 != -1)
Line2 = i;
else
Line1 = i;
}
}
if(Line2 == -1)
Line2 = Line1;
for(int i = 0; i < W; ++i)
{
int ans = add_not(Line1 * W + i);
if(ans == 0)
{
if(Column1 == -1)
Column1 = i;
else
Column2 = i;
}
}
if(Column2 == -1)
for(int i = 0; i < W; ++i)
{
int ans = add_not(Line2 * W + i);
if(ans == 0)
Column2 = i;
}
add_and({Line1 * W + Column1, Line2 * W + Column2});
}
