답안 #40874

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
40874 2018-02-09T15:41:03 Z gabrielsimoes Gap (APIO16_gap) C++14
30 / 100
59 ms 2660 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll INF = 1000000000000000000;

ll findGap(int T, int N) {
	assert(T == 1);

	ll v[N];
	int i = 0, k = N-1;
	ll mn = -1, mx = INF+1;
	while (i <= k) {
		MinMax(mn+1, mx-1, &v[i], &v[k]);
		mn = v[i++];
		mx = v[k--];
	}

	ll ans = 0;
	for (int i = 1; i < N; i++) {
		ans = max(ans, v[i] - v[i-1]);
	}

	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 352 KB Output is correct
3 Correct 2 ms 464 KB Output is correct
4 Correct 2 ms 540 KB Output is correct
5 Correct 1 ms 540 KB Output is correct
6 Correct 2 ms 660 KB Output is correct
7 Correct 2 ms 676 KB Output is correct
8 Correct 1 ms 676 KB Output is correct
9 Correct 2 ms 676 KB Output is correct
10 Correct 2 ms 676 KB Output is correct
11 Correct 3 ms 676 KB Output is correct
12 Correct 2 ms 676 KB Output is correct
13 Correct 2 ms 676 KB Output is correct
14 Correct 2 ms 676 KB Output is correct
15 Correct 2 ms 676 KB Output is correct
16 Correct 16 ms 900 KB Output is correct
17 Correct 15 ms 940 KB Output is correct
18 Correct 15 ms 1004 KB Output is correct
19 Correct 15 ms 1004 KB Output is correct
20 Correct 11 ms 1004 KB Output is correct
21 Correct 59 ms 2168 KB Output is correct
22 Correct 55 ms 2168 KB Output is correct
23 Correct 56 ms 2168 KB Output is correct
24 Correct 57 ms 2284 KB Output is correct
25 Correct 54 ms 2284 KB Output is correct
26 Correct 59 ms 2284 KB Output is correct
27 Correct 57 ms 2284 KB Output is correct
28 Correct 57 ms 2284 KB Output is correct
29 Correct 57 ms 2284 KB Output is correct
30 Correct 43 ms 2284 KB Output is correct
31 Correct 1 ms 2284 KB Output is correct
32 Correct 2 ms 2284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 3 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 3 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 3 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 2 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 3 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 3 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 10 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 9 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 13 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 12 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 5 ms 2284 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 31 ms 2492 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 32 ms 2508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 32 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 33 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 22 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 38 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 30 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 33 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 33 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 17 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 3 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 2 ms 2660 KB Execution killed with signal 11 (could be triggered by violating memory limits)