답안 #584435

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
584435 2022-06-27T11:36:45 Z PiejanVDC 커다란 상품 (IOI17_prize) C++17
20 / 100
92 ms 296 KB
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;


int s(int l, int r) {
    int mid = (l+r)/2;
    vector<int>gt = ask(mid);
    if(!gt[0] && !gt[1])
        return mid;
    if(l == r)
        return -1;
    int a = -1, b = -1;
    if(gt[0] && l < mid)
        a = s(l, mid-1);
    if(gt[1] && r > mid)
        b = s(mid+1, r);
    return max(a,b);
}

int find_best(int n) {
    return s(0,n-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 0 ms 292 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 1 ms 288 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 292 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 292 KB Output is correct
2 Correct 0 ms 272 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 0 ms 296 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 0 ms 288 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 268 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Incorrect 92 ms 208 KB Incorrect
12 Halted 0 ms 0 KB -