Submission #1027391

#TimeUsernameProblemLanguageResultExecution timeMemory
1027391MuhammetGap (APIO16_gap)C++17
30 / 100
36 ms4440 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; #define ll long long #define sz(s) (int)s.size() ll findGap(int T, int n){ vector <ll> v, v1; for(int i = 0; i < (n+1)/2; i++){ ll s, t, mn, mx; if(i == 0) s = 0, t = 1e18; else s = v.back()+1, t = v1.back()-1; if(s > t) break; MinMax(s, t, &mn, &mx); v.push_back(mn); v1.push_back(mx); } if(n % 2 == 1) v1.pop_back(); while(sz(v1) > 0){ v.push_back(v1.back()); v1.pop_back(); } ll ans = 0; for(int i = 0; i < n-1; i++){ ans = max(ans, v[i+1]-v[i]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...