This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 2e2 + 42;
int last;
vector<int> pos, lig[N], col[N];
void construct_network(int H, int W, int K) {
last = H * W - 1;
for(int i = 0; i < H; i++)
for(int j = 0; j < W; j++) {
lig[i].push_back(i * W + j);
col[j].push_back(i * W + j);
}
for(int i = 0; i < H; i++) {
if(i != 0) lig[i].push_back(last);
add_xor(lig[i]);
last++;
}
for(int i = 0; i < W; i++) {
if(i != 0) col[i].push_back(last);
add_xor(col[i]);
last++;
}
pos.push_back(H*W);
add_not(0);
last++;
vector<int> and0;
and0.push_back(0);
and0.push_back(last);
for(int i = 0; i < 8; i++) {
add_and(and0);
last++;
pos.push_back(last);
}
for(int i = H*W + 1; i < H * W + H + W; i++) {
int toAdd = i;
for(int j = 0; j < 9; j++) {
vector<int> add;
add.push_back(toAdd);
add.push_back(pos[j]);
add_xor(add);
last++;
pos[j] = last;
add_and(add);
last++;
toAdd = last;
}
}
add_or(and0);
last++;
int bit1 = last;
for(int i = 0; i < 9; i++) {
if(K % 2 == 0) {
vector<int> add;
add.push_back(bit1);
add.push_back(pos[i]);
add_xor(add);
last++;
pos[i] = last;
}
K /= 2;
}
add_and(pos);
}
# | 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... |