Submission #773894

#TimeUsernameProblemLanguageResultExecution timeMemory
773894nomuluunGap (APIO16_gap)C++14
0 / 100
50 ms2528 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; vector<ll>num; void nu(ll l, ll r){ ll mn,mx; MinMax(l,r,&mn,&mx); if(mn==-1)return; else if(mn==mx){ num.push_back(mn); return; } else{ num.push_back(mn); num.push_back(mx); ll mid=(mn+mx)/2; nu(mn+1, mid); nu(mid+1, mx-1); return; } } long long findGap(int T, int N) { ll l=1, r=LLONG_MAX,z=0; nu(l,r); sort(num.begin(),num.end()); for(int i=1; i<N; i++){ z=max(z,num[i]-num[i-1]); } return z; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...