이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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+1, 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)
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... |