답안 #814815

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

const int maxn = 300000, maxq = 50000;
int B;
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;
	B = N / max((double)1, sqrt(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 1 ms 468 KB Output is correct
3 Correct 0 ms 468 KB Output is correct
4 Correct 0 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 1 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 3 ms 468 KB Output is correct
4 Correct 12 ms 1620 KB Output is correct
5 Correct 22 ms 2808 KB Output is correct
6 Correct 44 ms 3924 KB Output is correct
7 Correct 35 ms 3944 KB Output is correct
8 Correct 36 ms 3952 KB Output is correct
9 Correct 35 ms 3924 KB Output is correct
10 Correct 35 ms 3928 KB Output is correct
11 Correct 35 ms 3908 KB Output is correct
12 Correct 36 ms 3924 KB Output is correct
13 Correct 36 ms 3936 KB Output is correct
14 Correct 35 ms 3924 KB Output is correct
15 Correct 36 ms 3940 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 3 ms 468 KB Output is correct
4 Correct 12 ms 1620 KB Output is correct
5 Correct 22 ms 2808 KB Output is correct
6 Correct 44 ms 3924 KB Output is correct
7 Correct 35 ms 3944 KB Output is correct
8 Correct 36 ms 3952 KB Output is correct
9 Correct 35 ms 3924 KB Output is correct
10 Correct 35 ms 3928 KB Output is correct
11 Correct 35 ms 3908 KB Output is correct
12 Correct 36 ms 3924 KB Output is correct
13 Correct 36 ms 3936 KB Output is correct
14 Correct 35 ms 3924 KB Output is correct
15 Correct 36 ms 3940 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 3 ms 468 KB Output is correct
19 Correct 16 ms 1648 KB Output is correct
20 Correct 30 ms 2728 KB Output is correct
21 Correct 37 ms 3924 KB Output is correct
22 Correct 37 ms 3924 KB Output is correct
23 Correct 37 ms 3868 KB Output is correct
24 Correct 38 ms 3940 KB Output is correct
25 Correct 37 ms 3940 KB Output is correct
26 Correct 37 ms 3840 KB Output is correct
27 Correct 36 ms 3920 KB Output is correct
28 Correct 37 ms 3880 KB Output is correct
29 Correct 39 ms 3860 KB Output is correct
30 Correct 37 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 3 ms 468 KB Output is correct
4 Correct 12 ms 1620 KB Output is correct
5 Correct 22 ms 2808 KB Output is correct
6 Correct 44 ms 3924 KB Output is correct
7 Correct 35 ms 3944 KB Output is correct
8 Correct 36 ms 3952 KB Output is correct
9 Correct 35 ms 3924 KB Output is correct
10 Correct 35 ms 3928 KB Output is correct
11 Correct 35 ms 3908 KB Output is correct
12 Correct 36 ms 3924 KB Output is correct
13 Correct 36 ms 3936 KB Output is correct
14 Correct 35 ms 3924 KB Output is correct
15 Correct 36 ms 3940 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 3 ms 468 KB Output is correct
19 Correct 16 ms 1648 KB Output is correct
20 Correct 30 ms 2728 KB Output is correct
21 Correct 37 ms 3924 KB Output is correct
22 Correct 37 ms 3924 KB Output is correct
23 Correct 37 ms 3868 KB Output is correct
24 Correct 38 ms 3940 KB Output is correct
25 Correct 37 ms 3940 KB Output is correct
26 Correct 37 ms 3840 KB Output is correct
27 Correct 36 ms 3920 KB Output is correct
28 Correct 37 ms 3880 KB Output is correct
29 Correct 39 ms 3860 KB Output is correct
30 Correct 37 ms 3924 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 980 KB Output is correct
39 Correct 14 ms 1668 KB Output is correct
40 Correct 27 ms 2772 KB Output is correct
41 Correct 42 ms 3864 KB Output is correct
42 Correct 42 ms 3956 KB Output is correct
43 Correct 42 ms 3860 KB Output is correct
44 Correct 44 ms 3956 KB Output is correct
45 Correct 42 ms 3912 KB Output is correct
46 Correct 42 ms 3864 KB Output is correct
47 Correct 47 ms 3952 KB Output is correct
48 Correct 50 ms 3952 KB Output is correct
49 Correct 42 ms 3872 KB Output is correct
50 Correct 45 ms 3860 KB Output is correct
51 Correct 41 ms 3876 KB Output is correct
52 Correct 41 ms 3956 KB Output is correct
53 Correct 42 ms 3952 KB Output is correct
54 Correct 42 ms 3956 KB Output is correct
55 Correct 41 ms 3944 KB Output is correct
56 Correct 41 ms 3932 KB Output is correct
57 Correct 41 ms 3856 KB Output is correct
58 Correct 44 ms 3872 KB Output is correct
59 Correct 41 ms 3956 KB Output is correct
60 Correct 41 ms 3952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 0 ms 468 KB Output is correct
4 Correct 0 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 1 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 3 ms 468 KB Output is correct
14 Correct 12 ms 1620 KB Output is correct
15 Correct 22 ms 2808 KB Output is correct
16 Correct 44 ms 3924 KB Output is correct
17 Correct 35 ms 3944 KB Output is correct
18 Correct 36 ms 3952 KB Output is correct
19 Correct 35 ms 3924 KB Output is correct
20 Correct 35 ms 3928 KB Output is correct
21 Correct 35 ms 3908 KB Output is correct
22 Correct 36 ms 3924 KB Output is correct
23 Correct 36 ms 3936 KB Output is correct
24 Correct 35 ms 3924 KB Output is correct
25 Correct 36 ms 3940 KB Output is correct
26 Correct 1 ms 468 KB Output is correct
27 Correct 1 ms 468 KB Output is correct
28 Correct 3 ms 468 KB Output is correct
29 Correct 16 ms 1648 KB Output is correct
30 Correct 30 ms 2728 KB Output is correct
31 Correct 37 ms 3924 KB Output is correct
32 Correct 37 ms 3924 KB Output is correct
33 Correct 37 ms 3868 KB Output is correct
34 Correct 38 ms 3940 KB Output is correct
35 Correct 37 ms 3940 KB Output is correct
36 Correct 37 ms 3840 KB Output is correct
37 Correct 36 ms 3920 KB Output is correct
38 Correct 37 ms 3880 KB Output is correct
39 Correct 39 ms 3860 KB Output is correct
40 Correct 37 ms 3924 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 980 KB Output is correct
49 Correct 14 ms 1668 KB Output is correct
50 Correct 27 ms 2772 KB Output is correct
51 Correct 42 ms 3864 KB Output is correct
52 Correct 42 ms 3956 KB Output is correct
53 Correct 42 ms 3860 KB Output is correct
54 Correct 44 ms 3956 KB Output is correct
55 Correct 42 ms 3912 KB Output is correct
56 Correct 42 ms 3864 KB Output is correct
57 Correct 47 ms 3952 KB Output is correct
58 Correct 50 ms 3952 KB Output is correct
59 Correct 42 ms 3872 KB Output is correct
60 Correct 45 ms 3860 KB Output is correct
61 Correct 41 ms 3876 KB Output is correct
62 Correct 41 ms 3956 KB Output is correct
63 Correct 42 ms 3952 KB Output is correct
64 Correct 42 ms 3956 KB Output is correct
65 Correct 41 ms 3944 KB Output is correct
66 Correct 41 ms 3932 KB Output is correct
67 Correct 41 ms 3856 KB Output is correct
68 Correct 44 ms 3872 KB Output is correct
69 Correct 41 ms 3956 KB Output is correct
70 Correct 41 ms 3952 KB Output is correct
71 Correct 7 ms 980 KB Output is correct
72 Correct 9 ms 1096 KB Output is correct
73 Correct 7 ms 1040 KB Output is correct
74 Correct 8 ms 980 KB Output is correct
75 Correct 7 ms 980 KB Output is correct
76 Correct 16 ms 1756 KB Output is correct
77 Correct 14 ms 1748 KB Output is correct
78 Correct 14 ms 1756 KB Output is correct
79 Correct 15 ms 1688 KB Output is correct
80 Correct 14 ms 1760 KB Output is correct
81 Correct 28 ms 3048 KB Output is correct
82 Correct 34 ms 3148 KB Output is correct
83 Correct 34 ms 3052 KB Output is correct
84 Correct 30 ms 2992 KB Output is correct
85 Correct 28 ms 2968 KB Output is correct
86 Correct 29 ms 3312 KB Output is correct
87 Correct 30 ms 3284 KB Output is correct
88 Correct 30 ms 3280 KB Output is correct
89 Correct 29 ms 3284 KB Output is correct
90 Correct 30 ms 3296 KB Output is correct
91 Correct 46 ms 6592 KB Output is correct
92 Correct 48 ms 6684 KB Output is correct
93 Correct 46 ms 6636 KB Output is correct
94 Correct 45 ms 6676 KB Output is correct
95 Correct 46 ms 6556 KB Output is correct
96 Correct 50 ms 9360 KB Output is correct
97 Correct 50 ms 9324 KB Output is correct
98 Correct 50 ms 9292 KB Output is correct
99 Correct 51 ms 9376 KB Output is correct
100 Correct 49 ms 9292 KB Output is correct
101 Correct 54 ms 9296 KB Output is correct
102 Correct 49 ms 9292 KB Output is correct
103 Correct 49 ms 9340 KB Output is correct
104 Correct 52 ms 9292 KB Output is correct
105 Correct 50 ms 9308 KB Output is correct
106 Correct 50 ms 10696 KB Output is correct
107 Correct 60 ms 10700 KB Output is correct
108 Correct 53 ms 10716 KB Output is correct
109 Correct 51 ms 10640 KB Output is correct
110 Correct 56 ms 10692 KB Output is correct
111 Correct 49 ms 10720 KB Output is correct
112 Correct 49 ms 10744 KB Output is correct
113 Correct 54 ms 10712 KB Output is correct
114 Correct 50 ms 10700 KB Output is correct
115 Correct 50 ms 10692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 0 ms 468 KB Output is correct
4 Correct 0 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 1 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 3 ms 468 KB Output is correct
14 Correct 12 ms 1620 KB Output is correct
15 Correct 22 ms 2808 KB Output is correct
16 Correct 44 ms 3924 KB Output is correct
17 Correct 35 ms 3944 KB Output is correct
18 Correct 36 ms 3952 KB Output is correct
19 Correct 35 ms 3924 KB Output is correct
20 Correct 35 ms 3928 KB Output is correct
21 Correct 35 ms 3908 KB Output is correct
22 Correct 36 ms 3924 KB Output is correct
23 Correct 36 ms 3936 KB Output is correct
24 Correct 35 ms 3924 KB Output is correct
25 Correct 36 ms 3940 KB Output is correct
26 Correct 1 ms 468 KB Output is correct
27 Correct 1 ms 468 KB Output is correct
28 Correct 3 ms 468 KB Output is correct
29 Correct 16 ms 1648 KB Output is correct
30 Correct 30 ms 2728 KB Output is correct
31 Correct 37 ms 3924 KB Output is correct
32 Correct 37 ms 3924 KB Output is correct
33 Correct 37 ms 3868 KB Output is correct
34 Correct 38 ms 3940 KB Output is correct
35 Correct 37 ms 3940 KB Output is correct
36 Correct 37 ms 3840 KB Output is correct
37 Correct 36 ms 3920 KB Output is correct
38 Correct 37 ms 3880 KB Output is correct
39 Correct 39 ms 3860 KB Output is correct
40 Correct 37 ms 3924 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 980 KB Output is correct
49 Correct 14 ms 1668 KB Output is correct
50 Correct 27 ms 2772 KB Output is correct
51 Correct 42 ms 3864 KB Output is correct
52 Correct 42 ms 3956 KB Output is correct
53 Correct 42 ms 3860 KB Output is correct
54 Correct 44 ms 3956 KB Output is correct
55 Correct 42 ms 3912 KB Output is correct
56 Correct 42 ms 3864 KB Output is correct
57 Correct 47 ms 3952 KB Output is correct
58 Correct 50 ms 3952 KB Output is correct
59 Correct 42 ms 3872 KB Output is correct
60 Correct 45 ms 3860 KB Output is correct
61 Correct 41 ms 3876 KB Output is correct
62 Correct 41 ms 3956 KB Output is correct
63 Correct 42 ms 3952 KB Output is correct
64 Correct 42 ms 3956 KB Output is correct
65 Correct 41 ms 3944 KB Output is correct
66 Correct 41 ms 3932 KB Output is correct
67 Correct 41 ms 3856 KB Output is correct
68 Correct 44 ms 3872 KB Output is correct
69 Correct 41 ms 3956 KB Output is correct
70 Correct 41 ms 3952 KB Output is correct
71 Correct 7 ms 980 KB Output is correct
72 Correct 9 ms 1096 KB Output is correct
73 Correct 7 ms 1040 KB Output is correct
74 Correct 8 ms 980 KB Output is correct
75 Correct 7 ms 980 KB Output is correct
76 Correct 16 ms 1756 KB Output is correct
77 Correct 14 ms 1748 KB Output is correct
78 Correct 14 ms 1756 KB Output is correct
79 Correct 15 ms 1688 KB Output is correct
80 Correct 14 ms 1760 KB Output is correct
81 Correct 28 ms 3048 KB Output is correct
82 Correct 34 ms 3148 KB Output is correct
83 Correct 34 ms 3052 KB Output is correct
84 Correct 30 ms 2992 KB Output is correct
85 Correct 28 ms 2968 KB Output is correct
86 Correct 29 ms 3312 KB Output is correct
87 Correct 30 ms 3284 KB Output is correct
88 Correct 30 ms 3280 KB Output is correct
89 Correct 29 ms 3284 KB Output is correct
90 Correct 30 ms 3296 KB Output is correct
91 Correct 46 ms 6592 KB Output is correct
92 Correct 48 ms 6684 KB Output is correct
93 Correct 46 ms 6636 KB Output is correct
94 Correct 45 ms 6676 KB Output is correct
95 Correct 46 ms 6556 KB Output is correct
96 Correct 50 ms 9360 KB Output is correct
97 Correct 50 ms 9324 KB Output is correct
98 Correct 50 ms 9292 KB Output is correct
99 Correct 51 ms 9376 KB Output is correct
100 Correct 49 ms 9292 KB Output is correct
101 Correct 54 ms 9296 KB Output is correct
102 Correct 49 ms 9292 KB Output is correct
103 Correct 49 ms 9340 KB Output is correct
104 Correct 52 ms 9292 KB Output is correct
105 Correct 50 ms 9308 KB Output is correct
106 Correct 50 ms 10696 KB Output is correct
107 Correct 60 ms 10700 KB Output is correct
108 Correct 53 ms 10716 KB Output is correct
109 Correct 51 ms 10640 KB Output is correct
110 Correct 56 ms 10692 KB Output is correct
111 Correct 49 ms 10720 KB Output is correct
112 Correct 49 ms 10744 KB Output is correct
113 Correct 54 ms 10712 KB Output is correct
114 Correct 50 ms 10700 KB Output is correct
115 Correct 50 ms 10692 KB Output is correct
116 Correct 179 ms 1936 KB Output is correct
117 Correct 181 ms 1940 KB Output is correct
118 Correct 781 ms 2636 KB Output is correct
119 Correct 840 ms 2540 KB Output is correct
120 Correct 819 ms 2508 KB Output is correct
121 Correct 1563 ms 3136 KB Output is correct
122 Correct 1581 ms 3144 KB Output is correct
123 Correct 3164 ms 4444 KB Output is correct
124 Correct 3255 ms 4548 KB Output is correct
125 Correct 3233 ms 4668 KB Output is correct
126 Correct 4864 ms 5444 KB Output is correct
127 Correct 4984 ms 7164 KB Output is correct
128 Correct 4803 ms 7152 KB Output is correct
129 Correct 4772 ms 7164 KB Output is correct
130 Correct 4702 ms 7152 KB Output is correct
131 Correct 4885 ms 7336 KB Output is correct
132 Correct 4925 ms 7216 KB Output is correct
133 Correct 4882 ms 7324 KB Output is correct
134 Correct 4977 ms 7324 KB Output is correct
135 Correct 4936 ms 7336 KB Output is correct
136 Correct 5310 ms 7236 KB Output is correct
137 Correct 5460 ms 7292 KB Output is correct
138 Correct 5306 ms 7320 KB Output is correct
139 Correct 5412 ms 7324 KB Output is correct
140 Correct 5742 ms 7324 KB Output is correct
141 Correct 5342 ms 7360 KB Output is correct
142 Correct 5734 ms 7352 KB Output is correct
143 Correct 5203 ms 7360 KB Output is correct
144 Correct 4976 ms 7364 KB Output is correct
145 Correct 5375 ms 7356 KB Output is correct
146 Correct 5152 ms 7728 KB Output is correct
147 Correct 6034 ms 7732 KB Output is correct
148 Correct 5318 ms 7732 KB Output is correct
149 Correct 5342 ms 7736 KB Output is correct
150 Correct 5822 ms 7736 KB Output is correct
151 Correct 5605 ms 7896 KB Output is correct
152 Correct 5882 ms 7900 KB Output is correct
153 Correct 5704 ms 7900 KB Output is correct
154 Correct 5549 ms 7896 KB Output is correct
155 Correct 5636 ms 7892 KB Output is correct
156 Correct 5255 ms 9240 KB Output is correct
157 Correct 5381 ms 9108 KB Output is correct
158 Correct 5544 ms 9108 KB Output is correct
159 Correct 5271 ms 9108 KB Output is correct
160 Correct 6072 ms 9124 KB Output is correct
161 Correct 5250 ms 8568 KB Output is correct
162 Correct 5444 ms 8564 KB Output is correct
163 Correct 5538 ms 8572 KB Output is correct
164 Correct 5574 ms 8568 KB Output is correct
165 Correct 5275 ms 8572 KB Output is correct
166 Correct 5278 ms 7752 KB Output is correct
167 Correct 5319 ms 7756 KB Output is correct
168 Correct 5310 ms 7748 KB Output is correct
169 Correct 5553 ms 7756 KB Output is correct
170 Correct 5182 ms 7752 KB Output is correct
171 Correct 4857 ms 7620 KB Output is correct
172 Correct 4799 ms 7624 KB Output is correct
173 Correct 4777 ms 7628 KB Output is correct
174 Correct 4762 ms 6596 KB Output is correct
175 Correct 5446 ms 6476 KB Output is correct