제출 #538269

#제출 시각아이디문제언어결과실행 시간메모리
538269status_codingGap (APIO16_gap)C++14
0 / 100
54 ms2760 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int t, int n) { if(t == 1) { vector<long long> l, r; long long st=0, dr=1e18; while(st <= dr) { MinMax(st, dr, &st, &dr); if(st != -1) { l.push_back(st); if(st != dr) r.push_back(dr); st++; dr--; } else break; } while(!r.empty()) { l.push_back(r.back()); r.pop_back(); } /* for(long long it : l) cout<<it<<' '; cout<<'\n'; */ long long ans=0; for(int i=1;i<n;i++) ans=max(ans, l[i] - l[i-1]); return ans; } else { if(n == 4) return 3; exit(1); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...