Submission #805153

#TimeUsernameProblemLanguageResultExecution timeMemory
805153KerimRice Hub (IOI11_ricehub)C++17
68 / 100
1077 ms612 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 = 0; i < R; i++){ int x = X[i]; vector<int> dist; for (int j = 0; j < R; j++) dist.push_back(abs(X[j] - x)); 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...