이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "koala.h"
int minValue(int n, int w) {
int query[n];
for (int i = 0; i < n; i++) query[i] = !i;
int response[n];
playRound(query, response);
for (int i = 0; i < n; i++) if (response[i] <= query[i]) return i;
assert(0);
}
std::random_device rnd_dev;
std::mt19937 rnd(rnd_dev() ^ clock());
int maxValue(int n, int w) {
std::vector<int> cands(n);
std::iota(cands.begin(), cands.end(), 0);
std::shuffle(cands.begin(), cands.end(), rnd);
while (cands.size() >= 8) {
int one = w / cands.size();
int query[n];
memset(query, 0, sizeof(query));
for (auto i : cands) query[i] = one;
int response[n];
playRound(query, response);
std::vector<int> next;
for (auto i : cands) if (response[i] > query[i]) next.push_back(i);
assert(next.size());
cands = next;
}
return cands[0];
}
int greaterValue(int n, int w) {
}
void allValues(int n, int w, int *p) {
}
컴파일 시 표준 에러 (stderr) 메시지
koala.cpp: In function 'int greaterValue(int, int)':
koala.cpp:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
38 | }
| ^
# | 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... |