답안 #814790

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
814790 2023-08-08T09:59:00 Z khshg Diversity (CEOI21_diversity) C++14
100 / 100
6842 ms 10744 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array

const int maxn = 300000, maxq = 50000, B = 3333;
int N, Q;
int A[maxn], cnt[maxn], l[maxn + 1], r[maxn + 1];
ar<int, 3> q[maxn];
ll cur, ans[maxq];
ar<ll, maxn + 1> pref, LtoR, RtoL;

void add(ar<ll, maxn + 1>& a, int i, ll val) {
	++i;
	while(i <= maxn) {
		a[i] += val;
		i += i & -i;
	}
}

ll sum(ar<ll, maxn + 1>& a, int p) {
	ll ans = 0;
	while(p) {
		ans += a[p];
		p -= p & -p;
	}
	return ans;
}

ll sum(ar<ll, maxn + 1>& a, int l, int r) {
	return sum(a, r + 1) - sum(a, l);
}

int prv(int x) {
	if(x <= (N - 1) / 2) return N - x;
	else return N - x - 1;
}
 
int nxt(int x) {
	if(x <= N / 2) return N - x - 1;
	else return N - x;
}


void add(int i) {
	int v = A[i];
	i = r[cnt[v]];
	assert(i >= 0 && i < N);
	if(l[cnt[v]] == r[cnt[v]]) {
		l[cnt[v]] = r[cnt[v]] = -1;
	} else {
		r[cnt[v]] = prv(i);
	}
	cur += ++cnt[v];
	if(i + 1 <= N - 1) cur += sum(LtoR, i + 1, N - 1) - sum(pref, i + 1, N - 1) * i;
	if(0 <= i - 1) cur += sum(RtoL, 0, i - 1) - sum(pref, 0, i - 1) * (N - 1 - i);
	add(LtoR, i, i + 1);
	add(RtoL, i, N - i);
	add(pref, i, 1);
	if(l[cnt[v]] == -1) l[cnt[v]] = r[cnt[v]] = i;
	else l[cnt[v]] = i;
}

