#include <bits/stdc++.h>
#include "towers.h"
using namespace std;
const int N = 1e5 + 10 , inf = 1e9 , Lg = 17;
int n , a[N] , rmxq[N][Lg] , rmnq[N][Lg] , lg2[N] , nexL[N] , nexR[N];
int b[N] , psum[N];
vector <int> all;
int mn_pos(int aa , int bb)
{
if(a[aa] < a[bb])
return aa;
return bb;
}
int mx_pos(int aa , int bb)
{
if(a[aa] > a[bb])
return aa;
return bb;
}
int Get_mx(int l , int r)
{
r++;
int sz = (r - l); sz = lg2[sz];
return mx_pos(rmxq[l][sz] , rmxq[r - (1 << sz)][sz]);
}
int Get_mn(int l , int r)
{
r++;
int sz = (r - l); sz = lg2[sz];
return mn_pos(rmnq[l][sz] , rmnq[r - (1 << sz)][sz]);
}
void Build()
{
lg2[1] = 0;
for(int i = 2 ; i < N ; i++)
lg2[i] = lg2[i / 2] + 1;
for(int i = 0 ; i < n ; i++)
rmnq[i][0] = rmxq[i][0] = i;
for(int j = 1 ; j < Lg ; j++)
{
int len = (1 << j);
for(int i = 0 ; i + len <= n ; i++)
{
rmnq[i][j] = mn_pos(rmnq[i][j - 1] , rmnq[i + len / 2][j - 1]);
rmxq[i][j] = mx_pos(rmxq[i][j - 1] , rmxq[i + len / 2][j - 1]);
}
}
for(int i = 1 ; i + 1 < n ; i++) if(a[i] > a[i - 1] && a[i] > a[i + 1])
b[i] = 1;
for(int i = 1 ; i < n ; i++)
psum[i] = psum[i - 1] + b[i];
vector <int> st;
for(int i = 0 ; i < n ; i++)
{
nexL[i] = -1;
nexR[i] = n;
while(!st.empty())
{
if(a[st.back()] < a[i])
{
nexR[st.back()] = i;
st.pop_back();
}
else
{
nexL[i] = st.back();
break;
}
}
st.push_back(i);
}
for(int i = 0 ; i < n ; i++) if(i - nexL[i] > 1 && nexR[i] - i > 1)
{
int lc = Get_mn(nexL[i] + 1 , i - 1) , rc = Get_mn(i + 1 , nexR[i] - 1);
all.push_back(a[i] - max(a[lc] , a[rc]));
}
sort(all.begin() , all.end());
}
void init(int nn , vector <int> vec)
{
n = nn;
for(int i = 0 ; i < n ; i++)
a[i] = vec[i];
Build();
}
int Solve(int l , int r , int d)
{
if(l > r)
return 0;
int pos_mx = Get_mx(l , r);
int res = Solve(l , pos_mx - 1 , d) + Solve(pos_mx + 1 , r , d);
if(pos_mx != l && pos_mx != r)
{
int lc = Get_mn(l , pos_mx - 1) , rc = Get_mn(pos_mx + 1 , r);
if(a[pos_mx] - a[lc] >= d && a[pos_mx] - a[rc] >= d)
res++;
}
return res;
}
int max_towers(int l , int r , int d)
{
if(d == 1)
{
if(l + 1 >= r)
return 1;
return 1 + psum[r - 1] - psum[l];
}
if(psum[r - 1] - psum[l] == 0)
return 1;
if(psum[r - 1] - psum[l] == 1)
{
int id = Get_mx(l , r);
int lc = Get_mn(l , id - 1) , rc = Get_mn(id + 1 , r);
if(a[id] - d >= a[lc] && a[id] - d >= a[rc])
return 2;
return 1;
}
if(l == 0 && r == n - 1)
{
int id = lower_bound(all.begin() , all.end() , d) - all.begin();
return all.size() - id + 1;
}
return 1 + Solve(l , r , d);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
258 ms |
13656 KB |
Output is correct |
2 |
Correct |
525 ms |
16728 KB |
Output is correct |
3 |
Correct |
538 ms |
16728 KB |
Output is correct |
4 |
Correct |
505 ms |
16728 KB |
Output is correct |
5 |
Correct |
501 ms |
17364 KB |
Output is correct |
6 |
Correct |
502 ms |
16728 KB |
Output is correct |
7 |
Correct |
519 ms |
17364 KB |
Output is correct |
8 |
Correct |
1 ms |
4440 KB |
Output is correct |
9 |
Correct |
1 ms |
4440 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4440 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
4440 KB |
Output is correct |
4 |
Correct |
1 ms |
4440 KB |
Output is correct |
5 |
Correct |
1 ms |
4440 KB |
Output is correct |
6 |
Correct |
1 ms |
4440 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4440 KB |
Output is correct |
9 |
Correct |
1 ms |
4440 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
1 ms |
4440 KB |
Output is correct |
12 |
Correct |
1 ms |
4440 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4524 KB |
Output is correct |
15 |
Correct |
1 ms |
4440 KB |
Output is correct |
16 |
Correct |
1 ms |
4440 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4440 KB |
Output is correct |
20 |
Correct |
1 ms |
4440 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
4440 KB |
Output is correct |
23 |
Correct |
1 ms |
4440 KB |
Output is correct |
24 |
Correct |
1 ms |
4440 KB |
Output is correct |
25 |
Correct |
0 ms |
4440 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
1 ms |
4440 KB |
Output is correct |
28 |
Correct |
1 ms |
4440 KB |
Output is correct |
29 |
Correct |
1 ms |
4440 KB |
Output is correct |
30 |
Correct |
1 ms |
4440 KB |
Output is correct |
31 |
Correct |
1 ms |
4572 KB |
Output is correct |
32 |
Correct |
1 ms |
4440 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4440 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
4440 KB |
Output is correct |
4 |
Correct |
1 ms |
4440 KB |
Output is correct |
5 |
Correct |
1 ms |
4440 KB |
Output is correct |
6 |
Correct |
1 ms |
4440 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4440 KB |
Output is correct |
9 |
Correct |
1 ms |
4440 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
1 ms |
4440 KB |
Output is correct |
12 |
Correct |
1 ms |
4440 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4524 KB |
Output is correct |
15 |
Correct |
1 ms |
4440 KB |
Output is correct |
16 |
Correct |
1 ms |
4440 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4440 KB |
Output is correct |
20 |
Correct |
1 ms |
4440 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
4440 KB |
Output is correct |
23 |
Correct |
1 ms |
4440 KB |
Output is correct |
24 |
Correct |
1 ms |
4440 KB |
Output is correct |
25 |
Correct |
0 ms |
4440 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
1 ms |
4440 KB |
Output is correct |
28 |
Correct |
1 ms |
4440 KB |
Output is correct |
29 |
Correct |
1 ms |
4440 KB |
Output is correct |
30 |
Correct |
1 ms |
4440 KB |
Output is correct |
31 |
Correct |
1 ms |
4572 KB |
Output is correct |
32 |
Correct |
1 ms |
4440 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4440 KB |
Output is correct |
36 |
Correct |
14 ms |
13708 KB |
Output is correct |
37 |
Correct |
16 ms |
17224 KB |
Output is correct |
38 |
Correct |
17 ms |
17228 KB |
Output is correct |
39 |
Correct |
16 ms |
17276 KB |
Output is correct |
40 |
Correct |
16 ms |
17240 KB |
Output is correct |
41 |
Correct |
17 ms |
17224 KB |
Output is correct |
42 |
Correct |
17 ms |
17240 KB |
Output is correct |
43 |
Correct |
13 ms |
16728 KB |
Output is correct |
44 |
Correct |
13 ms |
17364 KB |
Output is correct |
45 |
Correct |
13 ms |
16728 KB |
Output is correct |
46 |
Correct |
14 ms |
17240 KB |
Output is correct |
47 |
Correct |
16 ms |
17064 KB |
Output is correct |
48 |
Correct |
16 ms |
17240 KB |
Output is correct |
49 |
Correct |
17 ms |
17204 KB |
Output is correct |
50 |
Correct |
19 ms |
17356 KB |
Output is correct |
51 |
Correct |
13 ms |
16728 KB |
Output is correct |
52 |
Correct |
16 ms |
17216 KB |
Output is correct |
53 |
Correct |
16 ms |
17240 KB |
Output is correct |
54 |
Correct |
16 ms |
17240 KB |
Output is correct |
55 |
Correct |
14 ms |
17344 KB |
Output is correct |
56 |
Correct |
13 ms |
16728 KB |
Output is correct |
57 |
Correct |
16 ms |
16696 KB |
Output is correct |
58 |
Correct |
19 ms |
17240 KB |
Output is correct |
59 |
Correct |
16 ms |
17240 KB |
Output is correct |
60 |
Correct |
17 ms |
17200 KB |
Output is correct |
61 |
Correct |
17 ms |
17240 KB |
Output is correct |
62 |
Correct |
16 ms |
17240 KB |
Output is correct |
63 |
Correct |
16 ms |
17224 KB |
Output is correct |
64 |
Correct |
13 ms |
16728 KB |
Output is correct |
65 |
Correct |
16 ms |
17348 KB |
Output is correct |
66 |
Correct |
13 ms |
16728 KB |
Output is correct |
67 |
Correct |
13 ms |
17364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
405 ms |
17068 KB |
Output is correct |
2 |
Correct |
520 ms |
17232 KB |
Output is correct |
3 |
Correct |
538 ms |
17240 KB |
Output is correct |
4 |
Correct |
528 ms |
17240 KB |
Output is correct |
5 |
Correct |
527 ms |
17240 KB |
Output is correct |
6 |
Correct |
520 ms |
17240 KB |
Output is correct |
7 |
Correct |
540 ms |
17240 KB |
Output is correct |
8 |
Correct |
517 ms |
16728 KB |
Output is correct |
9 |
Correct |
502 ms |
17364 KB |
Output is correct |
10 |
Correct |
500 ms |
16728 KB |
Output is correct |
11 |
Correct |
495 ms |
17616 KB |
Output is correct |
12 |
Correct |
472 ms |
16728 KB |
Output is correct |
13 |
Correct |
525 ms |
17364 KB |
Output is correct |
14 |
Correct |
1 ms |
4440 KB |
Output is correct |
15 |
Correct |
1 ms |
4440 KB |
Output is correct |
16 |
Correct |
1 ms |
4440 KB |
Output is correct |
17 |
Correct |
18 ms |
17212 KB |
Output is correct |
18 |
Correct |
17 ms |
17224 KB |
Output is correct |
19 |
Correct |
20 ms |
17240 KB |
Output is correct |
20 |
Correct |
14 ms |
17396 KB |
Output is correct |
21 |
Correct |
13 ms |
16740 KB |
Output is correct |
22 |
Correct |
23 ms |
17220 KB |
Output is correct |
23 |
Correct |
16 ms |
17200 KB |
Output is correct |
24 |
Correct |
17 ms |
17240 KB |
Output is correct |
25 |
Correct |
24 ms |
17364 KB |
Output is correct |
26 |
Correct |
14 ms |
16708 KB |
Output is correct |
27 |
Correct |
1 ms |
4440 KB |
Output is correct |
28 |
Correct |
1 ms |
4440 KB |
Output is correct |
29 |
Correct |
1 ms |
4440 KB |
Output is correct |
30 |
Correct |
1 ms |
4440 KB |
Output is correct |
31 |
Correct |
1 ms |
4440 KB |
Output is correct |
32 |
Correct |
1 ms |
4440 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4440 KB |
Output is correct |
36 |
Correct |
1 ms |
4440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
118 ms |
7016 KB |
Output is correct |
2 |
Correct |
565 ms |
17240 KB |
Output is correct |
3 |
Correct |
521 ms |
17240 KB |
Output is correct |
4 |
Correct |
532 ms |
17240 KB |
Output is correct |
5 |
Correct |
558 ms |
17240 KB |
Output is correct |
6 |
Correct |
546 ms |
17236 KB |
Output is correct |
7 |
Correct |
535 ms |
17240 KB |
Output is correct |
8 |
Correct |
486 ms |
16728 KB |
Output is correct |
9 |
Correct |
492 ms |
17616 KB |
Output is correct |
10 |
Correct |
493 ms |
16728 KB |
Output is correct |
11 |
Correct |
547 ms |
17364 KB |
Output is correct |
12 |
Correct |
16 ms |
17224 KB |
Output is correct |
13 |
Correct |
16 ms |
17204 KB |
Output is correct |
14 |
Correct |
16 ms |
17240 KB |
Output is correct |
15 |
Correct |
19 ms |
17348 KB |
Output is correct |
16 |
Correct |
13 ms |
16728 KB |
Output is correct |
17 |
Correct |
16 ms |
16708 KB |
Output is correct |
18 |
Correct |
16 ms |
17240 KB |
Output is correct |
19 |
Correct |
16 ms |
17240 KB |
Output is correct |
20 |
Correct |
22 ms |
17248 KB |
Output is correct |
21 |
Correct |
19 ms |
17224 KB |
Output is correct |
22 |
Correct |
22 ms |
17240 KB |
Output is correct |
23 |
Correct |
17 ms |
17240 KB |
Output is correct |
24 |
Correct |
13 ms |
16716 KB |
Output is correct |
25 |
Correct |
13 ms |
17364 KB |
Output is correct |
26 |
Correct |
19 ms |
16712 KB |
Output is correct |
27 |
Correct |
17 ms |
17364 KB |
Output is correct |
28 |
Correct |
1 ms |
4440 KB |
Output is correct |
29 |
Correct |
1 ms |
4440 KB |
Output is correct |
30 |
Correct |
1 ms |
4440 KB |
Output is correct |
31 |
Correct |
1 ms |
4440 KB |
Output is correct |
32 |
Correct |
1 ms |
4440 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4440 KB |
Output is correct |
36 |
Correct |
1 ms |
4440 KB |
Output is correct |
37 |
Correct |
1 ms |
4440 KB |
Output is correct |
38 |
Correct |
1 ms |
4440 KB |
Output is correct |
39 |
Correct |
1 ms |
4440 KB |
Output is correct |
40 |
Correct |
1 ms |
4440 KB |
Output is correct |
41 |
Correct |
1 ms |
4440 KB |
Output is correct |
42 |
Correct |
1 ms |
4440 KB |
Output is correct |
43 |
Correct |
1 ms |
4440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4440 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
4440 KB |
Output is correct |
4 |
Correct |
1 ms |
4440 KB |
Output is correct |
5 |
Correct |
1 ms |
4440 KB |
Output is correct |
6 |
Correct |
1 ms |
4440 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4440 KB |
Output is correct |
9 |
Correct |
1 ms |
4440 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
1 ms |
4440 KB |
Output is correct |
12 |
Correct |
1 ms |
4440 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4524 KB |
Output is correct |
15 |
Correct |
1 ms |
4440 KB |
Output is correct |
16 |
Correct |
1 ms |
4440 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4440 KB |
Output is correct |
20 |
Correct |
1 ms |
4440 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
4440 KB |
Output is correct |
23 |
Correct |
1 ms |
4440 KB |
Output is correct |
24 |
Correct |
1 ms |
4440 KB |
Output is correct |
25 |
Correct |
0 ms |
4440 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
1 ms |
4440 KB |
Output is correct |
28 |
Correct |
1 ms |
4440 KB |
Output is correct |
29 |
Correct |
1 ms |
4440 KB |
Output is correct |
30 |
Correct |
1 ms |
4440 KB |
Output is correct |
31 |
Correct |
1 ms |
4572 KB |
Output is correct |
32 |
Correct |
1 ms |
4440 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4440 KB |
Output is correct |
36 |
Correct |
14 ms |
13708 KB |
Output is correct |
37 |
Correct |
16 ms |
17224 KB |
Output is correct |
38 |
Correct |
17 ms |
17228 KB |
Output is correct |
39 |
Correct |
16 ms |
17276 KB |
Output is correct |
40 |
Correct |
16 ms |
17240 KB |
Output is correct |
41 |
Correct |
17 ms |
17224 KB |
Output is correct |
42 |
Correct |
17 ms |
17240 KB |
Output is correct |
43 |
Correct |
13 ms |
16728 KB |
Output is correct |
44 |
Correct |
13 ms |
17364 KB |
Output is correct |
45 |
Correct |
13 ms |
16728 KB |
Output is correct |
46 |
Correct |
14 ms |
17240 KB |
Output is correct |
47 |
Correct |
16 ms |
17064 KB |
Output is correct |
48 |
Correct |
16 ms |
17240 KB |
Output is correct |
49 |
Correct |
17 ms |
17204 KB |
Output is correct |
50 |
Correct |
19 ms |
17356 KB |
Output is correct |
51 |
Correct |
13 ms |
16728 KB |
Output is correct |
52 |
Correct |
16 ms |
17216 KB |
Output is correct |
53 |
Correct |
16 ms |
17240 KB |
Output is correct |
54 |
Correct |
16 ms |
17240 KB |
Output is correct |
55 |
Correct |
14 ms |
17344 KB |
Output is correct |
56 |
Correct |
13 ms |
16728 KB |
Output is correct |
57 |
Correct |
16 ms |
16696 KB |
Output is correct |
58 |
Correct |
19 ms |
17240 KB |
Output is correct |
59 |
Correct |
16 ms |
17240 KB |
Output is correct |
60 |
Correct |
17 ms |
17200 KB |
Output is correct |
61 |
Correct |
17 ms |
17240 KB |
Output is correct |
62 |
Correct |
16 ms |
17240 KB |
Output is correct |
63 |
Correct |
16 ms |
17224 KB |
Output is correct |
64 |
Correct |
13 ms |
16728 KB |
Output is correct |
65 |
Correct |
16 ms |
17348 KB |
Output is correct |
66 |
Correct |
13 ms |
16728 KB |
Output is correct |
67 |
Correct |
13 ms |
17364 KB |
Output is correct |
68 |
Correct |
405 ms |
17068 KB |
Output is correct |
69 |
Correct |
520 ms |
17232 KB |
Output is correct |
70 |
Correct |
538 ms |
17240 KB |
Output is correct |
71 |
Correct |
528 ms |
17240 KB |
Output is correct |
72 |
Correct |
527 ms |
17240 KB |
Output is correct |
73 |
Correct |
520 ms |
17240 KB |
Output is correct |
74 |
Correct |
540 ms |
17240 KB |
Output is correct |
75 |
Correct |
517 ms |
16728 KB |
Output is correct |
76 |
Correct |
502 ms |
17364 KB |
Output is correct |
77 |
Correct |
500 ms |
16728 KB |
Output is correct |
78 |
Correct |
495 ms |
17616 KB |
Output is correct |
79 |
Correct |
472 ms |
16728 KB |
Output is correct |
80 |
Correct |
525 ms |
17364 KB |
Output is correct |
81 |
Correct |
1 ms |
4440 KB |
Output is correct |
82 |
Correct |
1 ms |
4440 KB |
Output is correct |
83 |
Correct |
1 ms |
4440 KB |
Output is correct |
84 |
Correct |
18 ms |
17212 KB |
Output is correct |
85 |
Correct |
17 ms |
17224 KB |
Output is correct |
86 |
Correct |
20 ms |
17240 KB |
Output is correct |
87 |
Correct |
14 ms |
17396 KB |
Output is correct |
88 |
Correct |
13 ms |
16740 KB |
Output is correct |
89 |
Correct |
23 ms |
17220 KB |
Output is correct |
90 |
Correct |
16 ms |
17200 KB |
Output is correct |
91 |
Correct |
17 ms |
17240 KB |
Output is correct |
92 |
Correct |
24 ms |
17364 KB |
Output is correct |
93 |
Correct |
14 ms |
16708 KB |
Output is correct |
94 |
Correct |
1 ms |
4440 KB |
Output is correct |
95 |
Correct |
1 ms |
4440 KB |
Output is correct |
96 |
Correct |
1 ms |
4440 KB |
Output is correct |
97 |
Correct |
1 ms |
4440 KB |
Output is correct |
98 |
Correct |
1 ms |
4440 KB |
Output is correct |
99 |
Correct |
1 ms |
4440 KB |
Output is correct |
100 |
Correct |
1 ms |
4440 KB |
Output is correct |
101 |
Correct |
1 ms |
4440 KB |
Output is correct |
102 |
Correct |
1 ms |
4440 KB |
Output is correct |
103 |
Correct |
1 ms |
4440 KB |
Output is correct |
104 |
Execution timed out |
4019 ms |
16216 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
258 ms |
13656 KB |
Output is correct |
2 |
Correct |
525 ms |
16728 KB |
Output is correct |
3 |
Correct |
538 ms |
16728 KB |
Output is correct |
4 |
Correct |
505 ms |
16728 KB |
Output is correct |
5 |
Correct |
501 ms |
17364 KB |
Output is correct |
6 |
Correct |
502 ms |
16728 KB |
Output is correct |
7 |
Correct |
519 ms |
17364 KB |
Output is correct |
8 |
Correct |
1 ms |
4440 KB |
Output is correct |
9 |
Correct |
1 ms |
4440 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
1 ms |
4440 KB |
Output is correct |
12 |
Correct |
1 ms |
4440 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4440 KB |
Output is correct |
15 |
Correct |
1 ms |
4440 KB |
Output is correct |
16 |
Correct |
1 ms |
4440 KB |
Output is correct |
17 |
Correct |
1 ms |
4440 KB |
Output is correct |
18 |
Correct |
1 ms |
4440 KB |
Output is correct |
19 |
Correct |
1 ms |
4440 KB |
Output is correct |
20 |
Correct |
1 ms |
4440 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
4440 KB |
Output is correct |
23 |
Correct |
1 ms |
4440 KB |
Output is correct |
24 |
Correct |
1 ms |
4524 KB |
Output is correct |
25 |
Correct |
1 ms |
4440 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
1 ms |
4440 KB |
Output is correct |
28 |
Correct |
1 ms |
4440 KB |
Output is correct |
29 |
Correct |
1 ms |
4440 KB |
Output is correct |
30 |
Correct |
1 ms |
4440 KB |
Output is correct |
31 |
Correct |
1 ms |
4440 KB |
Output is correct |
32 |
Correct |
1 ms |
4440 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
0 ms |
4440 KB |
Output is correct |
36 |
Correct |
1 ms |
4440 KB |
Output is correct |
37 |
Correct |
1 ms |
4440 KB |
Output is correct |
38 |
Correct |
1 ms |
4440 KB |
Output is correct |
39 |
Correct |
1 ms |
4440 KB |
Output is correct |
40 |
Correct |
1 ms |
4440 KB |
Output is correct |
41 |
Correct |
1 ms |
4572 KB |
Output is correct |
42 |
Correct |
1 ms |
4440 KB |
Output is correct |
43 |
Correct |
1 ms |
4440 KB |
Output is correct |
44 |
Correct |
1 ms |
4440 KB |
Output is correct |
45 |
Correct |
1 ms |
4440 KB |
Output is correct |
46 |
Correct |
14 ms |
13708 KB |
Output is correct |
47 |
Correct |
16 ms |
17224 KB |
Output is correct |
48 |
Correct |
17 ms |
17228 KB |
Output is correct |
49 |
Correct |
16 ms |
17276 KB |
Output is correct |
50 |
Correct |
16 ms |
17240 KB |
Output is correct |
51 |
Correct |
17 ms |
17224 KB |
Output is correct |
52 |
Correct |
17 ms |
17240 KB |
Output is correct |
53 |
Correct |
13 ms |
16728 KB |
Output is correct |
54 |
Correct |
13 ms |
17364 KB |
Output is correct |
55 |
Correct |
13 ms |
16728 KB |
Output is correct |
56 |
Correct |
14 ms |
17240 KB |
Output is correct |
57 |
Correct |
16 ms |
17064 KB |
Output is correct |
58 |
Correct |
16 ms |
17240 KB |
Output is correct |
59 |
Correct |
17 ms |
17204 KB |
Output is correct |
60 |
Correct |
19 ms |
17356 KB |
Output is correct |
61 |
Correct |
13 ms |
16728 KB |
Output is correct |
62 |
Correct |
16 ms |
17216 KB |
Output is correct |
63 |
Correct |
16 ms |
17240 KB |
Output is correct |
64 |
Correct |
16 ms |
17240 KB |
Output is correct |
65 |
Correct |
14 ms |
17344 KB |
Output is correct |
66 |
Correct |
13 ms |
16728 KB |
Output is correct |
67 |
Correct |
16 ms |
16696 KB |
Output is correct |
68 |
Correct |
19 ms |
17240 KB |
Output is correct |
69 |
Correct |
16 ms |
17240 KB |
Output is correct |
70 |
Correct |
17 ms |
17200 KB |
Output is correct |
71 |
Correct |
17 ms |
17240 KB |
Output is correct |
72 |
Correct |
16 ms |
17240 KB |
Output is correct |
73 |
Correct |
16 ms |
17224 KB |
Output is correct |
74 |
Correct |
13 ms |
16728 KB |
Output is correct |
75 |
Correct |
16 ms |
17348 KB |
Output is correct |
76 |
Correct |
13 ms |
16728 KB |
Output is correct |
77 |
Correct |
13 ms |
17364 KB |
Output is correct |
78 |
Correct |
405 ms |
17068 KB |
Output is correct |
79 |
Correct |
520 ms |
17232 KB |
Output is correct |
80 |
Correct |
538 ms |
17240 KB |
Output is correct |
81 |
Correct |
528 ms |
17240 KB |
Output is correct |
82 |
Correct |
527 ms |
17240 KB |
Output is correct |
83 |
Correct |
520 ms |
17240 KB |
Output is correct |
84 |
Correct |
540 ms |
17240 KB |
Output is correct |
85 |
Correct |
517 ms |
16728 KB |
Output is correct |
86 |
Correct |
502 ms |
17364 KB |
Output is correct |
87 |
Correct |
500 ms |
16728 KB |
Output is correct |
88 |
Correct |
495 ms |
17616 KB |
Output is correct |
89 |
Correct |
472 ms |
16728 KB |
Output is correct |
90 |
Correct |
525 ms |
17364 KB |
Output is correct |
91 |
Correct |
1 ms |
4440 KB |
Output is correct |
92 |
Correct |
1 ms |
4440 KB |
Output is correct |
93 |
Correct |
1 ms |
4440 KB |
Output is correct |
94 |
Correct |
18 ms |
17212 KB |
Output is correct |
95 |
Correct |
17 ms |
17224 KB |
Output is correct |
96 |
Correct |
20 ms |
17240 KB |
Output is correct |
97 |
Correct |
14 ms |
17396 KB |
Output is correct |
98 |
Correct |
13 ms |
16740 KB |
Output is correct |
99 |
Correct |
23 ms |
17220 KB |
Output is correct |
100 |
Correct |
16 ms |
17200 KB |
Output is correct |
101 |
Correct |
17 ms |
17240 KB |
Output is correct |
102 |
Correct |
24 ms |
17364 KB |
Output is correct |
103 |
Correct |
14 ms |
16708 KB |
Output is correct |
104 |
Correct |
1 ms |
4440 KB |
Output is correct |
105 |
Correct |
1 ms |
4440 KB |
Output is correct |
106 |
Correct |
1 ms |
4440 KB |
Output is correct |
107 |
Correct |
1 ms |
4440 KB |
Output is correct |
108 |
Correct |
1 ms |
4440 KB |
Output is correct |
109 |
Correct |
1 ms |
4440 KB |
Output is correct |
110 |
Correct |
1 ms |
4440 KB |
Output is correct |
111 |
Correct |
1 ms |
4440 KB |
Output is correct |
112 |
Correct |
1 ms |
4440 KB |
Output is correct |
113 |
Correct |
1 ms |
4440 KB |
Output is correct |
114 |
Correct |
118 ms |
7016 KB |
Output is correct |
115 |
Correct |
565 ms |
17240 KB |
Output is correct |
116 |
Correct |
521 ms |
17240 KB |
Output is correct |
117 |
Correct |
532 ms |
17240 KB |
Output is correct |
118 |
Correct |
558 ms |
17240 KB |
Output is correct |
119 |
Correct |
546 ms |
17236 KB |
Output is correct |
120 |
Correct |
535 ms |
17240 KB |
Output is correct |
121 |
Correct |
486 ms |
16728 KB |
Output is correct |
122 |
Correct |
492 ms |
17616 KB |
Output is correct |
123 |
Correct |
493 ms |
16728 KB |
Output is correct |
124 |
Correct |
547 ms |
17364 KB |
Output is correct |
125 |
Correct |
16 ms |
17224 KB |
Output is correct |
126 |
Correct |
16 ms |
17204 KB |
Output is correct |
127 |
Correct |
16 ms |
17240 KB |
Output is correct |
128 |
Correct |
19 ms |
17348 KB |
Output is correct |
129 |
Correct |
13 ms |
16728 KB |
Output is correct |
130 |
Correct |
16 ms |
16708 KB |
Output is correct |
131 |
Correct |
16 ms |
17240 KB |
Output is correct |
132 |
Correct |
16 ms |
17240 KB |
Output is correct |
133 |
Correct |
22 ms |
17248 KB |
Output is correct |
134 |
Correct |
19 ms |
17224 KB |
Output is correct |
135 |
Correct |
22 ms |
17240 KB |
Output is correct |
136 |
Correct |
17 ms |
17240 KB |
Output is correct |
137 |
Correct |
13 ms |
16716 KB |
Output is correct |
138 |
Correct |
13 ms |
17364 KB |
Output is correct |
139 |
Correct |
19 ms |
16712 KB |
Output is correct |
140 |
Correct |
17 ms |
17364 KB |
Output is correct |
141 |
Correct |
1 ms |
4440 KB |
Output is correct |
142 |
Correct |
1 ms |
4440 KB |
Output is correct |
143 |
Correct |
1 ms |
4440 KB |
Output is correct |
144 |
Correct |
1 ms |
4440 KB |
Output is correct |
145 |
Correct |
1 ms |
4440 KB |
Output is correct |
146 |
Correct |
1 ms |
4440 KB |
Output is correct |
147 |
Correct |
1 ms |
4440 KB |
Output is correct |
148 |
Correct |
1 ms |
4440 KB |
Output is correct |
149 |
Correct |
1 ms |
4440 KB |
Output is correct |
150 |
Correct |
1 ms |
4440 KB |
Output is correct |
151 |
Correct |
1 ms |
4440 KB |
Output is correct |
152 |
Correct |
1 ms |
4440 KB |
Output is correct |
153 |
Correct |
1 ms |
4440 KB |
Output is correct |
154 |
Correct |
1 ms |
4440 KB |
Output is correct |
155 |
Correct |
1 ms |
4440 KB |
Output is correct |
156 |
Correct |
1 ms |
4440 KB |
Output is correct |
157 |
Execution timed out |
4019 ms |
16216 KB |
Time limit exceeded |
158 |
Halted |
0 ms |
0 KB |
- |