#include "vision.h"
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x) cerr<< #x <<" = "<< x<<endl;
#define debug2(x,y) cerr<< #x <<" = "<< x<<" "<< #y <<" = "<< y<<endl;
using namespace std;
int _add(int x,int y){
vector<int>v;
v.pb(x);v.pb(y);
return add_and(v);
}
int _or(int x,int y){
vector<int>v;
v.pb(x);v.pb(y);
return add_or(v);
}
int _xor(int x,int y){
vector<int>v;
v.pb(x);v.pb(y);
return add_xor(v);
}
int n,m;
const int N=202;
vector<int>adj[2*N];
int res_or[2*N],res_xor[2*N];
int solve(int t,int dis){
if(!t){
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
adj[i+j].pb(i*m+j);
}
else{
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
adj[i-j+N].pb(i*m+j);
}
vector<int>ans;
int l=-1,r;
for(int i=0;i<2*N;i++){
if(adj[i].size()){
if(l==-1)
l=i;
r=i;
res_or[i]=add_or(adj[i]);
res_xor[i]=add_xor(adj[i]);
}
adj[i].clear();
}
for(int i=l;i<=r;i++){
int val=add_not(_xor(res_or[i],res_xor[i]));
vector<int>tmp;
for(int j=max(l,i-dis);j<=min(r,i+dis);j++)
if(i!=j)
tmp.pb(res_or[j]);
vector<int>aa;
aa.pb(add_not(add_or(tmp)));
aa.pb(res_or[i]);aa.pb(val);
ans.pb(add_and(aa));
}
return add_or(ans);
}
void construct_network(int H, int W, int K) {n=H;m=W;
_xor(_or(solve(0,K),solve(1,K)),_or(solve(0,K-1),solve(1,K-1)));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
932 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |