#include <bits/stdc++.h>
#define MAX 500005
#define MOD (ll)(1e9+7)
#define INF (ll)(1e18)
#define inf (1000000001)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
int n, q;
int arr[100005];
struct SEG1 {
ll seg[400005];
void update(int str, int ed, int idx, ll val, int node) {
if(str == ed) {
seg[node] = val;
return;
}
int mid = str + ed >> 1;
if(idx <= mid) update(str, mid, idx, val, node << 1);
else update(mid + 1, ed, idx, val, node << 1 | 1);
seg[node] = seg[node << 1] + seg[node << 1 | 1];
}
ll query(int str, int ed, int left, int right, int node) {
if(str > right || ed < left) return 0;
if(left <= str && ed <= right) return seg[node];
int mid = str + ed >> 1;
return query(str, mid, left, right, node << 1) + query(mid + 1, ed, left, right, node << 1 | 1);
}
} seg1;
struct SEG2 {
int seg[400005];
void update(int str, int ed, int idx, int val, int node) {
if(str == ed) {
seg[node] = val;
return;
}
int mid = str + ed >> 1;
if(idx <= mid) update(str, mid, idx, val, node << 1);
else update(mid + 1, ed, idx, val, node << 1 | 1);
seg[node] = max(seg[node << 1], seg[node << 1 | 1]);
}
int get_mx(int str, int ed, int left, int right, int val, int node) {
if(str > right || ed < left) return -1;
if(seg[node] <= val) return -1;
if(str == ed) return str;
int mid = str + ed >> 1;
int tmp = get_mx(mid + 1, ed, left, right, val, node << 1 | 1);
if(tmp != -1) return tmp;
return get_mx(str, mid, left, right, val, node << 1);
}
int get_mn(int str, int ed, int left, int right, ll val, int node) {
if(str > right || ed < left) return -1;
if(seg[node] <= val) return -1;
if(str == ed) return str;
int mid = str + ed >> 1;
int tmp = get_mn(str, mid, left, right, val, node << 1);
if(tmp != -1) return tmp;
return get_mn(mid + 1, ed, left, right, val, node << 1 | 1);
}
} seg2;
struct SEG3 {
struct Node{
int mn, cnt;
Node() { mn = inf, cnt = 0; }
};
Node seg[400005];
int lazy[400005];
Node Merge(Node l, Node r) {
Node ret; ret.cnt = 0;
ret.mn = min(l.mn, r.mn);
if(l.mn == ret.mn) ret.cnt += l.cnt;
if(r.mn == ret.mn) ret.cnt += r.cnt;
return ret;
}
void init(int str, int ed, int node) {
lazy[node] = 0;
if(str == ed) {
seg[node].mn = 0, seg[node].cnt = 1;
return;
}
int mid = str + ed >> 1;
init(str, mid, node << 1);
init(mid + 1, ed, node << 1 | 1);
seg[node] = Merge(seg[node << 1], seg[node << 1 | 1]);
}
void lazyProp(int str, int ed, int node) {
if(lazy[node]) {
seg[node].mn += lazy[node];
if(str != ed) {
lazy[node << 1] += lazy[node];
lazy[node << 1 | 1] += lazy[node];
}
lazy[node] = 0;
}
}
void update(int str, int ed, int left, int right, int val, int node) {
lazyProp(str, ed, node);
if(str > right || ed < left) return;
if(left <= str && ed <= right) {
lazy[node] += val;
lazyProp(str, ed, node);
return;
}
int mid = str + ed >> 1;
update(str, mid, left, right, val, node << 1);
update(mid + 1, ed, left, right, val, node << 1 | 1);
seg[node] = Merge(seg[node << 1], seg[node << 1 | 1]);
}
Node query(int str, int ed, int left, int right, int node) {
lazyProp(str, ed, node);
if(str > right || ed < left) return Node();
if(left <= str && ed <= right) return seg[node];
int mid = str + ed >> 1;
return Merge(query(str, mid, left, right, node << 1), query(mid + 1, ed, left, right, node << 1 | 1));
}
} seg3;
set<pii> s;
struct SEG4 {
vector<pii> seg[400005];
void update(int str, int ed, int l, int r, int node) {
int mid = str + ed >> 1;
if(str == ed || (l <= mid && r > mid)) {
seg[node].push_back({l, r});
seg3.update(1, n, l, r, 1, 1);
return;
}
if(r <= mid) update(str, mid, l, r, node << 1);
else update(mid + 1, ed, l, r, node << 1 | 1);
}
void erasex(int str, int ed, int x, int node) {
while(!seg[node].empty() && seg[node].back().first <= x && x <= seg[node].back().second) {
seg3.update(1, n, seg[node].back().first, seg[node].back().second, -1, 1);
s.erase({seg[node].back().first, seg[node].back().second});
seg[node].pop_back();
}
if(str == ed) return;
int mid = str + ed >> 1;
if(x <= mid) erasex(str, mid, x, node << 1);
else erasex(mid + 1, ed, x, node << 1 | 1);
}
} seg4;
void update(int i) {
vector<pll> left, right;
int j = i, sum = arr[j];
while(j > 1) {
j = seg2.get_mx(1, n, 1, j - 1, sum, 1);
if(j == -1) break;
left.push_back({j, seg1.query(1, n, 1, j, 1)});
sum += arr[j];
}
left.push_back({0, 0});
j = i, sum = arr[j];
while(j < n) {
j = seg2.get_mn(1, n, j + 1, n, sum, 1);
if(j == -1) break;
right.push_back({j, seg1.query(1, n, 1, j - 1, 1)});
sum += arr[j];
}
right.push_back({n + 1, seg1.query(1, n, 1, n, 1)});
vector<pii> range;
for(auto l : left) for(auto r : right) {
if(l.first == 0 && r.first == n + 1) continue;
if(r.second - l.second < (ll)min(arr[r.first], arr[l.first])) {
range.push_back({l.first + 1, r.first - 1});
}
}
sort(range.begin(), range.end(), [&](auto a, auto b) {
if(a.second - a.first != b.second - b.first) return a.second - a.first < b.second - b.first;
return a.first < b.first;
});
for(auto [l, r] : range) {
if(s.find({l, r}) == s.end()) {
seg4.update(1, n, l, r, 1);
s.insert({l, r});
}
}
}
int compL(int i, int lim) {
vector<int> right;
int j = i, sum = arr[j];
while(j < n) {
j = seg2.get_mn(1, n, j + 1, n, sum, 1);
if(j == -1) break;
right.push_back(j);
sum += arr[j];
}
int mx = i;
for(auto r : right) {
if(r <= lim && seg1.query(1, n, i, r - 1, 1) < (ll)arr[r]) mx = max(mx, r);
}
return mx;
}
int compR(int i, int lim) {
vector<int> left;
int j = i, sum = arr[j];
while(j > 1) {
j = seg2.get_mx(1, n, 1, j - 1, sum, 1);
if(j == -1) break;
left.push_back(j);
sum += arr[j];
}
int mn = i;
for(auto l : left) {
if(l >= lim && seg1.query(1, n, l + 1, i, 1) < (ll)arr[l]) mn = min(mn, l);
}
return mn;
}
void update_query(int a, int b) {
arr[a] = b;
seg1.update(1, n, a, b, 1);
seg2.update(1, n, a, b, 1);
seg4.erasex(1, n, a, 1);
update(a);
if(a > 1) seg4.erasex(1, n, a - 1, 1);
if(a > 1) update(a - 1);
if(a < n) seg4.erasex(1, n, a + 1, 1);
if(a < n) update(a + 1);
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
seg3.init(1, n, 1); arr[0] = arr[n + 1] = inf;
for(int i = 1; i <= n; ++i) {
cin >> arr[i];
update_query(i, arr[i]);
}
cin >> q;
while(q--) {
int t, a, b; cin >> t >> a >> b;
if(t == 1) update_query(a, b);
else {
int l = a, r = b;
a = compL(a, r); b = compR(b, l);
cout << seg3.query(1, n, a, b, 1).cnt << '\n';
}
}
return 0;
}
Compilation message
fish2.cpp: In member function 'void SEG1::update(int, int, int, ll, int)':
fish2.cpp:22:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
22 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'll SEG1::query(int, int, int, int, int)':
fish2.cpp:30:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
30 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'void SEG2::update(int, int, int, int, int)':
fish2.cpp:42:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
42 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'int SEG2::get_mx(int, int, int, int, int, int)':
fish2.cpp:51:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
51 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'int SEG2::get_mn(int, int, int, int, ll, int)':
fish2.cpp:60:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
60 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'void SEG3::init(int, int, int)':
fish2.cpp:87:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
87 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'void SEG3::update(int, int, int, int, int, int)':
fish2.cpp:110:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
110 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'SEG3::Node SEG3::query(int, int, int, int, int)':
fish2.cpp:119:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
119 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'void SEG4::update(int, int, int, int, int)':
fish2.cpp:128:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
128 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In member function 'void SEG4::erasex(int, int, int, int)':
fish2.cpp:145:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
145 | int mid = str + ed >> 1;
| ~~~~^~~~
fish2.cpp: In function 'void update(int)':
fish2.cpp:184:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
184 | for(auto [l, r] : range) {
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12756 KB |
Output is correct |
2 |
Correct |
5 ms |
12756 KB |
Output is correct |
3 |
Correct |
5 ms |
12756 KB |
Output is correct |
4 |
Correct |
5 ms |
12756 KB |
Output is correct |
5 |
Correct |
15 ms |
12920 KB |
Output is correct |
6 |
Correct |
10 ms |
12916 KB |
Output is correct |
7 |
Correct |
13 ms |
12884 KB |
Output is correct |
8 |
Correct |
18 ms |
12896 KB |
Output is correct |
9 |
Correct |
14 ms |
12884 KB |
Output is correct |
10 |
Correct |
11 ms |
12884 KB |
Output is correct |
11 |
Correct |
7 ms |
12884 KB |
Output is correct |
12 |
Correct |
12 ms |
12884 KB |
Output is correct |
13 |
Correct |
10 ms |
12884 KB |
Output is correct |
14 |
Correct |
18 ms |
12888 KB |
Output is correct |
15 |
Correct |
14 ms |
12884 KB |
Output is correct |
16 |
Correct |
13 ms |
12884 KB |
Output is correct |
17 |
Correct |
11 ms |
12884 KB |
Output is correct |
18 |
Correct |
9 ms |
12884 KB |
Output is correct |
19 |
Correct |
9 ms |
12884 KB |
Output is correct |
20 |
Correct |
9 ms |
12852 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12860 KB |
Output is correct |
2 |
Correct |
468 ms |
22480 KB |
Output is correct |
3 |
Correct |
934 ms |
22224 KB |
Output is correct |
4 |
Correct |
473 ms |
22496 KB |
Output is correct |
5 |
Correct |
915 ms |
22280 KB |
Output is correct |
6 |
Correct |
358 ms |
20632 KB |
Output is correct |
7 |
Correct |
1044 ms |
19224 KB |
Output is correct |
8 |
Correct |
362 ms |
20792 KB |
Output is correct |
9 |
Correct |
1128 ms |
19252 KB |
Output is correct |
10 |
Correct |
1977 ms |
19672 KB |
Output is correct |
11 |
Correct |
2248 ms |
19728 KB |
Output is correct |
12 |
Correct |
641 ms |
20356 KB |
Output is correct |
13 |
Correct |
588 ms |
20372 KB |
Output is correct |
14 |
Correct |
502 ms |
22476 KB |
Output is correct |
15 |
Correct |
573 ms |
22264 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12756 KB |
Output is correct |
2 |
Correct |
5 ms |
12756 KB |
Output is correct |
3 |
Correct |
5 ms |
12756 KB |
Output is correct |
4 |
Correct |
5 ms |
12756 KB |
Output is correct |
5 |
Correct |
15 ms |
12920 KB |
Output is correct |
6 |
Correct |
10 ms |
12916 KB |
Output is correct |
7 |
Correct |
13 ms |
12884 KB |
Output is correct |
8 |
Correct |
18 ms |
12896 KB |
Output is correct |
9 |
Correct |
14 ms |
12884 KB |
Output is correct |
10 |
Correct |
11 ms |
12884 KB |
Output is correct |
11 |
Correct |
7 ms |
12884 KB |
Output is correct |
12 |
Correct |
12 ms |
12884 KB |
Output is correct |
13 |
Correct |
10 ms |
12884 KB |
Output is correct |
14 |
Correct |
18 ms |
12888 KB |
Output is correct |
15 |
Correct |
14 ms |
12884 KB |
Output is correct |
16 |
Correct |
13 ms |
12884 KB |
Output is correct |
17 |
Correct |
11 ms |
12884 KB |
Output is correct |
18 |
Correct |
9 ms |
12884 KB |
Output is correct |
19 |
Correct |
9 ms |
12884 KB |
Output is correct |
20 |
Correct |
9 ms |
12852 KB |
Output is correct |
21 |
Correct |
6 ms |
12860 KB |
Output is correct |
22 |
Correct |
468 ms |
22480 KB |
Output is correct |
23 |
Correct |
934 ms |
22224 KB |
Output is correct |
24 |
Correct |
473 ms |
22496 KB |
Output is correct |
25 |
Correct |
915 ms |
22280 KB |
Output is correct |
26 |
Correct |
358 ms |
20632 KB |
Output is correct |
27 |
Correct |
1044 ms |
19224 KB |
Output is correct |
28 |
Correct |
362 ms |
20792 KB |
Output is correct |
29 |
Correct |
1128 ms |
19252 KB |
Output is correct |
30 |
Correct |
1977 ms |
19672 KB |
Output is correct |
31 |
Correct |
2248 ms |
19728 KB |
Output is correct |
32 |
Correct |
641 ms |
20356 KB |
Output is correct |
33 |
Correct |
588 ms |
20372 KB |
Output is correct |
34 |
Correct |
502 ms |
22476 KB |
Output is correct |
35 |
Correct |
573 ms |
22264 KB |
Output is correct |
36 |
Correct |
461 ms |
23176 KB |
Output is correct |
37 |
Correct |
944 ms |
22456 KB |
Output is correct |
38 |
Correct |
961 ms |
21688 KB |
Output is correct |
39 |
Correct |
466 ms |
23256 KB |
Output is correct |
40 |
Correct |
924 ms |
21760 KB |
Output is correct |
41 |
Correct |
358 ms |
20700 KB |
Output is correct |
42 |
Correct |
379 ms |
20652 KB |
Output is correct |
43 |
Correct |
1026 ms |
19360 KB |
Output is correct |
44 |
Correct |
1002 ms |
19324 KB |
Output is correct |
45 |
Correct |
1980 ms |
20212 KB |
Output is correct |
46 |
Correct |
1965 ms |
19748 KB |
Output is correct |
47 |
Correct |
2204 ms |
18760 KB |
Output is correct |
48 |
Correct |
614 ms |
20416 KB |
Output is correct |
49 |
Correct |
534 ms |
20272 KB |
Output is correct |
50 |
Correct |
505 ms |
22604 KB |
Output is correct |
51 |
Correct |
527 ms |
22312 KB |
Output is correct |
52 |
Correct |
504 ms |
22488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12860 KB |
Output is correct |
2 |
Correct |
468 ms |
22480 KB |
Output is correct |
3 |
Correct |
934 ms |
22224 KB |
Output is correct |
4 |
Correct |
473 ms |
22496 KB |
Output is correct |
5 |
Correct |
915 ms |
22280 KB |
Output is correct |
6 |
Correct |
358 ms |
20632 KB |
Output is correct |
7 |
Correct |
1044 ms |
19224 KB |
Output is correct |
8 |
Correct |
362 ms |
20792 KB |
Output is correct |
9 |
Correct |
1128 ms |
19252 KB |
Output is correct |
10 |
Correct |
1977 ms |
19672 KB |
Output is correct |
11 |
Correct |
2248 ms |
19728 KB |
Output is correct |
12 |
Correct |
641 ms |
20356 KB |
Output is correct |
13 |
Correct |
588 ms |
20372 KB |
Output is correct |
14 |
Correct |
502 ms |
22476 KB |
Output is correct |
15 |
Correct |
573 ms |
22264 KB |
Output is correct |
16 |
Correct |
6 ms |
12756 KB |
Output is correct |
17 |
Correct |
1367 ms |
22580 KB |
Output is correct |
18 |
Correct |
814 ms |
23632 KB |
Output is correct |
19 |
Correct |
1366 ms |
22836 KB |
Output is correct |
20 |
Correct |
1399 ms |
22712 KB |
Output is correct |
21 |
Correct |
1402 ms |
22676 KB |
Output is correct |
22 |
Correct |
812 ms |
23696 KB |
Output is correct |
23 |
Correct |
1296 ms |
22524 KB |
Output is correct |
24 |
Correct |
1454 ms |
23076 KB |
Output is correct |
25 |
Correct |
1332 ms |
22864 KB |
Output is correct |
26 |
Correct |
1434 ms |
22988 KB |
Output is correct |
27 |
Correct |
498 ms |
21212 KB |
Output is correct |
28 |
Correct |
504 ms |
21196 KB |
Output is correct |
29 |
Correct |
553 ms |
21204 KB |
Output is correct |
30 |
Correct |
1713 ms |
19576 KB |
Output is correct |
31 |
Correct |
1627 ms |
19524 KB |
Output is correct |
32 |
Correct |
2825 ms |
20368 KB |
Output is correct |
33 |
Correct |
2213 ms |
20164 KB |
Output is correct |
34 |
Correct |
2833 ms |
19692 KB |
Output is correct |
35 |
Correct |
2552 ms |
19100 KB |
Output is correct |
36 |
Correct |
2439 ms |
20428 KB |
Output is correct |
37 |
Correct |
770 ms |
20728 KB |
Output is correct |
38 |
Correct |
754 ms |
20548 KB |
Output is correct |
39 |
Correct |
758 ms |
23108 KB |
Output is correct |
40 |
Correct |
700 ms |
23036 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12860 KB |
Output is correct |
2 |
Correct |
468 ms |
22480 KB |
Output is correct |
3 |
Correct |
934 ms |
22224 KB |
Output is correct |
4 |
Correct |
473 ms |
22496 KB |
Output is correct |
5 |
Correct |
915 ms |
22280 KB |
Output is correct |
6 |
Correct |
358 ms |
20632 KB |
Output is correct |
7 |
Correct |
1044 ms |
19224 KB |
Output is correct |
8 |
Correct |
362 ms |
20792 KB |
Output is correct |
9 |
Correct |
1128 ms |
19252 KB |
Output is correct |
10 |
Correct |
1977 ms |
19672 KB |
Output is correct |
11 |
Correct |
2248 ms |
19728 KB |
Output is correct |
12 |
Correct |
641 ms |
20356 KB |
Output is correct |
13 |
Correct |
588 ms |
20372 KB |
Output is correct |
14 |
Correct |
502 ms |
22476 KB |
Output is correct |
15 |
Correct |
573 ms |
22264 KB |
Output is correct |
16 |
Correct |
6 ms |
12756 KB |
Output is correct |
17 |
Correct |
2758 ms |
22612 KB |
Output is correct |
18 |
Correct |
1838 ms |
25060 KB |
Output is correct |
19 |
Correct |
2516 ms |
22644 KB |
Output is correct |
20 |
Correct |
1671 ms |
24904 KB |
Output is correct |
21 |
Correct |
2685 ms |
22656 KB |
Output is correct |
22 |
Correct |
1949 ms |
24896 KB |
Output is correct |
23 |
Correct |
2833 ms |
22680 KB |
Output is correct |
24 |
Correct |
1869 ms |
25036 KB |
Output is correct |
25 |
Correct |
2592 ms |
22560 KB |
Output is correct |
26 |
Correct |
707 ms |
21824 KB |
Output is correct |
27 |
Correct |
861 ms |
21980 KB |
Output is correct |
28 |
Correct |
1707 ms |
23156 KB |
Output is correct |
29 |
Correct |
751 ms |
21828 KB |
Output is correct |
30 |
Correct |
851 ms |
21900 KB |
Output is correct |
31 |
Correct |
2105 ms |
23444 KB |
Output is correct |
32 |
Correct |
3145 ms |
24096 KB |
Output is correct |
33 |
Correct |
2780 ms |
19848 KB |
Output is correct |
34 |
Correct |
2726 ms |
24444 KB |
Output is correct |
35 |
Correct |
2405 ms |
19952 KB |
Output is correct |
36 |
Correct |
2985 ms |
23740 KB |
Output is correct |
37 |
Correct |
1408 ms |
22792 KB |
Output is correct |
38 |
Correct |
1126 ms |
22316 KB |
Output is correct |
39 |
Correct |
974 ms |
23372 KB |
Output is correct |
40 |
Correct |
770 ms |
23204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
12756 KB |
Output is correct |
2 |
Correct |
5 ms |
12756 KB |
Output is correct |
3 |
Correct |
5 ms |
12756 KB |
Output is correct |
4 |
Correct |
5 ms |
12756 KB |
Output is correct |
5 |
Correct |
15 ms |
12920 KB |
Output is correct |
6 |
Correct |
10 ms |
12916 KB |
Output is correct |
7 |
Correct |
13 ms |
12884 KB |
Output is correct |
8 |
Correct |
18 ms |
12896 KB |
Output is correct |
9 |
Correct |
14 ms |
12884 KB |
Output is correct |
10 |
Correct |
11 ms |
12884 KB |
Output is correct |
11 |
Correct |
7 ms |
12884 KB |
Output is correct |
12 |
Correct |
12 ms |
12884 KB |
Output is correct |
13 |
Correct |
10 ms |
12884 KB |
Output is correct |
14 |
Correct |
18 ms |
12888 KB |
Output is correct |
15 |
Correct |
14 ms |
12884 KB |
Output is correct |
16 |
Correct |
13 ms |
12884 KB |
Output is correct |
17 |
Correct |
11 ms |
12884 KB |
Output is correct |
18 |
Correct |
9 ms |
12884 KB |
Output is correct |
19 |
Correct |
9 ms |
12884 KB |
Output is correct |
20 |
Correct |
9 ms |
12852 KB |
Output is correct |
21 |
Correct |
6 ms |
12860 KB |
Output is correct |
22 |
Correct |
468 ms |
22480 KB |
Output is correct |
23 |
Correct |
934 ms |
22224 KB |
Output is correct |
24 |
Correct |
473 ms |
22496 KB |
Output is correct |
25 |
Correct |
915 ms |
22280 KB |
Output is correct |
26 |
Correct |
358 ms |
20632 KB |
Output is correct |
27 |
Correct |
1044 ms |
19224 KB |
Output is correct |
28 |
Correct |
362 ms |
20792 KB |
Output is correct |
29 |
Correct |
1128 ms |
19252 KB |
Output is correct |
30 |
Correct |
1977 ms |
19672 KB |
Output is correct |
31 |
Correct |
2248 ms |
19728 KB |
Output is correct |
32 |
Correct |
641 ms |
20356 KB |
Output is correct |
33 |
Correct |
588 ms |
20372 KB |
Output is correct |
34 |
Correct |
502 ms |
22476 KB |
Output is correct |
35 |
Correct |
573 ms |
22264 KB |
Output is correct |
36 |
Correct |
461 ms |
23176 KB |
Output is correct |
37 |
Correct |
944 ms |
22456 KB |
Output is correct |
38 |
Correct |
961 ms |
21688 KB |
Output is correct |
39 |
Correct |
466 ms |
23256 KB |
Output is correct |
40 |
Correct |
924 ms |
21760 KB |
Output is correct |
41 |
Correct |
358 ms |
20700 KB |
Output is correct |
42 |
Correct |
379 ms |
20652 KB |
Output is correct |
43 |
Correct |
1026 ms |
19360 KB |
Output is correct |
44 |
Correct |
1002 ms |
19324 KB |
Output is correct |
45 |
Correct |
1980 ms |
20212 KB |
Output is correct |
46 |
Correct |
1965 ms |
19748 KB |
Output is correct |
47 |
Correct |
2204 ms |
18760 KB |
Output is correct |
48 |
Correct |
614 ms |
20416 KB |
Output is correct |
49 |
Correct |
534 ms |
20272 KB |
Output is correct |
50 |
Correct |
505 ms |
22604 KB |
Output is correct |
51 |
Correct |
527 ms |
22312 KB |
Output is correct |
52 |
Correct |
504 ms |
22488 KB |
Output is correct |
53 |
Correct |
6 ms |
12756 KB |
Output is correct |
54 |
Correct |
1367 ms |
22580 KB |
Output is correct |
55 |
Correct |
814 ms |
23632 KB |
Output is correct |
56 |
Correct |
1366 ms |
22836 KB |
Output is correct |
57 |
Correct |
1399 ms |
22712 KB |
Output is correct |
58 |
Correct |
1402 ms |
22676 KB |
Output is correct |
59 |
Correct |
812 ms |
23696 KB |
Output is correct |
60 |
Correct |
1296 ms |
22524 KB |
Output is correct |
61 |
Correct |
1454 ms |
23076 KB |
Output is correct |
62 |
Correct |
1332 ms |
22864 KB |
Output is correct |
63 |
Correct |
1434 ms |
22988 KB |
Output is correct |
64 |
Correct |
498 ms |
21212 KB |
Output is correct |
65 |
Correct |
504 ms |
21196 KB |
Output is correct |
66 |
Correct |
553 ms |
21204 KB |
Output is correct |
67 |
Correct |
1713 ms |
19576 KB |
Output is correct |
68 |
Correct |
1627 ms |
19524 KB |
Output is correct |
69 |
Correct |
2825 ms |
20368 KB |
Output is correct |
70 |
Correct |
2213 ms |
20164 KB |
Output is correct |
71 |
Correct |
2833 ms |
19692 KB |
Output is correct |
72 |
Correct |
2552 ms |
19100 KB |
Output is correct |
73 |
Correct |
2439 ms |
20428 KB |
Output is correct |
74 |
Correct |
770 ms |
20728 KB |
Output is correct |
75 |
Correct |
754 ms |
20548 KB |
Output is correct |
76 |
Correct |
758 ms |
23108 KB |
Output is correct |
77 |
Correct |
700 ms |
23036 KB |
Output is correct |
78 |
Correct |
6 ms |
12756 KB |
Output is correct |
79 |
Correct |
2758 ms |
22612 KB |
Output is correct |
80 |
Correct |
1838 ms |
25060 KB |
Output is correct |
81 |
Correct |
2516 ms |
22644 KB |
Output is correct |
82 |
Correct |
1671 ms |
24904 KB |
Output is correct |
83 |
Correct |
2685 ms |
22656 KB |
Output is correct |
84 |
Correct |
1949 ms |
24896 KB |
Output is correct |
85 |
Correct |
2833 ms |
22680 KB |
Output is correct |
86 |
Correct |
1869 ms |
25036 KB |
Output is correct |
87 |
Correct |
2592 ms |
22560 KB |
Output is correct |
88 |
Correct |
707 ms |
21824 KB |
Output is correct |
89 |
Correct |
861 ms |
21980 KB |
Output is correct |
90 |
Correct |
1707 ms |
23156 KB |
Output is correct |
91 |
Correct |
751 ms |
21828 KB |
Output is correct |
92 |
Correct |
851 ms |
21900 KB |
Output is correct |
93 |
Correct |
2105 ms |
23444 KB |
Output is correct |
94 |
Correct |
3145 ms |
24096 KB |
Output is correct |
95 |
Correct |
2780 ms |
19848 KB |
Output is correct |
96 |
Correct |
2726 ms |
24444 KB |
Output is correct |
97 |
Correct |
2405 ms |
19952 KB |
Output is correct |
98 |
Correct |
2985 ms |
23740 KB |
Output is correct |
99 |
Correct |
1408 ms |
22792 KB |
Output is correct |
100 |
Correct |
1126 ms |
22316 KB |
Output is correct |
101 |
Correct |
974 ms |
23372 KB |
Output is correct |
102 |
Correct |
770 ms |
23204 KB |
Output is correct |
103 |
Correct |
3181 ms |
21964 KB |
Output is correct |
104 |
Correct |
1495 ms |
25028 KB |
Output is correct |
105 |
Correct |
1736 ms |
22924 KB |
Output is correct |
106 |
Correct |
1514 ms |
24020 KB |
Output is correct |
107 |
Correct |
2805 ms |
22368 KB |
Output is correct |
108 |
Correct |
1464 ms |
25024 KB |
Output is correct |
109 |
Correct |
1935 ms |
22392 KB |
Output is correct |
110 |
Correct |
1571 ms |
24640 KB |
Output is correct |
111 |
Correct |
1682 ms |
23016 KB |
Output is correct |
112 |
Correct |
1440 ms |
23948 KB |
Output is correct |
113 |
Correct |
841 ms |
21752 KB |
Output is correct |
114 |
Correct |
546 ms |
21396 KB |
Output is correct |
115 |
Correct |
1871 ms |
23340 KB |
Output is correct |
116 |
Correct |
1659 ms |
22712 KB |
Output is correct |
117 |
Correct |
618 ms |
21616 KB |
Output is correct |
118 |
Correct |
1400 ms |
21044 KB |
Output is correct |
119 |
Correct |
886 ms |
21972 KB |
Output is correct |
120 |
Correct |
1750 ms |
23196 KB |
Output is correct |
121 |
Correct |
1608 ms |
22252 KB |
Output is correct |
122 |
Correct |
3177 ms |
23916 KB |
Output is correct |
123 |
Correct |
2827 ms |
19372 KB |
Output is correct |
124 |
Correct |
2736 ms |
21848 KB |
Output is correct |
125 |
Correct |
2596 ms |
19000 KB |
Output is correct |
126 |
Correct |
2727 ms |
21176 KB |
Output is correct |
127 |
Correct |
1449 ms |
22808 KB |
Output is correct |
128 |
Correct |
889 ms |
21236 KB |
Output is correct |
129 |
Correct |
1030 ms |
23440 KB |
Output is correct |
130 |
Correct |
863 ms |
23212 KB |
Output is correct |