Submission #519595

#TimeUsernameProblemLanguageResultExecution timeMemory
519595aryan12Gap (APIO16_gap)C++17
30 / 100
40 ms1936 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long Solve1(long long N) { long long A[N]; long long L = 0, R = N - 1; long long valL = 0, valR = 1e18; while(L <= R) { MinMax(valL, valR, &valL, &valR); A[L++] = valL; A[R--] = valR; valL++; valR--; } long long ans = 0; for(long long i = 1; i < N; i++) { ans = max(ans, A[i] - A[i - 1]); } return ans; } long long findGap(int T, int N) { return Solve1(N); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...