# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
113523 | E869120 | 커다란 상품 (IOI17_prize) | C++14 | 114 ms | 2204 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
int A[200009];
vector<int> find_next(vector<int> R) {
int maxn = 0;
for (int i = 0; i < 12; i++) {
vector<int> P = ask(R[rand() % R.size()]);
maxn = max(maxn, P[0] + P[1]);
}
int cx = 0; vector<int> T;
while (cx < R.size()) {
vector<int> P = ask(R[cx]);
if (P[0] + P[1] != maxn) { T.push_back(R[cx]); cx++; continue; }
if (cx + 1 == (int)R.size()) break;
int cl = cx, cr = R.size(), cm, maxn = -1;
for (int i = 0; i < 18; i++) {
cm = (cl + cr) / 2;
vector<int> Q = ask(R[cm]);
if (P == Q) { cl = cm; maxn = max(maxn, cm); }
else { cr = cm; }
}
if (maxn == (int)R.size() - 1) break;
T.push_back(R[maxn + 1]);
cx = maxn + 2;
}
//for (int i = 0; i < T.size(); i++) cout << T[i] << ", "; cout << endl;
return T;
}
int find_best(int n) {
vector<int> E; for (int i = 0; i < n; i++) E.push_back(i);
while (E.size() >= 2) E = find_next(E);
return E[0];
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |