# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
70287 | E869120 | 커다란 상품 (IOI17_prize) | C++14 | 108 ms | 572 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
int find_best(int n) {
int cx = 0;
while (true) {
vector<int> X1 = ask(cx);
int L = cx, R = n, M, maxn = 0, QQ = 18;
vector<int> X2 = ask(min(n - 1, cx + 1023));
if(X2 != X1) { R = min(n, cx + 1023); QQ = 10; }
while (true) {
bool flag = false; if (R - L <= 1) flag = true;
M = (L + R) / 2;
vector<int> R1 = ask(min(n, M));
if (R1[0] + R1[1] == 0) return M;
if (X1 == R1) { L = M; maxn = max(maxn, M); }
else { R = M; }
if (flag == true) break;
}
cx = maxn + 2;
}
return -1;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |