#include "vision.h"
#include "bits/stdc++.h"
using namespace std;
vector<int> sum(vector<int> v,int x){
vector<int> simpan;
for(int i=0;i<9;i++){
simpan.push_back(add_xor({v[i],x}));
x=add_and({v[i],x});
}
return simpan;
}
vector<int> jumlah(vector<int> v,vector<int> u){
vector<int> ret;
ret.push_back(add_and({0,add_not(0)}));
for(int i=1;i<=8;i++)ret.push_back(add_and({ret[0]}));
for(auto isi : v)ret=sum(ret,isi);
for(auto isi : u)ret=sum(ret,isi);
return ret;
}
vector<int> baris(int h,int w){
vector<int> ret;
for(int i=0;i<h;i++){
vector<int> v;
for(int j=0;j<w;j++)v.push_back(i*w+j);
ret.push_back(add_xor(v));
}
return ret;
}
vector<int> kolom(int h,int w){
vector<int> ret;
for(int j=0;j<w;j++){
vector<int> v;
for(int i=0;i<h;i++)v.push_back(i*w+j);
ret.push_back(add_xor(v));
}
return ret;
}
void sama(vector<int> v,int k){
for(int i=0;i<9;i++){
if(!((1<<i) & k))v[i]=add_not(v[i]);
}
add_and(v);
}
void construct_network(int H, int W, int K) {
sama(jumlah(baris(H,W),kolom(H,W)),K);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 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 |
2 ms |
376 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 |
2 ms |
376 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 |
2 ms |
376 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 |
4 ms |
632 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 |
2 ms |
256 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 |
14 ms |
1652 KB |
on inputs (80, 199), (81, 199), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |