Submission #548033

#TimeUsernameProblemLanguageResultExecution timeMemory
548033SamNguyenGap (APIO16_gap)C++14
30 / 100
57 ms1864 KiB
#include "gap.h" #include <vector> #include <iostream> using namespace std; using lli = long long; lli findGap1(int N) { vector<lli> seq(N); lli L = 0, R = 1e18; for (int i = 0, j = N - 1; i <= j; i++, j--) { MinMax(L, R, &seq[i], &seq[j]); L = seq[i] + 1, R = seq[j] - 1; } lli res = 0; for (int i = 0; i + 1 < N; i++) res = max(res, seq[i + 1] - seq[i]); return res; } long long findGap2(int N) { return -1; } long long findGap(int T, int N) { return (T == 1) ? findGap1(N) : findGap2(N); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...