Submission #328903

#TimeUsernameProblemLanguageResultExecution timeMemory
328903opukittpceno_hhrGap (APIO16_gap)C++17
0 / 100
60 ms2404 KiB
#include "gap.h" #include <iostream> #include <vector> #include <map> #include <set> #include <queue> #include <algorithm> #include <string> #include <cmath> #include <cstdio> #include <iomanip> #include <fstream> #include <cassert> #include <cstring> #include <unordered_set> #include <unordered_map> #include <numeric> #include <ctime> #include <bitset> #include <complex> #include <chrono> #include <random> #include <functional> using namespace std; typedef long long ll; const ll INF = 1e18 + 239; ll findGap(int T, int N) { ll F, S; MinMax((ll)0, INF, &F, &S); vector<ll> v; while (F != -1 && F != S) { v.push_back(F); v.push_back(S); ll nF, nS; MinMax(F + 1, S - 1, &nF, &nS); F = nF; S = nS; // cerr << "nw " << F << ' ' << S << endl; } if (F == S && F != -1) v.push_back(F); sort(v.begin(), v.end()); ll ans = 0; for (int i = 0; i + 1 < N; i++) { ans = max(ans, v[i + 1] - v[i]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...