# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1015124 | 2024-07-06T06:25:04 Z | vjudge1 | Gap (APIO16_gap) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "grader.cpp" using namespace std; typedef long long ll; ll findGap(int T, int N){ if (T == 1){ vector<ll> vec; ll mn = 0, mx = 1e18; while (N > 0){ N -= 2; MinMax(mn, mx, &mn, &mx); vec.push_back(mn); vec.push_back(mx); mn++; mx--; } sort(vec.begin(), vec.end()); ll res = 0; for (int i = 1; i < N; i ++) res = max(res, vec[i] - vec[i - 1]); return res; } return 0; }