#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);
}
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=0;i<H;i++) tmp.push_back(H*W+i);
Hh[0]=add_xor(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=0;i<W;i++) tmp.push_back(H*W+H+i);
Ww[0]=add_xor(tmp);
tmp.clear();
for(int i=0;i<K;i++)
{
if(i>H || 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 |
Incorrect |
0 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
0 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
0 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
0 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Incorrect |
3 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, 0), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
1152 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 |
Incorrect |
0 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |