제출 #740067

#제출 시각아이디문제언어결과실행 시간메모리
740067CutebolGap (APIO16_gap)C++17
0 / 100
46 ms2296 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std ; #define int long long long long findGap(int32_t T, int32_t n) { vector <int> vec ; int l = 1 , r = 1e18 , mn , mx , ans = 0 ; while ( l <= r ){ MinMax( l , r , &mn , &mx ) ; if ( mn == -1 || mx == -1 ) break ; vec.push_back(mn) ; if ( mn != mx ) vec.push_back(mx) ; l = mn + 1 , r = mx-1 ; } sort ( vec.begin() , vec.end() ) ; for ( int i = 0 ; i < n-1 ; i ++ ) ans = max ( ans , vec[i+1]-vec[i] ) ; return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...