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>
#define ll long long
#define ar array
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
template<typename T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
void construct_network(int H, int W, int K) {
vector<int> res;
if (H <= 30 && W <= 30) {
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
vector<int> cur;
for (int k = 0; k < H; k++) {
for (int l = 0; l < W; l++) {
if (abs(k - i) + abs(j - l) == K) {
cur.emplace_back(k*W+l);
}
}
}
if (cur.size()) {
int idx = add_or(cur);
res.emplace_back(add_and({i*W+j, idx}));
}
}
}
}
else {
vector<int> cur;
for (int k = 0; k < H; k++) {
for (int l = 0; l < W; l++) {
if (k + l == K) {
cur.emplace_back(k*W+l);
}
}
}
if (cur.size()) {
int idx = add_or(cur);
res.emplace_back(add_and({0, idx}));
}
}
add_or(res);
}
# | 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... |