답안 #1038122

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1038122 2024-07-29T13:10:46 Z ArthuroWich 쌀 창고 (IOI11_ricehub) C++17
68 / 100
1000 ms 1004 KB
#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
int besthub(int n, int l, int x[], long long B) {
    int ans = 0;
    for (int i = 0; i < n; i++) {
        int co = 0; 
        long long s = B;
        vector<int> a;
        for (int j = 0; j < n; j++) {
            a.push_back(abs(x[i]-x[j]));
        }
        sort(a.rbegin(), a.rend());
        while(!a.empty() && a.back() <= s) {
            co++;
            s -= a.back();
            a.pop_back();
        }
        ans = max(ans, co);
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 436 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 448 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 448 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 2 ms 348 KB Output is correct
22 Correct 2 ms 452 KB Output is correct
23 Correct 4 ms 452 KB Output is correct
24 Correct 4 ms 344 KB Output is correct
25 Correct 4 ms 452 KB Output is correct
26 Correct 4 ms 348 KB Output is correct
27 Correct 3 ms 348 KB Output is correct
28 Correct 3 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 12 ms 716 KB Output is correct
4 Correct 13 ms 460 KB Output is correct
5 Correct 2 ms 448 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 8 ms 464 KB Output is correct
8 Correct 8 ms 344 KB Output is correct
9 Correct 4 ms 348 KB Output is correct
10 Correct 4 ms 440 KB Output is correct
11 Correct 10 ms 348 KB Output is correct
12 Correct 10 ms 460 KB Output is correct
13 Correct 17 ms 468 KB Output is correct
14 Correct 17 ms 348 KB Output is correct
15 Correct 4 ms 348 KB Output is correct
16 Correct 4 ms 448 KB Output is correct
17 Correct 13 ms 344 KB Output is correct
18 Correct 15 ms 348 KB Output is correct
19 Correct 22 ms 600 KB Output is correct
20 Correct 18 ms 344 KB Output is correct
21 Correct 275 ms 348 KB Output is correct
22 Correct 296 ms 344 KB Output is correct
23 Correct 610 ms 524 KB Output is correct
24 Correct 630 ms 348 KB Output is correct
25 Correct 595 ms 536 KB Output is correct
26 Correct 557 ms 348 KB Output is correct
27 Correct 390 ms 344 KB Output is correct
28 Correct 438 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1025 ms 1004 KB Time limit exceeded
2 Halted 0 ms 0 KB -