#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))
ll INF=1e18+10;
int inf=1e9+10;
ll M=1e9+7;
void construct_network(int H, int W, int K) {
vi ab;
REP(i,0,H){
REP(j,0,W){
ab.PB(i*W+j);
j++;
}
i++;
REP(j,1,W){
ab.PB(i*W+j);
j++;
}
}
int x=add_or(ab);
ab.clear();
REP(i,0,H){
REP(j,1,W){
ab.PB(i*W+j);
j++;
}
i++;
REP(j,0,W){
ab.PB(i*W+j);
j++;
}
}
int y=add_or(ab);
ab.clear();
ab.PB(x);ab.PB(y);
int z=add_xor(ab);
set<pi> a;
REP(i,0,H){
REP(j,0,W){
int x=W*i+j;
REP(k,0,K+1){
int y=W*(i+k)+j+(K-k);
if(i+k<H&&i+k>=0&&j+K-k>=0&&j+K-k<W&&y<H*W&&y>=0){
if(x<y)a.insert({x,y});
else a.insert({y,x});
}
y=W*(i-k)+j+(K-k);
if(i-k<H&&i-k>=0&&j+K-k>=0&&j+K-k<W&&y<H*W&&y>=0){
if(x<y)a.insert({x,y});
else a.insert({y,x});
}
y=W*(i+k)+j-(K-k);
if(i+k<H&&i+k>=0&&j-(K-k)>=0&&j-(K-k)<W&&y<H*W&&y>=0){
if(x<y)a.insert({x,y});
else a.insert({y,x});
}
y=W*(i-k)+j-(K-k);
if(i-k<H&&i-k>=0&&j-(K-k)>=0&&j-(K-k)<W&&y<H*W&&y>=0){
if(x<y)a.insert({x,y});
else a.insert({y,x});
}
}
}
}
vii arr(H*W+1);
for(auto u:a){
arr[u.F].PB(u.S);
}
vi brr;
REP(i,0,H*W+1){
if(arr[i].empty())continue;
vi crr;
crr.PB(i);
for(auto u:arr[i])crr.PB(u);
int p=add_xor(crr);
int r=add_or(crr);
int q=add_not(p);
vi drr;
drr.PB(r);drr.PB(q);
int v=add_and(drr);
brr.PB(v);
}
int t=add_or(brr);
vi g;g.PB(t);
if(K%2==0){
g.PB(z);
add_and(g);
}
else{
int zz=add_not(z);
g.PB(zz);
add_and(g);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
35 ms |
7372 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |