이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> V,V1,V2,V3,V4;
void construct_network(int H, int W, int K) {
int n = H*W;
for (int k = -W+1; k < H; ++k) {
V.clear();
for (int i = 0; i < H; ++i) {
int j = i-k;
if (j >= 0 && j < W) V.push_back(i*W+j);
}
add_or(V); n++;
}
V.clear();
for (int i = 0; i < H+W-1; ++i) V.push_back(H*W+i);
add_xor(V); n++;
V1.push_back(n-1); V3.push_back(n-1);
for (int k = 0; k < H+W-1; ++k) {
V.clear();
for (int i = 0; i < H; ++i) {
int j = k-i;
if (j >= 0 && j < W) V.push_back(i*W+j);
}
add_or(V); n++;
}
V.clear();
for (int i = 0; i < H+W-1; ++i) V.push_back(H*W+H+W+i);
add_xor(V); n++;
V2.push_back(n-1); V4.push_back(n-1);
for (int i = 0; i+K < H+W-1; ++i) {
V.clear();
for (int j = 0; j <= K; ++j) V.push_back(H*W+i+j);
add_or(V); add_xor(V); add_not(n+1); add_and({n,n+2}); n += 4;
V1.push_back(n-1);
}
for (int i = 0; i+K < H+W-1; ++i) {
V.clear();
for (int j = 0; j <= K; ++j) V.push_back(H*W+H+W+i+j);
add_or(V); add_xor(V); add_not(n+1); add_and({n,n+2}); n += 4;
V2.push_back(n-1);
}
for (int i = 0; i+K-1 < H+W-1; ++i) {
V.clear();
for (int j = 0; j < K; ++j) V.push_back(H*W+i+j);
add_or(V); add_xor(V); add_not(n+1); add_and({n,n+2}); n += 4;
V3.push_back(n-1);
}
for (int i = 0; i+K-1 < H+W-1; ++i) {
V.clear();
for (int j = 0; j < K; ++j) V.push_back(H*W+H+W+i+j);
add_or(V); add_xor(V); add_not(n+1); add_and({n,n+2}); n += 4;
V4.push_back(n-1);
}
add_or(V1); add_or(V2); add_or(V3); add_or(V4); n += 4;
add_and({n-4,n-3}); add_and({n-2,n-1}); n += 2;
add_not(n-1); n++;
add_and({n-3,n-1});
}
# | 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... |