Submission #805143

#TimeUsernameProblemLanguageResultExecution timeMemory
805143KerimRice Hub (IOI11_ricehub)C++17
42 / 100
1069 ms736 KiB
#include "ricehub.h" #include "bits/stdc++.h" #define ll long long using namespace std; int besthub(int R, int L, int X[], long long B){ int answer = 0; for (int i = 1; i <= L; i++){ vector<int> dist; for (int j = 0; j < R; j++) dist.push_back(abs(X[j] - i)); sort(dist.begin(), dist.end()); ll budget = 0; int count = 0; for (auto x: dist){ budget += x; if (budget > B) break; count += 1; } answer = max(answer, count); } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...