Submission #740075

#TimeUsernameProblemLanguageResultExecution timeMemory
740075CutebolGap (APIO16_gap)C++17
0 / 100
56 ms2452 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std ; #define ll long long long long findGap(int T , int n){ vector <ll> vec ; ll 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 = 1 ; i < n ; i ++ ) ans = max ( ans , vec[i]-vec[i-1] ) ; return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...