#include<bits/stdc++.h>
using namespace std;
#include "vision.h"
int j,i,iL[500],iR[500],bR[500],bL[500];
vector<int> ansVec,V,Dr[500],Dl[500];
int getans(int h,int w,int k){
for(int i=k;i<w+h-1;i++){
V.push_back(bL[i-k]);
V.push_back(iL[i]);
ansVec.push_back(add_and(V));
V.clear();
V.push_back(bR[i-k]);
V.push_back(iR[i]);
ansVec.push_back(add_and(V));
V.clear();
}
return add_or(ansVec);
}
void construct_network(int H,int W,int K){
for(i=0;i<H;i++)
for(j=0;j<W;j++){
Dr[i-j+W-1].push_back(i*W+j);
Dl[i+j].push_back(i*W+j);
}
iL[0]=add_or(Dl[0]);
iR[0]=add_or(Dr[0]);
bL[0]=add_or(Dl[0]);
bR[0]=add_or(Dr[0]);
for(i=1;i<H+W-1;i++){
iL[i]=add_or(Dl[i]);
iR[i]=add_or(Dr[i]);
V.push_back(iL[i]);
V.push_back(bL[i-1]);
bL[i]=add_or(V);
V.clear();
V.push_back(iR[i]);
V.push_back(bR[i-1]);
bR[i]=add_or(V);
V.clear();
}
int ans1=getans(H,W,K);
if(K<=W+H-2){
int ans2=getans(H,W,K+1);
V.push_back(ans1);
V.push_back(ans2);
add_xor(V);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
504 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
1912 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 |
2 ms |
376 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |