제출 #1029088

#제출 시각아이디문제언어결과실행 시간메모리
1029088amirhoseinfar1385커다란 상품 (IOI17_prize)C++17
20 / 100
56 ms1092 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; map<int,pair<int,int>>mp; pair<int,int>pors(int u){ if(mp.count(u)==0){ vector<int>hey=ask(u); mp[u]=make_pair(hey[0],hey[1]); } return mp[u]; } int find_best(int n) { for(int i=0;i<n;){ pair<int,int>av=pors(i); if(av.first+av.second==0){ return i; } pair<int,int>fake; int low=i,high=n,mid; while(high-low>1){ mid=(high+low)>>1; fake=pors(mid); if(fake.first+fake.second!=av.first+av.second){ high=mid; }else{ if(fake.first-av.first==0){ low=mid; }else{ high=mid; } } } i=low+1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...