#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<H;i++)
{
if(K-i<0 || K-i>K || i>K || i<0) continue;
tmp.push_back(add_and({Hh[i], Ww[K-i]}));
}
add_or(tmp);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Incorrect |
1 ms |
256 KB |
WA in grader: Invalid index |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Incorrect |
1 ms |
256 KB |
WA in grader: Invalid index |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Incorrect |
1 ms |
256 KB |
WA in grader: Invalid index |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Incorrect |
1 ms |
256 KB |
WA in grader: Invalid index |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
WA in grader: Invalid index |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
1152 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
6 ms |
768 KB |
Output is correct |
8 |
Correct |
7 ms |
768 KB |
Output is correct |
9 |
Correct |
11 ms |
1152 KB |
Output is correct |
10 |
Correct |
1 ms |
256 KB |
Output is correct |
11 |
Correct |
1 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Incorrect |
1 ms |
256 KB |
WA in grader: Invalid index |
5 |
Halted |
0 ms |
0 KB |
- |