제출 #328902

#제출 시각아이디문제언어결과실행 시간메모리
328902opukittpceno_hhrGap (APIO16_gap)C++17
0 / 100
56 ms2496 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; ll findGap(int T, int N) { ll F, S; MinMax((ll)0, (ll)1e18, &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; } if (F == S) 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...