Submission #443412

#TimeUsernameProblemLanguageResultExecution timeMemory
443412hossain2020Gap (APIO16_gap)C++14
0 / 100
3090 ms1824 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long v[1000005],i,j; long long findGap(int T, int N) { i=0; long long c=0,d=1,c1=0,d1=1,o=0; long long *a=&c,*b=&d; while (i<N) { MinMax(c1,d1,a,b); if (*a+*b==-2) { d1++; d++; *b=d; continue; } c1=*a; c1++; d1=c+1; v[i]=*a; c=*a; if (i) { o=max(o,v[i]-v[i-1]); } i++; c++; d=c+1; *b=d; } return o; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...