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;
using ll = long long;
using ari2 = array<int, 2>;
using ari3 = array<int, 3>;
using arl2 = array<ll, 2>;
using arl3 = array<ll, 3>;
#define vt vector
#define size(x) (int((x).size()))
#define all(x) begin(x), end(x)
#define REP(a, b, c, d) for (int a = (b); (d) > 0 ? a <= (c) : a >= (c); a += (d))
#define FOR(a, b, c) REP(a, b, c, 1)
#define ROF(a, b, c) REP(a, b, c, -1)
void construct_network(int H, int W, int K) {
/*
if (min(H, W) == 1) {
int cur = H * W;
FOR(i, K, H*W-1) {
add_and({i, i-K});
cur++;
}
if (K == max(H, W) - 1)
return;
int cur2 = cur;
add_or({H*W, H*W+1});
FOR(i, H*W+2, cur-1) {
add_or({i, cur2});
cur2++;
}
return;
}//*/
int cnt = H * W;
FOR(i, 0, H-1)
FOR(j, 0, W-1)
FOR(ii, i, H-1)
FOR(jj, 0, W-1)
if (abs(i - ii) + abs(j - jj) == K)
add_and({i * W + j, ii * W + jj}), cnt++;
if (cnt == H*W+1)
return;
add_or({H*W, H*W+1});
int cur = cnt;
FOR(i, H*W+2, cnt-1) {
add_or({i, cur});
cur++;
}
return;
}
# | 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... |