#include "towers.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <set>
#include <algorithm>
using namespace std;
int ind = -1;
bool ch = true;
vector <int> h;
const int N = 100100, M = 20;
int mx[N][M], Left[N], Right[N], pref[N], LS[N], RS[N];
int mxleft[N][M], mnright[N][M];
vector <int> esim;
vector <int> indexes;
bool check = true;
int findmaxinrange(int L, int R) {
if (L > R) return 0;
int u = log2(R - L + 1);
return max(mx[L][u], mx[R - (1 << u) + 1][u]);
}
int findmininrange(int L, int R, int w) {
if (L > R) return 2e9 + 1;
int u = log2(R - L + 1);
if (w == 1) return max(mxleft[L][u], mxleft[R - (1 << u) + 1][u]);
return min(mnright[L][u], mnright[R - (1 << u) + 1][u]);
}
void init(int n, vector<int> a) {
ch = true;
ind = -1;
h = a;
pref[0] = 0;
for (int i = 0; i < n - 1; ++i)
{
if (a[i] > a[i + 1]) {
if (ind == -1) ind = i;
}
else {
if (ind != -1) ch = false;
}
}
LS[0] = -1;
RS[n - 1] = -1;
for (int i = 1; i < n; i++) {
int v = i - 1;
while (v != -1 && a[i] < a[v]) {
v = LS[v];
}
LS[i] = v;
}
for (int i = n - 2; i >= 0; i--) {
int v = i + 1;
while (v != -1 && a[i] < a[v]) {
v = RS[v];
}
RS[i] = v;
}
for (int i = 1; i < n - 1; i++) {
pref[i] = pref[i - 1];
if (a[i] < a[i + 1] && a[i] < a[i - 1]) pref[i]++;
}
for (int i = 0; i < n; i++) {
mx[i][0] = a[i];
}
for (int j = 1; j < 20; j++) {
for (int i = n - 1; i >= 0; i--) {
mx[i][j] = max(mx[i][j - 1], mx[min(n - 1, i + (1 << (j - 1)))][j - 1]);
}
}
for (int i = 0; i < n; i++) {
int hmn = 2e9;
if (LS[i] != -1) {
hmn = min(hmn, findmaxinrange(LS[i] + 1, i - 1));
}
if (RS[i] != -1) {
hmn = min(hmn, findmaxinrange(i + 1, RS[i] - 1));
}
int u = hmn - a[i];
esim.push_back(u);
}
sort(esim.begin(), esim.end());
}
int querynumber = 0;
int max_towers(int L, int R, int D) {
int n = (int)h.size();
++querynumber;
if (ch) {
if (R < ind || L > ind) return 1;
if (h[ind] >= (max(h[L], h[R]) + D)) return 2;
return 1;
}
if (querynumber == 1) {
vector <pair<int, int>> v;
set <int> ms;
for (int i = 0; i < n; i++) {
int l = 0, r = i - 1;
Left[i] = -1;
while (l <= r) {
int mid = (l + r) / 2;
if (findmaxinrange(mid, i - 1) >= h[i] + D) {
Left[i] = mid;
l = mid + 1;
}
else r = mid - 1;
}
Right[i] = n;
l = i + 1, r = n - 1;
while (l <= r) {
int mid = (l + r) / 2;
if (findmaxinrange(i + 1, mid) >= h[i] + D) {
Right[i] = mid;
r = mid - 1;
}
else l = mid + 1;
}
v.push_back({ h[i], i });
}
int ans = 0;
sort(v.begin(), v.end());
for (auto q : v) {
int ind = q.second;
if (ind > R || ind < L) continue;
auto it = ms.lower_bound(ind);
if (it != ms.begin()) {
it--;
if (*it > Left[ind]) continue;
}
it = ms.lower_bound(ind);
if (it != ms.end() && *it < Right[ind]) {
continue;
}
ms.insert(ind);
++ans;
}
return ans;
}
if (D == 1) {
if (L == R) {
return 1;
}
int cnt = pref[R - 1] - pref[L];
if (h[L] < h[L + 1]) ++cnt;
if (h[R] < h[R - 1]) ++cnt;
return cnt;
}
if (L == 0 && R == n - 1) {
int u = lower_bound(esim.begin(), esim.end(), D) - esim.begin();
return n - u;
}
if (check) {
check = false;
vector <pair<int, int>> v;
set <int> ms;
for (int i = 0; i < n; i++) {
int l = 0, r = i - 1;
Left[i] = -1;
while (l <= r) {
int mid = (l + r) / 2;
if (findmaxinrange(mid, i - 1) >= h[i] + D) {
Left[i] = mid;
l = mid + 1;
}
else r = mid - 1;
}
Right[i] = n;
l = i + 1, r = n - 1;
while (l <= r) {
int mid = (l + r) / 2;
if (findmaxinrange(i + 1, mid) >= h[i] + D) {
Right[i] = mid;
r = mid - 1;
}
else l = mid + 1;
}
}
for (int i = 0; i < n; i++) {
int hmn = 2e9;
if (LS[i] != -1) {
hmn = min(hmn, findmaxinrange(LS[i] + 1, i - 1));
}
if (RS[i] != -1) {
hmn = min(hmn, findmaxinrange(i + 1, RS[i] - 1));
}
int u = hmn - h[i];
if (u >= D) {
indexes.push_back(i);
}
}
for (int i = 0; i < n; i++) {
mxleft[i][0] = Left[i];
mnright[i][0] = Right[i];
}
for (int j = 1; j < 20; j++) {
for (int i = n - 1; i >= 0; i--) {
mxleft[i][j] = max(mxleft[i][j - 1], mxleft[min(n - 1, i + (1 << (j - 1)))][j - 1]);
mnright[i][j] = min(mnright[i][j - 1], mnright[min(n - 1, i + (1 << (j - 1)))][j - 1]);
}
}
}
if (L == R) {
return 1;
}
auto it = lower_bound(indexes.begin(), indexes.end(), L);
int ans = upper_bound(indexes.begin(), indexes.end(), R) - lower_bound(indexes.begin(), indexes.end(), L);
if (it != indexes.end()) {
int q = Left[*it];
if (L < q) {
if (findmininrange(L, q - 1, 2) < *it) {
++ans;
}
}
}
it = upper_bound(indexes.begin(), indexes.end(), R);
if (it != indexes.begin()) {
--it;
int q = Right[*it];
if (q < R) {
if (findmininrange(q + 1, R, 1) > *it) {
++ans;
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
332 ms |
6792 KB |
Output is correct |
2 |
Correct |
668 ms |
11076 KB |
Output is correct |
3 |
Correct |
991 ms |
11044 KB |
Output is correct |
4 |
Correct |
1098 ms |
11044 KB |
Output is correct |
5 |
Correct |
754 ms |
11040 KB |
Output is correct |
6 |
Correct |
835 ms |
11060 KB |
Output is correct |
7 |
Correct |
943 ms |
11084 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
464 KB |
Output is correct |
10 |
Correct |
1 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
592 KB |
Output is correct |
3 |
Correct |
2 ms |
540 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
464 KB |
Output is correct |
6 |
Correct |
2 ms |
464 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
1 ms |
464 KB |
Output is correct |
9 |
Correct |
1 ms |
464 KB |
Output is correct |
10 |
Correct |
2 ms |
564 KB |
Output is correct |
11 |
Correct |
2 ms |
592 KB |
Output is correct |
12 |
Correct |
1 ms |
228 KB |
Output is correct |
13 |
Correct |
1 ms |
464 KB |
Output is correct |
14 |
Correct |
1 ms |
464 KB |
Output is correct |
15 |
Correct |
2 ms |
592 KB |
Output is correct |
16 |
Correct |
3 ms |
592 KB |
Output is correct |
17 |
Correct |
2 ms |
584 KB |
Output is correct |
18 |
Correct |
1 ms |
464 KB |
Output is correct |
19 |
Correct |
2 ms |
592 KB |
Output is correct |
20 |
Correct |
2 ms |
592 KB |
Output is correct |
21 |
Correct |
2 ms |
592 KB |
Output is correct |
22 |
Correct |
2 ms |
592 KB |
Output is correct |
23 |
Correct |
1 ms |
464 KB |
Output is correct |
24 |
Correct |
1 ms |
592 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
2 ms |
596 KB |
Output is correct |
27 |
Correct |
2 ms |
464 KB |
Output is correct |
28 |
Correct |
2 ms |
576 KB |
Output is correct |
29 |
Correct |
2 ms |
464 KB |
Output is correct |
30 |
Correct |
2 ms |
464 KB |
Output is correct |
31 |
Correct |
2 ms |
592 KB |
Output is correct |
32 |
Correct |
1 ms |
464 KB |
Output is correct |
33 |
Correct |
1 ms |
464 KB |
Output is correct |
34 |
Correct |
1 ms |
592 KB |
Output is correct |
35 |
Correct |
2 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
592 KB |
Output is correct |
3 |
Correct |
2 ms |
540 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
464 KB |
Output is correct |
6 |
Correct |
2 ms |
464 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
1 ms |
464 KB |
Output is correct |
9 |
Correct |
1 ms |
464 KB |
Output is correct |
10 |
Correct |
2 ms |
564 KB |
Output is correct |
11 |
Correct |
2 ms |
592 KB |
Output is correct |
12 |
Correct |
1 ms |
228 KB |
Output is correct |
13 |
Correct |
1 ms |
464 KB |
Output is correct |
14 |
Correct |
1 ms |
464 KB |
Output is correct |
15 |
Correct |
2 ms |
592 KB |
Output is correct |
16 |
Correct |
3 ms |
592 KB |
Output is correct |
17 |
Correct |
2 ms |
584 KB |
Output is correct |
18 |
Correct |
1 ms |
464 KB |
Output is correct |
19 |
Correct |
2 ms |
592 KB |
Output is correct |
20 |
Correct |
2 ms |
592 KB |
Output is correct |
21 |
Correct |
2 ms |
592 KB |
Output is correct |
22 |
Correct |
2 ms |
592 KB |
Output is correct |
23 |
Correct |
1 ms |
464 KB |
Output is correct |
24 |
Correct |
1 ms |
592 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
2 ms |
596 KB |
Output is correct |
27 |
Correct |
2 ms |
464 KB |
Output is correct |
28 |
Correct |
2 ms |
576 KB |
Output is correct |
29 |
Correct |
2 ms |
464 KB |
Output is correct |
30 |
Correct |
2 ms |
464 KB |
Output is correct |
31 |
Correct |
2 ms |
592 KB |
Output is correct |
32 |
Correct |
1 ms |
464 KB |
Output is correct |
33 |
Correct |
1 ms |
464 KB |
Output is correct |
34 |
Correct |
1 ms |
592 KB |
Output is correct |
35 |
Correct |
2 ms |
464 KB |
Output is correct |
36 |
Correct |
63 ms |
8128 KB |
Output is correct |
37 |
Correct |
108 ms |
12556 KB |
Output is correct |
38 |
Correct |
117 ms |
12516 KB |
Output is correct |
39 |
Correct |
106 ms |
12472 KB |
Output is correct |
40 |
Correct |
104 ms |
12648 KB |
Output is correct |
41 |
Correct |
127 ms |
12864 KB |
Output is correct |
42 |
Correct |
106 ms |
12500 KB |
Output is correct |
43 |
Correct |
27 ms |
11040 KB |
Output is correct |
44 |
Correct |
26 ms |
11040 KB |
Output is correct |
45 |
Correct |
82 ms |
12472 KB |
Output is correct |
46 |
Correct |
96 ms |
12524 KB |
Output is correct |
47 |
Correct |
106 ms |
12596 KB |
Output is correct |
48 |
Correct |
106 ms |
12560 KB |
Output is correct |
49 |
Correct |
95 ms |
12516 KB |
Output is correct |
50 |
Correct |
26 ms |
11076 KB |
Output is correct |
51 |
Correct |
76 ms |
12528 KB |
Output is correct |
52 |
Correct |
131 ms |
13688 KB |
Output is correct |
53 |
Correct |
120 ms |
14380 KB |
Output is correct |
54 |
Correct |
125 ms |
14388 KB |
Output is correct |
55 |
Correct |
26 ms |
11084 KB |
Output is correct |
56 |
Correct |
84 ms |
12520 KB |
Output is correct |
57 |
Correct |
115 ms |
12132 KB |
Output is correct |
58 |
Correct |
120 ms |
12884 KB |
Output is correct |
59 |
Correct |
136 ms |
13196 KB |
Output is correct |
60 |
Correct |
135 ms |
14364 KB |
Output is correct |
61 |
Correct |
133 ms |
13984 KB |
Output is correct |
62 |
Correct |
120 ms |
13316 KB |
Output is correct |
63 |
Correct |
137 ms |
13976 KB |
Output is correct |
64 |
Correct |
29 ms |
11076 KB |
Output is correct |
65 |
Correct |
26 ms |
11040 KB |
Output is correct |
66 |
Correct |
89 ms |
12472 KB |
Output is correct |
67 |
Correct |
95 ms |
12472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
860 ms |
12476 KB |
Output is correct |
2 |
Correct |
1029 ms |
12724 KB |
Output is correct |
3 |
Correct |
849 ms |
12568 KB |
Output is correct |
4 |
Correct |
1075 ms |
13148 KB |
Output is correct |
5 |
Correct |
967 ms |
13076 KB |
Output is correct |
6 |
Correct |
959 ms |
12476 KB |
Output is correct |
7 |
Correct |
968 ms |
13640 KB |
Output is correct |
8 |
Correct |
632 ms |
11076 KB |
Output is correct |
9 |
Correct |
639 ms |
11144 KB |
Output is correct |
10 |
Correct |
976 ms |
12484 KB |
Output is correct |
11 |
Correct |
930 ms |
12560 KB |
Output is correct |
12 |
Correct |
899 ms |
11044 KB |
Output is correct |
13 |
Correct |
793 ms |
11116 KB |
Output is correct |
14 |
Correct |
0 ms |
208 KB |
Output is correct |
15 |
Correct |
1 ms |
464 KB |
Output is correct |
16 |
Correct |
1 ms |
464 KB |
Output is correct |
17 |
Correct |
103 ms |
12532 KB |
Output is correct |
18 |
Correct |
110 ms |
12660 KB |
Output is correct |
19 |
Correct |
97 ms |
12560 KB |
Output is correct |
20 |
Correct |
26 ms |
11080 KB |
Output is correct |
21 |
Correct |
76 ms |
12444 KB |
Output is correct |
22 |
Correct |
130 ms |
13572 KB |
Output is correct |
23 |
Correct |
134 ms |
14300 KB |
Output is correct |
24 |
Correct |
131 ms |
14396 KB |
Output is correct |
25 |
Correct |
24 ms |
11076 KB |
Output is correct |
26 |
Correct |
92 ms |
12528 KB |
Output is correct |
27 |
Correct |
2 ms |
464 KB |
Output is correct |
28 |
Correct |
2 ms |
592 KB |
Output is correct |
29 |
Correct |
2 ms |
592 KB |
Output is correct |
30 |
Correct |
1 ms |
464 KB |
Output is correct |
31 |
Correct |
1 ms |
592 KB |
Output is correct |
32 |
Correct |
2 ms |
592 KB |
Output is correct |
33 |
Correct |
2 ms |
592 KB |
Output is correct |
34 |
Correct |
2 ms |
592 KB |
Output is correct |
35 |
Correct |
1 ms |
464 KB |
Output is correct |
36 |
Correct |
2 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
250 ms |
3420 KB |
Output is correct |
2 |
Correct |
916 ms |
13036 KB |
Output is correct |
3 |
Correct |
744 ms |
13460 KB |
Output is correct |
4 |
Correct |
972 ms |
12768 KB |
Output is correct |
5 |
Correct |
1059 ms |
12872 KB |
Output is correct |
6 |
Correct |
1086 ms |
12480 KB |
Output is correct |
7 |
Correct |
1073 ms |
12744 KB |
Output is correct |
8 |
Correct |
863 ms |
11044 KB |
Output is correct |
9 |
Correct |
814 ms |
11040 KB |
Output is correct |
10 |
Correct |
874 ms |
12604 KB |
Output is correct |
11 |
Correct |
922 ms |
12720 KB |
Output is correct |
12 |
Correct |
122 ms |
13544 KB |
Output is correct |
13 |
Correct |
122 ms |
14340 KB |
Output is correct |
14 |
Correct |
134 ms |
14388 KB |
Output is correct |
15 |
Correct |
24 ms |
11072 KB |
Output is correct |
16 |
Correct |
83 ms |
12540 KB |
Output is correct |
17 |
Correct |
108 ms |
12200 KB |
Output is correct |
18 |
Correct |
132 ms |
12928 KB |
Output is correct |
19 |
Correct |
131 ms |
13152 KB |
Output is correct |
20 |
Correct |
128 ms |
14392 KB |
Output is correct |
21 |
Correct |
124 ms |
13936 KB |
Output is correct |
22 |
Correct |
130 ms |
13340 KB |
Output is correct |
23 |
Correct |
128 ms |
14044 KB |
Output is correct |
24 |
Correct |
33 ms |
11040 KB |
Output is correct |
25 |
Correct |
26 ms |
11204 KB |
Output is correct |
26 |
Correct |
88 ms |
12456 KB |
Output is correct |
27 |
Correct |
83 ms |
12472 KB |
Output is correct |
28 |
Correct |
2 ms |
592 KB |
Output is correct |
29 |
Correct |
2 ms |
592 KB |
Output is correct |
30 |
Correct |
2 ms |
592 KB |
Output is correct |
31 |
Correct |
1 ms |
464 KB |
Output is correct |
32 |
Correct |
2 ms |
492 KB |
Output is correct |
33 |
Correct |
2 ms |
336 KB |
Output is correct |
34 |
Correct |
2 ms |
464 KB |
Output is correct |
35 |
Correct |
2 ms |
592 KB |
Output is correct |
36 |
Correct |
2 ms |
592 KB |
Output is correct |
37 |
Correct |
2 ms |
464 KB |
Output is correct |
38 |
Correct |
2 ms |
464 KB |
Output is correct |
39 |
Correct |
2 ms |
592 KB |
Output is correct |
40 |
Correct |
1 ms |
464 KB |
Output is correct |
41 |
Correct |
1 ms |
464 KB |
Output is correct |
42 |
Correct |
2 ms |
464 KB |
Output is correct |
43 |
Correct |
1 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
592 KB |
Output is correct |
3 |
Correct |
2 ms |
540 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
464 KB |
Output is correct |
6 |
Correct |
2 ms |
464 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
1 ms |
464 KB |
Output is correct |
9 |
Correct |
1 ms |
464 KB |
Output is correct |
10 |
Correct |
2 ms |
564 KB |
Output is correct |
11 |
Correct |
2 ms |
592 KB |
Output is correct |
12 |
Correct |
1 ms |
228 KB |
Output is correct |
13 |
Correct |
1 ms |
464 KB |
Output is correct |
14 |
Correct |
1 ms |
464 KB |
Output is correct |
15 |
Correct |
2 ms |
592 KB |
Output is correct |
16 |
Correct |
3 ms |
592 KB |
Output is correct |
17 |
Correct |
2 ms |
584 KB |
Output is correct |
18 |
Correct |
1 ms |
464 KB |
Output is correct |
19 |
Correct |
2 ms |
592 KB |
Output is correct |
20 |
Correct |
2 ms |
592 KB |
Output is correct |
21 |
Correct |
2 ms |
592 KB |
Output is correct |
22 |
Correct |
2 ms |
592 KB |
Output is correct |
23 |
Correct |
1 ms |
464 KB |
Output is correct |
24 |
Correct |
1 ms |
592 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
2 ms |
596 KB |
Output is correct |
27 |
Correct |
2 ms |
464 KB |
Output is correct |
28 |
Correct |
2 ms |
576 KB |
Output is correct |
29 |
Correct |
2 ms |
464 KB |
Output is correct |
30 |
Correct |
2 ms |
464 KB |
Output is correct |
31 |
Correct |
2 ms |
592 KB |
Output is correct |
32 |
Correct |
1 ms |
464 KB |
Output is correct |
33 |
Correct |
1 ms |
464 KB |
Output is correct |
34 |
Correct |
1 ms |
592 KB |
Output is correct |
35 |
Correct |
2 ms |
464 KB |
Output is correct |
36 |
Correct |
63 ms |
8128 KB |
Output is correct |
37 |
Correct |
108 ms |
12556 KB |
Output is correct |
38 |
Correct |
117 ms |
12516 KB |
Output is correct |
39 |
Correct |
106 ms |
12472 KB |
Output is correct |
40 |
Correct |
104 ms |
12648 KB |
Output is correct |
41 |
Correct |
127 ms |
12864 KB |
Output is correct |
42 |
Correct |
106 ms |
12500 KB |
Output is correct |
43 |
Correct |
27 ms |
11040 KB |
Output is correct |
44 |
Correct |
26 ms |
11040 KB |
Output is correct |
45 |
Correct |
82 ms |
12472 KB |
Output is correct |
46 |
Correct |
96 ms |
12524 KB |
Output is correct |
47 |
Correct |
106 ms |
12596 KB |
Output is correct |
48 |
Correct |
106 ms |
12560 KB |
Output is correct |
49 |
Correct |
95 ms |
12516 KB |
Output is correct |
50 |
Correct |
26 ms |
11076 KB |
Output is correct |
51 |
Correct |
76 ms |
12528 KB |
Output is correct |
52 |
Correct |
131 ms |
13688 KB |
Output is correct |
53 |
Correct |
120 ms |
14380 KB |
Output is correct |
54 |
Correct |
125 ms |
14388 KB |
Output is correct |
55 |
Correct |
26 ms |
11084 KB |
Output is correct |
56 |
Correct |
84 ms |
12520 KB |
Output is correct |
57 |
Correct |
115 ms |
12132 KB |
Output is correct |
58 |
Correct |
120 ms |
12884 KB |
Output is correct |
59 |
Correct |
136 ms |
13196 KB |
Output is correct |
60 |
Correct |
135 ms |
14364 KB |
Output is correct |
61 |
Correct |
133 ms |
13984 KB |
Output is correct |
62 |
Correct |
120 ms |
13316 KB |
Output is correct |
63 |
Correct |
137 ms |
13976 KB |
Output is correct |
64 |
Correct |
29 ms |
11076 KB |
Output is correct |
65 |
Correct |
26 ms |
11040 KB |
Output is correct |
66 |
Correct |
89 ms |
12472 KB |
Output is correct |
67 |
Correct |
95 ms |
12472 KB |
Output is correct |
68 |
Correct |
860 ms |
12476 KB |
Output is correct |
69 |
Correct |
1029 ms |
12724 KB |
Output is correct |
70 |
Correct |
849 ms |
12568 KB |
Output is correct |
71 |
Correct |
1075 ms |
13148 KB |
Output is correct |
72 |
Correct |
967 ms |
13076 KB |
Output is correct |
73 |
Correct |
959 ms |
12476 KB |
Output is correct |
74 |
Correct |
968 ms |
13640 KB |
Output is correct |
75 |
Correct |
632 ms |
11076 KB |
Output is correct |
76 |
Correct |
639 ms |
11144 KB |
Output is correct |
77 |
Correct |
976 ms |
12484 KB |
Output is correct |
78 |
Correct |
930 ms |
12560 KB |
Output is correct |
79 |
Correct |
899 ms |
11044 KB |
Output is correct |
80 |
Correct |
793 ms |
11116 KB |
Output is correct |
81 |
Correct |
0 ms |
208 KB |
Output is correct |
82 |
Correct |
1 ms |
464 KB |
Output is correct |
83 |
Correct |
1 ms |
464 KB |
Output is correct |
84 |
Correct |
103 ms |
12532 KB |
Output is correct |
85 |
Correct |
110 ms |
12660 KB |
Output is correct |
86 |
Correct |
97 ms |
12560 KB |
Output is correct |
87 |
Correct |
26 ms |
11080 KB |
Output is correct |
88 |
Correct |
76 ms |
12444 KB |
Output is correct |
89 |
Correct |
130 ms |
13572 KB |
Output is correct |
90 |
Correct |
134 ms |
14300 KB |
Output is correct |
91 |
Correct |
131 ms |
14396 KB |
Output is correct |
92 |
Correct |
24 ms |
11076 KB |
Output is correct |
93 |
Correct |
92 ms |
12528 KB |
Output is correct |
94 |
Correct |
2 ms |
464 KB |
Output is correct |
95 |
Correct |
2 ms |
592 KB |
Output is correct |
96 |
Correct |
2 ms |
592 KB |
Output is correct |
97 |
Correct |
1 ms |
464 KB |
Output is correct |
98 |
Correct |
1 ms |
592 KB |
Output is correct |
99 |
Correct |
2 ms |
592 KB |
Output is correct |
100 |
Correct |
2 ms |
592 KB |
Output is correct |
101 |
Correct |
2 ms |
592 KB |
Output is correct |
102 |
Correct |
1 ms |
464 KB |
Output is correct |
103 |
Correct |
2 ms |
464 KB |
Output is correct |
104 |
Correct |
836 ms |
24416 KB |
Output is correct |
105 |
Incorrect |
1152 ms |
27428 KB |
22302nd lines differ - on the 1st token, expected: '1', found: '0' |
106 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
332 ms |
6792 KB |
Output is correct |
2 |
Correct |
668 ms |
11076 KB |
Output is correct |
3 |
Correct |
991 ms |
11044 KB |
Output is correct |
4 |
Correct |
1098 ms |
11044 KB |
Output is correct |
5 |
Correct |
754 ms |
11040 KB |
Output is correct |
6 |
Correct |
835 ms |
11060 KB |
Output is correct |
7 |
Correct |
943 ms |
11084 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
464 KB |
Output is correct |
10 |
Correct |
1 ms |
464 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
2 ms |
592 KB |
Output is correct |
13 |
Correct |
2 ms |
540 KB |
Output is correct |
14 |
Correct |
2 ms |
596 KB |
Output is correct |
15 |
Correct |
2 ms |
464 KB |
Output is correct |
16 |
Correct |
2 ms |
464 KB |
Output is correct |
17 |
Correct |
2 ms |
592 KB |
Output is correct |
18 |
Correct |
1 ms |
464 KB |
Output is correct |
19 |
Correct |
1 ms |
464 KB |
Output is correct |
20 |
Correct |
2 ms |
564 KB |
Output is correct |
21 |
Correct |
2 ms |
592 KB |
Output is correct |
22 |
Correct |
1 ms |
228 KB |
Output is correct |
23 |
Correct |
1 ms |
464 KB |
Output is correct |
24 |
Correct |
1 ms |
464 KB |
Output is correct |
25 |
Correct |
2 ms |
592 KB |
Output is correct |
26 |
Correct |
3 ms |
592 KB |
Output is correct |
27 |
Correct |
2 ms |
584 KB |
Output is correct |
28 |
Correct |
1 ms |
464 KB |
Output is correct |
29 |
Correct |
2 ms |
592 KB |
Output is correct |
30 |
Correct |
2 ms |
592 KB |
Output is correct |
31 |
Correct |
2 ms |
592 KB |
Output is correct |
32 |
Correct |
2 ms |
592 KB |
Output is correct |
33 |
Correct |
1 ms |
464 KB |
Output is correct |
34 |
Correct |
1 ms |
592 KB |
Output is correct |
35 |
Correct |
1 ms |
336 KB |
Output is correct |
36 |
Correct |
2 ms |
596 KB |
Output is correct |
37 |
Correct |
2 ms |
464 KB |
Output is correct |
38 |
Correct |
2 ms |
576 KB |
Output is correct |
39 |
Correct |
2 ms |
464 KB |
Output is correct |
40 |
Correct |
2 ms |
464 KB |
Output is correct |
41 |
Correct |
2 ms |
592 KB |
Output is correct |
42 |
Correct |
1 ms |
464 KB |
Output is correct |
43 |
Correct |
1 ms |
464 KB |
Output is correct |
44 |
Correct |
1 ms |
592 KB |
Output is correct |
45 |
Correct |
2 ms |
464 KB |
Output is correct |
46 |
Correct |
63 ms |
8128 KB |
Output is correct |
47 |
Correct |
108 ms |
12556 KB |
Output is correct |
48 |
Correct |
117 ms |
12516 KB |
Output is correct |
49 |
Correct |
106 ms |
12472 KB |
Output is correct |
50 |
Correct |
104 ms |
12648 KB |
Output is correct |
51 |
Correct |
127 ms |
12864 KB |
Output is correct |
52 |
Correct |
106 ms |
12500 KB |
Output is correct |
53 |
Correct |
27 ms |
11040 KB |
Output is correct |
54 |
Correct |
26 ms |
11040 KB |
Output is correct |
55 |
Correct |
82 ms |
12472 KB |
Output is correct |
56 |
Correct |
96 ms |
12524 KB |
Output is correct |
57 |
Correct |
106 ms |
12596 KB |
Output is correct |
58 |
Correct |
106 ms |
12560 KB |
Output is correct |
59 |
Correct |
95 ms |
12516 KB |
Output is correct |
60 |
Correct |
26 ms |
11076 KB |
Output is correct |
61 |
Correct |
76 ms |
12528 KB |
Output is correct |
62 |
Correct |
131 ms |
13688 KB |
Output is correct |
63 |
Correct |
120 ms |
14380 KB |
Output is correct |
64 |
Correct |
125 ms |
14388 KB |
Output is correct |
65 |
Correct |
26 ms |
11084 KB |
Output is correct |
66 |
Correct |
84 ms |
12520 KB |
Output is correct |
67 |
Correct |
115 ms |
12132 KB |
Output is correct |
68 |
Correct |
120 ms |
12884 KB |
Output is correct |
69 |
Correct |
136 ms |
13196 KB |
Output is correct |
70 |
Correct |
135 ms |
14364 KB |
Output is correct |
71 |
Correct |
133 ms |
13984 KB |
Output is correct |
72 |
Correct |
120 ms |
13316 KB |
Output is correct |
73 |
Correct |
137 ms |
13976 KB |
Output is correct |
74 |
Correct |
29 ms |
11076 KB |
Output is correct |
75 |
Correct |
26 ms |
11040 KB |
Output is correct |
76 |
Correct |
89 ms |
12472 KB |
Output is correct |
77 |
Correct |
95 ms |
12472 KB |
Output is correct |
78 |
Correct |
860 ms |
12476 KB |
Output is correct |
79 |
Correct |
1029 ms |
12724 KB |
Output is correct |
80 |
Correct |
849 ms |
12568 KB |
Output is correct |
81 |
Correct |
1075 ms |
13148 KB |
Output is correct |
82 |
Correct |
967 ms |
13076 KB |
Output is correct |
83 |
Correct |
959 ms |
12476 KB |
Output is correct |
84 |
Correct |
968 ms |
13640 KB |
Output is correct |
85 |
Correct |
632 ms |
11076 KB |
Output is correct |
86 |
Correct |
639 ms |
11144 KB |
Output is correct |
87 |
Correct |
976 ms |
12484 KB |
Output is correct |
88 |
Correct |
930 ms |
12560 KB |
Output is correct |
89 |
Correct |
899 ms |
11044 KB |
Output is correct |
90 |
Correct |
793 ms |
11116 KB |
Output is correct |
91 |
Correct |
0 ms |
208 KB |
Output is correct |
92 |
Correct |
1 ms |
464 KB |
Output is correct |
93 |
Correct |
1 ms |
464 KB |
Output is correct |
94 |
Correct |
103 ms |
12532 KB |
Output is correct |
95 |
Correct |
110 ms |
12660 KB |
Output is correct |
96 |
Correct |
97 ms |
12560 KB |
Output is correct |
97 |
Correct |
26 ms |
11080 KB |
Output is correct |
98 |
Correct |
76 ms |
12444 KB |
Output is correct |
99 |
Correct |
130 ms |
13572 KB |
Output is correct |
100 |
Correct |
134 ms |
14300 KB |
Output is correct |
101 |
Correct |
131 ms |
14396 KB |
Output is correct |
102 |
Correct |
24 ms |
11076 KB |
Output is correct |
103 |
Correct |
92 ms |
12528 KB |
Output is correct |
104 |
Correct |
2 ms |
464 KB |
Output is correct |
105 |
Correct |
2 ms |
592 KB |
Output is correct |
106 |
Correct |
2 ms |
592 KB |
Output is correct |
107 |
Correct |
1 ms |
464 KB |
Output is correct |
108 |
Correct |
1 ms |
592 KB |
Output is correct |
109 |
Correct |
2 ms |
592 KB |
Output is correct |
110 |
Correct |
2 ms |
592 KB |
Output is correct |
111 |
Correct |
2 ms |
592 KB |
Output is correct |
112 |
Correct |
1 ms |
464 KB |
Output is correct |
113 |
Correct |
2 ms |
464 KB |
Output is correct |
114 |
Correct |
250 ms |
3420 KB |
Output is correct |
115 |
Correct |
916 ms |
13036 KB |
Output is correct |
116 |
Correct |
744 ms |
13460 KB |
Output is correct |
117 |
Correct |
972 ms |
12768 KB |
Output is correct |
118 |
Correct |
1059 ms |
12872 KB |
Output is correct |
119 |
Correct |
1086 ms |
12480 KB |
Output is correct |
120 |
Correct |
1073 ms |
12744 KB |
Output is correct |
121 |
Correct |
863 ms |
11044 KB |
Output is correct |
122 |
Correct |
814 ms |
11040 KB |
Output is correct |
123 |
Correct |
874 ms |
12604 KB |
Output is correct |
124 |
Correct |
922 ms |
12720 KB |
Output is correct |
125 |
Correct |
122 ms |
13544 KB |
Output is correct |
126 |
Correct |
122 ms |
14340 KB |
Output is correct |
127 |
Correct |
134 ms |
14388 KB |
Output is correct |
128 |
Correct |
24 ms |
11072 KB |
Output is correct |
129 |
Correct |
83 ms |
12540 KB |
Output is correct |
130 |
Correct |
108 ms |
12200 KB |
Output is correct |
131 |
Correct |
132 ms |
12928 KB |
Output is correct |
132 |
Correct |
131 ms |
13152 KB |
Output is correct |
133 |
Correct |
128 ms |
14392 KB |
Output is correct |
134 |
Correct |
124 ms |
13936 KB |
Output is correct |
135 |
Correct |
130 ms |
13340 KB |
Output is correct |
136 |
Correct |
128 ms |
14044 KB |
Output is correct |
137 |
Correct |
33 ms |
11040 KB |
Output is correct |
138 |
Correct |
26 ms |
11204 KB |
Output is correct |
139 |
Correct |
88 ms |
12456 KB |
Output is correct |
140 |
Correct |
83 ms |
12472 KB |
Output is correct |
141 |
Correct |
2 ms |
592 KB |
Output is correct |
142 |
Correct |
2 ms |
592 KB |
Output is correct |
143 |
Correct |
2 ms |
592 KB |
Output is correct |
144 |
Correct |
1 ms |
464 KB |
Output is correct |
145 |
Correct |
2 ms |
492 KB |
Output is correct |
146 |
Correct |
2 ms |
336 KB |
Output is correct |
147 |
Correct |
2 ms |
464 KB |
Output is correct |
148 |
Correct |
2 ms |
592 KB |
Output is correct |
149 |
Correct |
2 ms |
592 KB |
Output is correct |
150 |
Correct |
2 ms |
464 KB |
Output is correct |
151 |
Correct |
2 ms |
464 KB |
Output is correct |
152 |
Correct |
2 ms |
592 KB |
Output is correct |
153 |
Correct |
1 ms |
464 KB |
Output is correct |
154 |
Correct |
1 ms |
464 KB |
Output is correct |
155 |
Correct |
2 ms |
464 KB |
Output is correct |
156 |
Correct |
1 ms |
464 KB |
Output is correct |
157 |
Correct |
836 ms |
24416 KB |
Output is correct |
158 |
Incorrect |
1152 ms |
27428 KB |
22302nd lines differ - on the 1st token, expected: '1', found: '0' |
159 |
Halted |
0 ms |
0 KB |
- |