Submission #40770

#TimeUsernameProblemLanguageResultExecution timeMemory
40770Just_Solve_The_ProblemGap (APIO16_gap)C++11
0 / 100
82 ms2284 KiB
#include <bits/stdc++.h> #include <gap.h> long long findGap(int t, int n) { long long left; long long right; left = 0; right = 1e18; long long mn, mx; long long vec[n]; int cnt = 0; int cn = n - 1; while (mn != mx) { MinMax(left, right, &mn, &mx); vec[cnt++] = mn; if (mn != mx) vec[cn--] = mx; left = mn + 1; right= mx - 1; } long long ans = 0; for (int i = 1; i < n; i++) { if (vec[i] - vec[i - 1] > ans) { ans = vec[i] - vec[i - 1]; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...