이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "vision.h"
template <class T> using Vec = std::vector<T>;
void construct_network(int H, int W, int K) {
const auto cell = [&](const int i, const int j) {
return i * W + j;
};
const auto inside = [&](const int i, const int j) {
return 0 <= i and i < H and 0 <= j and j < W;
};
Vec<int> check;
for (int i = 0; i < H; ++i) {
for (int j = 0; j < W; ++j) {
Vec<int> see;
int x = i, y = j + K;
while (y > j) {
if (inside(x, y)) {
see.push_back(cell(x, y));
}
x += 1;
y -= 1;
}
while (x > i) {
if (inside(x, y)) {
see.push_back(cell(x, y));
}
x -= 1;
y -= 1;
}
if (!see.empty()) {
const int exists = add_or(see);
check.push_back(add_and(Vec<int>{cell(i, j), exists}));
}
}
}
add_or(check);
}
# | 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... |