제출 #1062377

#제출 시각아이디문제언어결과실행 시간메모리
1062377Sir_Ahmed_Imran커다란 상품 (IOI17_prize)C++17
90 / 100
57 ms5748 KiB
///~~~LOTA~~~/// #include <bits/stdc++.h> #include "prize.h" using namespace std; #define ll long long #define ld long double #define append push_back #define add insert #define nl '\n' #define ff first #define ss second #define pii pair<int,int> #define pll pair<ll,ll> #define all(x) (x).begin(),(x).end() #define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define terminator main #define MAXN 200000 vector<int> a[MAXN]; vector<int> get(int x){ if(a[x].empty()) a[x]=ask(x); return a[x]; } int find_best(int n){ int m,o; srand(time(0)); vector<int> a; for(int i=m=0;i<500;i++){ a=get(rand()%n); m=max(m,a[0]+a[1]); } o=0; while(o<n){ a=get(o); if(!a[0] && !a[1]) return o; if(a[0]+a[1]==m){ for(int i=131072;i>0;i/=2){ if(o+i<n && get(o+i)==a) o+=i; } } o++; } return o; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...