제출 #96371

#제출 시각아이디문제언어결과실행 시간메모리
96371figter001커다란 상품 (IOI17_prize)C++14
0 / 100
2 ms376 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5+50; int dp[maxn],ans,n; void qu(int a){ if(dp[a])return; dp[a] = 1; vector<int> res = ask(a); if(res[0] + res[1] == 0){ ans = a; } } void solve(int l,int r){ if(l > r)return; int md = (l+r)/2; ask(md); if(ans != -1)return; solve(l,md-1); solve(md+1,r); } int find_best(int N) { srand(time(0)); n = N; solve(0,n-1); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...