#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
void construct_network(int H,int W,int K){
int cnt=0;
map <pair <int,int>,bool> p;
for (int i=0; i<H; i++){
for (int j=0; j<W; j++){
for (int xp=i,yp=j-K; xp!=i-K&&yp!=j; xp--,yp++){
if (xp>=0&&xp<H&&yp>=0&&yp<W&&!p[{i*W+j,xp*W+yp}]&&!p[{xp*W+yp,i*W+j}]){
add_or({i*W+j,xp*W+yp});
cnt++;
p[{i*W+j,xp*W+yp}]=1;
}
}
for (int xp=i-K,yp=j; xp!=i&&yp!=j+K; xp++,yp++){
if (xp>=0&&xp<H&&yp>=0&&yp<W&&!p[{i*W+j,xp*W+yp}]&&!p[{xp*W+yp,i*W+j}]){
add_or({i*W+j,xp*W+yp});
cnt++;
p[{i*W+j,xp*W+yp}]=1;
}
}
for (int xp=i,yp=j+K; xp!=i+K&&yp!=j; xp++,yp--){
if (xp>=0&&xp<H&&yp>=0&&yp<W&&!p[{i*W+j,xp*W+yp}]&&!p[{xp*W+yp,i*W+j}]){
add_or({i*W+j,xp*W+yp});
cnt++;
p[{i*W+j,xp*W+yp}]=1;
}
}
for (int xp=i+K,yp=j; xp!=i&&yp!=j-K; xp--,yp--){
if (xp>=0&&xp<H&&yp>=0&&yp<W&&!p[{i*W+j,xp*W+yp}]&&!p[{xp*W+yp,i*W+j}]){
add_or({i*W+j,xp*W+yp});
cnt++;
p[{i*W+j,xp*W+yp}]=1;
}
}
}
}
if (cnt==1) return;
//cnt results stored in [h*w,h*w+cnt)
vector <int> v;
int curpr=0,cnt1=0;
for (int i=0; i<cnt; i++){
v.push_back(H*W+i);
curpr++;
if (i==cnt-1||curpr==10000){
add_or(v);
v.clear();
cnt1++;
curpr=0;
}
}
if (cnt1==1) return;
//cnt1 results stored in [h*w+cnt,h*w+cnt+cnt1)
v.clear();
for (int i=H*W+cnt; i<H*W+cnt+cnt1; i++){
v.push_back(i);
}
add_or(v);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (1, 1), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
2152 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |