제출 #525336

#제출 시각아이디문제언어결과실행 시간메모리
525336status_codingGap (APIO16_gap)C++14
0 / 100
40 ms2820 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int t, int n) { if(t == 1) { vector<long long> a, b; long long st=0, dr=1e18; while(st <= dr) { long long nSt, nDr; MinMax(st, dr, &nSt, &nDr); st=nSt; dr=nDr; if(st == -1) break; a.push_back(st); if(st != dr) b.push_back(dr); st++; dr--; } reverse(b.begin(), b.end()); a.insert(a.end(), b.begin(), b.end()); long long ans=0; for(int i=1;i<(int)a.size();i++) ans=max(ans, a[i]-a[i-1]); return ans; } else return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...