제출 #345093

#제출 시각아이디문제언어결과실행 시간메모리
345093daniel920712Rice Hub (IOI11_ricehub)C++14
17 / 100
260 ms3064 KiB
#include "ricehub.h" #include <algorithm> #include <vector> using namespace std; vector < long long > all; vector < long long > a,b; int besthub(int R, int L, int X[], long long B) { long long now=0,i,j,ans=0; for(i=R/2-10;i<=R/2+10;i++) { if(i<0||i>=R) continue; all.clear(); for(j=0;j<R;j++) all.push_back((long long) abs(X[j]-X[i])); sort(all.begin(),all.end()); now=0; for(j=0;j<R;j++) { if(now+all[j]>B) break; now+=all[j]; } ans=max(ans,j); } return (int) ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...