이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <iostream>
using namespace std;
const int dx[] = {+1, +1};
const int dy[] = {+1, -1};
void construct_network(int H, int W, int K) {
int sz = H * W, cur = H * W - 1;
vector<int> ask, ksa, is(K + 1, 0), si(K + 1, 0);
vector<int> kek[K + 1], lol[K + 1];
for (int i = 0; i < H; ++i) {
ask.clear();
for (int j = 0; j < W; ++j)
ask.push_back(i * W + j);
add_or(ask);
}
for (int j = 0; j < W; ++j) {
ask.clear();
for (int i = 0; i < H; ++i)
ask.push_back(i * W + j);
add_or(ask);
}
sz = H * W, cur = H * W + H + W - 1;
ask.clear();
for (int i = 0; i < H; ++i) {
ask.push_back(sz + i);
for (int j = 1; i + j < H && j <= K; ++j) {
add_and({sz + i, sz + i + j});
cur++;
kek[j].push_back(cur);
}
}
add_xor(ask);
cur++;
kek[0].push_back(cur);
sz = H * W + H;
ask.clear();
for (int i = 0; i < W; ++i) {
ask.push_back(sz + i);
for (int j = 1; i + j < W && j <= K; ++j) {
add_and({sz + i, sz + i + j});
cur++;
lol[j].push_back(cur);
}
}
add_xor(ask);
cur++;
lol[0].push_back(cur);
for (int i = 0; i <= K; ++i) {
if (kek[i].empty())
add_xor({0, 0});
else
add_or(kek[i]);
cur++;
is[i] = cur;
}
for (int i = 0; i <= K; ++i) {
if (lol[i].empty())
add_xor({0, 0});
else
add_or(lol[i]);
cur++;
si[i] = cur;
}
ask.clear();
for (int i = 0; i <= K; ++i) {
add_and({is[i], si[K - i]});
cur++;
ask.push_back(cur);
}
add_or(ask);
return;
}
# | 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... |