#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
const int N=200;
int a,b,c,d,e,i,j,ii,jj,zx,xc,k,K,COUNTI,MASIVI[1000009],nuli,XOR[1009],OR[1009];
vector <pair <int, int> > X[1009],Y[1009];
vector <int> vv,v,va,vz,vx;
//
/*int add_xor(vector <int> q){
if(q.size()==0){
cout<<"ADDXOR";
exit(0);
}
int qw=0;
for(int qq=0; qq<q.size(); qq++){
qw^=MASIVI[q[qq]];
}
COUNTI++;MASIVI[COUNTI]=qw;
return COUNTI;
}
int add_or(vector <int> q){
if(q.size()==0){
cout<<"ADDOR";
exit(0);
}
int qw=0;
for(int qq=0; qq<q.size(); qq++){
qw|=MASIVI[q[qq]];
}
COUNTI++;MASIVI[COUNTI]=qw;
return COUNTI;
}
int add_and(vector <int> q){
if(q.size()==0){
cout<<"ADDAND";
exit(0);
}
int qw=1;
for(int qq=0; qq<q.size(); qq++){
qw&=MASIVI[q[qq]];
}
COUNTI++;MASIVI[COUNTI]=qw;
return COUNTI;
}
int add_not(int q){
int qq=0;
if(MASIVI[q]==0) qq=1; else qq=0;
COUNTI++;MASIVI[COUNTI]=qq;
return COUNTI;
}*/
//
int TWONUMBER(vector <int> q){
int qw=0,we=0;
vector <int> QW,WE;
//QW.push_back(q);QW.push_back(w);
qw=add_or(q);we=add_xor(q);
WE.push_back(qw);WE.push_back(we);
return add_xor(WE);
}
int F(int q, int w){
return q*b+w;
}
int solve(int KK){
K=KK;
int QW=0,WE=0;
va.clear();
vv.clear();
for(i=0; i<420; i++){
for(vector <pair <int, int> >::iterator it=X[i].begin(); it!=X[i].end(); it++){
vv.push_back(F((*it).first,(*it).second));
}
if(vv.size()!=0) XOR[i]=add_xor(vv); else XOR[i]=nuli;
if(vv.size()!=0) OR[i]=add_or(vv); else OR[i]=nuli;
if(i==K-1){
if(vv.size()!=0) va.push_back(TWONUMBER(vv)); else va.push_back(nuli);
continue;
}
if(i>K-1){
v.clear();
vx.clear();
vx.push_back(XOR[i]);vx.push_back(XOR[i-K]);
//v.push_back(add_xor(vx));
v.push_back(add_not(add_xor(vx)));
vx.clear();
vx.push_back(OR[i]);vx.push_back(OR[i-K]);
v.push_back(add_xor(vx));
va.push_back(add_and(v));
//va.push_back(add_xor(v));
continue;
}
}
//cout<<MASIVI[va[0]]<<endl;
QW=add_or(va);
//
va.clear();
vv.clear();
for(i=0; i<420; i++){
for(vector <pair <int, int> >::iterator it=Y[i].begin(); it!=Y[i].end(); it++){
vv.push_back(F((*it).first,(*it).second));
}
if(vv.size()!=0) XOR[i]=add_xor(vv); else XOR[i]=nuli;
if(vv.size()!=0) OR[i]=add_or(vv); else OR[i]=nuli;
if(i==K-1){
if(vv.size()!=0) va.push_back(TWONUMBER(vv)); else va.push_back(nuli);
continue;
}
if(i>K-1){
v.clear();
vx.clear();
vx.push_back(XOR[i]);vx.push_back(XOR[i-K]);
//v.push_back(add_xor(vx));
v.push_back(add_not(add_xor(vx)));
vx.clear();
vx.push_back(OR[i]);vx.push_back(OR[i-K]);
v.push_back(add_xor(vx));
va.push_back(add_and(v));
//va.push_back(add_xor(v));
continue;
}
}
WE=add_or(va);
vv.clear();vv.push_back(QW);vv.push_back(WE);
//cout<<MASIVI[QW]<<" "<<MASIVI[WE]<<" "<<K<<endl;
return add_and(vv);
}
void construct_network(int H, int W, int KK) {
if(H*W==2){
vv.clear();vv.push_back(0);vv.push_back(1);
nuli=add_xor(vv);
}else{
vv.clear();vv.push_back(0);vv.push_back(1);vv.push_back(2);
nuli=add_and(vv);
}
a=H;b=W;k=KK;
for(i=0; i<H; i++){
for(j=0; j<W; j++){
X[i+j].push_back(make_pair(i,j));
Y[i-j+N].push_back(make_pair(i,j));
}
}
int AX=solve(k);
int AZ=solve(k+1);
vv.clear();vv.push_back(AZ);vv.push_back(AX);
add_xor(vv);
}
/*int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>a>>b>>k;
cin>>c>>d>>zx>>xc;
MASIVI[F(c,d)]=1;
MASIVI[F(zx,xc)]=1;
COUNTI=F(a-1,b-1);
c=0;d=0;zx=0;xc=0;
construct_network(a,b,k);
cout<<MASIVI[COUNTI];
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1096 KB |
Output is correct |
2 |
Correct |
6 ms |
1096 KB |
Output is correct |
3 |
Correct |
6 ms |
1108 KB |
Output is correct |
4 |
Correct |
7 ms |
1096 KB |
Output is correct |
5 |
Correct |
9 ms |
1096 KB |
Output is correct |
6 |
Correct |
7 ms |
1092 KB |
Output is correct |
7 |
Correct |
7 ms |
1096 KB |
Output is correct |
8 |
Correct |
7 ms |
1096 KB |
Output is correct |
9 |
Correct |
7 ms |
1096 KB |
Output is correct |
10 |
Correct |
7 ms |
1096 KB |
Output is correct |
11 |
Correct |
9 ms |
1096 KB |
Output is correct |
12 |
Correct |
8 ms |
1096 KB |
Output is correct |
13 |
Correct |
8 ms |
1116 KB |
Output is correct |
14 |
Correct |
8 ms |
1096 KB |
Output is correct |
15 |
Correct |
8 ms |
1096 KB |
Output is correct |
16 |
Correct |
8 ms |
1108 KB |
Output is correct |
17 |
Correct |
6 ms |
1096 KB |
Output is correct |
18 |
Correct |
6 ms |
1096 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1096 KB |
Output is correct |
2 |
Correct |
6 ms |
1096 KB |
Output is correct |
3 |
Correct |
6 ms |
1108 KB |
Output is correct |
4 |
Correct |
7 ms |
1096 KB |
Output is correct |
5 |
Correct |
9 ms |
1096 KB |
Output is correct |
6 |
Correct |
7 ms |
1092 KB |
Output is correct |
7 |
Correct |
7 ms |
1096 KB |
Output is correct |
8 |
Correct |
7 ms |
1096 KB |
Output is correct |
9 |
Correct |
7 ms |
1096 KB |
Output is correct |
10 |
Correct |
7 ms |
1096 KB |
Output is correct |
11 |
Correct |
9 ms |
1096 KB |
Output is correct |
12 |
Correct |
8 ms |
1096 KB |
Output is correct |
13 |
Correct |
8 ms |
1116 KB |
Output is correct |
14 |
Correct |
8 ms |
1096 KB |
Output is correct |
15 |
Correct |
8 ms |
1096 KB |
Output is correct |
16 |
Correct |
8 ms |
1108 KB |
Output is correct |
17 |
Correct |
6 ms |
1096 KB |
Output is correct |
18 |
Correct |
6 ms |
1096 KB |
Output is correct |
19 |
Correct |
8 ms |
1096 KB |
Output is correct |
20 |
Correct |
8 ms |
1116 KB |
Output is correct |
21 |
Correct |
19 ms |
1824 KB |
Output is correct |
22 |
Correct |
19 ms |
1736 KB |
Output is correct |
23 |
Correct |
33 ms |
2728 KB |
Output is correct |
24 |
Correct |
40 ms |
2632 KB |
Output is correct |
25 |
Correct |
33 ms |
2620 KB |
Output is correct |
26 |
Correct |
41 ms |
2664 KB |
Output is correct |
27 |
Correct |
32 ms |
2628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1096 KB |
Output is correct |
2 |
Correct |
6 ms |
1096 KB |
Output is correct |
3 |
Correct |
6 ms |
1108 KB |
Output is correct |
4 |
Correct |
7 ms |
1096 KB |
Output is correct |
5 |
Correct |
9 ms |
1096 KB |
Output is correct |
6 |
Correct |
7 ms |
1092 KB |
Output is correct |
7 |
Correct |
7 ms |
1096 KB |
Output is correct |
8 |
Correct |
7 ms |
1096 KB |
Output is correct |
9 |
Correct |
7 ms |
1096 KB |
Output is correct |
10 |
Correct |
7 ms |
1096 KB |
Output is correct |
11 |
Correct |
9 ms |
1096 KB |
Output is correct |
12 |
Correct |
8 ms |
1096 KB |
Output is correct |
13 |
Correct |
8 ms |
1116 KB |
Output is correct |
14 |
Correct |
8 ms |
1096 KB |
Output is correct |
15 |
Correct |
8 ms |
1096 KB |
Output is correct |
16 |
Correct |
8 ms |
1108 KB |
Output is correct |
17 |
Correct |
6 ms |
1096 KB |
Output is correct |
18 |
Correct |
6 ms |
1096 KB |
Output is correct |
19 |
Correct |
8 ms |
1096 KB |
Output is correct |
20 |
Correct |
8 ms |
1116 KB |
Output is correct |
21 |
Correct |
19 ms |
1824 KB |
Output is correct |
22 |
Correct |
19 ms |
1736 KB |
Output is correct |
23 |
Correct |
33 ms |
2728 KB |
Output is correct |
24 |
Correct |
40 ms |
2632 KB |
Output is correct |
25 |
Correct |
33 ms |
2620 KB |
Output is correct |
26 |
Correct |
41 ms |
2664 KB |
Output is correct |
27 |
Correct |
32 ms |
2628 KB |
Output is correct |
28 |
Incorrect |
5 ms |
4556 KB |
WA in grader: Too many inputs |
29 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1096 KB |
Output is correct |
2 |
Correct |
6 ms |
1096 KB |
Output is correct |
3 |
Correct |
6 ms |
1108 KB |
Output is correct |
4 |
Correct |
7 ms |
1096 KB |
Output is correct |
5 |
Correct |
9 ms |
1096 KB |
Output is correct |
6 |
Correct |
7 ms |
1092 KB |
Output is correct |
7 |
Correct |
7 ms |
1096 KB |
Output is correct |
8 |
Correct |
7 ms |
1096 KB |
Output is correct |
9 |
Correct |
7 ms |
1096 KB |
Output is correct |
10 |
Correct |
7 ms |
1096 KB |
Output is correct |
11 |
Correct |
9 ms |
1096 KB |
Output is correct |
12 |
Correct |
8 ms |
1096 KB |
Output is correct |
13 |
Correct |
8 ms |
1116 KB |
Output is correct |
14 |
Correct |
8 ms |
1096 KB |
Output is correct |
15 |
Correct |
8 ms |
1096 KB |
Output is correct |
16 |
Correct |
8 ms |
1108 KB |
Output is correct |
17 |
Correct |
6 ms |
1096 KB |
Output is correct |
18 |
Correct |
6 ms |
1096 KB |
Output is correct |
19 |
Correct |
8 ms |
1096 KB |
Output is correct |
20 |
Correct |
8 ms |
1116 KB |
Output is correct |
21 |
Correct |
19 ms |
1824 KB |
Output is correct |
22 |
Correct |
19 ms |
1736 KB |
Output is correct |
23 |
Correct |
33 ms |
2728 KB |
Output is correct |
24 |
Correct |
40 ms |
2632 KB |
Output is correct |
25 |
Correct |
33 ms |
2620 KB |
Output is correct |
26 |
Correct |
41 ms |
2664 KB |
Output is correct |
27 |
Correct |
32 ms |
2628 KB |
Output is correct |
28 |
Incorrect |
5 ms |
4556 KB |
WA in grader: Too many inputs |
29 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
2884 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1116 KB |
Output is correct |
2 |
Correct |
8 ms |
1096 KB |
Output is correct |
3 |
Incorrect |
4 ms |
4556 KB |
WA in grader: Too many inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
6404 KB |
WA in grader: Too many inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1096 KB |
Output is correct |
2 |
Correct |
6 ms |
1096 KB |
Output is correct |
3 |
Correct |
6 ms |
1108 KB |
Output is correct |
4 |
Correct |
7 ms |
1096 KB |
Output is correct |
5 |
Correct |
9 ms |
1096 KB |
Output is correct |
6 |
Correct |
7 ms |
1092 KB |
Output is correct |
7 |
Correct |
7 ms |
1096 KB |
Output is correct |
8 |
Correct |
7 ms |
1096 KB |
Output is correct |
9 |
Correct |
7 ms |
1096 KB |
Output is correct |
10 |
Correct |
7 ms |
1096 KB |
Output is correct |
11 |
Correct |
9 ms |
1096 KB |
Output is correct |
12 |
Correct |
8 ms |
1096 KB |
Output is correct |
13 |
Correct |
8 ms |
1116 KB |
Output is correct |
14 |
Correct |
8 ms |
1096 KB |
Output is correct |
15 |
Correct |
8 ms |
1096 KB |
Output is correct |
16 |
Correct |
8 ms |
1108 KB |
Output is correct |
17 |
Correct |
6 ms |
1096 KB |
Output is correct |
18 |
Correct |
6 ms |
1096 KB |
Output is correct |
19 |
Correct |
8 ms |
1096 KB |
Output is correct |
20 |
Correct |
8 ms |
1116 KB |
Output is correct |
21 |
Correct |
19 ms |
1824 KB |
Output is correct |
22 |
Correct |
19 ms |
1736 KB |
Output is correct |
23 |
Correct |
33 ms |
2728 KB |
Output is correct |
24 |
Correct |
40 ms |
2632 KB |
Output is correct |
25 |
Correct |
33 ms |
2620 KB |
Output is correct |
26 |
Correct |
41 ms |
2664 KB |
Output is correct |
27 |
Correct |
32 ms |
2628 KB |
Output is correct |
28 |
Incorrect |
5 ms |
4556 KB |
WA in grader: Too many inputs |
29 |
Halted |
0 ms |
0 KB |
- |