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;
#define vec vector
void construct_network(int H, int W, int K) {
//cerr << H << ' ' << W << ' ' << K << '\n';
auto dist = [&](int i, int j) {
int x1 = i%W;
int y1 = i/W;
int x2 = j%W;
int y2 = j/W;
return abs(x1-x2)+abs(y1-y2);
};
int cnt = 0;
for(int i = 0; i<1; i++) {
for(int j = i+1; j<H*W; j++) {
if(dist(i, j) == K) {
add_and({i, j});
// cerr << "HERE" << '\n';
cnt++;
}
}
}
// cerr << "OK" << '\n';
vec<int> or_check(cnt);
// cerr << cnt << '\n';
iota(or_check.begin(), or_check.end(), H*W);
add_or(or_check);
}
# | 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... |