Submission #963319

# Submission time Handle Problem Language Result Execution time Memory
963319 2024-04-14T20:46:29 Z SuPythony Rice Hub (IOI11_ricehub) C++17
17 / 100
1000 ms 1252 KB
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int besthub(int R, int L, int X[], long long B)
{
    int ans=0;
    for (int i=0; i<R; i++) {
        for (int j=i; j<R; j++) {
            int pos=(X[i]+X[j])/2;
            vector<ll> c;
            for (int k=0; k<R; k++) {
                c.push_back(abs(pos-X[k]));
            }
            sort(c.begin(),c.end());
            ll used=0;
            int a=0;
            for (ll i: c) {
                if (used+i<=B) {
                    used+=i;
                    a++;
                } else break;
            }
            ans=max(ans,a);
        }
    }
    return ans;
}
# 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 1 ms 348 KB Output is correct
4 Correct 5 ms 448 KB Output is correct
5 Correct 4 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 500 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 448 KB Output is correct
5 Correct 5 ms 604 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
7 Correct 5 ms 460 KB Output is correct
8 Correct 6 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 1 ms 444 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 7 ms 344 KB Output is correct
16 Correct 8 ms 452 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 8 ms 348 KB Output is correct
20 Correct 7 ms 452 KB Output is correct
21 Correct 557 ms 432 KB Output is correct
22 Correct 617 ms 428 KB Output is correct
23 Execution timed out 1101 ms 344 KB Time limit exceeded
24 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 42 ms 348 KB Output is correct
2 Correct 42 ms 348 KB Output is correct
3 Execution timed out 1045 ms 344 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1040 ms 1252 KB Time limit exceeded
2 Halted 0 ms 0 KB -