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 convert(pair<int, int> cords, int H, int W) {
return cords.first*W + cords.second;
}
void construct_network(int H, int W, int K) {
vector<int> finalComp;
for (int i=0; i<H; i++) {
for (int j = 0; j<W; j++) {
vector<int> prs;
for (int k = max(0, i-K); k<min(H, i+K+1); k++) {
for (int l = j; l<min(W, j+K+1); l++) {
if (abs(i-k) + abs(j-l) == K) {
prs.push_back(convert({k,l}, H, W));
}
}
}
if (prs.empty()) continue;
finalComp.push_back(add_and({convert({i, j}, H, W), add_or(prs)}));
}
}
add_or(finalComp);
}
# | 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... |