Submission #409769

#TimeUsernameProblemLanguageResultExecution timeMemory
409769jeqchoGap (APIO16_gap)C++17
0 / 100
1051 ms524292 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pair<int,int>> vpi; #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define F0R(i,a) FOR(i,0,a) #define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i) #define R0F(i,a) ROF(i,0,a) #define trav(a,x) for (auto& a: x) #define pb push_back #define rsz resize #define sz(x) int(x.size()) #define all(x) begin(x), end(x) #define fi first #define se second long long findGap(int T, int N) { ll a=0; ll b=1e18; vector<ll>v; while(sz(v)!=N) { ll c,d; MinMax(a,b,&c,&d); v.pb(c); v.pb(d); a=c-1; b=d-1; } sort(all(v)); ll rec=-1e9; F0R(i,N-1) { rec=max(rec,v[i+1]-v[i]); } return rec; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...