Submission #1084923

# Submission time Handle Problem Language Result Execution time Memory
1084923 2024-09-07T08:33:55 Z PakinDioxide Rice Hub (IOI11_ricehub) C++17
0 / 100
2 ms 604 KB
#include "ricehub.h"
#include <bits/stdc++.h>

using namespace std;

int besthub(int n, int m, int a[], long long x) {
    int mx = 0, l = 1, r = 0;
    int p[n+1];
    p[0] = 0;
    for (int i = 0; i < n; i++) p[i+1] = p[i] + a[i];
    while (r < n) {
        r++;
        while (p[r] - 2*p[(l + r - 1)/2] + p[l-1] > x) l++;
        mx = max(mx, r - l + 1);
    }
    return mx;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 600 KB Output is correct
2 Incorrect 2 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -