| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1221136 | SpyrosAliv | Rice Hub (IOI11_ricehub) | C++20 | 1094 ms | 800 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int besthub(int R, int L, int X[], ll B) {
vector<int> coords;
int n = R;
ll b = B;
for (int i = 0; i < n; i++) coords.push_back(X[i]);
int maxAns = 0;
for (int i = 0; i < n; i++) {
vector<int> dis;
for (int j = 0; j < n; j++) {
dis.push_back(abs(coords[i] - coords[j]));
}
sort(dis.begin(), dis.end());
ll curr = 0;
int tot = 0;
for (int i = 0; i < n; i++) {
curr += dis[i];
if (curr > b) break;
tot++;
}
maxAns = max(maxAns, tot);
}
return maxAns;
}| # | 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... | ||||
