제출 #631508

#제출 시각아이디문제언어결과실행 시간메모리
631508TranGiaHuy1508Gap (APIO16_gap)C++17
0 / 100
42 ms2044 KiB
#include <bits/stdc++.h> using namespace std; #include "gap.h" using ll = long long; ll findGap(int T, int N){ if (T == 1){ ll mn, mx; vector<ll> L, R; ll lb = -1, rb = 1e18 + 1; while (lb < rb){ MinMax(lb + 1, rb - 1, &mn, &mx); if (mn < 0) break; L.push_back(mn); R.push_back(mx); lb = mn; rb = mx; } ll res = 0; for (int i = 1; i < (int)L.size(); i++){ res = max(res, abs(L[i] - L[i-1])); } for (int i = 1; i < (int)R.size(); i++){ res = max(res, abs(R[i] - R[i-1])); } res = max(res, abs(R.back() - L.back())); return res; } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...