Submission #1003262

# Submission time Handle Problem Language Result Execution time Memory
1003262 2024-06-20T08:18:56 Z vjudge1 Rice Hub (IOI11_ricehub) C++17
42 / 100
1000 ms 600 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
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 412 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 2 ms 348 KB Output is correct
6 Correct 2 ms 444 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 3 ms 348 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 1 ms 348 KB Output is correct
15 Correct 3 ms 348 KB Output is correct
16 Correct 3 ms 348 KB Output is correct
17 Correct 1 ms 444 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 4 ms 344 KB Output is correct
20 Correct 4 ms 348 KB Output is correct
21 Correct 648 ms 432 KB Output is correct
22 Correct 672 ms 428 KB Output is correct
23 Correct 825 ms 348 KB Output is correct
24 Correct 803 ms 348 KB Output is correct
25 Correct 800 ms 348 KB Output is correct
26 Correct 826 ms 436 KB Output is correct
27 Correct 808 ms 428 KB Output is correct
28 Correct 876 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 348 KB Output is correct
2 Correct 24 ms 448 KB Output is correct
3 Execution timed out 1047 ms 348 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1035 ms 600 KB Time limit exceeded
2 Halted 0 ms 0 KB -