제출 #566499

#제출 시각아이디문제언어결과실행 시간메모리
566499sofapuden커다란 상품 (IOI17_prize)C++14
20 / 100
724 ms1048576 KiB
#include "prize.h" #include<bits/stdc++.h> #include<bits/extc++.h> using namespace __gnu_pbds; using namespace std; tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> T; map<int,vector<int>> M; vector<int> am(5,0); vector<int> que(int x){ if(M.count(x))return M[x]; return M[x] = ask(x); } int f(int l, int r){ int m = (l+r)/2; vector<int> v = que(m); if(v[0] == 0 && v[1] == 0)return m; if(v[1] > v[0]){ int x = f(m+1,r); if(x != -1)return x; } return f(l,m-1); } int find_best(int n) { return f(0,n-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...