제출 #295347

#제출 시각아이디문제언어결과실행 시간메모리
295347williamMBDK커다란 상품 (IOI17_prize)C++14
20 / 100
95 ms1272 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int ans = -1; void solve(int l, int r){ if(ans != -1) return; 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...