#include <bits/stdc++.h>
#include "vision.h"
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 2e5 + 2;
const int mod = 1e9 + 7;
int tsz;
int Solve(int n, int m, int k) {
vector<vector<int>> a(n + m - 1), b(n + m - 1);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i + j].push_back(i * m + j);
b[i - j + m - 1].push_back(i * m + j);
}
}
vector<int> aid(n + m - 1), bid(n + m - 1), pa(n + m - 1), pb(n + m - 1);
for (int i = 0; i < n + m - 1; i++) {
vector<int> v;
for (int j : a[i]) v.push_back(j);
aid[i] = add_xor(v);
if (i == 0) pa[i] = aid[i];
else pa[i] = add_or({pa[i - 1], aid[i]});
}
for (int i = 0; i < n + m - 1; i++) {
vector<int> v;
for (int j : b[i]) v.push_back(j);
bid[i] = add_xor(v);
if (i == 0) pb[i] = bid[i];
else pb[i] = add_or({pb[i - 1], bid[i]});
}
vector<int> x;
for (int i = k; i < n + m - 1; i++) {
x.push_back(add_and({aid[i], pa[i - k]}));
}
for (int i = k; i < n + m - 1; i++) {
x.push_back(add_and({bid[i], pb[i - k]}));
}
return add_or(x);
}
void construct_network(int h, int w, int k) {
if (k == h + w - 2) Solve(h, w, k);
add_xor({Solve(h, w, k), Solve(h, w, k + 1)});
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
468 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
1 ms |
468 KB |
Output is correct |
4 |
Incorrect |
1 ms |
468 KB |
WA in grader: Instruction with no inputs |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
2596 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
724 KB |
Output is correct |
5 |
Correct |
2 ms |
468 KB |
Output is correct |
6 |
Correct |
2 ms |
468 KB |
Output is correct |
7 |
Correct |
10 ms |
1492 KB |
Output is correct |
8 |
Correct |
10 ms |
1516 KB |
Output is correct |
9 |
Correct |
20 ms |
2620 KB |
Output is correct |
10 |
Incorrect |
1 ms |
212 KB |
WA in grader: Instruction with no inputs |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |