Submission #1292301

#TimeUsernameProblemLanguageResultExecution timeMemory
1292301MinhKienGap (APIO16_gap)C++20
0 / 100
34 ms3240 KiB
#include "gap.h"
#include <iostream>

using namespace std;

#define ll long long

const int N = 1e5 + 10;
ll a[N];

ll findGap(int t, int n) {
    ll A, B;
    MinMax(0, 1e18, &A, &B);
    a[1] = A;
    for (int i = 2; i <= n; ++i) {
        MinMax(a[i - 1] + 1, 1e18, &A, &B);
        a[i] = A;
    }

    ll res = 0;
    for (int i = 2; i <= n; ++i) {
        res = max(res, a[i] - a[i - 1]);
    }

    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...