이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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
#define cerr cout
#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) {
if (dist == 1) {
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)}));
}
}
debug(pos);
for (int i = 1, prev = pos.front(); i < sz(pos); i++) {
prev = add_or({prev, pos[i]});
}
}
else {
int prev = -1;
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});
}
}
}
add_and({prev, prev});
}
}
#undef ENC
컴파일 시 표준 에러 (stderr) 메시지
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:24: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 42
| ^~
vision.cpp:42:9: note: in expansion of macro 'debug'
42 | debug(pos);
| ^~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |