제출 #875603

#제출 시각아이디문제언어결과실행 시간메모리
875603NeroZeinGap (APIO16_gap)C++17
0 / 100
28 ms3096 KiB
#include "gap.h" #include "bits/stdc++.h" using namespace std; long long ans; void solve(long long l, long long r) { if (l == r || r - l <= ans) { return; } long long mid = (l + r) / 2; long long t, smaller, bigger; MinMax(l, mid, &t, &smaller); MinMax(mid, r, &bigger, &t); if (smaller == bigger) { return; } ans = max(ans, bigger - smaller); solve(l, smaller); solve(bigger, r); } long long findGap(int T, int N) { solve(0LL, LLONG_MAX); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...