제출 #1126055

#제출 시각아이디문제언어결과실행 시간메모리
1126055m_bezrutchka쌀 창고 (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...