이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
// char dp[501][501][501];
// short select[501][501][501];
// char dfs(const int l, const int r, const int x) {
// if (l == r) return 0;
// if (dp[l][r][x] != 0) return dp[l][r][x];
// char min = 100;
// for (int i = 1; i < x; ++i) {
// const int m = (i + x) / 2;
// char max = 0;
// max = std::max();
// }
// }
int HC(int N) {
int l = 1, r = N, x = 1;
Guess(x);
while (l < r) {
if (x == l) {
const int t = Guess(r);
if (t == 0) return (l + r) / 2;
else if (t == 1) l = (l + r + 1) / 2;
else r = (l + r) / 2;
} else {
const int t = Guess(l);
if (t == 0) return (l + r) / 2;
else if (t == 1) r = (l + r) / 2;
else l = (l + r + 1) / 2;
}
}
return l;
}
# | 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... |