Submission #572493

# Submission time Handle Problem Language Result Execution time Memory
572493 2022-06-04T13:39:43 Z valerikk Diversity (CEOI21_diversity) C++17
100 / 100
2390 ms 6012 KB
#include <bits/stdc++.h>

using namespace std;

const int N = 3e5 + 7;
const int Q = 5e4 + 11;
const int B = 450;

long long solve(vector<pair<int, int>> c) {
	sort(c.rbegin(), c.rend());

	int n = 0, k = 0;
	
	deque<pair<int, int>> q;

	int t = 0;
	for (const auto &[x, y] : c) {
		n += x * y;
		k += y;
		if (t) {
			q.push_back({x, (y + 1) / 2});	
			if (y > 1)
				q.push_front({x, y / 2});
		} else {
			q.push_front({x, (y + 1) / 2});
			if (y > 1)
				q.push_back({x, y / 2});
		}

		t = (t + y) & 1;
	}

	vector<pair<int, int>> z(q.begin(), q.end());

	long long all = n * 1ll * (n + 1) / 2 * k;

	long long bad = 0;

	long long sum = 0;
	for (int i = 0; i < (int) z.size(); ++i) {
		const auto &[x, y] = z[i];

		bad += sum * sum * y;
		bad += sum * x * y * (y - 1);
		bad += sum * y;
		bad += x * 1ll * y * (y - 1) / 2;
		bad += (y - 1) * 1ll * y * (2 * (y - 1) + 1) / 6 * x * x;

		sum += x * y;
	}

	sum = 0;
	for (int i = (int) z.size() - 1; i >= 0; --i) {
		const auto &[x, y] = z[i];

		bad += sum * sum * y;
		bad += sum * x * y * (y - 1);
		bad += sum * y;
		bad += x * 1ll * y * (y - 1) / 2;
		bad += (y - 1) * 1ll * y * (2 * (y - 1) + 1) / 6 * x * x;

		sum += x * y;
	}

	bad /= 2;

	// cout << all << " " << bad << "\n";

	long long res = all - bad;

	return res;
}

int n, q;
int a[N];
int l[Q], r[Q];
int ord[Q];

struct Cnt {
	int cnt[N];
	int scnt[N];
	bool used[N];
	vector<int> s;

	void add(int x) {
		--scnt[cnt[x]];
		++cnt[x];
		if (++scnt[cnt[x]] == 1 && !used[cnt[x]] && cnt[x] > 0) {
			s.push_back(cnt[x]);
			used[cnt[x]] = true;
		}
	}

	void remove(int x) {
		--scnt[cnt[x]];
		--cnt[x];
		if (++scnt[cnt[x]] == 1 && !used[cnt[x]] && cnt[x] > 0) {
			s.push_back(cnt[x]);
			used[cnt[x]] = true;
		}
	}

	vector<pair<int, int>> get_cnts() {
		vector<pair<int, int>> res;
		vector<int> s1;
		for (int i : s) {
			if (scnt[i] > 0) {
				res.push_back({i, scnt[i]});
				s1.push_back(i);
			} else {
				used[i] = false;
			}
		}
		s = s1;
		return res;
	}

