제출 #41260

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
412602018-02-15 08:06:20Just_Solve_The_ProblemGap (APIO16_gap)C++11
88.08 / 100
83 ms2284 KiB
#include <gap.h>
#include <bits/stdc++.h>
//#include "grader.cpp"
#define ll long long
const int inf = (int)1e9 + 7;
using namespace std;
ll solve1(int n) {
long long left;
long long right;
left = 0;
right = 1e18;
long long mn = 0, mx = 1e18;
long long vec[n];
int cnt = 0;
int cn = n - 1;
while (cnt <= cn) {
MinMax(left, right, &mn, &mx);
vec[cnt++] = mn;
if (mn != mx)
vec[cn--] = mx;
left = mn + 1;
right = mx - 1;
}
long long ans = 0;
for (int i = 1; i < n; i++) {
if (vec[i] - vec[i - 1] > ans) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...