Submission #540818

# Submission time Handle Problem Language Result Execution time Memory
540818 2022-03-21T19:56:42 Z MohamedFaresNebili Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "ricehub"
/// #pragma GCC optimize ("Ofast")
/// #pragma GCC target ("avx2")

        using namespace std;

        using ll = long long;
        using ii = pair<ll, ll>;

        #define ff first
        #define ss second
        #define pb push_back

        const int MOD = 1e9 + 7;

        int besthub(int R, int L, int X[], long long B) {
            int res = 0; vector<ll> pref(R, 0);
            for(int l = 0; l < R; l++) {
                pref[l] = X[l];
                if(l) pref[l] += pref[l - 1];
            }
            for(int l = 0; l < R; l++) {
                int curr = 1;
                int lo = l, hi = R - 1;
                while(lo <= hi) {
                    int md = (lo + hi) / 2; int d = (md + l) / 2;
                    ll m = X[d];
                    ll calc = m * (d - l + 1) - 2 * pref[d] - m * (md - d) + pref[md];
                    if(l) calc += pref[l - 1];
                    if(calc <= B) lo = md + 1, curr = max(curr, md - l + 1);
                    else hi = md - 1;
                }
                res = max(res, curr);
            }
            return res;
        }

Compilation message

ricehub.cpp:2:10: fatal error: ricehub: No such file or directory
    2 | #include "ricehub"
      |          ^~~~~~~~~
compilation terminated.