Submission #1105739

#TimeUsernameProblemLanguageResultExecution timeMemory
1105739mariaclaraGap (APIO16_gap)C++17
30 / 100
30 ms3512 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; const ll INF = 1e18; #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() #define mk make_pair #define pb push_back #define fr first #define sc second ll findGap(int T, int N) { if(T == 1) { vector<ll> a(N); int l = 0, r = N-1; ll val1 = 0, val2 = INF; while(l <= r) { MinMax(val1, val2, &a[l], &a[r]); val1 = a[l] + 1; val2 = a[r] - 1; l++; r--; } ll ans = 0; for(int i = 1; i < N; i++) ans = max(ans, a[i] - a[i-1]); return ans; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...