| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1013414 | NintsiChkhaidze | 커다란 상품 (IOI17_prize) | C++17 | 8 ms | 10328 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#include "prize.h"
using namespace std;
bool fix[200003];
int Q;
vector <int> dp[200003];
vector <int> askk(int x){
Q++;
return ask(x);
}
int find_best(int n){
int block = 500,mx = -1,idx = -1;
vector <int> opt;
for (int i = 0; i < min(n,block); i++){
vector <int> vec = askk(i);
int sum = vec[0] + vec[1];
if (sum == 0) return i;
if (sum > mx){
mx = sum;
opt = vec;
idx = i;
}
}
for (int i = idx; i < n; i++){
vector <int> vec = askk(i);
if (vec[0] + vec[1] == 0) {
return i;
}
if (vec[0] + vec[1] != mx) {
fix[i] = 1;
continue;
}
opt = vec;
int id = i;
int l = i, r = n - 1,res = i;
for (int j = 18; j >= 0; j--){
int c = i + (1<<j) - 1;
if (c >= n) continue;
vector <int> vec = askk(c);
if (vec == opt) {
res += (1<<j);
}
}
for (int j = id; j <= res; j++)
fix[j] = 1;
i = res;
}
for (int i = 0; i < n; i++){
if (!fix[i]){
vector <int> vec = askk(i);
if (vec[0] + vec[1] == 0) {
return i;
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
