#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define OPTM ios_base::sync_with_stdio(0); cin.tie(0);
#define INF int(1e9+7)
#define ln '\n'
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define FOR(i,s,n) for (int i = s; i < n; i++)
#define FORR(i,n,s) for (int i = n; i > s; i--)
#define FORX(u, arr) for (auto u : arr)
#define PB push_back
#define F first
#define S second
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define UM unordered_map
#define US unordered_set
#define PQ priority_queue
#define ALL(v) v.begin(), v.end()
const ll LLINF = 1e18+1;
int H,W,K;
int cur,rst,cst,ren,cen,sen;
void init() {
FOR(i,0,H) {
vector<int> v;
FOR(j,0,W) v.PB(i*W+j);
add_or(v);
cur++;
}
FOR(j,0,W) {
vector<int> v;
FOR(i,0,H) v.PB(i*W+j);
add_or(v);
cur++;
}
}
void rowzero() {
vector<int> v;
FOR(i,0,H) v.PB(H*W+i);
add_xor(v);
cur++;
}
void colzero() {
vector<int> v;
FOR(i,0,W) v.PB(H*W+H+i);
add_xor(v);
cur++;
}
void sum() {
cen = cur;
FOR(i,0,K+1) {
if (i > H-1 || K-i > W-1) continue;
vector<int> v = {H*W+i, H*W+H+K-i};
if (i == 0) v[0] = rst;
if (i == K) v[1] = cst;
add_and(v);
cur++;
}
sen = cur;
}
void finale() {
vector<int> v;
FOR(i,cen,sen) v.PB(i);
add_or(v);
cur++;
}
void construct_network(int h, int w, int k) {
H = h, W = w, K = k;
cur = H*W;
// init
init();
// row
rst = cur;
rowzero();
// col
cst = cur;
colzero();
// final
sum();
finale();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 1), (0, 2), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 1), (0, 2), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 1), (0, 2), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 1), (0, 2), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 1), (0, 3), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
2 ms |
340 KB |
Output is correct |
9 |
Correct |
2 ms |
340 KB |
Output is correct |
10 |
Correct |
2 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
4 ms |
596 KB |
Output is correct |
21 |
Correct |
4 ms |
596 KB |
Output is correct |
22 |
Correct |
4 ms |
596 KB |
Output is correct |
23 |
Correct |
4 ms |
596 KB |
Output is correct |
24 |
Correct |
4 ms |
596 KB |
Output is correct |
25 |
Correct |
4 ms |
596 KB |
Output is correct |
26 |
Correct |
4 ms |
596 KB |
Output is correct |
27 |
Correct |
7 ms |
980 KB |
Output is correct |
28 |
Correct |
7 ms |
980 KB |
Output is correct |
29 |
Correct |
7 ms |
1124 KB |
Output is correct |
30 |
Correct |
9 ms |
1108 KB |
Output is correct |
31 |
Correct |
7 ms |
1084 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
980 KB |
on inputs (80, 199), (81, 199), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 1), (0, 2), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |