#include <bits/stdc++.h>
#include <gap.h>
long long findGap(int t, int n) {
long long left;
long long right;
left = 1;
right = 1e18;
long long mn, mx;
long long vec[n];
int cnt = 0;
int cn = n - 1;
while (mn != mx) {
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) {
ans = vec[i] - vec[i - 1];
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
2 |
Correct |
1 ms |
352 KB |
Output is correct |
3 |
Correct |
1 ms |
424 KB |
Output is correct |
4 |
Correct |
1 ms |
460 KB |
Output is correct |
5 |
Correct |
1 ms |
476 KB |
Output is correct |
6 |
Incorrect |
1 ms |
476 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
476 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
532 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
532 KB |
Output isn't correct |
10 |
Runtime error |
1 ms |
604 KB |
Execution failed because the return code was nonzero |
11 |
Incorrect |
3 ms |
604 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
13 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
620 KB |
Output isn't correct |
16 |
Incorrect |
21 ms |
1004 KB |
Output isn't correct |
17 |
Incorrect |
22 ms |
1004 KB |
Output isn't correct |
18 |
Incorrect |
15 ms |
1004 KB |
Output isn't correct |
19 |
Incorrect |
15 ms |
1004 KB |
Output isn't correct |
20 |
Runtime error |
11 ms |
1004 KB |
Execution failed because the return code was nonzero |
21 |
Incorrect |
55 ms |
2156 KB |
Output isn't correct |
22 |
Incorrect |
55 ms |
2156 KB |
Output isn't correct |
23 |
Incorrect |
63 ms |
2156 KB |
Output isn't correct |
24 |
Incorrect |
59 ms |
2156 KB |
Output isn't correct |
25 |
Incorrect |
48 ms |
2160 KB |
Output isn't correct |
26 |
Incorrect |
57 ms |
2160 KB |
Output isn't correct |
27 |
Incorrect |
56 ms |
2284 KB |
Output isn't correct |
28 |
Incorrect |
55 ms |
2284 KB |
Output isn't correct |
29 |
Incorrect |
55 ms |
2284 KB |
Output isn't correct |
30 |
Runtime error |
42 ms |
2284 KB |
Execution failed because the return code was nonzero |
31 |
Runtime error |
1 ms |
2284 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
2 ms |
2284 KB |
Execution failed because the return code was nonzero |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
2284 KB |
Output isn't correct |
2 |
Partially correct |
1 ms |
2284 KB |
Partially correct |
3 |
Partially correct |
1 ms |
2284 KB |
Partially correct |
4 |
Partially correct |
1 ms |
2284 KB |
Partially correct |
5 |
Partially correct |
1 ms |
2284 KB |
Partially correct |
6 |
Incorrect |
1 ms |
2284 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2284 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
2284 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2284 KB |
Output isn't correct |
10 |
Runtime error |
1 ms |
2284 KB |
Execution failed because the return code was nonzero |
11 |
Incorrect |
2 ms |
2284 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
2284 KB |
Output isn't correct |
13 |
Incorrect |
2 ms |
2284 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
2284 KB |
Output isn't correct |
15 |
Incorrect |
2 ms |
2284 KB |
Output isn't correct |
16 |
Incorrect |
14 ms |
2284 KB |
Output isn't correct |
17 |
Incorrect |
15 ms |
2284 KB |
Output isn't correct |
18 |
Incorrect |
14 ms |
2284 KB |
Output isn't correct |
19 |
Incorrect |
14 ms |
2284 KB |
Output isn't correct |
20 |
Runtime error |
11 ms |
2284 KB |
Execution failed because the return code was nonzero |
21 |
Incorrect |
56 ms |
2284 KB |
Expected int32, but "2500100001" found |
22 |
Incorrect |
55 ms |
2284 KB |
Expected int32, but "2500100001" found |
23 |
Incorrect |
58 ms |
2284 KB |
Expected int32, but "2500100001" found |
24 |
Incorrect |
54 ms |
2284 KB |
Expected int32, but "2500100001" found |
25 |
Incorrect |
52 ms |
2284 KB |
Expected int32, but "2500100001" found |
26 |
Incorrect |
55 ms |
2284 KB |
Expected int32, but "2500100001" found |
27 |
Incorrect |
54 ms |
2284 KB |
Expected int32, but "2500100001" found |
28 |
Incorrect |
58 ms |
2284 KB |
Expected int32, but "2500100001" found |
29 |
Incorrect |
57 ms |
2284 KB |
Expected int32, but "2500100001" found |
30 |
Runtime error |
45 ms |
2284 KB |
Execution failed because the return code was nonzero |
31 |
Runtime error |
2 ms |
2284 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
1 ms |
2284 KB |
Execution failed because the return code was nonzero |