# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
967747 |
2024-04-22T18:34:18 Z |
TAhmed33 |
Gap (APIO16_gap) |
C++ |
|
1004 ms |
3100 KB |
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
const ll inf = 1e18;
vector <ll> a;
pair <ll, ll> ask (ll l, ll r) {
if (l > r) return {-1, -1};
ll mn = l, mx = r;
MinMax(l, r, &mn, &mx);
return {mn, mx};
}
ll findGap (int t, int n) {
auto g = ask(0, inf);
ll ans = 0;
ll cur = g.first;
while (cur != g.second) {
ll l = cur + 1, r = g.second, ne = -1;
while (l <= r) {
ll mid = (l + r) / 2;
auto h = ask(cur, mid);
if (h.second == cur) {
l = mid + 1;
} else {
r = mid - 1; ne = mid;
}
}
ans = max(ans, ne - cur);
cur = ne;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
11 |
Incorrect |
9 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
11 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
11 ms |
2500 KB |
Output isn't correct |
14 |
Incorrect |
9 ms |
2392 KB |
Output isn't correct |
15 |
Incorrect |
6 ms |
2392 KB |
Output isn't correct |
16 |
Incorrect |
213 ms |
2584 KB |
Output isn't correct |
17 |
Incorrect |
210 ms |
2584 KB |
Output isn't correct |
18 |
Incorrect |
213 ms |
2580 KB |
Output isn't correct |
19 |
Incorrect |
208 ms |
2580 KB |
Output isn't correct |
20 |
Incorrect |
87 ms |
2572 KB |
Output isn't correct |
21 |
Incorrect |
975 ms |
2852 KB |
Output isn't correct |
22 |
Incorrect |
970 ms |
2840 KB |
Output isn't correct |
23 |
Incorrect |
964 ms |
3096 KB |
Output isn't correct |
24 |
Incorrect |
961 ms |
3100 KB |
Output isn't correct |
25 |
Incorrect |
694 ms |
2848 KB |
Output isn't correct |
26 |
Incorrect |
1004 ms |
2856 KB |
Output isn't correct |
27 |
Incorrect |
959 ms |
2820 KB |
Output isn't correct |
28 |
Incorrect |
961 ms |
2852 KB |
Output isn't correct |
29 |
Incorrect |
989 ms |
2856 KB |
Output isn't correct |
30 |
Incorrect |
428 ms |
2848 KB |
Output isn't correct |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1 ms |
2388 KB |
Partially correct |
2 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
3 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
4 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
5 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
6 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
7 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
8 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
9 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
10 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
11 |
Partially correct |
10 ms |
2392 KB |
Partially correct |
12 |
Partially correct |
10 ms |
2392 KB |
Partially correct |
13 |
Partially correct |
11 ms |
2392 KB |
Partially correct |
14 |
Partially correct |
10 ms |
2504 KB |
Partially correct |
15 |
Partially correct |
6 ms |
2392 KB |
Partially correct |
16 |
Partially correct |
212 ms |
2752 KB |
Partially correct |
17 |
Partially correct |
211 ms |
2576 KB |
Partially correct |
18 |
Partially correct |
209 ms |
2584 KB |
Partially correct |
19 |
Partially correct |
223 ms |
2580 KB |
Partially correct |
20 |
Partially correct |
88 ms |
2568 KB |
Partially correct |
21 |
Incorrect |
964 ms |
2856 KB |
Expected int32, but "5455163050" found |
22 |
Incorrect |
967 ms |
3096 KB |
Expected int32, but "5470412045" found |
23 |
Incorrect |
960 ms |
2856 KB |
Expected int32, but "5476406278" found |
24 |
Incorrect |
964 ms |
2856 KB |
Expected int32, but "5448778778" found |
25 |
Incorrect |
701 ms |
2984 KB |
Expected int32, but "5007487657" found |
26 |
Incorrect |
972 ms |
2860 KB |
Expected int32, but "5458385715" found |
27 |
Incorrect |
967 ms |
2860 KB |
Expected int32, but "5441723754" found |
28 |
Incorrect |
977 ms |
2840 KB |
Expected int32, but "5456055451" found |
29 |
Incorrect |
974 ms |
2856 KB |
Expected int32, but "5463373881" found |
30 |
Incorrect |
437 ms |
2852 KB |
Expected int32, but "7106866961" found |
31 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
32 |
Partially correct |
1 ms |
2392 KB |
Partially correct |