| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1330510 | hayford08 | 쌀 창고 (IOI11_ricehub) | C++20 | 1 ms | 344 KiB |
#include "ricehub.h"
#include <algorithm>
#include <cmath>
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
int maxFields = 0;
for (int hub = 1; hub <= L; hub++) {
long long distances[100];
for (int i = 0; i < R; i++) {
distances[i] = abs(X[i] - hub);
}
sort(distances, distances + R);
long long total = 0;
int count = 0;
for (int i = 0; i < R; i++) {
if (total + distances[i] <= B) {
total += distances[i];
count++;
} else {
break;
}
}
if (count > maxFields) {
maxFields = count;
}
}
return maxFields;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
