#if defined(ONPC) && !defined(_GLIBCXX_ASSERTIONS)
#define _GLIBCXX_ASSERTIONS
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#ifdef ONPC
#include "t_debug.cpp"
#else
#define debug(...) 42
#endif
#define allit(a) (a).begin(), (a).end()
#define sz(a) ((int) (a).size())
#include "vision.h"
using namespace std;
using ll = long long;
using vi = vector<int>;
namespace pd = __gnu_pbds;
template<typename K>
using ordered_set = pd::tree<K, pd::null_type, less<int>, pd::rb_tree_tag, pd::tree_order_statistics_node_update>;
template<typename... T>
using gp_hash_table = pd::gp_hash_table<T...>;//simple using statement gives warnings
const int INF = 1e9;
const ll INFL = 1e18;
const int N = 1e5;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(RANDOM);
#define ENC(i,j) ((i) * m + (j))
void construct_network(int n, int m, int dist) {
int prev = -1;
cout << "[" << n << ", " << m << ", " << dist << "]" << endl;
//for (int i = 0; i < n; i++) {
// for (int j = 0; j < m; j++) {
// if (i + j == dist) {
// if (prev == -1) prev = i*m + j;
// else prev = add_or({prev, i*m + j});
// }
// }
//}
vi pos;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (i) pos.push_back(add_and({ENC(i, j), ENC(i-1, j)}));
if (j) pos.push_back(add_and({ENC(i, j), ENC(i, j-1)}));
}
}
if (sz(pos) >= 2) {
int prev = add_or({pos[0], pos[1]});
for (int i = 2; i < sz(pos); i++) {
prev = add_or({prev, pos[i]});
}
}
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:9: warning: unused variable 'prev' [-Wunused-variable]
33 | int prev = -1;
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1104 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
secret mismatch |
2 |
Halted |
0 ms |
0 KB |
- |