제출 #404395

#제출 시각아이디문제언어결과실행 시간메모리
404395CursedCodeGap (APIO16_gap)C++14
30 / 100
57 ms2336 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() typedef long long lld; lld findGap(int T, int N){ lld p = 0, q = (lld)1e18 + 1; vector <lld> arr; while(true){ lld mn, mx; MinMax(p+1, q-1, &mn, &mx); arr.pb(mn); arr.pb(mx); if (mn == mx || sz(arr) == N) break; p = mn, q = mx; } sort(all(arr)); lld ans = 0; for (int i=1;i<sz(arr);i++) ans = max(ans, arr[i]-arr[i-1]); return ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...