# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
23276 | 2017-05-05T22:05:32 Z | repeating | Gap (APIO16_gap) | C++11 | 0 ms | 0 KB |
#include <bits/stdc++.h> #define F first #define S second #define P push #define pb push_back #define MEM(dp,i) memset(dp,i,sizeof(dp)) #define W while #define R return #define C continue #define SI size() #define ll long long #define pll pair<ll,ll> #define SF(x) scanf("%I64d",&x) using namespace std; const long long INF = 2e9; long long MOD = 1e9+7; void MinMax(ll ,ll ,long long &,long long &); long long findGap(int,int); long long findGap(int t,int n){ ll l=0,r=1e18; vector<ll> v; W(l+1<r){ MinMax(l+1,r-1,l,r); v.pb(l); v.pb(r); if(l==-1)break; } sort(v.begin(),v.end()); ll res=0; for(int i=1;i<v.SI;i++){ res=max(res,v[i]-v[i-1]); } R res; }