#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
using pl = pair<ll, ll>;
#define F(i, l, r) for (ll i = (l); i < (r); ++i)
#define FD(i, l, r) for (ll i = (l); i > (r); --i)
#define K first
#define V second
template<typename T> struct SparseTable {
int n,log2=0;
function<T(T, T)> merge;
T id;
vector<vector<T>> a = {{}};
SparseTable(const vector<T>& v, function<T(T, T)> _merge, T _id): merge(_merge), id(_id) {
n = v.size();
while((1<<log2) <= n) {
++log2;
}
a.resize(log2);
a[0] = v;
for(int i=1,len=1;i<log2;++i,len*=2) {
a[i].resize(n + 1 - (1<<i));
for(size_t j=0;j<a[i].size();++j) {
a[i][j] = merge(a[i-1][j], a[i-1][j + len]);
}
}
}
SparseTable(){}
T query(int l, int r) { // [l,r)
if (r <= l) return id;
int len = __lg(r-l);
return merge(a[len][l], a[len][r- (1<<len)]);
}
};
SparseTable<ll> spmin;
const int MAXN = 100010, INF = 1000000010;
struct node{
vector<pl> vec;
vector<int> mn, mx;
node(){};
node(int value, int pos){
vec.emplace_back(value, pos);
mn.push_back(pos);
mx.push_back(pos);
}
node(node& a, node& b){
vec.resize(a.vec.size() + b.vec.size());
mn.resize(vec.size());
mx.resize(vec.size());
merge(a.vec.begin(), a.vec.end(), b.vec.begin(), b.vec.end(), vec.begin());
int mi=MAXN, ma=-1;
FD(i, ll(vec.size())-1, -1) {
mi=min(mi, vec[i].V);
ma=max(ma, vec[i].V);
mn[i]=mi, mx[i]=ma;
}
}
};
int n, arr[MAXN], ml[MAXN], mr[MAXN], res[MAXN];
node tr[2*MAXN];
pair<int, pl> query(int l, int r, int x){
int ret=0, mn=INF, mx=-1;
for(l+=n, r+=n; l<r; l>>=1, r>>=1){
if(l&1){
auto itr = lower_bound(tr[l].vec.begin(), tr[l].vec.end(), pair(x, -1));
int pos = (int)(itr - tr[l].vec.begin());
ret += (int)(tr[l].vec.end() - itr);
if(itr!=tr[l].vec.end()) mn=min(mn, tr[l].mn[pos]), mx=max(mx, tr[l].mx[pos]);
++l;
}
if(r&1){
--r;
auto itr = lower_bound(tr[r].vec.begin(), tr[r].vec.end(), pair(x, -1));
int pos = (int)(itr - tr[r].vec.begin());
ret += (int)(tr[r].vec.end() - itr);
if(itr!=tr[r].vec.end()) mn=min(mn, tr[r].mn[pos]), mx=max(mx, tr[r].mx[pos]);
}
}
return {ret, {mn, mx}};
}
void init(int N, vector<int> H) {
n=N;
F(i, 0, n) arr[i] = H[i];
spmin = SparseTable<ll>(H, [](ll a, ll b) {
return min(a, b);
}, INF);
F(i, 0, n) {
int x;
for(x=i-1; x!=-1 && H[x]<H[i]; x=ml[x]);
ml[i]=x;
}
FD(i, n-1, -1) {
int x;
for(x=i+1; x!=n && H[x]<H[i]; x=mr[x]);
mr[i]=x;
}
F(i, 0, n) {
int l = ml[i], r = mr[i];
int a = H[i] - spmin.query(l+1, i);
int b = H[i] - spmin.query(i+1, r);
res[i] = min(a, b);
}
F(i, 0, n) tr[n+i]=node(res[i], i);
FD(i, n-1, -1) tr[i]=node(tr[i<<1], tr[i<<1|1]);
}
int max_towers(int L, int R, int D) {
pair<int, pl> ans = query(L, R+1, D);
if(ans.K == 0) return 1;
int sa = (spmin.query(L, ans.V.K) > arr[ans.V.K] - D);
int sb = (spmin.query(ans.V.V+1, R+1) > arr[ans.V.V] - D);
return max(0, ans.K - sa - sb) + 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
342 ms |
44132 KB |
Output is correct |
2 |
Correct |
712 ms |
65536 KB |
Output is correct |
3 |
Correct |
691 ms |
65528 KB |
Output is correct |
4 |
Correct |
677 ms |
65544 KB |
Output is correct |
5 |
Correct |
689 ms |
65428 KB |
Output is correct |
6 |
Correct |
720 ms |
65540 KB |
Output is correct |
7 |
Correct |
732 ms |
65528 KB |
Output is correct |
8 |
Correct |
5 ms |
14936 KB |
Output is correct |
9 |
Correct |
6 ms |
15704 KB |
Output is correct |
10 |
Correct |
5 ms |
15704 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
14936 KB |
Output is correct |
2 |
Correct |
6 ms |
15704 KB |
Output is correct |
3 |
Correct |
5 ms |
15704 KB |
Output is correct |
4 |
Correct |
5 ms |
15704 KB |
Output is correct |
5 |
Correct |
5 ms |
15704 KB |
Output is correct |
6 |
Correct |
5 ms |
15704 KB |
Output is correct |
7 |
Correct |
5 ms |
15704 KB |
Output is correct |
8 |
Correct |
6 ms |
15704 KB |
Output is correct |
9 |
Correct |
5 ms |
15704 KB |
Output is correct |
10 |
Correct |
7 ms |
15704 KB |
Output is correct |
11 |
Correct |
5 ms |
15704 KB |
Output is correct |
12 |
Correct |
4 ms |
14936 KB |
Output is correct |
13 |
Correct |
5 ms |
15704 KB |
Output is correct |
14 |
Correct |
5 ms |
15704 KB |
Output is correct |
15 |
Correct |
5 ms |
15704 KB |
Output is correct |
16 |
Correct |
5 ms |
15956 KB |
Output is correct |
17 |
Correct |
5 ms |
15704 KB |
Output is correct |
18 |
Correct |
5 ms |
15728 KB |
Output is correct |
19 |
Correct |
5 ms |
15704 KB |
Output is correct |
20 |
Correct |
5 ms |
15704 KB |
Output is correct |
21 |
Correct |
5 ms |
15704 KB |
Output is correct |
22 |
Correct |
5 ms |
15704 KB |
Output is correct |
23 |
Correct |
6 ms |
15704 KB |
Output is correct |
24 |
Correct |
5 ms |
15704 KB |
Output is correct |
25 |
Correct |
5 ms |
15192 KB |
Output is correct |
26 |
Correct |
5 ms |
15704 KB |
Output is correct |
27 |
Correct |
5 ms |
15704 KB |
Output is correct |
28 |
Correct |
7 ms |
15708 KB |
Output is correct |
29 |
Correct |
5 ms |
15704 KB |
Output is correct |
30 |
Correct |
5 ms |
15704 KB |
Output is correct |
31 |
Correct |
5 ms |
15704 KB |
Output is correct |
32 |
Correct |
5 ms |
15704 KB |
Output is correct |
33 |
Correct |
5 ms |
15724 KB |
Output is correct |
34 |
Correct |
7 ms |
15956 KB |
Output is correct |
35 |
Correct |
5 ms |
15704 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
14936 KB |
Output is correct |
2 |
Correct |
6 ms |
15704 KB |
Output is correct |
3 |
Correct |
5 ms |
15704 KB |
Output is correct |
4 |
Correct |
5 ms |
15704 KB |
Output is correct |
5 |
Correct |
5 ms |
15704 KB |
Output is correct |
6 |
Correct |
5 ms |
15704 KB |
Output is correct |
7 |
Correct |
5 ms |
15704 KB |
Output is correct |
8 |
Correct |
6 ms |
15704 KB |
Output is correct |
9 |
Correct |
5 ms |
15704 KB |
Output is correct |
10 |
Correct |
7 ms |
15704 KB |
Output is correct |
11 |
Correct |
5 ms |
15704 KB |
Output is correct |
12 |
Correct |
4 ms |
14936 KB |
Output is correct |
13 |
Correct |
5 ms |
15704 KB |
Output is correct |
14 |
Correct |
5 ms |
15704 KB |
Output is correct |
15 |
Correct |
5 ms |
15704 KB |
Output is correct |
16 |
Correct |
5 ms |
15956 KB |
Output is correct |
17 |
Correct |
5 ms |
15704 KB |
Output is correct |
18 |
Correct |
5 ms |
15728 KB |
Output is correct |
19 |
Correct |
5 ms |
15704 KB |
Output is correct |
20 |
Correct |
5 ms |
15704 KB |
Output is correct |
21 |
Correct |
5 ms |
15704 KB |
Output is correct |
22 |
Correct |
5 ms |
15704 KB |
Output is correct |
23 |
Correct |
6 ms |
15704 KB |
Output is correct |
24 |
Correct |
5 ms |
15704 KB |
Output is correct |
25 |
Correct |
5 ms |
15192 KB |
Output is correct |
26 |
Correct |
5 ms |
15704 KB |
Output is correct |
27 |
Correct |
5 ms |
15704 KB |
Output is correct |
28 |
Correct |
7 ms |
15708 KB |
Output is correct |
29 |
Correct |
5 ms |
15704 KB |
Output is correct |
30 |
Correct |
5 ms |
15704 KB |
Output is correct |
31 |
Correct |
5 ms |
15704 KB |
Output is correct |
32 |
Correct |
5 ms |
15704 KB |
Output is correct |
33 |
Correct |
5 ms |
15724 KB |
Output is correct |
34 |
Correct |
7 ms |
15956 KB |
Output is correct |
35 |
Correct |
5 ms |
15704 KB |
Output is correct |
36 |
Correct |
56 ms |
46876 KB |
Output is correct |
37 |
Correct |
80 ms |
65524 KB |
Output is correct |
38 |
Correct |
78 ms |
65616 KB |
Output is correct |
39 |
Correct |
76 ms |
65524 KB |
Output is correct |
40 |
Correct |
78 ms |
65536 KB |
Output is correct |
41 |
Correct |
80 ms |
65532 KB |
Output is correct |
42 |
Correct |
76 ms |
65528 KB |
Output is correct |
43 |
Correct |
71 ms |
65540 KB |
Output is correct |
44 |
Correct |
70 ms |
65464 KB |
Output is correct |
45 |
Correct |
73 ms |
65544 KB |
Output is correct |
46 |
Correct |
69 ms |
65548 KB |
Output is correct |
47 |
Correct |
80 ms |
65428 KB |
Output is correct |
48 |
Correct |
75 ms |
65620 KB |
Output is correct |
49 |
Correct |
76 ms |
65600 KB |
Output is correct |
50 |
Correct |
71 ms |
65528 KB |
Output is correct |
51 |
Correct |
73 ms |
65532 KB |
Output is correct |
52 |
Correct |
79 ms |
65540 KB |
Output is correct |
53 |
Correct |
76 ms |
65576 KB |
Output is correct |
54 |
Correct |
76 ms |
65576 KB |
Output is correct |
55 |
Correct |
70 ms |
65524 KB |
Output is correct |
56 |
Correct |
68 ms |
65572 KB |
Output is correct |
57 |
Correct |
75 ms |
63724 KB |
Output is correct |
58 |
Correct |
77 ms |
65524 KB |
Output is correct |
59 |
Correct |
81 ms |
65620 KB |
Output is correct |
60 |
Correct |
78 ms |
65636 KB |
Output is correct |
61 |
Correct |
77 ms |
65540 KB |
Output is correct |
62 |
Correct |
79 ms |
65540 KB |
Output is correct |
63 |
Correct |
79 ms |
65528 KB |
Output is correct |
64 |
Correct |
69 ms |
65524 KB |
Output is correct |
65 |
Correct |
74 ms |
65712 KB |
Output is correct |
66 |
Correct |
72 ms |
65660 KB |
Output is correct |
67 |
Correct |
70 ms |
65540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
591 ms |
65024 KB |
Output is correct |
2 |
Correct |
745 ms |
65780 KB |
Output is correct |
3 |
Correct |
774 ms |
65452 KB |
Output is correct |
4 |
Correct |
703 ms |
65544 KB |
Output is correct |
5 |
Correct |
691 ms |
65540 KB |
Output is correct |
6 |
Correct |
772 ms |
65540 KB |
Output is correct |
7 |
Correct |
796 ms |
65536 KB |
Output is correct |
8 |
Correct |
698 ms |
65624 KB |
Output is correct |
9 |
Correct |
748 ms |
65584 KB |
Output is correct |
10 |
Correct |
730 ms |
65528 KB |
Output is correct |
11 |
Correct |
715 ms |
65524 KB |
Output is correct |
12 |
Correct |
730 ms |
65548 KB |
Output is correct |
13 |
Correct |
716 ms |
65412 KB |
Output is correct |
14 |
Correct |
4 ms |
14936 KB |
Output is correct |
15 |
Correct |
5 ms |
15704 KB |
Output is correct |
16 |
Correct |
5 ms |
15956 KB |
Output is correct |
17 |
Correct |
81 ms |
65536 KB |
Output is correct |
18 |
Correct |
77 ms |
65532 KB |
Output is correct |
19 |
Correct |
76 ms |
65536 KB |
Output is correct |
20 |
Correct |
68 ms |
65540 KB |
Output is correct |
21 |
Correct |
71 ms |
65616 KB |
Output is correct |
22 |
Correct |
79 ms |
65540 KB |
Output is correct |
23 |
Correct |
76 ms |
65452 KB |
Output is correct |
24 |
Correct |
75 ms |
65680 KB |
Output is correct |
25 |
Correct |
71 ms |
65628 KB |
Output is correct |
26 |
Correct |
70 ms |
65660 KB |
Output is correct |
27 |
Correct |
5 ms |
15704 KB |
Output is correct |
28 |
Correct |
5 ms |
15704 KB |
Output is correct |
29 |
Correct |
5 ms |
15984 KB |
Output is correct |
30 |
Correct |
5 ms |
15704 KB |
Output is correct |
31 |
Correct |
5 ms |
15704 KB |
Output is correct |
32 |
Correct |
5 ms |
15704 KB |
Output is correct |
33 |
Correct |
5 ms |
15904 KB |
Output is correct |
34 |
Correct |
5 ms |
15704 KB |
Output is correct |
35 |
Correct |
6 ms |
15700 KB |
Output is correct |
36 |
Correct |
5 ms |
15704 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
220 ms |
26072 KB |
Output is correct |
2 |
Correct |
687 ms |
65544 KB |
Output is correct |
3 |
Correct |
682 ms |
65528 KB |
Output is correct |
4 |
Correct |
664 ms |
65616 KB |
Output is correct |
5 |
Correct |
682 ms |
65540 KB |
Output is correct |
6 |
Correct |
671 ms |
65528 KB |
Output is correct |
7 |
Correct |
666 ms |
65544 KB |
Output is correct |
8 |
Correct |
609 ms |
65608 KB |
Output is correct |
9 |
Correct |
632 ms |
65544 KB |
Output is correct |
10 |
Correct |
644 ms |
65540 KB |
Output is correct |
11 |
Correct |
622 ms |
65536 KB |
Output is correct |
12 |
Correct |
80 ms |
65544 KB |
Output is correct |
13 |
Correct |
75 ms |
65540 KB |
Output is correct |
14 |
Correct |
75 ms |
65528 KB |
Output is correct |
15 |
Correct |
68 ms |
65528 KB |
Output is correct |
16 |
Correct |
68 ms |
65528 KB |
Output is correct |
17 |
Correct |
74 ms |
63744 KB |
Output is correct |
18 |
Correct |
80 ms |
65456 KB |
Output is correct |
19 |
Correct |
78 ms |
65504 KB |
Output is correct |
20 |
Correct |
76 ms |
65524 KB |
Output is correct |
21 |
Correct |
78 ms |
65520 KB |
Output is correct |
22 |
Correct |
75 ms |
65424 KB |
Output is correct |
23 |
Correct |
75 ms |
65540 KB |
Output is correct |
24 |
Correct |
73 ms |
65856 KB |
Output is correct |
25 |
Correct |
69 ms |
65520 KB |
Output is correct |
26 |
Correct |
70 ms |
65524 KB |
Output is correct |
27 |
Correct |
77 ms |
65528 KB |
Output is correct |
28 |
Correct |
5 ms |
15960 KB |
Output is correct |
29 |
Correct |
5 ms |
15708 KB |
Output is correct |
30 |
Correct |
5 ms |
15704 KB |
Output is correct |
31 |
Correct |
5 ms |
15756 KB |
Output is correct |
32 |
Correct |
5 ms |
15704 KB |
Output is correct |
33 |
Correct |
4 ms |
15192 KB |
Output is correct |
34 |
Correct |
5 ms |
15704 KB |
Output is correct |
35 |
Correct |
6 ms |
15704 KB |
Output is correct |
36 |
Correct |
5 ms |
15704 KB |
Output is correct |
37 |
Correct |
5 ms |
15704 KB |
Output is correct |
38 |
Correct |
5 ms |
15704 KB |
Output is correct |
39 |
Correct |
5 ms |
15704 KB |
Output is correct |
40 |
Correct |
5 ms |
15704 KB |
Output is correct |
41 |
Correct |
5 ms |
15704 KB |
Output is correct |
42 |
Correct |
5 ms |
15704 KB |
Output is correct |
43 |
Correct |
5 ms |
15704 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
14936 KB |
Output is correct |
2 |
Correct |
6 ms |
15704 KB |
Output is correct |
3 |
Correct |
5 ms |
15704 KB |
Output is correct |
4 |
Correct |
5 ms |
15704 KB |
Output is correct |
5 |
Correct |
5 ms |
15704 KB |
Output is correct |
6 |
Correct |
5 ms |
15704 KB |
Output is correct |
7 |
Correct |
5 ms |
15704 KB |
Output is correct |
8 |
Correct |
6 ms |
15704 KB |
Output is correct |
9 |
Correct |
5 ms |
15704 KB |
Output is correct |
10 |
Correct |
7 ms |
15704 KB |
Output is correct |
11 |
Correct |
5 ms |
15704 KB |
Output is correct |
12 |
Correct |
4 ms |
14936 KB |
Output is correct |
13 |
Correct |
5 ms |
15704 KB |
Output is correct |
14 |
Correct |
5 ms |
15704 KB |
Output is correct |
15 |
Correct |
5 ms |
15704 KB |
Output is correct |
16 |
Correct |
5 ms |
15956 KB |
Output is correct |
17 |
Correct |
5 ms |
15704 KB |
Output is correct |
18 |
Correct |
5 ms |
15728 KB |
Output is correct |
19 |
Correct |
5 ms |
15704 KB |
Output is correct |
20 |
Correct |
5 ms |
15704 KB |
Output is correct |
21 |
Correct |
5 ms |
15704 KB |
Output is correct |
22 |
Correct |
5 ms |
15704 KB |
Output is correct |
23 |
Correct |
6 ms |
15704 KB |
Output is correct |
24 |
Correct |
5 ms |
15704 KB |
Output is correct |
25 |
Correct |
5 ms |
15192 KB |
Output is correct |
26 |
Correct |
5 ms |
15704 KB |
Output is correct |
27 |
Correct |
5 ms |
15704 KB |
Output is correct |
28 |
Correct |
7 ms |
15708 KB |
Output is correct |
29 |
Correct |
5 ms |
15704 KB |
Output is correct |
30 |
Correct |
5 ms |
15704 KB |
Output is correct |
31 |
Correct |
5 ms |
15704 KB |
Output is correct |
32 |
Correct |
5 ms |
15704 KB |
Output is correct |
33 |
Correct |
5 ms |
15724 KB |
Output is correct |
34 |
Correct |
7 ms |
15956 KB |
Output is correct |
35 |
Correct |
5 ms |
15704 KB |
Output is correct |
36 |
Correct |
56 ms |
46876 KB |
Output is correct |
37 |
Correct |
80 ms |
65524 KB |
Output is correct |
38 |
Correct |
78 ms |
65616 KB |
Output is correct |
39 |
Correct |
76 ms |
65524 KB |
Output is correct |
40 |
Correct |
78 ms |
65536 KB |
Output is correct |
41 |
Correct |
80 ms |
65532 KB |
Output is correct |
42 |
Correct |
76 ms |
65528 KB |
Output is correct |
43 |
Correct |
71 ms |
65540 KB |
Output is correct |
44 |
Correct |
70 ms |
65464 KB |
Output is correct |
45 |
Correct |
73 ms |
65544 KB |
Output is correct |
46 |
Correct |
69 ms |
65548 KB |
Output is correct |
47 |
Correct |
80 ms |
65428 KB |
Output is correct |
48 |
Correct |
75 ms |
65620 KB |
Output is correct |
49 |
Correct |
76 ms |
65600 KB |
Output is correct |
50 |
Correct |
71 ms |
65528 KB |
Output is correct |
51 |
Correct |
73 ms |
65532 KB |
Output is correct |
52 |
Correct |
79 ms |
65540 KB |
Output is correct |
53 |
Correct |
76 ms |
65576 KB |
Output is correct |
54 |
Correct |
76 ms |
65576 KB |
Output is correct |
55 |
Correct |
70 ms |
65524 KB |
Output is correct |
56 |
Correct |
68 ms |
65572 KB |
Output is correct |
57 |
Correct |
75 ms |
63724 KB |
Output is correct |
58 |
Correct |
77 ms |
65524 KB |
Output is correct |
59 |
Correct |
81 ms |
65620 KB |
Output is correct |
60 |
Correct |
78 ms |
65636 KB |
Output is correct |
61 |
Correct |
77 ms |
65540 KB |
Output is correct |
62 |
Correct |
79 ms |
65540 KB |
Output is correct |
63 |
Correct |
79 ms |
65528 KB |
Output is correct |
64 |
Correct |
69 ms |
65524 KB |
Output is correct |
65 |
Correct |
74 ms |
65712 KB |
Output is correct |
66 |
Correct |
72 ms |
65660 KB |
Output is correct |
67 |
Correct |
70 ms |
65540 KB |
Output is correct |
68 |
Correct |
591 ms |
65024 KB |
Output is correct |
69 |
Correct |
745 ms |
65780 KB |
Output is correct |
70 |
Correct |
774 ms |
65452 KB |
Output is correct |
71 |
Correct |
703 ms |
65544 KB |
Output is correct |
72 |
Correct |
691 ms |
65540 KB |
Output is correct |
73 |
Correct |
772 ms |
65540 KB |
Output is correct |
74 |
Correct |
796 ms |
65536 KB |
Output is correct |
75 |
Correct |
698 ms |
65624 KB |
Output is correct |
76 |
Correct |
748 ms |
65584 KB |
Output is correct |
77 |
Correct |
730 ms |
65528 KB |
Output is correct |
78 |
Correct |
715 ms |
65524 KB |
Output is correct |
79 |
Correct |
730 ms |
65548 KB |
Output is correct |
80 |
Correct |
716 ms |
65412 KB |
Output is correct |
81 |
Correct |
4 ms |
14936 KB |
Output is correct |
82 |
Correct |
5 ms |
15704 KB |
Output is correct |
83 |
Correct |
5 ms |
15956 KB |
Output is correct |
84 |
Correct |
81 ms |
65536 KB |
Output is correct |
85 |
Correct |
77 ms |
65532 KB |
Output is correct |
86 |
Correct |
76 ms |
65536 KB |
Output is correct |
87 |
Correct |
68 ms |
65540 KB |
Output is correct |
88 |
Correct |
71 ms |
65616 KB |
Output is correct |
89 |
Correct |
79 ms |
65540 KB |
Output is correct |
90 |
Correct |
76 ms |
65452 KB |
Output is correct |
91 |
Correct |
75 ms |
65680 KB |
Output is correct |
92 |
Correct |
71 ms |
65628 KB |
Output is correct |
93 |
Correct |
70 ms |
65660 KB |
Output is correct |
94 |
Correct |
5 ms |
15704 KB |
Output is correct |
95 |
Correct |
5 ms |
15704 KB |
Output is correct |
96 |
Correct |
5 ms |
15984 KB |
Output is correct |
97 |
Correct |
5 ms |
15704 KB |
Output is correct |
98 |
Correct |
5 ms |
15704 KB |
Output is correct |
99 |
Correct |
5 ms |
15704 KB |
Output is correct |
100 |
Correct |
5 ms |
15904 KB |
Output is correct |
101 |
Correct |
5 ms |
15704 KB |
Output is correct |
102 |
Correct |
6 ms |
15700 KB |
Output is correct |
103 |
Correct |
5 ms |
15704 KB |
Output is correct |
104 |
Correct |
721 ms |
59580 KB |
Output is correct |
105 |
Correct |
717 ms |
65532 KB |
Output is correct |
106 |
Correct |
771 ms |
65524 KB |
Output is correct |
107 |
Correct |
759 ms |
65544 KB |
Output is correct |
108 |
Correct |
779 ms |
65580 KB |
Output is correct |
109 |
Correct |
803 ms |
65524 KB |
Output is correct |
110 |
Correct |
700 ms |
65628 KB |
Output is correct |
111 |
Correct |
770 ms |
65540 KB |
Output is correct |
112 |
Correct |
758 ms |
65648 KB |
Output is correct |
113 |
Correct |
756 ms |
65524 KB |
Output is correct |
114 |
Correct |
708 ms |
65792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
342 ms |
44132 KB |
Output is correct |
2 |
Correct |
712 ms |
65536 KB |
Output is correct |
3 |
Correct |
691 ms |
65528 KB |
Output is correct |
4 |
Correct |
677 ms |
65544 KB |
Output is correct |
5 |
Correct |
689 ms |
65428 KB |
Output is correct |
6 |
Correct |
720 ms |
65540 KB |
Output is correct |
7 |
Correct |
732 ms |
65528 KB |
Output is correct |
8 |
Correct |
5 ms |
14936 KB |
Output is correct |
9 |
Correct |
6 ms |
15704 KB |
Output is correct |
10 |
Correct |
5 ms |
15704 KB |
Output is correct |
11 |
Correct |
4 ms |
14936 KB |
Output is correct |
12 |
Correct |
6 ms |
15704 KB |
Output is correct |
13 |
Correct |
5 ms |
15704 KB |
Output is correct |
14 |
Correct |
5 ms |
15704 KB |
Output is correct |
15 |
Correct |
5 ms |
15704 KB |
Output is correct |
16 |
Correct |
5 ms |
15704 KB |
Output is correct |
17 |
Correct |
5 ms |
15704 KB |
Output is correct |
18 |
Correct |
6 ms |
15704 KB |
Output is correct |
19 |
Correct |
5 ms |
15704 KB |
Output is correct |
20 |
Correct |
7 ms |
15704 KB |
Output is correct |
21 |
Correct |
5 ms |
15704 KB |
Output is correct |
22 |
Correct |
4 ms |
14936 KB |
Output is correct |
23 |
Correct |
5 ms |
15704 KB |
Output is correct |
24 |
Correct |
5 ms |
15704 KB |
Output is correct |
25 |
Correct |
5 ms |
15704 KB |
Output is correct |
26 |
Correct |
5 ms |
15956 KB |
Output is correct |
27 |
Correct |
5 ms |
15704 KB |
Output is correct |
28 |
Correct |
5 ms |
15728 KB |
Output is correct |
29 |
Correct |
5 ms |
15704 KB |
Output is correct |
30 |
Correct |
5 ms |
15704 KB |
Output is correct |
31 |
Correct |
5 ms |
15704 KB |
Output is correct |
32 |
Correct |
5 ms |
15704 KB |
Output is correct |
33 |
Correct |
6 ms |
15704 KB |
Output is correct |
34 |
Correct |
5 ms |
15704 KB |
Output is correct |
35 |
Correct |
5 ms |
15192 KB |
Output is correct |
36 |
Correct |
5 ms |
15704 KB |
Output is correct |
37 |
Correct |
5 ms |
15704 KB |
Output is correct |
38 |
Correct |
7 ms |
15708 KB |
Output is correct |
39 |
Correct |
5 ms |
15704 KB |
Output is correct |
40 |
Correct |
5 ms |
15704 KB |
Output is correct |
41 |
Correct |
5 ms |
15704 KB |
Output is correct |
42 |
Correct |
5 ms |
15704 KB |
Output is correct |
43 |
Correct |
5 ms |
15724 KB |
Output is correct |
44 |
Correct |
7 ms |
15956 KB |
Output is correct |
45 |
Correct |
5 ms |
15704 KB |
Output is correct |
46 |
Correct |
56 ms |
46876 KB |
Output is correct |
47 |
Correct |
80 ms |
65524 KB |
Output is correct |
48 |
Correct |
78 ms |
65616 KB |
Output is correct |
49 |
Correct |
76 ms |
65524 KB |
Output is correct |
50 |
Correct |
78 ms |
65536 KB |
Output is correct |
51 |
Correct |
80 ms |
65532 KB |
Output is correct |
52 |
Correct |
76 ms |
65528 KB |
Output is correct |
53 |
Correct |
71 ms |
65540 KB |
Output is correct |
54 |
Correct |
70 ms |
65464 KB |
Output is correct |
55 |
Correct |
73 ms |
65544 KB |
Output is correct |
56 |
Correct |
69 ms |
65548 KB |
Output is correct |
57 |
Correct |
80 ms |
65428 KB |
Output is correct |
58 |
Correct |
75 ms |
65620 KB |
Output is correct |
59 |
Correct |
76 ms |
65600 KB |
Output is correct |
60 |
Correct |
71 ms |
65528 KB |
Output is correct |
61 |
Correct |
73 ms |
65532 KB |
Output is correct |
62 |
Correct |
79 ms |
65540 KB |
Output is correct |
63 |
Correct |
76 ms |
65576 KB |
Output is correct |
64 |
Correct |
76 ms |
65576 KB |
Output is correct |
65 |
Correct |
70 ms |
65524 KB |
Output is correct |
66 |
Correct |
68 ms |
65572 KB |
Output is correct |
67 |
Correct |
75 ms |
63724 KB |
Output is correct |
68 |
Correct |
77 ms |
65524 KB |
Output is correct |
69 |
Correct |
81 ms |
65620 KB |
Output is correct |
70 |
Correct |
78 ms |
65636 KB |
Output is correct |
71 |
Correct |
77 ms |
65540 KB |
Output is correct |
72 |
Correct |
79 ms |
65540 KB |
Output is correct |
73 |
Correct |
79 ms |
65528 KB |
Output is correct |
74 |
Correct |
69 ms |
65524 KB |
Output is correct |
75 |
Correct |
74 ms |
65712 KB |
Output is correct |
76 |
Correct |
72 ms |
65660 KB |
Output is correct |
77 |
Correct |
70 ms |
65540 KB |
Output is correct |
78 |
Correct |
591 ms |
65024 KB |
Output is correct |
79 |
Correct |
745 ms |
65780 KB |
Output is correct |
80 |
Correct |
774 ms |
65452 KB |
Output is correct |
81 |
Correct |
703 ms |
65544 KB |
Output is correct |
82 |
Correct |
691 ms |
65540 KB |
Output is correct |
83 |
Correct |
772 ms |
65540 KB |
Output is correct |
84 |
Correct |
796 ms |
65536 KB |
Output is correct |
85 |
Correct |
698 ms |
65624 KB |
Output is correct |
86 |
Correct |
748 ms |
65584 KB |
Output is correct |
87 |
Correct |
730 ms |
65528 KB |
Output is correct |
88 |
Correct |
715 ms |
65524 KB |
Output is correct |
89 |
Correct |
730 ms |
65548 KB |
Output is correct |
90 |
Correct |
716 ms |
65412 KB |
Output is correct |
91 |
Correct |
4 ms |
14936 KB |
Output is correct |
92 |
Correct |
5 ms |
15704 KB |
Output is correct |
93 |
Correct |
5 ms |
15956 KB |
Output is correct |
94 |
Correct |
81 ms |
65536 KB |
Output is correct |
95 |
Correct |
77 ms |
65532 KB |
Output is correct |
96 |
Correct |
76 ms |
65536 KB |
Output is correct |
97 |
Correct |
68 ms |
65540 KB |
Output is correct |
98 |
Correct |
71 ms |
65616 KB |
Output is correct |
99 |
Correct |
79 ms |
65540 KB |
Output is correct |
100 |
Correct |
76 ms |
65452 KB |
Output is correct |
101 |
Correct |
75 ms |
65680 KB |
Output is correct |
102 |
Correct |
71 ms |
65628 KB |
Output is correct |
103 |
Correct |
70 ms |
65660 KB |
Output is correct |
104 |
Correct |
5 ms |
15704 KB |
Output is correct |
105 |
Correct |
5 ms |
15704 KB |
Output is correct |
106 |
Correct |
5 ms |
15984 KB |
Output is correct |
107 |
Correct |
5 ms |
15704 KB |
Output is correct |
108 |
Correct |
5 ms |
15704 KB |
Output is correct |
109 |
Correct |
5 ms |
15704 KB |
Output is correct |
110 |
Correct |
5 ms |
15904 KB |
Output is correct |
111 |
Correct |
5 ms |
15704 KB |
Output is correct |
112 |
Correct |
6 ms |
15700 KB |
Output is correct |
113 |
Correct |
5 ms |
15704 KB |
Output is correct |
114 |
Correct |
220 ms |
26072 KB |
Output is correct |
115 |
Correct |
687 ms |
65544 KB |
Output is correct |
116 |
Correct |
682 ms |
65528 KB |
Output is correct |
117 |
Correct |
664 ms |
65616 KB |
Output is correct |
118 |
Correct |
682 ms |
65540 KB |
Output is correct |
119 |
Correct |
671 ms |
65528 KB |
Output is correct |
120 |
Correct |
666 ms |
65544 KB |
Output is correct |
121 |
Correct |
609 ms |
65608 KB |
Output is correct |
122 |
Correct |
632 ms |
65544 KB |
Output is correct |
123 |
Correct |
644 ms |
65540 KB |
Output is correct |
124 |
Correct |
622 ms |
65536 KB |
Output is correct |
125 |
Correct |
80 ms |
65544 KB |
Output is correct |
126 |
Correct |
75 ms |
65540 KB |
Output is correct |
127 |
Correct |
75 ms |
65528 KB |
Output is correct |
128 |
Correct |
68 ms |
65528 KB |
Output is correct |
129 |
Correct |
68 ms |
65528 KB |
Output is correct |
130 |
Correct |
74 ms |
63744 KB |
Output is correct |
131 |
Correct |
80 ms |
65456 KB |
Output is correct |
132 |
Correct |
78 ms |
65504 KB |
Output is correct |
133 |
Correct |
76 ms |
65524 KB |
Output is correct |
134 |
Correct |
78 ms |
65520 KB |
Output is correct |
135 |
Correct |
75 ms |
65424 KB |
Output is correct |
136 |
Correct |
75 ms |
65540 KB |
Output is correct |
137 |
Correct |
73 ms |
65856 KB |
Output is correct |
138 |
Correct |
69 ms |
65520 KB |
Output is correct |
139 |
Correct |
70 ms |
65524 KB |
Output is correct |
140 |
Correct |
77 ms |
65528 KB |
Output is correct |
141 |
Correct |
5 ms |
15960 KB |
Output is correct |
142 |
Correct |
5 ms |
15708 KB |
Output is correct |
143 |
Correct |
5 ms |
15704 KB |
Output is correct |
144 |
Correct |
5 ms |
15756 KB |
Output is correct |
145 |
Correct |
5 ms |
15704 KB |
Output is correct |
146 |
Correct |
4 ms |
15192 KB |
Output is correct |
147 |
Correct |
5 ms |
15704 KB |
Output is correct |
148 |
Correct |
6 ms |
15704 KB |
Output is correct |
149 |
Correct |
5 ms |
15704 KB |
Output is correct |
150 |
Correct |
5 ms |
15704 KB |
Output is correct |
151 |
Correct |
5 ms |
15704 KB |
Output is correct |
152 |
Correct |
5 ms |
15704 KB |
Output is correct |
153 |
Correct |
5 ms |
15704 KB |
Output is correct |
154 |
Correct |
5 ms |
15704 KB |
Output is correct |
155 |
Correct |
5 ms |
15704 KB |
Output is correct |
156 |
Correct |
5 ms |
15704 KB |
Output is correct |
157 |
Correct |
721 ms |
59580 KB |
Output is correct |
158 |
Correct |
717 ms |
65532 KB |
Output is correct |
159 |
Correct |
771 ms |
65524 KB |
Output is correct |
160 |
Correct |
759 ms |
65544 KB |
Output is correct |
161 |
Correct |
779 ms |
65580 KB |
Output is correct |
162 |
Correct |
803 ms |
65524 KB |
Output is correct |
163 |
Correct |
700 ms |
65628 KB |
Output is correct |
164 |
Correct |
770 ms |
65540 KB |
Output is correct |
165 |
Correct |
758 ms |
65648 KB |
Output is correct |
166 |
Correct |
756 ms |
65524 KB |
Output is correct |
167 |
Correct |
708 ms |
65792 KB |
Output is correct |
168 |
Correct |
3 ms |
14936 KB |
Output is correct |
169 |
Correct |
514 ms |
31320 KB |
Output is correct |
170 |
Correct |
876 ms |
65548 KB |
Output is correct |
171 |
Correct |
873 ms |
65648 KB |
Output is correct |
172 |
Correct |
867 ms |
65668 KB |
Output is correct |
173 |
Correct |
823 ms |
65644 KB |
Output is correct |
174 |
Correct |
832 ms |
65480 KB |
Output is correct |
175 |
Correct |
892 ms |
65632 KB |
Output is correct |
176 |
Correct |
745 ms |
65496 KB |
Output is correct |
177 |
Correct |
724 ms |
65524 KB |
Output is correct |
178 |
Correct |
733 ms |
65524 KB |
Output is correct |
179 |
Correct |
689 ms |
65536 KB |
Output is correct |