이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
using namespace std;
typedef vector<int> vi;
const int N = 200, M = 200;
int close(int *aa, int n, int k) {
vi uu;
int i, j, yes;
uu.resize(2);
yes = -1;
for (i = 0; i < n; i++)
if (yes == -1)
yes = aa[i];
else
uu[0] = yes, uu[1] = aa[i], yes = add_xor(uu);
if (k > 0)
for (i = 0; i + 1 < n; i++) {
int yes_;
uu.resize(0);
for (j = i + 1; j <= i + k && j < n; j++)
uu.push_back(aa[j]);
yes_ = add_or(uu);
uu.resize(2);
uu[0] = yes_, uu[1] = aa[i], yes_ = add_and(uu);
uu[0] = yes, uu[1] = yes_, yes = add_or(uu);
}
return yes;
}
int aa[N + M], bb[N + M];
void construct_network(int n, int m, int k) {
int x, y, i, j, not_too_far, not_too_close, yes;
vi uu;
for (x = 0; x <= (n - 1) + (m - 1); x++) {
uu.resize(0);
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
if (i + j == x)
uu.push_back(i * m + j);
aa[x] = add_or(uu);
}
for (y = 0; y <= (n - 1) + (m - 1); y++) {
uu.resize(0);
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
if (i - j + m - 1 == y)
uu.push_back(i * m + j);
bb[y] = add_or(uu);
}
uu.resize(2);
uu[0] = close(aa, n + m - 1, k), uu[1] = close(bb, n + m - 1, k), not_too_far = add_and(uu);
uu[0] = close(aa, n + m - 1, k - 1), uu[1] = close(bb, n + m - 1, k - 1), not_too_close = add_not(add_and(uu));
uu[0] = not_too_far, uu[1] = not_too_close;
yes = add_and(uu);
}
컴파일 시 표준 에러 (stderr) 메시지
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:38:46: warning: variable 'yes' set but not used [-Wunused-but-set-variable]
38 | int x, y, i, j, not_too_far, not_too_close, yes;
| ^~~
# | 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... |