Submission #1126055

#TimeUsernameProblemLanguageResultExecution timeMemory
1126055m_bezrutchkaRice Hub (IOI11_ricehub)C++20
68 / 100
1094 ms716 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B) { // sub1 int resp = 0; for (int j = 0; j < R; j++) { int hub = X[j]; vector<int> dists; for (int i = 0; i < R; i++) { dists.push_back(abs(X[i] - hub)); } sort(dists.begin(), dists.end()); int cur_resp = 0; int money = B; for (int i = 0; i < R; i++) { if (dists[i] > money) break; cur_resp++; money -= dists[i]; } resp = max(cur_resp, resp); } return resp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...