Submission #963316

# Submission time Handle Problem Language Result Execution time Memory
963316 2024-04-14T20:44:47 Z SuPythony Rice Hub (IOI11_ricehub) C++17
0 / 100
1000 ms 1172 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=(i+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 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1098 ms 1172 KB Time limit exceeded
2 Halted 0 ms 0 KB -