| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1260647 | thewizardman | The Big Prize (IOI17_prize) | C++20 | 23 ms | 408 KiB |
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
static const int asdf[5] = {0, 1, 5, 26, 473};
static inline int type(int val) { return lower_bound(asdf, asdf + 5, val) - asdf; }
int cnt[5] = {1, 0, 0, 0, 0};
priority_queue<tuple<double, int, int>> pq;
int find_best(int n) {
pq.push({1, 0, n-1});
while (!pq.empty()) {
auto [d, l, r] = pq.top(); pq.pop();
int mid = (l + r) >> 1;
auto a = ask(mid);
if (a[0] + a[1] == 0) return mid;
if (a[0] && mid - 1 >= l) pq.push({(double)a[0]/(double)asdf[type(a[0])], l, mid - 1});
else if (a[1] && mid + 1 <= r) pq.push({(double)a[1]/(double)asdf[type(a[1])], mid + 1, r});
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