	Cnt() {
		for (int i = 0; i < N; ++i) {
			++scnt[cnt[i]];
		}
		s.reserve(N);
	}
} cnt;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> n >> q;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}

	for (int i = 0; i < q; ++i) {
		cin >> l[i] >> r[i];
		--l[i];
	}

	iota(ord, ord + q, 0);
	sort(ord, ord + q, [&] (const int &i, const int &j) {
		int blocki = l[i] / B;
		int blockj = l[j] / B;
		return make_pair(blocki, (blocki & 1) ? -r[i] : r[i]) < make_pair(blockj, (blockj & 1) ? -r[j] : r[j]);
	});

	vector<long long> ans(q);

	int cl = 0, cr = 0;
	for (int i = 0; i < q; ++i) {
		while (cl > l[ord[i]]) {
			cnt.add(a[--cl]);
		}
		while (cr < r[ord[i]]) {
			cnt.add(a[cr++]);
		}
		while (cl < l[ord[i]]) {
			cnt.remove(a[cl++]);
		}
		while (cr > r[ord[i]]) {
			cnt.remove(a[--cr]);
		}

		ans[ord[i]] = solve(cnt.get_cnts());
	}

	for (int i = 0; i < q; ++i) {
		cout << ans[i] << "\n";
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 360 KB Output is correct
3 Correct 2 ms 360 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 2 ms 360 KB Output is correct
10 Correct 2 ms 360 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 372 KB Output is correct
4 Correct 7 ms 1236 KB Output is correct
5 Correct 18 ms 2068 KB Output is correct
6 Correct 23 ms 2588 KB Output is correct
7 Correct 22 ms 3656 KB Output is correct
8 Correct 20 ms 2464 KB Output is correct
9 Correct 18 ms 2536 KB Output is correct
10 Correct 21 ms 3016 KB Output is correct
11 Correct 19 ms 2768 KB Output is correct
12 Correct 21 ms 2648 KB Output is correct
13 Correct 19 ms 2520 KB Output is correct
14 Correct 21 ms 2788 KB Output is correct
15 Correct 22 ms 2636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 372 KB Output is correct
4 Correct 7 ms 1236 KB Output is correct
5 Correct 18 ms 2068 KB Output is correct
6 Correct 23 ms 2588 KB Output is correct
7 Correct 22 ms 3656 KB Output is correct
8 Correct 20 ms 2464 KB Output is correct
9 Correct 18 ms 2536 KB Output is correct
10 Correct 21 ms 3016 KB Output is correct
11 Correct 19 ms 2768 KB Output is correct
12 Correct 21 ms 2648 KB Output is correct
13 Correct 19 ms 2520 KB Output is correct
14 Correct 21 ms 2788 KB Output is correct
15 Correct 22 ms 2636 KB Output is correct
16 Correct 2 ms 340 KB Output is correct
17 Correct 2 ms 360 KB Output is correct
18 Correct 2 ms 340 KB Output is correct
19 Correct 8 ms 1108 KB Output is correct
20 Correct 14 ms 1912 KB Output is correct
21 Correct 21 ms 2552 KB Output is correct
22 Correct 26 ms 2500 KB Output is correct
23 Correct 24 ms 2536 KB Output is correct
24 Correct 23 ms 2380 KB Output is correct
25 Correct 23 ms 2468 KB Output is correct
26 Correct 22 ms 2552 KB Output is correct
27 Correct 25 ms 2444 KB Output is correct
28 Correct 21 ms 2764 KB Output is correct
29 Correct 21 ms 2524 KB Output is correct
30 Correct 21 ms 2456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 372 KB Output is correct
4 Correct 7 ms 1236 KB Output is correct
5 Correct 18 ms 2068 KB Output is correct
6 Correct 23 ms 2588 KB Output is correct
7 Correct 22 ms 3656 KB Output is correct
8 Correct 20 ms 2464 KB Output is correct
9 Correct 18 ms 2536 KB Output is correct
10 Correct 21 ms 3016 KB Output is correct
11 Correct 19 ms 2768 KB Output is correct
12 Correct 21 ms 2648 KB Output is correct
13 Correct 19 ms 2520 KB Output is correct
14 Correct 21 ms 2788 KB Output is correct
15 Correct 22 ms 2636 KB Output is correct
16 Correct 2 ms 340 KB Output is correct
17 Correct 2 ms 360 KB Output is correct
18 Correct 2 ms 340 KB Output is correct
19 Correct 8 ms 1108 KB Output is correct
20 Correct 14 ms 1912 KB Output is correct
21 Correct 21 ms 2552 KB Output is correct
22 Correct 26 ms 2500 KB Output is correct
23 Correct 24 ms 2536 KB Output is correct
24 Correct 23 ms 2380 KB Output is correct
25 Correct 23 ms 2468 KB Output is correct
26 Correct 22 ms 2552 KB Output is correct
27 Correct 25 ms 2444 KB Output is correct
28 Correct 21 ms 2764 KB Output is correct
29 Correct 21 ms 2524 KB Output is correct
30 Correct 21 ms 2456 KB Output is correct
31 Correct 2 ms 360 KB Output is correct
32 Correct 2 ms 340 KB Output is correct
33 Correct 2 ms 340 KB Output is correct
34 Correct 3 ms 404 KB Output is correct
35 Correct 2 ms 468 KB Output is correct
36 Correct 2 ms 340 KB Output is correct
37 Correct 6 ms 724 KB Output is correct
38 Correct 5 ms 660 KB Output is correct
39 Correct 9 ms 1112 KB Output is correct
40 Correct 17 ms 1804 KB Output is correct
41 Correct 30 ms 2108 KB Output is correct
42 Correct 32 ms 2176 KB Output is correct
43 Correct 25 ms 2136 KB Output is correct
44 Correct 21 ms 2124 KB Output is correct
45 Correct 26 ms 2120 KB Output is correct
46 Correct 21 ms 2208 KB Output is correct
47 Correct 28 ms 2272 KB Output is correct
48 Correct 26 ms 2164 KB Output is correct
49 Correct 22 ms 2192 KB Output is correct
50 Correct 23 ms 2104 KB Output is correct
51 Correct 24 ms 2148 KB Output is correct
52 Correct 27 ms 2148 KB Output is correct
53 Correct 25 ms 2148 KB Output is correct
54 Correct 23 ms 2156 KB Output is correct
55 Correct 26 ms 2124 KB Output is correct
56 Correct 25 ms 2120 KB Output is correct
57 Correct 27 ms 2128 KB Output is correct
58 Correct 22 ms 2108 KB Output is correct
59 Correct 30 ms 2220 KB Output is correct
60 Correct 30 ms 2180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 360 KB Output is correct
3 Correct 2 ms 360 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 2 ms 360 KB Output is correct
10 Correct 2 ms 360 KB Output is correct
11 Correct 2 ms 340 KB Output is correct
12 Correct 2 ms 340 KB Output is correct
13 Correct 2 ms 372 KB Output is correct
14 Correct 7 ms 1236 KB Output is correct
15 Correct 18 ms 2068 KB Output is correct
16 Correct 23 ms 2588 KB Output is correct
17 Correct 22 ms 3656 KB Output is correct
18 Correct 20 ms 2464 KB Output is correct
19 Correct 18 ms 2536 KB Output is correct
20 Correct 21 ms 3016 KB Output is correct
21 Correct 19 ms 2768 KB Output is correct
22 Correct 21 ms 2648 KB Output is correct
23 Correct 19 ms 2520 KB Output is correct
24 Correct 21 ms 2788 KB Output is correct
25 Correct 22 ms 2636 KB Output is correct
26 Correct 2 ms 340 KB Output is correct
27 Correct 2 ms 360 KB Output is correct
28 Correct 2 ms 340 KB Output is correct
29 Correct 8 ms 1108 KB Output is correct
30 Correct 14 ms 1912 KB Output is correct
31 Correct 21 ms 2552 KB Output is correct
32 Correct 26 ms 2500 KB Output is correct
33 Correct 24 ms 2536 KB Output is correct
34 Correct 23 ms 2380 KB Output is correct
35 Correct 23 ms 2468 KB Output is correct
36 Correct 22 ms 2552 KB Output is correct
37 Correct 25 ms 2444 KB Output is correct
38 Correct 21 ms 2764 KB Output is correct
39 Correct 21 ms 2524 KB Output is correct
40 Correct 21 ms 2456 KB Output is correct
41 Correct 2 ms 360 KB Output is correct
42 Correct 2 ms 340 KB Output is correct
43 Correct 2 ms 340 KB Output is correct
44 Correct 3 ms 404 KB Output is correct
45 Correct 2 ms 468 KB Output is correct
46 Correct 2 ms 340 KB Output is correct
47 Correct 6 ms 724 KB Output is correct
48 Correct 5 ms 660 KB Output is correct
49 Correct 9 ms 1112 KB Output is correct
50 Correct 17 ms 1804 KB Output is correct
51 Correct 30 ms 2108 KB Output is correct
52 Correct 32 ms 2176 KB Output is correct
53 Correct 25 ms 2136 KB Output is correct
54 Correct 21 ms 2124 KB Output is correct
55 Correct 26 ms 2120 KB Output is correct
56 Correct 21 ms 2208 KB Output is correct
57 Correct 28 ms 2272 KB Output is correct
58 Correct 26 ms 2164 KB Output is correct
59 Correct 22 ms 2192 KB Output is correct
60 Correct 23 ms 2104 KB Output is correct
61 Correct 24 ms 2148 KB Output is correct
62 Correct 27 ms 2148 KB Output is correct
63 Correct 25 ms 2148 KB Output is correct
64 Correct 23 ms 2156 KB Output is correct
65 Correct 26 ms 2124 KB Output is correct
66 Correct 25 ms 2120 KB Output is correct
67 Correct 27 ms 2128 KB Output is correct
68 Correct 22 ms 2108 KB Output is correct
69 Correct 30 ms 2220 KB Output is correct
70 Correct 30 ms 2180 KB Output is correct
71 Correct 5 ms 724 KB Output is correct
72 Correct 5 ms 736 KB Output is correct
73 Correct 7 ms 800 KB Output is correct
74 Correct 5 ms 756 KB Output is correct
75 Correct 6 ms 736 KB Output is correct
76 Correct 11 ms 1144 KB Output is correct
77 Correct 9 ms 1192 KB Output is correct
78 Correct 9 ms 1236 KB Output is correct
79 Correct 9 ms 1236 KB Output is correct
80 Correct 9 ms 1136 KB Output is correct
81 Correct 16 ms 1764 KB Output is correct
82 Correct 21 ms 1816 KB Output is correct
83 Correct 23 ms 1700 KB Output is correct
84 Correct 17 ms 1740 KB Output is correct
85 Correct 17 ms 1736 KB Output is correct
86 Correct 22 ms 1876 KB Output is correct
87 Correct 18 ms 1740 KB Output is correct
88 Correct 19 ms 1784 KB Output is correct
89 Correct 18 ms 1844 KB Output is correct
90 Correct 18 ms 1820 KB Output is correct
91 Correct 30 ms 2484 KB Output is correct
92 Correct 31 ms 2440 KB Output is correct
93 Correct 33 ms 2676 KB Output is correct
94 Correct 29 ms 2508 KB Output is correct
95 Correct 30 ms 2592 KB Output is correct
96 Correct 35 ms 2948 KB Output is correct
97 Correct 31 ms 2816 KB Output is correct
98 Correct 38 ms 2832 KB Output is correct
99 Correct 32 ms 2872 KB Output is correct
100 Correct 35 ms 2912 KB Output is correct
101 Correct 36 ms 2884 KB Output is correct
102 Correct 32 ms 2892 KB Output is correct
103 Correct 29 ms 2920 KB Output is correct
104 Correct 36 ms 2880 KB Output is correct
105 Correct 36 ms 2836 KB Output is correct
106 Correct 33 ms 3128 KB Output is correct
107 Correct 35 ms 3024 KB Output is correct
108 Correct 32 ms 3048 KB Output is correct
109 Correct 38 ms 3108 KB Output is correct
110 Correct 39 ms 3100 KB Output is correct
111 Correct 36 ms 3060 KB Output is correct
112 Correct 28 ms 3076 KB Output is correct
113 Correct 30 ms 3044 KB Output is correct
114 Correct 36 ms 3112 KB Output is correct
115 Correct 36 ms 3072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 360 KB Output is correct
3 Correct 2 ms 360 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 2 ms 360 KB Output is correct
10 Correct 2 ms 360 KB Output is correct
11 Correct 2 ms 340 KB Output is correct
12 Correct 2 ms 340 KB Output is correct
13 Correct 2 ms 372 KB Output is correct
14 Correct 7 ms 1236 KB Output is correct
15 Correct 18 ms 2068 KB Output is correct
16 Correct 23 ms 2588 KB Output is correct
17 Correct 22 ms 3656 KB Output is correct
18 Correct 20 ms 2464 KB Output is correct
19 Correct 18 ms 2536 KB Output is correct
20 Correct 21 ms 3016 KB Output is correct
21 Correct 19 ms 2768 KB Output is correct
22 Correct 21 ms 2648 KB Output is correct
23 Correct 19 ms 2520 KB Output is correct
24 Correct 21 ms 2788 KB Output is correct
25 Correct 22 ms 2636 KB Output is correct
26 Correct 2 ms 340 KB Output is correct
27 Correct 2 ms 360 KB Output is correct
28 Correct 2 ms 340 KB Output is correct
29 Correct 8 ms 1108 KB Output is correct
30 Correct 14 ms 1912 KB Output is correct
31 Correct 21 ms 2552 KB Output is correct
32 Correct 26 ms 2500 KB Output is correct
33 Correct 24 ms 2536 KB Output is correct
34 Correct 23 ms 2380 KB Output is correct
35 Correct 23 ms 2468 KB Output is correct
36 Correct 22 ms 2552 KB Output is correct
37 Correct 25 ms 2444 KB Output is correct
38 Correct 21 ms 2764 KB Output is correct
39 Correct 21 ms 2524 KB Output is correct
40 Correct 21 ms 2456 KB Output is correct
41 Correct 2 ms 360 KB Output is correct
42 Correct 2 ms 340 KB Output is correct
43 Correct 2 ms 340 KB Output is correct
44 Correct 3 ms 404 KB Output is correct
45 Correct 2 ms 468 KB Output is correct
46 Correct 2 ms 340 KB Output is correct
47 Correct 6 ms 724 KB Output is correct
48 Correct 5 ms 660 KB Output is correct
49 Correct 9 ms 1112 KB Output is correct
50 Correct 17 ms 1804 KB Output is correct
51 Correct 30 ms 2108 KB Output is correct
52 Correct 32 ms 2176 KB Output is correct
53 Correct 25 ms 2136 KB Output is correct
54 Correct 21 ms 2124 KB Output is correct
55 Correct 26 ms 2120 KB Output is correct
56 Correct 21 ms 2208 KB Output is correct
57 Correct 28 ms 2272 KB Output is correct
58 Correct 26 ms 2164 KB Output is correct
59 Correct 22 ms 2192 KB Output is correct
60 Correct 23 ms 2104 KB Output is correct
61 Correct 24 ms 2148 KB Output is correct
62 Correct 27 ms 2148 KB Output is correct
63 Correct 25 ms 2148 KB Output is correct
64 Correct 23 ms 2156 KB Output is correct
65 Correct 26 ms 2124 KB Output is correct
66 Correct 25 ms 2120 KB Output is correct
67 Correct 27 ms 2128 KB Output is correct
68 Correct 22 ms 2108 KB Output is correct
69 Correct 30 ms 2220 KB Output is correct
70 Correct 30 ms 2180 KB Output is correct
71 Correct 5 ms 724 KB Output is correct
72 Correct 5 ms 736 KB Output is correct
73 Correct 7 ms 800 KB Output is correct
74 Correct 5 ms 756 KB Output is correct
75 Correct 6 ms 736 KB Output is correct
76 Correct 11 ms 1144 KB Output is correct
77 Correct 9 ms 1192 KB Output is correct
78 Correct 9 ms 1236 KB Output is correct
79 Correct 9 ms 1236 KB Output is correct
80 Correct 9 ms 1136 KB Output is correct
81 Correct 16 ms 1764 KB Output is correct
82 Correct 21 ms 1816 KB Output is correct
83 Correct 23 ms 1700 KB Output is correct
84 Correct 17 ms 1740 KB Output is correct
85 Correct 17 ms 1736 KB Output is correct
86 Correct 22 ms 1876 KB Output is correct
87 Correct 18 ms 1740 KB Output is correct
88 Correct 19 ms 1784 KB Output is correct
89 Correct 18 ms 1844 KB Output is correct
90 Correct 18 ms 1820 KB Output is correct
91 Correct 30 ms 2484 KB Output is correct
92 Correct 31 ms 2440 KB Output is correct
93 Correct 33 ms 2676 KB Output is correct
94 Correct 29 ms 2508 KB Output is correct
95 Correct 30 ms 2592 KB Output is correct
96 Correct 35 ms 2948 KB Output is correct
97 Correct 31 ms 2816 KB Output is correct
98 Correct 38 ms 2832 KB Output is correct
99 Correct 32 ms 2872 KB Output is correct
100 Correct 35 ms 2912 KB Output is correct
101 Correct 36 ms 2884 KB Output is correct
102 Correct 32 ms 2892 KB Output is correct
103 Correct 29 ms 2920 KB Output is correct
104 Correct 36 ms 2880 KB Output is correct
105 Correct 36 ms 2836 KB Output is correct
106 Correct 33 ms 3128 KB Output is correct
107 Correct 35 ms 3024 KB Output is correct
108 Correct 32 ms 3048 KB Output is correct
109 Correct 38 ms 3108 KB Output is correct
110 Correct 39 ms 3100 KB Output is correct
111 Correct 36 ms 3060 KB Output is correct
112 Correct 28 ms 3076 KB Output is correct
113 Correct 30 ms 3044 KB Output is correct
114 Correct 36 ms 3112 KB Output is correct
115 Correct 36 ms 3072 KB Output is correct
116 Correct 265 ms 2260 KB Output is correct
117 Correct 320 ms 2276 KB Output is correct
118 Correct 484 ms 2700 KB Output is correct
119 Correct 534 ms 2712 KB Output is correct
120 Correct 362 ms 2716 KB Output is correct
121 Correct 736 ms 2928 KB Output is correct
122 Correct 512 ms 2920 KB Output is correct
123 Correct 1417 ms 3344 KB Output is correct
124 Correct 665 ms 3444 KB Output is correct
125 Correct 547 ms 3472 KB Output is correct
126 Correct 2314 ms 3744 KB Output is correct
127 Correct 2281 ms 4828 KB Output is correct
128 Correct 2292 ms 4820 KB Output is correct
129 Correct 2241 ms 4836 KB Output is correct
130 Correct 2301 ms 4812 KB Output is correct
131 Correct 2353 ms 4976 KB Output is correct
132 Correct 2386 ms 4992 KB Output is correct
133 Correct 2356 ms 4960 KB Output is correct
134 Correct 2352 ms 4968 KB Output is correct
135 Correct 2335 ms 4980 KB Output is correct
136 Correct 2390 ms 4988 KB Output is correct
137 Correct 2385 ms 4992 KB Output is correct
138 Correct 2363 ms 4988 KB Output is correct
139 Correct 2368 ms 4960 KB Output is correct
140 Correct 2376 ms 4976 KB Output is correct
141 Correct 2126 ms 5004 KB Output is correct
142 Correct 2124 ms 4996 KB Output is correct
143 Correct 2186 ms 5016 KB Output is correct
144 Correct 2141 ms 5008 KB Output is correct
145 Correct 2181 ms 5008 KB Output is correct
146 Correct 1170 ms 5264 KB Output is correct
147 Correct 1144 ms 5260 KB Output is correct
148 Correct 1167 ms 5264 KB Output is correct
149 Correct 1129 ms 5264 KB Output is correct
150 Correct 1136 ms 5256 KB Output is correct
151 Correct 1004 ms 5312 KB Output is correct
152 Correct 997 ms 5360 KB Output is correct
153 Correct 1038 ms 5304 KB Output is correct
154 Correct 1036 ms 5300 KB Output is correct
155 Correct 1022 ms 5308 KB Output is correct
156 Correct 1945 ms 5904 KB Output is correct
157 Correct 1931 ms 5928 KB Output is correct
158 Correct 1936 ms 5844 KB Output is correct
159 Correct 1889 ms 5840 KB Output is correct
160 Correct 1926 ms 5844 KB Output is correct
161 Correct 1551 ms 6012 KB Output is correct
162 Correct 1576 ms 5936 KB Output is correct
163 Correct 1608 ms 5884 KB Output is correct
164 Correct 1558 ms 5916 KB Output is correct
165 Correct 1572 ms 5964 KB Output is correct
166 Correct 2304 ms 5560 KB Output is correct
167 Correct 2322 ms 5516 KB Output is correct
168 Correct 2355 ms 5528 KB Output is correct
169 Correct 2353 ms 5556 KB Output is correct
170 Correct 2390 ms 5516 KB Output is correct
171 Correct 2311 ms 5468 KB Output is correct
172 Correct 2312 ms 5484 KB Output is correct
173 Correct 2344 ms 5476 KB Output is correct
174 Correct 2283 ms 5480 KB Output is correct
175 Correct 2342 ms 5516 KB Output is correct