답안 #101940

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101940 2019-03-21T07:04:34 Z joylintp 커다란 상품 (IOI17_prize) C++17
20 / 100
3 ms 512 KB
#include<bits/stdc++.h>
#include"prize.h"
#define INF 2147483647

using namespace std;

int find_best(int n)
{
    int l = -1, r = n;
    vector<int> res = {INF, INF};
    while (1)
    {
        int tmp = (l + r) / 2;
        res = ask(tmp);
        if (res[0] > res[1])
            r = tmp;
        else if (res[1] > res[0])
            l = tmp;
        else
            return (l + r) / 2;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 396 KB Output is correct
2 Correct 3 ms 396 KB Output is correct
3 Correct 2 ms 392 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 312 KB Output is correct
6 Correct 3 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 308 KB Output is correct
9 Correct 3 ms 512 KB Output is correct
10 Correct 3 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 3 ms 308 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 3 ms 384 KB Output is correct
11 Incorrect 2 ms 308 KB answer is not correct
12 Halted 0 ms 0 KB -