Submission #1295870

#TimeUsernameProblemLanguageResultExecution timeMemory
1295870AbdullahIshfaqRice Hub (IOI11_ricehub)C++20
100 / 100
8 ms728 KiB
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int besthub(int n, int L, int *xx, ll d)
{
    int k = 0;
    for (int i = 0, j = 0; j < n; j++)
    {
        d -= xx[j] - xx[(i + j) / 2];
        while (d < 0)
        {
            d += xx[(i + 1 + j) / 2] - xx[i];
            i++;
        }
        k = max(k, j - i + 1);
    }
    return k;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...