#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int add_and(std::vector<int> Ns);
int add_or(std::vector<int> Ns);
int add_xor(std::vector<int> Ns);
int add_not(int N);
int transformCoords(int W, int i, int j) {
return i*W+j;
}
bool isValid(int H, int W, int i, int j) {
if (i < 0 || j < 0 || i >= H || j >= W) return false;
return true;
}
void construct_network(int H, int W, int K) {
vector<int> Ns;
int idx = 0;
for (int x = 0; x < H; x++) {
for (int y = 0; y < W; y++) {
vector<int> arr;
for (int i = 0; i <= K; i++) {
set<pair<int, int>> coords;
coords.insert({x+i, y+K-i});
coords.insert({x+K-i, y-i});
coords.insert({x-i, y-K+i});
coords.insert({x-K+i, y+i});
for (auto it = coords.begin(); it != coords.end(); it++) {
if (isValid(H, W, (*it).first, (*it).second)) {
arr.pb(transformCoords(W, (*it).first, (*it).second));
}
}
// if (isValid(H, W, i+x, K-i+y)) {
// arr.pb(transformCoords(W, i+x, K-i+y));
// }
// if (isValid(H, W, x-i, K-i+y) && x-i != i+x) {
// arr.pb(transformCoords(W, x-i, K-i+y));
// }
}
arr.pb(transformCoords(W, x, y));
add_xor(arr);
Ns.pb(H*W+idx);
idx++;
// for (int i = 0; i < arr.size(); i++) cout << arr[i] << " ";
// cout << endl;
}
}
// for (int i = 0; i < Ns.size(); i++) {
// cout << Ns[i] << " x ";
// }
// cout << endl;
add_or(Ns);
add_not(H*W+idx);
// for (int i = 0; i < idx; i+=2) {
// Ns.pb(add_and({H*W+i, H*W+i+1}));
// }
// add_or(Ns);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
304 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
296 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
1184 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |