답안 #1003267

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1003267 2024-06-20T08:21:11 Z vjudge1 쌀 창고 (IOI11_ricehub) C++17
68 / 100
1000 ms 1408 KB
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
const ll sz=50005;
ll a[sz], b[sz], d[sz], s[sz];
int besthub(int r, int l, int x[], long long k)
{

    ll ans=0;
    for(int i=0; i<r; i++){
        vector<ll>v;
        for(int j=0; j<r; j++){
            v.push_back(abs(x[i]-x[j]));
        }
        sort(v.begin(), v.end());
        ll sum=0;
        for(int j=0; j<r; j++){
            if(sum+v[j]>k) break;
            sum+=v[j];
            ans=max(ans, (ll)j+1);
        }
    }
    return ans;
}
/*
{} []
5 20 6

1 2 10 12 14 3
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 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 424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 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 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 2 ms 348 KB Output is correct
22 Correct 2 ms 348 KB Output is correct
23 Correct 4 ms 456 KB Output is correct
24 Correct 4 ms 348 KB Output is correct
25 Correct 4 ms 348 KB Output is correct
26 Correct 4 ms 348 KB Output is correct
27 Correct 4 ms 344 KB Output is correct
28 Correct 4 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 13 ms 468 KB Output is correct
4 Correct 12 ms 348 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 348 KB Output is correct
8 Correct 8 ms 348 KB Output is correct
9 Correct 4 ms 348 KB Output is correct
10 Correct 4 ms 348 KB Output is correct
11 Correct 10 ms 348 KB Output is correct
12 Correct 12 ms 344 KB Output is correct
13 Correct 16 ms 464 KB Output is correct
14 Correct 16 ms 348 KB Output is correct
15 Correct 4 ms 344 KB Output is correct
16 Correct 4 ms 456 KB Output is correct
17 Correct 10 ms 348 KB Output is correct
18 Correct 10 ms 460 KB Output is correct
19 Correct 16 ms 344 KB Output is correct
20 Correct 16 ms 348 KB Output is correct
21 Correct 376 ms 552 KB Output is correct
22 Correct 357 ms 544 KB Output is correct
23 Correct 678 ms 348 KB Output is correct
24 Correct 613 ms 548 KB Output is correct
25 Correct 600 ms 348 KB Output is correct
26 Correct 651 ms 552 KB Output is correct
27 Correct 551 ms 548 KB Output is correct
28 Correct 560 ms 548 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1020 ms 1408 KB Time limit exceeded
2 Halted 0 ms 0 KB -