이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void construct_network(int H, int W, int K) {
vector<int> ROW, COL; ROW.clear(), COL.clear();
for(int i = 0; i < H; i++)
{
vector<int> rows; rows.clear();
for(int j = 0; j < W; j++) rows.pb(i*W+j);
ROW.pb(add_xor(rows));
}
for(int i = 0; i < W; i++)
{
vector<int> cols; cols.clear();
for(int j = 0; j < H; j++) cols.pb(j*W+i);
COL.pb(add_xor(cols));
}
int x = add_or(ROW), y = add_or(COL);
vector<int> t; t.clear(), t.pb(x), t.pb(add_not(y));
int option1f = add_and(t);
t.clear(), t.pb(y), t.pb(add_not(x));
int option2f = add_and(t);
vector<int> row_pair, col_pair; row_pair.clear(), col_pair.clear();
for(int i = H*W; i < H*W+H-1; i++)
{
t.clear(); t.pb(i), t.pb(i+1);
row_pair.pb(add_and(t));
}
for(int i = H*W+H; i < H*W+H+W-1; i++)
{
t.clear(); t.pb(i), t.pb(i+1);
col_pair.pb(add_and(t));
}
int option1s=-1, option2s=-1;
if(!row_pair.empty()) option1s = add_or(row_pair);
if(!col_pair.empty()) option2s = add_or(col_pair);
t.clear(), t.pb(option1f); if(option1s!=-1) t.pb(option1s);
int option1 = add_and(t);
t.clear(), t.pb(option2f); if(option2s!=-1) t.pb(option2s);
int option2 = add_and(t);
t.clear(), t.pb(option1), t.pb(option2);
add_or(t);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |