This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
vector<int> ask;
for (int i = 0; i < H; ++i) {
for (int j = 0; j < W; ++j) {
for (int k = 0; k <= K; ++k) {
for (int x = 0; x < 2; ++x) {
if (i + dx[x] * k >= H || i + dx[x] * k < 0 ||
j + dy[x] * (K - k) >= W || j + dy[x] * (K - k) < 0)
continue;
ask.push_back(sz);
sz++;
int a = i * W + j;
int b = (i + dx[x] * k) * W + j + dy[x] * (K - k);
add_and({a, b});
}
}
}
}
add_or(ask);
}
# | 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... |