제출 #328906

#제출 시각아이디문제언어결과실행 시간메모리
328906opukittpceno_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) { assert(T == 1); 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; if (F + 1 > S - 1) break; MinMax(F + 1, S - 1, &nF, &nS); F = nF; S = nS; } if (F == S && F != -1) v.push_back(F); sort(v.begin(), v.end()); assert((int)v.size() == N); 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...