#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pf printf
#define pb push_back
vector<int> qry,qry2;
int l[405],r[405];
int add_and(int a,int b){
vector<int> v{a,b};
return add_and(v);
}
int add_or(int a,int b){
vector<int> v{a,b};
return add_or(v);
}
void construct_network(int H,int W,int K){
for(int i=0;i<H+W-1;++i){
for(int h=0;h<H;++h){
if(h+W-1<i)continue;
qry.pb(h*W+(i-h));
}
l[i]=add_xor(qry);
qry.clear();
}
for(int i=0;i<H+W-1;++i){//h-w=i-(W-1)
for(int h=0;h<H;++h){
if(h-i>0||h-i<=-W)continue;
qry.pb(h*W+(h-i+W-1));
}
r[i]=add_xor(qry);
qry.clear();
}
int la,lb=-1,ra,rb=-1;
for(int i=0;i+K<H+W-1;++i){
for(int j=i+1;j<=i+K;++j)qry.pb(l[j]);
qry2.pb(add_and(l[i],add_or(qry)));
qry.clear();
}
la=add_or(qry2);
qry2.clear();
if(K!=1){
for(int i=0;i+K-1<H+W-1;++i){
for(int j=i+1;j<=i+K-1;++j)qry.pb(l[j]);
qry2.pb(add_and(l[i],add_or(qry)));
qry.clear();
}
lb=add_or(qry2);
qry2.clear();
}
for(int i=0;i+K<H+W-1;++i){
for(int j=i+1;j<=i+K;++j)qry.pb(r[j]);
qry2.pb(add_and(r[i],add_or(qry)));
qry.clear();
}
ra=add_or(qry2);
qry2.clear();
if(K!=1){
for(int i=0;i+K-1<H+W-1;++i){
for(int j=i+1;j<=i+K-1;++j)qry.pb(r[j]);
qry2.pb(add_and(r[i],add_or(qry)));
qry.clear();
}
rb=add_or(qry2);
qry2.clear();
}
if(K==1)add_or(la,ra);
else{
add_or(add_and(la,add_not(lb)),add_and(ra,add_not(rb)));
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Incorrect |
1 ms |
296 KB |
on inputs (0, 2), (1, 0), expected 0, but computed 1 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Incorrect |
1 ms |
296 KB |
on inputs (0, 2), (1, 0), expected 0, but computed 1 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Incorrect |
1 ms |
296 KB |
on inputs (0, 2), (1, 0), expected 0, but computed 1 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Incorrect |
1 ms |
296 KB |
on inputs (0, 2), (1, 0), expected 0, but computed 1 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
4 ms |
588 KB |
Output is correct |
3 |
Correct |
4 ms |
588 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
6 ms |
580 KB |
Output is correct |
6 |
Correct |
8 ms |
716 KB |
Output is correct |
7 |
Correct |
6 ms |
716 KB |
Output is correct |
8 |
Correct |
2 ms |
460 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
4 ms |
588 KB |
Output is correct |
11 |
Correct |
4 ms |
580 KB |
Output is correct |
12 |
Correct |
4 ms |
632 KB |
Output is correct |
13 |
Correct |
3 ms |
588 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
3 ms |
460 KB |
Output is correct |
16 |
Correct |
6 ms |
716 KB |
Output is correct |
17 |
Correct |
6 ms |
844 KB |
Output is correct |
18 |
Correct |
6 ms |
844 KB |
Output is correct |
19 |
Correct |
5 ms |
716 KB |
Output is correct |
20 |
Correct |
3 ms |
460 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Incorrect |
3 ms |
588 KB |
on inputs (0, 0), (3, 28), expected 1, but computed 0 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
1512 KB |
on inputs (126, 120), (176, 169), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Incorrect |
1 ms |
296 KB |
on inputs (0, 2), (1, 0), expected 0, but computed 1 |
8 |
Halted |
0 ms |
0 KB |
- |