#include "vision.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define x first
#define y second
#define MAXN 205
using namespace std;
int n,m,k;
vector<int>ad[2*MAXN],ms[2*MAXN];
int q[2*MAXN][2],s[2*MAXN],l1[2*MAXN],l2[2*MAXN];
void construct_network(int H, int W, int K) {
n=H; m=W; k=K;
for (int i=0;i<n;i++){
for (int j=0;j<m;j++){
ad[i+j].push_back(i*m+j);
ms[i-j+m-1].push_back(i*m+j);
// cout<<i-j+m-1<<' ';
}
}
//cout<<'\n';
int now=n*m-1;
for (int i=0;i<=n+m-2;i++){
vector<int>qus;
if (i+k<=n+m-2){
for (auto j:ad[i]) qus.push_back(j);
for (auto j:ad[i+k]) qus.push_back(j);
add_or(qus); now++;
qus.push_back(now);
add_xor(qus); now++;
q[i][0]=now;
// cout<<"add1\n";
}
}
for (int i=0;i<=n+m-2;i++){
vector<int>qus;
qus=ad[i];
add_or(qus); now++;
qus=ad[i]; qus.push_back(now);
add_xor(qus); now++;
}
for (int i=0;i<=n+m-2;i++){
vector<int>qus;
if (i+k<=n+m-2){
for (auto j:ms[i]) qus.push_back(j);
for (auto j:ms[i+k]) qus.push_back(j);
add_or(qus); now++;
qus.push_back(now);
add_xor(qus); now++;
q[i][1]=now;
}
}
for (int i=0;i<=n+m-2;i++){
vector<int>qus;
qus=ms[i];
add_or(qus); now++;
qus=ms[i]; qus.push_back(now);
add_xor(qus); now++;
}
for (int i=0;i<k;i++){
vector<int>qus;
for (int j=i;j<n+m;j+=k){
if (q[i][1])
qus.push_back(q[i][1]);
}
if (qus.empty()) continue;
add_or(qus); now++;
s[i]=now;
}
//cout<<"OK1 ";
vector<int>ans;
for (int i=0;i<=n+m-2;i++){
vector<int>qus;
if (!q[i][0]) continue;
qus.push_back(q[i][0]);
for (int j=0;j<k;j++)
if (s[j]) qus.push_back(s[j]);
add_or(qus); now++;
ans.push_back(now);
}
//cout<<"OK2 ";
vector<int>qus;
for (auto i:ans)
qus.push_back(i);
add_or(qus); now++;
int have1=now;
qus.clear();
for (int i=0;i<=n+m-2;i++){
qus.push_back(l1[i]);
qus.push_back(l2[i]);
}
add_or(qus); now++;
int have2=now;
add_and({have1,have2});
//cout<<"OK3 ";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 1), (0, 2), 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, 1), (0, 2), 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, 1), (0, 2), 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, 1), (0, 2), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
468 KB |
on inputs (0, 1), (0, 2), 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), (1, 1), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
49 ms |
5656 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 |
1 ms |
212 KB |
on inputs (0, 1), (0, 2), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |