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;
void construct_network(int H, int W, int K) {
vector<int> add;
for(int i=0;i<H;i++){
vector<int> line;
for(int j=0;j<W;j++){
line.push_back(i*W+j);
}
if(i > 0) line.push_back(add.back());
add.push_back(add_xor(line));
}
for(int i=0;i<W;i++){
vector<int> line;
for(int j=0;j<H;j++){
line.push_back(j*W+i);
}
if(i > 0) line.push_back(add.back());
add.push_back(add_xor(line));
}
int ls = 31 - __builtin_clz(K);
vector<int> number;
for(int i=0;i<=ls;i++){
if(H*W == 2) number.push_back(add_not(0));
else number.push_back(add_and({0,1,2}));
}
for(int v : add){
for(int i=0;i<=ls;i++){
int temp = number[i];
number[i] = add_xor({v,temp});
v = add_and({v,temp});
}
}
vector<int> check;
for(int i=0;i<=ls;i++){
if(K & (1 << i)) check.push_back(number[i]);
else check.push_back(add_not(number[i]));
}
add_and(check);
}
# | 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... |