void rem(int i) {
	int v = A[i];
	i = l[cnt[v]];
	if(l[cnt[v]] == r[cnt[v]]) {
		l[cnt[v]] = r[cnt[v]] = -1;
	} else {
		l[cnt[v]] = nxt(i);
	}
	cur -= cnt[v]--;
	if(i + 1 <= N - 1) cur -= sum(LtoR, i + 1, N - 1) - sum(pref, i + 1, N - 1) * i;
	if(0 <= i - 1) cur -= sum(RtoL, 0, i - 1) - sum(pref, 0, i - 1) * (N - 1 - i);
	add(LtoR, i, -(i + 1));
	add(RtoL, i, -(N - i));
	add(pref, i, -1);
	if(l[cnt[v]] == -1) l[cnt[v]] = r[cnt[v]] = i;
	else r[cnt[v]] = i;
}

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> N >> Q;
	l[0] = 0;
	r[0] = N / 2;
	for(int i = 0; i < N; ++i) {
		l[i + 1] = r[i + 1] = -1;
		cin >> A[i];
		--A[i];
	}
	for(int i = 0; i < Q; ++i) {
		for(int x : {0, 1}) { cin >> q[i][x]; --q[i][x]; }
		q[i][2] = i;
	}
	sort(q, q + Q, [&](const ar<int, 3>& a, const ar<int, 3>& b) {
		if(a[0] / B == b[0] / B) return (bool)((a[1] < b[1]) ^ ((a[0] / B) & 1));
		return ((a[0] / B) < (b[0] / B));
	});
	for(int i = 0, L = 0, R = 0; i < Q; ++i) {
		int ql = q[i][0], qr = q[i][1];
		while(R <= qr) add(R++);
		while(L < ql) rem(L++);
		while(L > ql) add(--L);
		while(R > qr + 1) rem(--R); // erkhes sussy
		ans[q[i][2]] = cur;
	}
	for(int i = 0; i < Q; ++i) {
		cout << ans[i] << '\n';
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 0 ms 468 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 0 ms 468 KB Output is correct
6 Correct 0 ms 468 KB Output is correct
7 Correct 0 ms 468 KB Output is correct
8 Correct 0 ms 468 KB Output is correct
9 Correct 0 ms 468 KB Output is correct
10 Correct 0 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 468 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 13 ms 1640 KB Output is correct
5 Correct 21 ms 2700 KB Output is correct
6 Correct 35 ms 3956 KB Output is correct
7 Correct 34 ms 3956 KB Output is correct
8 Correct 48 ms 3952 KB Output is correct
9 Correct 35 ms 3888 KB Output is correct
10 Correct 37 ms 3924 KB Output is correct
11 Correct 34 ms 3948 KB Output is correct
12 Correct 36 ms 3936 KB Output is correct
13 Correct 35 ms 3836 KB Output is correct
14 Correct 35 ms 3924 KB Output is correct
15 Correct 34 ms 3924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 468 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 13 ms 1640 KB Output is correct
5 Correct 21 ms 2700 KB Output is correct
6 Correct 35 ms 3956 KB Output is correct
7 Correct 34 ms 3956 KB Output is correct
8 Correct 48 ms 3952 KB Output is correct
9 Correct 35 ms 3888 KB Output is correct
10 Correct 37 ms 3924 KB Output is correct
11 Correct 34 ms 3948 KB Output is correct
12 Correct 36 ms 3936 KB Output is correct
13 Correct 35 ms 3836 KB Output is correct
14 Correct 35 ms 3924 KB Output is correct
15 Correct 34 ms 3924 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 2 ms 596 KB Output is correct
19 Correct 12 ms 1592 KB Output is correct
20 Correct 23 ms 2804 KB Output is correct
21 Correct 35 ms 3924 KB Output is correct
22 Correct 40 ms 3924 KB Output is correct
23 Correct 36 ms 3916 KB Output is correct
24 Correct 36 ms 3952 KB Output is correct
25 Correct 36 ms 3848 KB Output is correct
26 Correct 36 ms 3956 KB Output is correct
27 Correct 35 ms 3948 KB Output is correct
28 Correct 36 ms 3960 KB Output is correct
29 Correct 36 ms 3924 KB Output is correct
30 Correct 36 ms 3944 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 468 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 13 ms 1640 KB Output is correct
5 Correct 21 ms 2700 KB Output is correct
6 Correct 35 ms 3956 KB Output is correct
7 Correct 34 ms 3956 KB Output is correct
8 Correct 48 ms 3952 KB Output is correct
9 Correct 35 ms 3888 KB Output is correct
10 Correct 37 ms 3924 KB Output is correct
11 Correct 34 ms 3948 KB Output is correct
12 Correct 36 ms 3936 KB Output is correct
13 Correct 35 ms 3836 KB Output is correct
14 Correct 35 ms 3924 KB Output is correct
15 Correct 34 ms 3924 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 2 ms 596 KB Output is correct
19 Correct 12 ms 1592 KB Output is correct
20 Correct 23 ms 2804 KB Output is correct
21 Correct 35 ms 3924 KB Output is correct
22 Correct 40 ms 3924 KB Output is correct
23 Correct 36 ms 3916 KB Output is correct
24 Correct 36 ms 3952 KB Output is correct
25 Correct 36 ms 3848 KB Output is correct
26 Correct 36 ms 3956 KB Output is correct
27 Correct 35 ms 3948 KB Output is correct
28 Correct 36 ms 3960 KB Output is correct
29 Correct 36 ms 3924 KB Output is correct
30 Correct 36 ms 3944 KB Output is correct
31 Correct 1 ms 468 KB Output is correct
32 Correct 1 ms 468 KB Output is correct
33 Correct 1 ms 468 KB Output is correct
34 Correct 2 ms 596 KB Output is correct
35 Correct 2 ms 596 KB Output is correct
36 Correct 2 ms 596 KB Output is correct
37 Correct 7 ms 980 KB Output is correct
38 Correct 7 ms 1072 KB Output is correct
39 Correct 13 ms 1672 KB Output is correct
40 Correct 27 ms 2772 KB Output is correct
41 Correct 42 ms 3916 KB Output is correct
42 Correct 41 ms 3892 KB Output is correct
43 Correct 57 ms 3952 KB Output is correct
44 Correct 41 ms 3948 KB Output is correct
45 Correct 46 ms 3960 KB Output is correct
46 Correct 40 ms 3960 KB Output is correct
47 Correct 41 ms 3956 KB Output is correct
48 Correct 42 ms 3924 KB Output is correct
49 Correct 52 ms 3956 KB Output is correct
50 Correct 41 ms 3960 KB Output is correct
51 Correct 41 ms 3900 KB Output is correct
52 Correct 41 ms 3916 KB Output is correct
53 Correct 44 ms 3956 KB Output is correct
54 Correct 41 ms 3912 KB Output is correct
55 Correct 40 ms 3924 KB Output is correct
56 Correct 41 ms 3964 KB Output is correct
57 Correct 41 ms 3956 KB Output is correct
58 Correct 47 ms 3848 KB Output is correct
59 Correct 41 ms 3916 KB Output is correct
60 Correct 41 ms 3924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 0 ms 468 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 0 ms 468 KB Output is correct
6 Correct 0 ms 468 KB Output is correct
7 Correct 0 ms 468 KB Output is correct
8 Correct 0 ms 468 KB Output is correct
9 Correct 0 ms 468 KB Output is correct
10 Correct 0 ms 468 KB Output is correct
11 Correct 0 ms 468 KB Output is correct
12 Correct 1 ms 468 KB Output is correct
13 Correct 1 ms 468 KB Output is correct
14 Correct 13 ms 1640 KB Output is correct
15 Correct 21 ms 2700 KB Output is correct
16 Correct 35 ms 3956 KB Output is correct
17 Correct 34 ms 3956 KB Output is correct
18 Correct 48 ms 3952 KB Output is correct
19 Correct 35 ms 3888 KB Output is correct
20 Correct 37 ms 3924 KB Output is correct
21 Correct 34 ms 3948 KB Output is correct
22 Correct 36 ms 3936 KB Output is correct
23 Correct 35 ms 3836 KB Output is correct
24 Correct 35 ms 3924 KB Output is correct
25 Correct 34 ms 3924 KB Output is correct
26 Correct 1 ms 468 KB Output is correct
27 Correct 1 ms 468 KB Output is correct
28 Correct 2 ms 596 KB Output is correct
29 Correct 12 ms 1592 KB Output is correct
30 Correct 23 ms 2804 KB Output is correct
31 Correct 35 ms 3924 KB Output is correct
32 Correct 40 ms 3924 KB Output is correct
33 Correct 36 ms 3916 KB Output is correct
34 Correct 36 ms 3952 KB Output is correct
35 Correct 36 ms 3848 KB Output is correct
36 Correct 36 ms 3956 KB Output is correct
37 Correct 35 ms 3948 KB Output is correct
38 Correct 36 ms 3960 KB Output is correct
39 Correct 36 ms 3924 KB Output is correct
40 Correct 36 ms 3944 KB Output is correct
41 Correct 1 ms 468 KB Output is correct
42 Correct 1 ms 468 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 2 ms 596 KB Output is correct
45 Correct 2 ms 596 KB Output is correct
46 Correct 2 ms 596 KB Output is correct
47 Correct 7 ms 980 KB Output is correct
48 Correct 7 ms 1072 KB Output is correct
49 Correct 13 ms 1672 KB Output is correct
50 Correct 27 ms 2772 KB Output is correct
51 Correct 42 ms 3916 KB Output is correct
52 Correct 41 ms 3892 KB Output is correct
53 Correct 57 ms 3952 KB Output is correct
54 Correct 41 ms 3948 KB Output is correct
55 Correct 46 ms 3960 KB Output is correct
56 Correct 40 ms 3960 KB Output is correct
57 Correct 41 ms 3956 KB Output is correct
58 Correct 42 ms 3924 KB Output is correct
59 Correct 52 ms 3956 KB Output is correct
60 Correct 41 ms 3960 KB Output is correct
61 Correct 41 ms 3900 KB Output is correct
62 Correct 41 ms 3916 KB Output is correct
63 Correct 44 ms 3956 KB Output is correct
64 Correct 41 ms 3912 KB Output is correct
65 Correct 40 ms 3924 KB Output is correct
66 Correct 41 ms 3964 KB Output is correct
67 Correct 41 ms 3956 KB Output is correct
68 Correct 47 ms 3848 KB Output is correct
69 Correct 41 ms 3916 KB Output is correct
70 Correct 41 ms 3924 KB Output is correct
71 Correct 10 ms 1044 KB Output is correct
72 Correct 10 ms 1108 KB Output is correct
73 Correct 9 ms 1096 KB Output is correct
74 Correct 7 ms 1084 KB Output is correct
75 Correct 7 ms 1100 KB Output is correct
76 Correct 14 ms 1748 KB Output is correct
77 Correct 14 ms 1764 KB Output is correct
78 Correct 14 ms 1756 KB Output is correct
79 Correct 14 ms 1756 KB Output is correct
80 Correct 14 ms 1696 KB Output is correct
81 Correct 28 ms 3056 KB Output is correct
82 Correct 28 ms 3044 KB Output is correct
83 Correct 28 ms 3028 KB Output is correct
84 Correct 28 ms 3000 KB Output is correct
85 Correct 33 ms 3056 KB Output is correct
86 Correct 29 ms 3284 KB Output is correct
87 Correct 30 ms 3428 KB Output is correct
88 Correct 29 ms 3292 KB Output is correct
89 Correct 29 ms 3300 KB Output is correct
90 Correct 30 ms 3284 KB Output is correct
91 Correct 55 ms 6584 KB Output is correct
92 Correct 55 ms 6652 KB Output is correct
93 Correct 45 ms 6632 KB Output is correct
94 Correct 46 ms 6596 KB Output is correct
95 Correct 49 ms 6668 KB Output is correct
96 Correct 52 ms 9372 KB Output is correct
97 Correct 49 ms 9324 KB Output is correct
98 Correct 49 ms 9332 KB Output is correct
99 Correct 51 ms 9308 KB Output is correct
100 Correct 50 ms 9288 KB Output is correct
101 Correct 54 ms 9292 KB Output is correct
102 Correct 49 ms 9308 KB Output is correct
103 Correct 48 ms 9344 KB Output is correct
104 Correct 50 ms 9368 KB Output is correct
105 Correct 58 ms 9332 KB Output is correct
106 Correct 49 ms 10700 KB Output is correct
107 Correct 49 ms 10716 KB Output is correct
108 Correct 50 ms 10732 KB Output is correct
109 Correct 49 ms 10712 KB Output is correct
110 Correct 49 ms 10744 KB Output is correct
111 Correct 49 ms 10680 KB Output is correct
112 Correct 54 ms 10696 KB Output is correct
113 Correct 50 ms 10648 KB Output is correct
114 Correct 49 ms 10744 KB Output is correct
115 Correct 49 ms 10652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 0 ms 468 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 0 ms 468 KB Output is correct
6 Correct 0 ms 468 KB Output is correct
7 Correct 0 ms 468 KB Output is correct
8 Correct 0 ms 468 KB Output is correct
9 Correct 0 ms 468 KB Output is correct
10 Correct 0 ms 468 KB Output is correct
11 Correct 0 ms 468 KB Output is correct
12 Correct 1 ms 468 KB Output is correct
13 Correct 1 ms 468 KB Output is correct
14 Correct 13 ms 1640 KB Output is correct
15 Correct 21 ms 2700 KB Output is correct
16 Correct 35 ms 3956 KB Output is correct
17 Correct 34 ms 3956 KB Output is correct
18 Correct 48 ms 3952 KB Output is correct
19 Correct 35 ms 3888 KB Output is correct
20 Correct 37 ms 3924 KB Output is correct
21 Correct 34 ms 3948 KB Output is correct
22 Correct 36 ms 3936 KB Output is correct
23 Correct 35 ms 3836 KB Output is correct
24 Correct 35 ms 3924 KB Output is correct
25 Correct 34 ms 3924 KB Output is correct
26 Correct 1 ms 468 KB Output is correct
27 Correct 1 ms 468 KB Output is correct
28 Correct 2 ms 596 KB Output is correct
29 Correct 12 ms 1592 KB Output is correct
30 Correct 23 ms 2804 KB Output is correct
31 Correct 35 ms 3924 KB Output is correct
32 Correct 40 ms 3924 KB Output is correct
33 Correct 36 ms 3916 KB Output is correct
34 Correct 36 ms 3952 KB Output is correct
35 Correct 36 ms 3848 KB Output is correct
36 Correct 36 ms 3956 KB Output is correct
37 Correct 35 ms 3948 KB Output is correct
38 Correct 36 ms 3960 KB Output is correct
39 Correct 36 ms 3924 KB Output is correct
40 Correct 36 ms 3944 KB Output is correct
41 Correct 1 ms 468 KB Output is correct
42 Correct 1 ms 468 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 2 ms 596 KB Output is correct
45 Correct 2 ms 596 KB Output is correct
46 Correct 2 ms 596 KB Output is correct
47 Correct 7 ms 980 KB Output is correct
48 Correct 7 ms 1072 KB Output is correct
49 Correct 13 ms 1672 KB Output is correct
50 Correct 27 ms 2772 KB Output is correct
51 Correct 42 ms 3916 KB Output is correct
52 Correct 41 ms 3892 KB Output is correct
53 Correct 57 ms 3952 KB Output is correct
54 Correct 41 ms 3948 KB Output is correct
55 Correct 46 ms 3960 KB Output is correct
56 Correct 40 ms 3960 KB Output is correct
57 Correct 41 ms 3956 KB Output is correct
58 Correct 42 ms 3924 KB Output is correct
59 Correct 52 ms 3956 KB Output is correct
60 Correct 41 ms 3960 KB Output is correct
61 Correct 41 ms 3900 KB Output is correct
62 Correct 41 ms 3916 KB Output is correct
63 Correct 44 ms 3956 KB Output is correct
64 Correct 41 ms 3912 KB Output is correct
65 Correct 40 ms 3924 KB Output is correct
66 Correct 41 ms 3964 KB Output is correct
67 Correct 41 ms 3956 KB Output is correct
68 Correct 47 ms 3848 KB Output is correct
69 Correct 41 ms 3916 KB Output is correct
70 Correct 41 ms 3924 KB Output is correct
71 Correct 10 ms 1044 KB Output is correct
72 Correct 10 ms 1108 KB Output is correct
73 Correct 9 ms 1096 KB Output is correct
74 Correct 7 ms 1084 KB Output is correct
75 Correct 7 ms 1100 KB Output is correct
76 Correct 14 ms 1748 KB Output is correct
77 Correct 14 ms 1764 KB Output is correct
78 Correct 14 ms 1756 KB Output is correct
79 Correct 14 ms 1756 KB Output is correct
80 Correct 14 ms 1696 KB Output is correct
81 Correct 28 ms 3056 KB Output is correct
82 Correct 28 ms 3044 KB Output is correct
83 Correct 28 ms 3028 KB Output is correct
84 Correct 28 ms 3000 KB Output is correct
85 Correct 33 ms 3056 KB Output is correct
86 Correct 29 ms 3284 KB Output is correct
87 Correct 30 ms 3428 KB Output is correct
88 Correct 29 ms 3292 KB Output is correct
89 Correct 29 ms 3300 KB Output is correct
90 Correct 30 ms 3284 KB Output is correct
91 Correct 55 ms 6584 KB Output is correct
92 Correct 55 ms 6652 KB Output is correct
93 Correct 45 ms 6632 KB Output is correct
94 Correct 46 ms 6596 KB Output is correct
95 Correct 49 ms 6668 KB Output is correct
96 Correct 52 ms 9372 KB Output is correct
97 Correct 49 ms 9324 KB Output is correct
98 Correct 49 ms 9332 KB Output is correct
99 Correct 51 ms 9308 KB Output is correct
100 Correct 50 ms 9288 KB Output is correct
101 Correct 54 ms 9292 KB Output is correct
102 Correct 49 ms 9308 KB Output is correct
103 Correct 48 ms 9344 KB Output is correct
104 Correct 50 ms 9368 KB Output is correct
105 Correct 58 ms 9332 KB Output is correct
106 Correct 49 ms 10700 KB Output is correct
107 Correct 49 ms 10716 KB Output is correct
108 Correct 50 ms 10732 KB Output is correct
109 Correct 49 ms 10712 KB Output is correct
110 Correct 49 ms 10744 KB Output is correct
111 Correct 49 ms 10680 KB Output is correct
112 Correct 54 ms 10696 KB Output is correct
113 Correct 50 ms 10648 KB Output is correct
114 Correct 49 ms 10744 KB Output is correct
115 Correct 49 ms 10652 KB Output is correct
116 Correct 4054 ms 1932 KB Output is correct
117 Correct 4469 ms 2448 KB Output is correct
118 Correct 4473 ms 3236 KB Output is correct
119 Correct 4790 ms 3288 KB Output is correct
120 Correct 4735 ms 3292 KB Output is correct
121 Correct 5709 ms 4100 KB Output is correct
122 Correct 6036 ms 4160 KB Output is correct
123 Correct 5138 ms 5832 KB Output is correct
124 Correct 5252 ms 5984 KB Output is correct
125 Correct 5289 ms 6128 KB Output is correct
126 Correct 5883 ms 7036 KB Output is correct
127 Correct 6071 ms 7028 KB Output is correct
128 Correct 5857 ms 7028 KB Output is correct
129 Correct 5863 ms 7028 KB Output is correct
130 Correct 5903 ms 7024 KB Output is correct
131 Correct 6106 ms 7204 KB Output is correct
132 Correct 6066 ms 7204 KB Output is correct
133 Correct 6025 ms 7192 KB Output is correct
134 Correct 6035 ms 7200 KB Output is correct
135 Correct 6156 ms 7208 KB Output is correct
136 Correct 6054 ms 7200 KB Output is correct
137 Correct 6591 ms 7216 KB Output is correct
138 Correct 6476 ms 7200 KB Output is correct
139 Correct 6526 ms 7192 KB Output is correct
140 Correct 5984 ms 7116 KB Output is correct
141 Correct 5998 ms 7244 KB Output is correct
142 Correct 6203 ms 7232 KB Output is correct
143 Correct 6290 ms 7236 KB Output is correct
144 Correct 6547 ms 7232 KB Output is correct
145 Correct 6403 ms 7224 KB Output is correct
146 Correct 6088 ms 7604 KB Output is correct
147 Correct 6084 ms 7600 KB Output is correct
148 Correct 5942 ms 7600 KB Output is correct
149 Correct 5911 ms 7612 KB Output is correct
150 Correct 6053 ms 7604 KB Output is correct
151 Correct 6302 ms 7764 KB Output is correct
152 Correct 6014 ms 7760 KB Output is correct
153 Correct 6385 ms 7760 KB Output is correct
154 Correct 6465 ms 7764 KB Output is correct
155 Correct 6217 ms 7764 KB Output is correct
156 Correct 6609 ms 9160 KB Output is correct
157 Correct 6414 ms 9292 KB Output is correct
158 Correct 6454 ms 9296 KB Output is correct
159 Correct 6312 ms 9288 KB Output is correct
160 Correct 6328 ms 9296 KB Output is correct
161 Correct 6107 ms 8908 KB Output is correct
162 Correct 6243 ms 8860 KB Output is correct
163 Correct 6187 ms 8908 KB Output is correct
164 Correct 6183 ms 8856 KB Output is correct
165 Correct 6166 ms 8860 KB Output is correct
166 Correct 5969 ms 7824 KB Output is correct
167 Correct 5969 ms 7824 KB Output is correct
168 Correct 5935 ms 7824 KB Output is correct
169 Correct 6001 ms 7816 KB Output is correct
170 Correct 5943 ms 7884 KB Output is correct
171 Correct 5956 ms 7760 KB Output is correct
172 Correct 5913 ms 7772 KB Output is correct
173 Correct 6428 ms 7768 KB Output is correct
174 Correct 6073 ms 7756 KB Output is correct
175 Correct 6842 ms 7784 KB Output is correct