답안 #474464

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
474464 2021-09-18T09:59:30 Z aris12345678 커다란 상품 (IOI17_prize) C++14
20 / 100
1 ms 320 KB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

const int mxN = 200005;

// vector<int> ask(int i) {
//     int a, b;
//     cout << i << "\n";
//     scanf("%d %d", &a, &b);
//     return {a, b};
// }

int find_best(int n) {
    int st = 0, en = n-1, md;
    while(st <= en) {
        md = (st+en)/2;
        vector<int> p = ask(md);
        if(p[0] == 0 && p[1] == 0)
            return md;
        else if(p[0] == 1)
            en = md-1;
        else
            st = md+1;
    }
    return -1;
}

// int main() {
//     int n;
//     scanf("%d", &n);
//     printf("%d\n", find_best(n));
//     return 0;
// }
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 280 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 0 ms 288 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 284 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 284 KB Output is correct
6 Correct 1 ms 284 KB Output is correct
7 Correct 1 ms 272 KB Output is correct
8 Correct 1 ms 320 KB Output is correct
9 Correct 1 ms 284 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
11 Incorrect 1 ms 200 KB Integer -1 violates the range [0, 199999]
12 Halted 0 ms 0 KB -