#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define inf 1000000000
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pii>
#define SET(a, b) memset(a, b, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
int colres[205], rowres[205];
void construct_network(int h, int w, int k) {
vi rows;
FOR(i, 0, h-1) {
vi row;
FOR(j, 0, w-1) {
row.pb(i * w + j);
}
int id = add_xor(row);
add_or(row);
rows.pb(add_xor({id, id + 1}));
}
int row_2 = add_or(rows);
vi cols;
FOR(j, 0, w-1) {
vi col;
FOR(i, 0, h-1) {
col.pb(i * w + j);
}
colres[j] = add_xor(col);
}
vi adj_cols;
FOR(j, 0, w-2) {
adj_cols.pb(add_and({colres[j], colres[j + 1]}));
}
int col_1;
if (w == 1) col_1 = add_and({0, add_not(0)});
else col_1 = add_or(adj_cols);
int horizontal = add_and({row_2, col_1});
//-----------
cols.clear();
FOR(j, 0, w-1) {
vi col;
FOR(i, 0, h-1) {
col.pb(i * w + j);
}
int id = add_xor(col);
add_or(col);
cols.pb(add_xor({id, id + 1}));
}
int col_2 = add_or(cols);
rows.clear();
FOR(i, 0, h-1) {
vi row;
FOR(j, 0, w-1) {
row.pb(i * w + j);
}
rowres[i] = add_xor(row);
}
vi adj_rows;
FOR(j, 0, h-2) {
adj_rows.pb(add_and({rowres[j], rowres[j + 1]}));
}
int row_1;
if (h == 1) row_1 = add_and({0, add_not(0)});
else row_1 = add_or(adj_rows);
int vertical = add_and({row_1, col_2});
add_or({horizontal, vertical});
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Incorrect |
1 ms |
384 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
2816 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Correct |
3 ms |
512 KB |
Output is correct |
4 |
Correct |
5 ms |
768 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
16 ms |
1536 KB |
Output is correct |
8 |
Correct |
16 ms |
1536 KB |
Output is correct |
9 |
Correct |
29 ms |
2816 KB |
Output is correct |
10 |
Correct |
1 ms |
256 KB |
Output is correct |
11 |
Correct |
1 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |