제출 #262477

#제출 시각아이디문제언어결과실행 시간메모리
262477yuma220284Gap (APIO16_gap)C++14
0 / 100
59 ms1956 KiB
#include "gap.h" #include <vector> #include <algorithm> using namespace std; long long findGap(int T, int N) { if (T == 1) { vector<long long> A(N); long long L = 0, R = 1000000000000000000; for (int i = 0; i < (N + 1) / 2; i++) { long long MN, MX; MinMax(L, R, &MN, &MX); A[i] = MN, A[N - 1 - i] = MX; L = MN + 1, R = MX - 1; } long long ANS = 1000000000000000000; for (int i = 0; i < N - 1; i++) { ANS = min(ANS, A[i + 1] - A[i]); } return ANS; } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...