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 "grader.cpp"
using namespace std;
int h, w, k;
int get(int x, int y) {
return x * w + y;
}
bool check(int x, int y) {
return (0 <= x && x < h && 0 <= y && y < w);
}
void construct_network(int H, int W, int K) {
h = H; w = W; k = K;
vector <int> v;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
vector <int> vec;
int x, y;
x = i;
y = j + k;
while (y != j) {
if (check(x, y))
vec.push_back(get(x, y));
x++;
y--;
}
while (x != i) {
if (check(x, y))
vec.push_back(get(x, y));
x--;
y--;
}
if (vec.empty()) continue;
v.push_back(add_and({add_or(vec), get(i, j)}));
}
}
add_or(v);
}
# | 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... |