답안 #227975

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
227975 2020-04-29T12:10:35 Z AaronNaidu 커다란 상품 (IOI17_prize) C++14
20 / 100
5 ms 384 KB
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;




int find_best(int n) {
    int minn = 0;
    int maxx = n-1;
    while (minn <= maxx)
    {
        int med = (minn + maxx)/2;
        vector<int> v = ask(med);
        if (v[0] == 0 and v[1] == 0)
        {
            return med;
        }
        if (v[0] == 0 and v[1] == 1)
        {
            minn = med + 1;
        }
        else
        {
            maxx = med - 1;
        }
        
    }
    return minn;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Incorrect 5 ms 384 KB answer is not correct
12 Halted 0 ms 0 KB -