제출 #249303

#제출 시각아이디문제언어결과실행 시간메모리
249303sahil_kGap (APIO16_gap)C++14
0 / 100
60 ms1176 KiB
#include "gap.h" #include <iostream> #include <algorithm> using namespace std; long long findGap (int t, int n) { if (t == 1) { long long mn, mx; long long p_mn = -1, p_mx = 1e18+1; long long ans = 0; for (int i=0; i<(n+1)/2; i++) { if (p_mn+1 <= p_mx-1) MinMax(p_mn+1, p_mx-1, &mn, &mx); if (i != 0 && mn > -1) ans = max(ans, mn-p_mn); if (i != 0 && mx > -1) ans = max(ans, p_mx-mx); p_mn = mn; p_mx = mx; } if (mx > -1 && mn > -1) ans = max(ans, mx-mn); return ans; } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...