Submission #973135

# Submission time Handle Problem Language Result Execution time Memory
973135 2024-05-01T14:12:56 Z fzyzzz_z Rice Hub (IOI11_ricehub) C++17
0 / 100
2 ms 604 KB
#include <bits/stdc++.h>
using namespace std; 
#include "ricehub.h"

using ll = long long; 

int besthub(int n, int L, int a[], long long k) {
    int l = 0, r = 0, ans = 1;
    
    ll c = 0; 
    while (r < n) {
        if (c <= k) {
            ans = max(ans, r - l + 1); 
            r++; 
            if (r >= n) break; 
            c += a[r] - a[(r + l) / 2];
        } else {
            l++; 
            c -= a[(r + l + 1) / 2] - a[l - 1]; 
        }
    }

    return ans; 
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Incorrect 0 ms 344 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -