제출 #295342

#제출 시각아이디문제언어결과실행 시간메모리
295342williamMBDK커다란 상품 (IOI17_prize)C++14
20 / 100
88 ms1272 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int ans = -1; void solve(int l, int r){ int m = (l + r) / 2; auto temp = ask(m); if(!temp[0] && !temp[1]) { ans = m; return; } if(temp[0] && l != r){ solve(l, m - 1); } if(temp[1] && l != r){ solve(m + 1, r); } } int find_best(int N) { solve(0, N - 1); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...