#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> l, r, a, b, c, d, tmp;
void construct_network(int n, int m, int k)
{
for (int i=0; i<=n+m-2; i++)
{
tmp.clear();
for (int j=0; j<n; j++)
if (i-j>=0 && i-j<m)
tmp.push_back(j*m+i-j);
l.push_back(add_or(tmp));
}
for (int i=-n+1; i<=m-1; i++)
{
tmp.clear();
for (int j=0; j<n; j++)
if (i+j>=0 && i+j<m)
tmp.push_back(j*m+i+j);
r.push_back(add_or(tmp));
}
for (int i=0; i<n+m-2; i++)
{
tmp.clear();
for (int j=i+1; j<=min(i+k, n+m-2); j++)
tmp.push_back(l[j]);
int x=add_or(tmp);
tmp.clear();
tmp.push_back(l[i]);
tmp.push_back(x);
a.push_back(add_and(tmp));
if (i+k<=n+m-2)
{
tmp.clear();
tmp.push_back(l[i]);
tmp.push_back(l[i+k]);
b.push_back(add_and(tmp));
}
}
for (int i=0; i<n+m-2; i++)
{
tmp.clear();
for (int j=i+1; j<=min(i+k, n+m-2); j++)
tmp.push_back(r[j]);
int x=add_or(tmp);
tmp.clear();
tmp.push_back(r[i]);
tmp.push_back(x);
c.push_back(add_and(tmp));
if (i+k<=n+m-2)
{
tmp.clear();
tmp.push_back(r[i]);
tmp.push_back(r[i+k]);
d.push_back(add_and(tmp));
}
}
tmp.clear();
tmp.push_back(add_or(a));
tmp.push_back(add_or(d));
int x=add_and(tmp);
tmp.clear();
tmp.push_back(add_or(b));
tmp.push_back(add_or(c));
int y=add_and(tmp);
tmp.clear();
tmp.push_back(x);
tmp.push_back(y);
add_or(tmp);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
304 KB |
Output is correct |
6 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
304 KB |
Output is correct |
6 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
304 KB |
Output is correct |
6 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
304 KB |
Output is correct |
6 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
596 KB |
Output is correct |
3 |
Correct |
4 ms |
596 KB |
Output is correct |
4 |
Correct |
8 ms |
724 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
3 ms |
496 KB |
Output is correct |
7 |
Correct |
5 ms |
584 KB |
Output is correct |
8 |
Correct |
4 ms |
724 KB |
Output is correct |
9 |
Correct |
1 ms |
428 KB |
Output is correct |
10 |
Correct |
3 ms |
468 KB |
Output is correct |
11 |
Correct |
4 ms |
596 KB |
Output is correct |
12 |
Correct |
4 ms |
596 KB |
Output is correct |
13 |
Correct |
4 ms |
596 KB |
Output is correct |
14 |
Correct |
8 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
340 KB |
Output is correct |
16 |
Correct |
3 ms |
548 KB |
Output is correct |
17 |
Correct |
4 ms |
560 KB |
Output is correct |
18 |
Correct |
4 ms |
596 KB |
Output is correct |
19 |
Correct |
5 ms |
684 KB |
Output is correct |
20 |
Correct |
6 ms |
724 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (1, 1), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
1244 KB |
Output is correct |
2 |
Correct |
1 ms |
296 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
428 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
6 |
Correct |
2 ms |
340 KB |
Output is correct |
7 |
Correct |
5 ms |
808 KB |
Output is correct |
8 |
Correct |
5 ms |
924 KB |
Output is correct |
9 |
Correct |
10 ms |
1364 KB |
Output is correct |
10 |
Correct |
0 ms |
304 KB |
Output is correct |
11 |
Correct |
1 ms |
300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
304 KB |
Output is correct |
6 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |