#include <cstdio>
#ifdef DEBUG
#define D(X) X
#else
#define D(X)
#endif
#include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define pi 3.14159265359
#define pub push_back
#define pob pop_back
#define pari pair<int,int>
#define parli pair<long, long>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const ll INF2 = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
bool comp(vector<ll>& v1, vector<ll>& v2)
{
return v1[0] < v2[0];
}
struct seg {
vector<int> tree;
int sz;
void build(int n) {
sz = 1;
while(sz<n) {
sz *= 2;
}
tree.resize(2*sz + 1, 0);
}
void clean()
{
for(int i=0; i<tree.size(); i++) {
tree[i] = 0;
}
}
void recSet(int idx, int lx, int rx, int i, int val) {
if(rx-lx==1) {
tree[idx] = val;
return;
}
int mid = (lx+rx)/2;
if(i<mid) {
recSet(2*idx+1, lx, mid, i, val);
} else
{
recSet(2*idx+2, mid, rx, i, val);
}
tree[idx] = max(tree[2*idx+1], tree[2*idx+2]);
}
void setX(int i, int val) {
recSet(0, 0, sz, i, val);
}
int rec_range(int idx, int lx, int rx, int l, int r) {
if(lx>=l&&rx<=r) {
return tree[idx];
}
if(rx<=l||lx>=r) return 0;
int mid = (lx+rx)/2;
int left = rec_range(2*idx+1, lx, mid, l, r);
int right = rec_range(2*idx+2, mid, rx, l, r);
return max(left, right);
}
int range(int l, int r) {
return rec_range(0, 0, sz, l, r);
}
};
vector<int> dp;
seg mint, maxt;
map<int, int> ord;
vector<int> h;
int res = 0;
int center = -1;
vector<int> pref;
void init2(int l, int r, int d)
{
int n = h.size();
res = 0;
for(int i=0; i<=n; i++) {
dp[i] = 0;
}
vector<int> used(n+1, 0);
vector<int> nums;
for(int i=l; i<=r; i++) {
int f1 = 0, f2 = 0;
nums.pub(h[i]);
nums.pub(h[i]-d);
nums.pub(h[i]+d);
if(i>l) {
if(h[i]>=h[i-1]) {
f1 = 1;
} else
{
f1 = 2;
}
}
if(i<r) {
if(h[i]>=h[i+1]) {
f2 = 1;
} else
{
f2 = 2;
}
}
if(f1==0) {
f1 = f2;
}
if(f2==0) {
f2 = f1;
}
if(f1==f2) {
used[i] = f1;
}
}
sort(nums.begin(), nums.end());
ord.clear();
ord[nums[0]] = 0;
int sz = nums.size();
for(int i=1; i<sz; i++) {
if(nums[i]>nums[i-1]) {
ord[nums[i]] = ord[nums[i-1]] + 1;
} else
{
ord[nums[i]] = ord[nums[i-1]];
}
}
mint.clean();
maxt.clean();
mint.build(sz);
maxt.build(sz);
for(int i=r; i>=l; i--) {
if(used[i]==0) {
continue;
}
if(used[i]==1&&h[i]-d>0) {
dp[i] = mint.range(0, ord[h[i]-d] + 1);
maxt.setX(ord[h[i]], dp[i]);
}
if(used[i]==2) {
dp[i] = 1 + maxt.range(ord[h[i]+d], sz);
mint.setX(ord[h[i]], dp[i]);
}
res = max(res, dp[i]);
}
}
void init(int n, vector<int> h2)
{
h.resize(n);
for(int i=0; i<n; i++) {
h[i] = h2[i];
}
dp.resize(n+1);
int idx = 1;
while(idx<n&&h[idx]>=h[idx-1]) {
idx++;
}
center = idx - 1;
while(idx<n&&h[idx]<=h[idx-1]) {
idx++;
}
pref.resize(n+1);
pref[0] = 0;
for(int i=1; i<=n; i++) {
pref[i] = pref[i-1];
if(i>1&&i<n) {
if(h[i-1]<h[i-2]&&h[i-1]<h[i]) {
pref[i]++;
}
} else if(i>1)
{
if(h[i-1]<h[i-2]) {
pref[i]++;
}
} else
{
if(h[i-1]<h[i]) {
pref[i]++;
}
}
}
if(idx!=n) {
center = -1;
init2(0, n - 1, 1);
}
}
int max_towers(int l, int r, int d)
{
int n = h.size();
if(n==1) {
return 1;
}
if(l==r) {
return 1;
}
if(center!=-1) {
if(r<=center||l>=center) {
return 1;
}
if(h[center]-h[l]>=d&&h[center]-h[r]>=d) {
return 2;
}
return 1;
}
if(d==1) {
int ans = pref[r] - pref[l+1];
if(h[l]<h[l+1]) {
ans++;
}
if(h[r]<h[r-1]) {
ans++;
}
return ans;
}
init2(l, r, d);
if(l==0&&r==h.size()-1) {
return res;
}
return res;
}
/*
4 0 3 20
0 1 2
1 2 3
18 1 19
*/
/*
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//D(freopen("input.txt","r",stdin);)
//D(freopen("ouput.txt","w",stdout);)
int t = 1;
//cin >> t;
loop:
while(t--)
{
int n;
cin >> n;
vector<int> a(n);
for(int i=0; i<n; i++) {
cin >> a[i];
}
init(n, a);
int res = max_towers(1, 5, 10);
if(res==0) {
res = 1;
}
cout << res;
}
return 0;
}
*/
Compilation message
towers.cpp: In member function 'void seg::clean()':
towers.cpp:43:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
43 | for(int i=0; i<tree.size(); i++) {
| ~^~~~~~~~~~~~
towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:237:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
237 | if(l==0&&r==h.size()-1) {
| ~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
224 ms |
1440 KB |
Output is correct |
2 |
Correct |
488 ms |
2344 KB |
Output is correct |
3 |
Correct |
512 ms |
2360 KB |
Output is correct |
4 |
Correct |
518 ms |
2376 KB |
Output is correct |
5 |
Correct |
495 ms |
2360 KB |
Output is correct |
6 |
Correct |
515 ms |
2368 KB |
Output is correct |
7 |
Correct |
530 ms |
2540 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
856 KB |
Output is correct |
3 |
Correct |
3 ms |
856 KB |
Output is correct |
4 |
Correct |
4 ms |
856 KB |
Output is correct |
5 |
Correct |
3 ms |
856 KB |
Output is correct |
6 |
Correct |
3 ms |
856 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
1172 KB |
Output is correct |
11 |
Correct |
1 ms |
856 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
2 ms |
856 KB |
Output is correct |
16 |
Correct |
2 ms |
856 KB |
Output is correct |
17 |
Correct |
2 ms |
856 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
856 KB |
Output is correct |
20 |
Correct |
2 ms |
856 KB |
Output is correct |
21 |
Correct |
2 ms |
856 KB |
Output is correct |
22 |
Correct |
2 ms |
856 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
856 KB |
Output is correct |
25 |
Correct |
2 ms |
600 KB |
Output is correct |
26 |
Correct |
3 ms |
856 KB |
Output is correct |
27 |
Correct |
3 ms |
856 KB |
Output is correct |
28 |
Correct |
3 ms |
856 KB |
Output is correct |
29 |
Correct |
4 ms |
856 KB |
Output is correct |
30 |
Correct |
4 ms |
856 KB |
Output is correct |
31 |
Correct |
3 ms |
856 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
2 ms |
856 KB |
Output is correct |
35 |
Correct |
2 ms |
864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
856 KB |
Output is correct |
3 |
Correct |
3 ms |
856 KB |
Output is correct |
4 |
Correct |
4 ms |
856 KB |
Output is correct |
5 |
Correct |
3 ms |
856 KB |
Output is correct |
6 |
Correct |
3 ms |
856 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
1172 KB |
Output is correct |
11 |
Correct |
1 ms |
856 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
2 ms |
856 KB |
Output is correct |
16 |
Correct |
2 ms |
856 KB |
Output is correct |
17 |
Correct |
2 ms |
856 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
856 KB |
Output is correct |
20 |
Correct |
2 ms |
856 KB |
Output is correct |
21 |
Correct |
2 ms |
856 KB |
Output is correct |
22 |
Correct |
2 ms |
856 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
856 KB |
Output is correct |
25 |
Correct |
2 ms |
600 KB |
Output is correct |
26 |
Correct |
3 ms |
856 KB |
Output is correct |
27 |
Correct |
3 ms |
856 KB |
Output is correct |
28 |
Correct |
3 ms |
856 KB |
Output is correct |
29 |
Correct |
4 ms |
856 KB |
Output is correct |
30 |
Correct |
4 ms |
856 KB |
Output is correct |
31 |
Correct |
3 ms |
856 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
2 ms |
856 KB |
Output is correct |
35 |
Correct |
2 ms |
864 KB |
Output is correct |
36 |
Correct |
128 ms |
15924 KB |
Output is correct |
37 |
Correct |
208 ms |
26008 KB |
Output is correct |
38 |
Correct |
196 ms |
26268 KB |
Output is correct |
39 |
Correct |
257 ms |
26120 KB |
Output is correct |
40 |
Correct |
237 ms |
26312 KB |
Output is correct |
41 |
Correct |
389 ms |
26624 KB |
Output is correct |
42 |
Correct |
227 ms |
26264 KB |
Output is correct |
43 |
Correct |
10 ms |
2364 KB |
Output is correct |
44 |
Correct |
10 ms |
2364 KB |
Output is correct |
45 |
Correct |
93 ms |
26216 KB |
Output is correct |
46 |
Correct |
97 ms |
26008 KB |
Output is correct |
47 |
Correct |
162 ms |
26168 KB |
Output is correct |
48 |
Correct |
206 ms |
26264 KB |
Output is correct |
49 |
Correct |
213 ms |
26096 KB |
Output is correct |
50 |
Correct |
10 ms |
2364 KB |
Output is correct |
51 |
Correct |
88 ms |
26156 KB |
Output is correct |
52 |
Correct |
180 ms |
26024 KB |
Output is correct |
53 |
Correct |
202 ms |
26012 KB |
Output is correct |
54 |
Correct |
197 ms |
26260 KB |
Output is correct |
55 |
Correct |
13 ms |
2372 KB |
Output is correct |
56 |
Correct |
89 ms |
26208 KB |
Output is correct |
57 |
Correct |
308 ms |
27188 KB |
Output is correct |
58 |
Correct |
308 ms |
27728 KB |
Output is correct |
59 |
Correct |
321 ms |
27736 KB |
Output is correct |
60 |
Correct |
476 ms |
27940 KB |
Output is correct |
61 |
Correct |
426 ms |
27924 KB |
Output is correct |
62 |
Correct |
369 ms |
27896 KB |
Output is correct |
63 |
Correct |
400 ms |
27924 KB |
Output is correct |
64 |
Correct |
12 ms |
2368 KB |
Output is correct |
65 |
Correct |
10 ms |
2372 KB |
Output is correct |
66 |
Correct |
162 ms |
27764 KB |
Output is correct |
67 |
Correct |
165 ms |
27916 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
591 ms |
26144 KB |
Output is correct |
2 |
Correct |
731 ms |
26264 KB |
Output is correct |
3 |
Correct |
726 ms |
26264 KB |
Output is correct |
4 |
Correct |
742 ms |
26012 KB |
Output is correct |
5 |
Correct |
775 ms |
26268 KB |
Output is correct |
6 |
Correct |
766 ms |
26004 KB |
Output is correct |
7 |
Correct |
760 ms |
26264 KB |
Output is correct |
8 |
Correct |
548 ms |
2364 KB |
Output is correct |
9 |
Correct |
561 ms |
2368 KB |
Output is correct |
10 |
Correct |
634 ms |
26264 KB |
Output is correct |
11 |
Correct |
679 ms |
26008 KB |
Output is correct |
12 |
Correct |
551 ms |
2392 KB |
Output is correct |
13 |
Correct |
556 ms |
2368 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
164 ms |
26048 KB |
Output is correct |
18 |
Correct |
210 ms |
26264 KB |
Output is correct |
19 |
Correct |
202 ms |
26008 KB |
Output is correct |
20 |
Correct |
12 ms |
2364 KB |
Output is correct |
21 |
Correct |
92 ms |
26304 KB |
Output is correct |
22 |
Correct |
162 ms |
26100 KB |
Output is correct |
23 |
Correct |
202 ms |
26008 KB |
Output is correct |
24 |
Correct |
196 ms |
26060 KB |
Output is correct |
25 |
Correct |
9 ms |
2364 KB |
Output is correct |
26 |
Correct |
86 ms |
26008 KB |
Output is correct |
27 |
Correct |
2 ms |
856 KB |
Output is correct |
28 |
Correct |
2 ms |
856 KB |
Output is correct |
29 |
Correct |
2 ms |
856 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
856 KB |
Output is correct |
32 |
Correct |
2 ms |
856 KB |
Output is correct |
33 |
Correct |
2 ms |
856 KB |
Output is correct |
34 |
Correct |
2 ms |
856 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
1 ms |
856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4019 ms |
7816 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
856 KB |
Output is correct |
3 |
Correct |
3 ms |
856 KB |
Output is correct |
4 |
Correct |
4 ms |
856 KB |
Output is correct |
5 |
Correct |
3 ms |
856 KB |
Output is correct |
6 |
Correct |
3 ms |
856 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
1172 KB |
Output is correct |
11 |
Correct |
1 ms |
856 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
2 ms |
856 KB |
Output is correct |
16 |
Correct |
2 ms |
856 KB |
Output is correct |
17 |
Correct |
2 ms |
856 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
856 KB |
Output is correct |
20 |
Correct |
2 ms |
856 KB |
Output is correct |
21 |
Correct |
2 ms |
856 KB |
Output is correct |
22 |
Correct |
2 ms |
856 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
856 KB |
Output is correct |
25 |
Correct |
2 ms |
600 KB |
Output is correct |
26 |
Correct |
3 ms |
856 KB |
Output is correct |
27 |
Correct |
3 ms |
856 KB |
Output is correct |
28 |
Correct |
3 ms |
856 KB |
Output is correct |
29 |
Correct |
4 ms |
856 KB |
Output is correct |
30 |
Correct |
4 ms |
856 KB |
Output is correct |
31 |
Correct |
3 ms |
856 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
2 ms |
856 KB |
Output is correct |
35 |
Correct |
2 ms |
864 KB |
Output is correct |
36 |
Correct |
128 ms |
15924 KB |
Output is correct |
37 |
Correct |
208 ms |
26008 KB |
Output is correct |
38 |
Correct |
196 ms |
26268 KB |
Output is correct |
39 |
Correct |
257 ms |
26120 KB |
Output is correct |
40 |
Correct |
237 ms |
26312 KB |
Output is correct |
41 |
Correct |
389 ms |
26624 KB |
Output is correct |
42 |
Correct |
227 ms |
26264 KB |
Output is correct |
43 |
Correct |
10 ms |
2364 KB |
Output is correct |
44 |
Correct |
10 ms |
2364 KB |
Output is correct |
45 |
Correct |
93 ms |
26216 KB |
Output is correct |
46 |
Correct |
97 ms |
26008 KB |
Output is correct |
47 |
Correct |
162 ms |
26168 KB |
Output is correct |
48 |
Correct |
206 ms |
26264 KB |
Output is correct |
49 |
Correct |
213 ms |
26096 KB |
Output is correct |
50 |
Correct |
10 ms |
2364 KB |
Output is correct |
51 |
Correct |
88 ms |
26156 KB |
Output is correct |
52 |
Correct |
180 ms |
26024 KB |
Output is correct |
53 |
Correct |
202 ms |
26012 KB |
Output is correct |
54 |
Correct |
197 ms |
26260 KB |
Output is correct |
55 |
Correct |
13 ms |
2372 KB |
Output is correct |
56 |
Correct |
89 ms |
26208 KB |
Output is correct |
57 |
Correct |
308 ms |
27188 KB |
Output is correct |
58 |
Correct |
308 ms |
27728 KB |
Output is correct |
59 |
Correct |
321 ms |
27736 KB |
Output is correct |
60 |
Correct |
476 ms |
27940 KB |
Output is correct |
61 |
Correct |
426 ms |
27924 KB |
Output is correct |
62 |
Correct |
369 ms |
27896 KB |
Output is correct |
63 |
Correct |
400 ms |
27924 KB |
Output is correct |
64 |
Correct |
12 ms |
2368 KB |
Output is correct |
65 |
Correct |
10 ms |
2372 KB |
Output is correct |
66 |
Correct |
162 ms |
27764 KB |
Output is correct |
67 |
Correct |
165 ms |
27916 KB |
Output is correct |
68 |
Correct |
591 ms |
26144 KB |
Output is correct |
69 |
Correct |
731 ms |
26264 KB |
Output is correct |
70 |
Correct |
726 ms |
26264 KB |
Output is correct |
71 |
Correct |
742 ms |
26012 KB |
Output is correct |
72 |
Correct |
775 ms |
26268 KB |
Output is correct |
73 |
Correct |
766 ms |
26004 KB |
Output is correct |
74 |
Correct |
760 ms |
26264 KB |
Output is correct |
75 |
Correct |
548 ms |
2364 KB |
Output is correct |
76 |
Correct |
561 ms |
2368 KB |
Output is correct |
77 |
Correct |
634 ms |
26264 KB |
Output is correct |
78 |
Correct |
679 ms |
26008 KB |
Output is correct |
79 |
Correct |
551 ms |
2392 KB |
Output is correct |
80 |
Correct |
556 ms |
2368 KB |
Output is correct |
81 |
Correct |
0 ms |
344 KB |
Output is correct |
82 |
Correct |
1 ms |
344 KB |
Output is correct |
83 |
Correct |
1 ms |
344 KB |
Output is correct |
84 |
Correct |
164 ms |
26048 KB |
Output is correct |
85 |
Correct |
210 ms |
26264 KB |
Output is correct |
86 |
Correct |
202 ms |
26008 KB |
Output is correct |
87 |
Correct |
12 ms |
2364 KB |
Output is correct |
88 |
Correct |
92 ms |
26304 KB |
Output is correct |
89 |
Correct |
162 ms |
26100 KB |
Output is correct |
90 |
Correct |
202 ms |
26008 KB |
Output is correct |
91 |
Correct |
196 ms |
26060 KB |
Output is correct |
92 |
Correct |
9 ms |
2364 KB |
Output is correct |
93 |
Correct |
86 ms |
26008 KB |
Output is correct |
94 |
Correct |
2 ms |
856 KB |
Output is correct |
95 |
Correct |
2 ms |
856 KB |
Output is correct |
96 |
Correct |
2 ms |
856 KB |
Output is correct |
97 |
Correct |
0 ms |
344 KB |
Output is correct |
98 |
Correct |
1 ms |
856 KB |
Output is correct |
99 |
Correct |
2 ms |
856 KB |
Output is correct |
100 |
Correct |
2 ms |
856 KB |
Output is correct |
101 |
Correct |
2 ms |
856 KB |
Output is correct |
102 |
Correct |
1 ms |
344 KB |
Output is correct |
103 |
Correct |
1 ms |
856 KB |
Output is correct |
104 |
Execution timed out |
4017 ms |
24212 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
224 ms |
1440 KB |
Output is correct |
2 |
Correct |
488 ms |
2344 KB |
Output is correct |
3 |
Correct |
512 ms |
2360 KB |
Output is correct |
4 |
Correct |
518 ms |
2376 KB |
Output is correct |
5 |
Correct |
495 ms |
2360 KB |
Output is correct |
6 |
Correct |
515 ms |
2368 KB |
Output is correct |
7 |
Correct |
530 ms |
2540 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
3 ms |
856 KB |
Output is correct |
13 |
Correct |
3 ms |
856 KB |
Output is correct |
14 |
Correct |
4 ms |
856 KB |
Output is correct |
15 |
Correct |
3 ms |
856 KB |
Output is correct |
16 |
Correct |
3 ms |
856 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
1 ms |
1172 KB |
Output is correct |
21 |
Correct |
1 ms |
856 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
2 ms |
856 KB |
Output is correct |
26 |
Correct |
2 ms |
856 KB |
Output is correct |
27 |
Correct |
2 ms |
856 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
1 ms |
856 KB |
Output is correct |
30 |
Correct |
2 ms |
856 KB |
Output is correct |
31 |
Correct |
2 ms |
856 KB |
Output is correct |
32 |
Correct |
2 ms |
856 KB |
Output is correct |
33 |
Correct |
0 ms |
344 KB |
Output is correct |
34 |
Correct |
1 ms |
856 KB |
Output is correct |
35 |
Correct |
2 ms |
600 KB |
Output is correct |
36 |
Correct |
3 ms |
856 KB |
Output is correct |
37 |
Correct |
3 ms |
856 KB |
Output is correct |
38 |
Correct |
3 ms |
856 KB |
Output is correct |
39 |
Correct |
4 ms |
856 KB |
Output is correct |
40 |
Correct |
4 ms |
856 KB |
Output is correct |
41 |
Correct |
3 ms |
856 KB |
Output is correct |
42 |
Correct |
1 ms |
344 KB |
Output is correct |
43 |
Correct |
1 ms |
344 KB |
Output is correct |
44 |
Correct |
2 ms |
856 KB |
Output is correct |
45 |
Correct |
2 ms |
864 KB |
Output is correct |
46 |
Correct |
128 ms |
15924 KB |
Output is correct |
47 |
Correct |
208 ms |
26008 KB |
Output is correct |
48 |
Correct |
196 ms |
26268 KB |
Output is correct |
49 |
Correct |
257 ms |
26120 KB |
Output is correct |
50 |
Correct |
237 ms |
26312 KB |
Output is correct |
51 |
Correct |
389 ms |
26624 KB |
Output is correct |
52 |
Correct |
227 ms |
26264 KB |
Output is correct |
53 |
Correct |
10 ms |
2364 KB |
Output is correct |
54 |
Correct |
10 ms |
2364 KB |
Output is correct |
55 |
Correct |
93 ms |
26216 KB |
Output is correct |
56 |
Correct |
97 ms |
26008 KB |
Output is correct |
57 |
Correct |
162 ms |
26168 KB |
Output is correct |
58 |
Correct |
206 ms |
26264 KB |
Output is correct |
59 |
Correct |
213 ms |
26096 KB |
Output is correct |
60 |
Correct |
10 ms |
2364 KB |
Output is correct |
61 |
Correct |
88 ms |
26156 KB |
Output is correct |
62 |
Correct |
180 ms |
26024 KB |
Output is correct |
63 |
Correct |
202 ms |
26012 KB |
Output is correct |
64 |
Correct |
197 ms |
26260 KB |
Output is correct |
65 |
Correct |
13 ms |
2372 KB |
Output is correct |
66 |
Correct |
89 ms |
26208 KB |
Output is correct |
67 |
Correct |
308 ms |
27188 KB |
Output is correct |
68 |
Correct |
308 ms |
27728 KB |
Output is correct |
69 |
Correct |
321 ms |
27736 KB |
Output is correct |
70 |
Correct |
476 ms |
27940 KB |
Output is correct |
71 |
Correct |
426 ms |
27924 KB |
Output is correct |
72 |
Correct |
369 ms |
27896 KB |
Output is correct |
73 |
Correct |
400 ms |
27924 KB |
Output is correct |
74 |
Correct |
12 ms |
2368 KB |
Output is correct |
75 |
Correct |
10 ms |
2372 KB |
Output is correct |
76 |
Correct |
162 ms |
27764 KB |
Output is correct |
77 |
Correct |
165 ms |
27916 KB |
Output is correct |
78 |
Correct |
591 ms |
26144 KB |
Output is correct |
79 |
Correct |
731 ms |
26264 KB |
Output is correct |
80 |
Correct |
726 ms |
26264 KB |
Output is correct |
81 |
Correct |
742 ms |
26012 KB |
Output is correct |
82 |
Correct |
775 ms |
26268 KB |
Output is correct |
83 |
Correct |
766 ms |
26004 KB |
Output is correct |
84 |
Correct |
760 ms |
26264 KB |
Output is correct |
85 |
Correct |
548 ms |
2364 KB |
Output is correct |
86 |
Correct |
561 ms |
2368 KB |
Output is correct |
87 |
Correct |
634 ms |
26264 KB |
Output is correct |
88 |
Correct |
679 ms |
26008 KB |
Output is correct |
89 |
Correct |
551 ms |
2392 KB |
Output is correct |
90 |
Correct |
556 ms |
2368 KB |
Output is correct |
91 |
Correct |
0 ms |
344 KB |
Output is correct |
92 |
Correct |
1 ms |
344 KB |
Output is correct |
93 |
Correct |
1 ms |
344 KB |
Output is correct |
94 |
Correct |
164 ms |
26048 KB |
Output is correct |
95 |
Correct |
210 ms |
26264 KB |
Output is correct |
96 |
Correct |
202 ms |
26008 KB |
Output is correct |
97 |
Correct |
12 ms |
2364 KB |
Output is correct |
98 |
Correct |
92 ms |
26304 KB |
Output is correct |
99 |
Correct |
162 ms |
26100 KB |
Output is correct |
100 |
Correct |
202 ms |
26008 KB |
Output is correct |
101 |
Correct |
196 ms |
26060 KB |
Output is correct |
102 |
Correct |
9 ms |
2364 KB |
Output is correct |
103 |
Correct |
86 ms |
26008 KB |
Output is correct |
104 |
Correct |
2 ms |
856 KB |
Output is correct |
105 |
Correct |
2 ms |
856 KB |
Output is correct |
106 |
Correct |
2 ms |
856 KB |
Output is correct |
107 |
Correct |
0 ms |
344 KB |
Output is correct |
108 |
Correct |
1 ms |
856 KB |
Output is correct |
109 |
Correct |
2 ms |
856 KB |
Output is correct |
110 |
Correct |
2 ms |
856 KB |
Output is correct |
111 |
Correct |
2 ms |
856 KB |
Output is correct |
112 |
Correct |
1 ms |
344 KB |
Output is correct |
113 |
Correct |
1 ms |
856 KB |
Output is correct |
114 |
Execution timed out |
4019 ms |
7816 KB |
Time limit exceeded |
115 |
Halted |
0 ms |
0 KB |
- |