Submission #224627

#TimeUsernameProblemLanguageResultExecution timeMemory
224627AASGRice Hub (IOI11_ricehub)C++11
42 / 100
1089 ms512 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B){ int mx=0; for(int i=1;i<=L;i++){ int au=0; long long ab=B; deque<int> rm; for(int l=0;l<R;l++){ rm.push_back(abs(i-X[l])); } sort(rm.begin(),rm.end()); long tm=rm.size(); for(int l=0;l<tm;l++){if(ab-rm[l]>=0){au++;ab=ab-rm[l];}else break;} mx=max(mx,au); } R=mx; return R; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...