#include "vision.h"
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second
#define vi vector<int>
/*
vi a;
int add_not(int x){
a.push_back(!a[x]);
return a.size() - 1;
}
int add_and(vi v){
a.push_back(1);
for(int i : v) a.back() &= a[i];
return a.size() - 1;
}
int add_or(vi v){
a.push_back(0);
if(*max_element(v.begin(), v.end()) > a.size()) exit(0);
for(int i : v) a.back() |= a[i];
return a.size() - 1;
}
int add_xor(vi v){
a.push_back(0);
for(int i : v) a.back() ^= a[i];
return a.size() - 1;
}
*/
void construct_network(int n, int m, int k){
vi v, w;
int d = n + m - 1, f[2], ff[2];
for(int t = 0; t < 2; t++)
for(int i = 0; i < d; i++){
v.clear();
for(int j = max(0, i + 1 - m); j < n && j <= i; j++){
v.push_back(j * m + (t ? m + j - i - 1 : i - j));
}
if(v.empty()) cout << t << " " << i << endl;
add_or(v);
}
for(int t = 0; t < 2; t++){
for(int i = 0; i < 2; i++){
w.clear();
for(int j = 0; j < d + t - k; j++){
v.clear();
for(int l = 0; l <= k - t; l++) v.push_back(n * m + d * i + j + l);
w.push_back(add_and({add_not(add_xor(v)), add_or(v)}));
}
ff[i] = add_or(w);
}
f[t] = add_and({ff[0], ff[1]});
}
add_and({f[0], add_not(f[1])});
}
/*
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, k;
cin >> n >> m >> k;
a.resize(n * m);
for(int i = 0; i < n; i++)
for(int j = 0; j < m; j++){
cin >> a[i * m + j];
}
construct_network(n, m, k);
cout << a.back() << endl;
return 0;
}
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
628 KB |
Output is correct |
2 |
Correct |
10 ms |
1152 KB |
Output is correct |
3 |
Correct |
10 ms |
1132 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
4 ms |
620 KB |
Output is correct |
6 |
Correct |
10 ms |
1004 KB |
Output is correct |
7 |
Correct |
9 ms |
1004 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
3 ms |
620 KB |
Output is correct |
10 |
Correct |
8 ms |
1004 KB |
Output is correct |
11 |
Correct |
10 ms |
1132 KB |
Output is correct |
12 |
Correct |
10 ms |
1132 KB |
Output is correct |
13 |
Correct |
9 ms |
876 KB |
Output is correct |
14 |
Correct |
1 ms |
384 KB |
Output is correct |
15 |
Correct |
3 ms |
620 KB |
Output is correct |
16 |
Correct |
9 ms |
1004 KB |
Output is correct |
17 |
Correct |
10 ms |
1132 KB |
Output is correct |
18 |
Correct |
13 ms |
1132 KB |
Output is correct |
19 |
Correct |
8 ms |
876 KB |
Output is correct |
20 |
Correct |
1 ms |
364 KB |
Output is correct |
21 |
Correct |
1 ms |
364 KB |
Output is correct |
22 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (1, 1), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
1640 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
4 ms |
620 KB |
Output is correct |
4 |
Correct |
4 ms |
620 KB |
Output is correct |
5 |
Correct |
3 ms |
620 KB |
Output is correct |
6 |
Correct |
3 ms |
620 KB |
Output is correct |
7 |
Correct |
8 ms |
1128 KB |
Output is correct |
8 |
Correct |
9 ms |
1128 KB |
Output is correct |
9 |
Correct |
18 ms |
1640 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 1), (1, 0), expected 1, but computed 0 |
7 |
Halted |
0 ms |
0 KB |
- |