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;
int width;
int val(int a, int b) { return a * width + b; }
void construct_network(int H, int W, int K) {
width = W;
vector<int> lastone;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
vector<int> vi;
// cout << i << " " << j << "\n";
for (int k = 0; k <= K; k++)
if (i + k >= 0 && i + k < H) {
if (j + K - k >= 0 && j + K - k < W) {
// cout << i + k << " " << j + K - k << " ";
vi.push_back(val(i + k, j + K - k));
}
if (j - (K - k) >= 0 && j - (K - k) < W) {
// cout << i + k << " " << j - (K - k) << " ";
vi.push_back(val(i + k, j - (K - k)));
}
}
// cout << "\n\n";
if (vi.size() >= 2) {
int x = add_or(vi);
vi.clear();
vi.push_back(x);
vi.push_back(val(i, j));
lastone.push_back(add_and(vi));
} else if (vi.size() == 1) {
vi.push_back(val(i, j));
lastone.push_back(add_and(vi));
}
}
}
add_or(lastone);
}
# | 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... |