제출 #262479

#제출 시각아이디문제언어결과실행 시간메모리
262479yuma220284Gap (APIO16_gap)C++14
30 / 100
59 ms2012 KiB
#include "gap.h" #include <iostream> #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 = 0; for (int i = 0; i < N - 1; i++) { ANS = max(ANS, A[i + 1] - A[i]); } return ANS; } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...