# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
106945 |
2019-04-21T09:47:23 Z |
maksim_gaponov |
Gap (APIO16_gap) |
C++14 |
|
78 ms |
2200 KB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int MAX = 1e18;
int findGap(signed T, signed N) {
// cout << T << ' ' << N << endl;
int l = 0;
int r = MAX;
int CNT = 0;
MinMax(l, r, &l, &r);
++CNT;
int ans = 0;
while (r != l) {
if (r - l == 1) {
ans = max(ans, r - l);
break;
}
int nl;
int nr;
MinMax(l + 1, r - 1, &nl, &nr);
++CNT;
if (nl != -1) {
ans = max(ans, r - nr);
ans = max(ans, nl - l);
} else {
ans = max(ans, r - l);
}
r = nr;
l = nl;
// cout << r << ' ';
}
// cout << endl;
assert(2 * CNT <= N + 1);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
440 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
9 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Correct |
2 ms |
384 KB |
Output is correct |
11 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Runtime error |
4 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
13 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
14 |
Runtime error |
5 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
15 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
16 |
Runtime error |
16 ms |
896 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
17 |
Runtime error |
15 ms |
1024 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
18 |
Runtime error |
16 ms |
1024 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
19 |
Runtime error |
16 ms |
1024 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
20 |
Correct |
14 ms |
512 KB |
Output is correct |
21 |
Runtime error |
56 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Runtime error |
53 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
23 |
Runtime error |
53 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
24 |
Runtime error |
64 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Runtime error |
48 ms |
2040 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
26 |
Runtime error |
49 ms |
2200 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
27 |
Runtime error |
66 ms |
2068 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
28 |
Runtime error |
53 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
29 |
Runtime error |
68 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
30 |
Correct |
40 ms |
1152 KB |
Output is correct |
31 |
Correct |
3 ms |
384 KB |
Output is correct |
32 |
Correct |
2 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Partially correct |
2 ms |
384 KB |
Partially correct |
3 |
Partially correct |
3 ms |
384 KB |
Partially correct |
4 |
Partially correct |
2 ms |
304 KB |
Partially correct |
5 |
Partially correct |
3 ms |
384 KB |
Partially correct |
6 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
9 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Partially correct |
2 ms |
384 KB |
Partially correct |
11 |
Runtime error |
4 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
13 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
14 |
Runtime error |
5 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
15 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
16 |
Runtime error |
19 ms |
832 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
17 |
Runtime error |
14 ms |
1072 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
18 |
Runtime error |
16 ms |
1024 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
19 |
Runtime error |
15 ms |
896 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
20 |
Partially correct |
10 ms |
512 KB |
Partially correct |
21 |
Runtime error |
50 ms |
2040 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Runtime error |
78 ms |
2172 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
23 |
Runtime error |
55 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
24 |
Runtime error |
55 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Runtime error |
48 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
26 |
Runtime error |
55 ms |
2040 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
27 |
Runtime error |
50 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
28 |
Runtime error |
55 ms |
2168 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
29 |
Runtime error |
56 ms |
2056 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
30 |
Incorrect |
40 ms |
1152 KB |
Expected int32, but "2500100000" found |
31 |
Partially correct |
3 ms |
384 KB |
Partially correct |
32 |
Partially correct |
2 ms |
384 KB |
Partially correct |