# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064908 | TAhmed33 | Vision Program (IOI19_vision) | C++17 | 73 ms | 1240 KiB |
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;
//#include "grader.cpp"
void construct_network(int H, int W, int K) {
auto ind = [&] (int x, int y) -> int {
return x * W + y;
};
vector <int> z;
int cnt = H * W - 1;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
for (int l = 0; l < H; l++) {
for (int m = 0; m < W; m++) {
if (abs(i - l) + abs(j - m) == K) {
if (min(H, W) == 1) {
assert(cnt + 1 <= H * W + 9999);
}
add_and({ind(i, j), ind(l, m)});
z.push_back(++cnt);
}
}
}
}
}
if (min(H, W) == 1) assert(z.size() <= 400);
add_or({z[0], z[1]}); cnt++;
for (int j = 1; j < z.size(); j++) {
assert(cnt + 1 <= H * W + 9999);
add_or({cnt++, z[j]});
}
}
Compilation message (stderr)
# | 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... |