# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
80288 | 2018-10-19T19:11:34 Z | MoNsTeR_CuBe | 커다란 상품 (IOI17_prize) | C++17 | 0 ms | 0 KB |
#include "prize.h" #include <bits/stdc++.h> using namespace std; int find_best(int n) { int left = 0; int right = n-1; while(left < right){ int mid = (left+right)/2; int tab[2] = ask(mid); if(tab[0]==1){ right = mid-1; }else if(tab[1] == 1){ left = mid+1; }else{ right = mid; break; } } return right; }