Submission #224664

#TimeUsernameProblemLanguageResultExecution timeMemory
224664jhtanRice Hub (IOI11_ricehub)C++14
42 / 100
1091 ms908 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 s = 0, c = 0; vector<int> V; for(int j=0; j<R; j++) V.push_back(abs(i-X[j])); sort(V.begin(), V.end()); for(int j=0; j<R; j++) { if(s + V[j] <= B) {s += V[j]; c++;} else break; } mx = max(mx, c); } return mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...