#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K) {
vector <int> v;
for(int i=0;i<H;i++)
{
v.clear();
for(int j=0;j<W;j++)
{
v.push_back(W*i+j);
}
add_or(v);
}
for(int i=0;i<W;i++)
{
v.clear();
for(int j=0;j<H;j++)
{
v.push_back(W*j+i);
}
add_or(v);
}
v.clear();
for(int i=0;i<H;i++) for(int j=0;j<W;j++) v.push_back(H*i+j);
int ult=add_or(v);
vector <int> Hh, Ww, tmp;
Hh.resize(H), Ww.resize(W);
for(int i=1;i<H;i++)
{
if(i>K) break;
tmp.clear();
for(int j=0;j<H-i;j++)
{
v.clear();
v.push_back(H*W+j);
v.push_back(H*W+j+i);
tmp.push_back(add_and(v));
}
Hh[i]=add_or(tmp);
}
tmp.clear();
for(int i=1;i<H;i++)
{
if(i>K) break;
tmp.push_back(Hh[i]);
}
if(H==1) Hh[0]=ult;
else Hh[0]=not(add_or(tmp));
for(int i=1;i<W;i++)
{
if(i>K) break;
tmp.clear();
for(int j=0;j<W-i;j++)
{
v.clear();
v.push_back(H*W+H+j);
v.push_back(H*W+H+j+i);
tmp.push_back(add_and(v));
}
Ww[i]=add_or(tmp);
}
tmp.clear();
for(int i=1;i<W;i++)
{
if(i>K) break;
tmp.push_back(Ww[i]);
}
if(W==1) Ww[0]=ult;
else Ww[0]=not(add_or(tmp));
tmp.clear();
for(int i=0;i<H;i++)
{
if(K-i<0 || K-i>W) continue;
tmp.push_back(add_and({Hh[i], Ww[K-i]}));
}
add_or(tmp);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Incorrect |
2 ms |
1148 KB |
WA in grader: Too many instructions |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 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 |
16 ms |
1604 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 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |