답안 #35034

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
35034 2017-11-17T13:28:28 Z cheater2k Gap (APIO16_gap) C++14
30 / 100
59 ms 5924 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
long long a[N];

long long findGap(int T, int n) {
	assert(T == 1);
	long long s = 0, t = 1e18;
	long long mn, mx;

	for (int i = 1; i <= (n + 1) / 2; ++i) {
		if (s <= t) MinMax(s, t, &mn, &mx);
		a[i] = mn; a[n - i + 1] = mx;
		s = mn + 1, t = mx - 1;
	}

	long long ans = 0;
	for (int i = 2; i <= n; ++i) ans = max(ans, a[i] - a[i - 1]);
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 5920 KB Output is correct
2 Correct 0 ms 5920 KB Output is correct
3 Correct 0 ms 5920 KB Output is correct
4 Correct 0 ms 5920 KB Output is correct
5 Correct 0 ms 5920 KB Output is correct
6 Correct 0 ms 5920 KB Output is correct
7 Correct 0 ms 5920 KB Output is correct
8 Correct 0 ms 5920 KB Output is correct
9 Correct 0 ms 5920 KB Output is correct
10 Correct 0 ms 5920 KB Output is correct
11 Correct 0 ms 5920 KB Output is correct
12 Correct 0 ms 5920 KB Output is correct
13 Correct 0 ms 5920 KB Output is correct
14 Correct 0 ms 5920 KB Output is correct
15 Correct 0 ms 5920 KB Output is correct
16 Correct 16 ms 5920 KB Output is correct
17 Correct 19 ms 5920 KB Output is correct
18 Correct 16 ms 5920 KB Output is correct
19 Correct 13 ms 5920 KB Output is correct
20 Correct 9 ms 5920 KB Output is correct
21 Correct 53 ms 5920 KB Output is correct
22 Correct 53 ms 5920 KB Output is correct
23 Correct 49 ms 5920 KB Output is correct
24 Correct 53 ms 5920 KB Output is correct
25 Correct 39 ms 5920 KB Output is correct
26 Correct 46 ms 5920 KB Output is correct
27 Correct 59 ms 5920 KB Output is correct
28 Correct 49 ms 5920 KB Output is correct
29 Correct 56 ms 5920 KB Output is correct
30 Correct 39 ms 5920 KB Output is correct
31 Correct 0 ms 5920 KB Output is correct
32 Correct 0 ms 5920 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
2 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
3 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
4 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
5 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
6 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
7 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
8 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
9 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
10 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
11 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
12 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
13 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
14 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
15 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
16 Runtime error 9 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
17 Runtime error 3 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
18 Runtime error 6 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
19 Runtime error 6 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
20 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
21 Runtime error 39 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
22 Runtime error 33 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
23 Runtime error 19 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
24 Runtime error 33 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
25 Runtime error 23 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
26 Runtime error 26 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
27 Runtime error 36 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
28 Runtime error 19 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
29 Runtime error 26 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
30 Runtime error 9 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
31 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)
32 Runtime error 0 ms 5924 KB Execution killed because of forbidden syscall gettid (186)