#include "vision.h"
#include <bits/stdc++.h>
#define fore(i, b, e) for (int i = b; i < (int)e; ++i)
#define pb push_back
using namespace std;
typedef vector<int> vi;
vi diagL[410], diagR[410];
int solve(int H, int W, int k) {
vi resR, resL;
vi v, pref;
fore(i, 0, H+W-1) {
v.pb(add_or(diagL[i]));
pref.pb(add_or(v));
if (i > 0) {
if (i >= k) {
int tmp = add_xor({pref[i-1], pref[i-k]});
resL.pb( add_and({v.back(), tmp}) );
}
else {
resL.pb( add_and({v.back(), pref[i-1]}) );
}
}
}
v.clear();
pref.clear();
fore(i, 0, H+W-1) {
v.pb(add_or(diagR[i]));
pref.pb(add_or(v));
if (i > 0) {
if (i >= k) {
int tmp = add_xor({pref[i-1], pref[i-k]});
resR.pb( add_and({v.back(), tmp}) );
}
else {
resR.pb( add_and({v.back(), pref[i-1]}) );
}
}
}
int rL = add_or(resL);
int rR = add_or(resR);
return add_and({rL, rR});
}
void construct_network(int H, int W, int K) {
fore(i, 0, H) {
fore(j, 0, W) {
diagL[i+j].pb(i*W + j);
diagR[i-j+W-1].pb(i*W + j);
}
}
if (H+W-2 == K) {
add_not(solve(H, W, K));
}
else {
add_xor({solve(H, W, K), solve(H, W, K+1)});
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Incorrect |
1 ms |
384 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Incorrect |
1 ms |
384 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Incorrect |
1 ms |
384 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Incorrect |
1 ms |
384 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
1280 KB |
Output is correct |
2 |
Correct |
11 ms |
1280 KB |
Output is correct |
3 |
Correct |
11 ms |
1280 KB |
Output is correct |
4 |
Correct |
10 ms |
768 KB |
Output is correct |
5 |
Correct |
18 ms |
1280 KB |
Output is correct |
6 |
Correct |
11 ms |
1308 KB |
Output is correct |
7 |
Correct |
19 ms |
1280 KB |
Output is correct |
8 |
Correct |
12 ms |
1280 KB |
Output is correct |
9 |
Correct |
20 ms |
1280 KB |
Output is correct |
10 |
Correct |
13 ms |
1280 KB |
Output is correct |
11 |
Correct |
11 ms |
1280 KB |
Output is correct |
12 |
Correct |
11 ms |
1280 KB |
Output is correct |
13 |
Correct |
13 ms |
1280 KB |
Output is correct |
14 |
Correct |
6 ms |
768 KB |
Output is correct |
15 |
Correct |
17 ms |
1280 KB |
Output is correct |
16 |
Correct |
12 ms |
1280 KB |
Output is correct |
17 |
Correct |
16 ms |
1280 KB |
Output is correct |
18 |
Correct |
16 ms |
1280 KB |
Output is correct |
19 |
Correct |
11 ms |
1280 KB |
Output is correct |
20 |
Correct |
9 ms |
768 KB |
Output is correct |
21 |
Correct |
0 ms |
384 KB |
Output is correct |
22 |
Correct |
1 ms |
288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
8 ms |
1024 KB |
Output is correct |
4 |
Correct |
7 ms |
896 KB |
Output is correct |
5 |
Correct |
9 ms |
896 KB |
Output is correct |
6 |
Correct |
7 ms |
900 KB |
Output is correct |
7 |
Correct |
7 ms |
640 KB |
Output is correct |
8 |
Correct |
12 ms |
1408 KB |
Output is correct |
9 |
Correct |
12 ms |
1408 KB |
Output is correct |
10 |
Correct |
25 ms |
1400 KB |
Output is correct |
11 |
Correct |
12 ms |
1408 KB |
Output is correct |
12 |
Correct |
13 ms |
896 KB |
Output is correct |
13 |
Correct |
12 ms |
1280 KB |
Output is correct |
14 |
Correct |
24 ms |
1280 KB |
Output is correct |
15 |
Correct |
10 ms |
1280 KB |
Output is correct |
16 |
Correct |
7 ms |
768 KB |
Output is correct |
17 |
Correct |
14 ms |
1280 KB |
Output is correct |
18 |
Correct |
16 ms |
1280 KB |
Output is correct |
19 |
Correct |
6 ms |
768 KB |
Output is correct |
20 |
Correct |
49 ms |
3444 KB |
Output is correct |
21 |
Correct |
47 ms |
3444 KB |
Output is correct |
22 |
Correct |
35 ms |
3448 KB |
Output is correct |
23 |
Correct |
17 ms |
2168 KB |
Output is correct |
24 |
Correct |
37 ms |
3444 KB |
Output is correct |
25 |
Correct |
41 ms |
3448 KB |
Output is correct |
26 |
Correct |
17 ms |
1920 KB |
Output is correct |
27 |
Correct |
60 ms |
5984 KB |
Output is correct |
28 |
Incorrect |
67 ms |
6008 KB |
on inputs (0, 0), (50, 50), expected 1, but computed 0 |
29 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
70 ms |
5944 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
7 ms |
1024 KB |
Output is correct |
4 |
Correct |
14 ms |
1408 KB |
Output is correct |
5 |
Correct |
11 ms |
1280 KB |
Output is correct |
6 |
Correct |
14 ms |
1280 KB |
Output is correct |
7 |
Correct |
38 ms |
3488 KB |
Output is correct |
8 |
Correct |
40 ms |
3516 KB |
Output is correct |
9 |
Correct |
64 ms |
6132 KB |
Output is correct |
10 |
Correct |
1 ms |
384 KB |
Output is correct |
11 |
Correct |
1 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Incorrect |
1 ms |
384 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
9 |
Halted |
0 ms |
0 KB |
- |