제출 #405690

#제출 시각아이디문제언어결과실행 시간메모리
405690inluminasGap (APIO16_gap)C++14
12.89 / 100
75 ms2240 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" vector<ll>a; void f(ll L,ll R){ if(R<L) return; ll mn,mx; MinMax(L,R,&mn,&mx); if(mn==-1) return; if(mn==mx){ a.push_back(mn); return; } a.push_back(mn); a.push_back(mx); if(mn+1==mx) return; mn++,mx--; ll mid=(mn+mx)/2; f(mn,mid); f(mid+1,mx); } long long findGap(int T, int N) { f(0,1e18); sort(a.begin(),a.end()); a.resize(unique(a.begin(),a.end())-a.begin()); ll res=0; for(int i=1;i<N;i++){ res=max(res,a[i]-a[i-1]); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...