답안 #282055

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
282055 2020-08-23T22:46:47 Z Pichon5 커다란 상품 (IOI17_prize) C++17
20 / 100
50 ms 384 KB
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
int find_best(int n) {
    int a=0,b=n-1;
    while(a<=b){
        int mid=(a+b)/2;
        vector<int>v=ask(mid);
        if(v[0]==0 && v[1]==0){
            return mid;
        }
        if(v[0]==1){
            b=mid-1;
        }else{
            a=mid+1;
        }
    }
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 0 ms 376 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 380 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 288 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
11 Incorrect 50 ms 256 KB Incorrect
12 Halted 0 ms 0 KB -