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 <bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K) {
auto conv = [&](int r, int c) {
return r * W + c;
};
int ins = 0;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
for (int k = i; k < H; k++) {
for (int l = (i == k ? j : 0); l < W; l++) {
if (abs(i - k) + abs(j - l) == K) {
add_and({conv(i, j), conv(k, l)});
ins++;
}
}
}
}
}
vector<int> tmp(ins);
iota(tmp.begin(), tmp.end(), H * W);
add_or(tmp);
}
# | 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... |