Submission #589418

# Submission time Handle Problem Language Result Execution time Memory
589418 2022-07-04T16:14:10 Z cheissmart Diversity (CEOI21_diversity) C++14
100 / 100
2108 ms 5792 KB
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

string _reset = "\u001b[0m", _yellow = "\u001b[33m", _bold = "\u001b[1m";
void DBG() { cerr << "]" << _reset << endl; }
template<class H, class...T> void DBG(H h, T ...t) {
	cerr << to_string(h);
	if(sizeof ...(t)) cerr << ", ";
	DBG(t...);
}
#ifdef CHEISSMART
#define debug(...) cerr << _yellow << _bold << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define debug(...)
#endif

const int INF = 1e9 + 7, K = 1000, N = 3e5 + 7;

namespace ds {
	int cnt[N];
	bool inhebe[N];
	vi hebe;
	void add(int x) {
		if(x == 0) return;
		cnt[x]++;
		if(!inhebe[x]) {
			inhebe[x] = true;
			hebe.PB(x);
		}
	}
	void del(int x) {
		if(x == 0) return;
		cnt[x]--;
	}
	ll qry() {
		vi alive;
		V<pi> aux;
		for(int x:hebe) {
			if(cnt[x] == 0) {
				inhebe[x] = false;
			} else {
				alive.PB(x);
				debug(x, cnt[x]);
				aux.EB(x, cnt[x]);
			}
		}
		hebe = alive;
		sort(ALL(aux));

		V<pi> even, odd;
		bool f = 0;
		for(auto[x, y]:aux) {
			if(!f) {
				even.EB(x, (y + 1) / 2);
				if(y / 2) odd.EB(x, y / 2);
			} else {
				odd.EB(x, (y + 1) / 2);
				if(y / 2) even.EB(x, y / 2);
			}
			f ^= y & 1;			
		}
		reverse(ALL(odd));
		even.insert(even.end(), ALL(odd));

		ll ans = 0, ct = 0, sx = 0, ss = 0;

		for(auto[x, y]:even) {
			ans += 1LL * x * (x + 1) * y;
			ll a = (x * (ct + 1) * sx - x * ss) * 2;
			ll b = (x * sx + 1LL * x * x * (ct + 1)) * 2 - 1LL * x * x * (2 * ct - 1);
			ll c = 1LL * x * x;
			ans += a * y;
			ans += b * y * (y - 1) / 2;
			ans += c * (y - 1) * y * (2 * y - 1) / 6;
			ss += x * (2 * ct + y - 1) * y / 2;
			sx += x * y;
			ct += y;
		}

		return ans / 2;
	}
}

signed main()
{
	IO_OP;

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

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

	vi order(q); iota(ALL(order), 0);
	sort(ALL(order), [&] (int i, int j) {
		return MP(l[i] / K, r[i]) < MP(l[j] / K, r[j]);
	});

	V<ll> ans(q);
	int cnt[N] = {};

	auto add = [&] (int x) {
		ds::del(cnt[x]);
		cnt[x]++;
		ds::add(cnt[x]);
	};
	auto del = [&] (int x) {
		ds::del(cnt[x]);
		cnt[x]--;
		ds::add(cnt[x]);
	};

	int L = 0, R = 0;
	add(a[0]);
	for(int qi:order) {
		while(R < r[qi]) add(a[++R]);
		while(L > l[qi]) add(a[--L]);
		while(R > r[qi]) del(a[R--]);
		while(L < l[qi]) del(a[L++]);
		ans[qi] = ds::qry();
	}

	for(int i = 0; i < q; i++)
		cout << ans[i] << '\n';

}

Compilation message

diversity.cpp: In function 'll ds::qry()':
diversity.cpp:66:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   66 |   for(auto[x, y]:aux) {
      |           ^
diversity.cpp:81:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   81 |   for(auto[x, y]:even) {
      |           ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1520 KB Output is correct
2 Correct 1 ms 1548 KB Output is correct
3 Correct 1 ms 1492 KB Output is correct
4 Correct 1 ms 1492 KB Output is correct
5 Correct 1 ms 1492 KB Output is correct
6 Correct 1 ms 1492 KB Output is correct
7 Correct 1 ms 1492 KB Output is correct
8 Correct 1 ms 1492 KB Output is correct
9 Correct 1 ms 1400 KB Output is correct
10 Correct 1 ms 1492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1492 KB Output is correct
2 Correct 1 ms 1496 KB Output is correct
3 Correct 2 ms 1532 KB Output is correct
4 Correct 8 ms 2360 KB Output is correct
5 Correct 14 ms 3596 KB Output is correct
6 Correct 21 ms 3968 KB Output is correct
7 Correct 23 ms 5064 KB Output is correct
8 Correct 22 ms 3800 KB Output is correct
9 Correct 20 ms 3892 KB Output is correct
10 Correct 21 ms 4336 KB Output is correct
11 Correct 20 ms 4192 KB Output is correct
12 Correct 19 ms 3944 KB Output is correct
13 Correct 19 ms 3820 KB Output is correct
14 Correct 30 ms 4192 KB Output is correct
15 Correct 20 ms 4212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1492 KB Output is correct
2 Correct 1 ms 1496 KB Output is correct
3 Correct 2 ms 1532 KB Output is correct
4 Correct 8 ms 2360 KB Output is correct
5 Correct 14 ms 3596 KB Output is correct
6 Correct 21 ms 3968 KB Output is correct
7 Correct 23 ms 5064 KB Output is correct
8 Correct 22 ms 3800 KB Output is correct
9 Correct 20 ms 3892 KB Output is correct
10 Correct 21 ms 4336 KB Output is correct
11 Correct 20 ms 4192 KB Output is correct
12 Correct 19 ms 3944 KB Output is correct
13 Correct 19 ms 3820 KB Output is correct
14 Correct 30 ms 4192 KB Output is correct
15 Correct 20 ms 4212 KB Output is correct
16 Correct 2 ms 1496 KB Output is correct
17 Correct 2 ms 1492 KB Output is correct
18 Correct 2 ms 1492 KB Output is correct
19 Correct 9 ms 2404 KB Output is correct
20 Correct 14 ms 3204 KB Output is correct
21 Correct 21 ms 4072 KB Output is correct
22 Correct 19 ms 3956 KB Output is correct
23 Correct 31 ms 4012 KB Output is correct
24 Correct 20 ms 3936 KB Output is correct
25 Correct 21 ms 3932 KB Output is correct
26 Correct 21 ms 3940 KB Output is correct
27 Correct 22 ms 3928 KB Output is correct
28 Correct 29 ms 4312 KB Output is correct
29 Correct 32 ms 3932 KB Output is correct
30 Correct 21 ms 3956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1492 KB Output is correct
2 Correct 1 ms 1496 KB Output is correct
3 Correct 2 ms 1532 KB Output is correct
4 Correct 8 ms 2360 KB Output is correct
5 Correct 14 ms 3596 KB Output is correct
6 Correct 21 ms 3968 KB Output is correct
7 Correct 23 ms 5064 KB Output is correct
8 Correct 22 ms 3800 KB Output is correct
9 Correct 20 ms 3892 KB Output is correct
10 Correct 21 ms 4336 KB Output is correct
11 Correct 20 ms 4192 KB Output is correct
12 Correct 19 ms 3944 KB Output is correct
13 Correct 19 ms 3820 KB Output is correct
14 Correct 30 ms 4192 KB Output is correct
15 Correct 20 ms 4212 KB Output is correct
16 Correct 2 ms 1496 KB Output is correct
17 Correct 2 ms 1492 KB Output is correct
18 Correct 2 ms 1492 KB Output is correct
19 Correct 9 ms 2404 KB Output is correct
20 Correct 14 ms 3204 KB Output is correct
21 Correct 21 ms 4072 KB Output is correct
22 Correct 19 ms 3956 KB Output is correct
23 Correct 31 ms 4012 KB Output is correct
24 Correct 20 ms 3936 KB Output is correct
25 Correct 21 ms 3932 KB Output is correct
26 Correct 21 ms 3940 KB Output is correct
27 Correct 22 ms 3928 KB Output is correct
28 Correct 29 ms 4312 KB Output is correct
29 Correct 32 ms 3932 KB Output is correct
30 Correct 21 ms 3956 KB Output is correct
31 Correct 1 ms 1500 KB Output is correct
32 Correct 2 ms 1492 KB Output is correct
33 Correct 2 ms 1500 KB Output is correct
34 Correct 2 ms 1504 KB Output is correct
35 Correct 2 ms 1492 KB Output is correct
36 Correct 3 ms 1636 KB Output is correct
37 Correct 7 ms 1900 KB Output is correct
38 Correct 5 ms 1900 KB Output is correct
39 Correct 9 ms 2260 KB Output is correct
40 Correct 23 ms 3036 KB Output is correct
41 Correct 20 ms 3424 KB Output is correct
42 Correct 20 ms 3412 KB Output is correct
43 Correct 20 ms 3452 KB Output is correct
44 Correct 21 ms 3412 KB Output is correct
45 Correct 21 ms 3412 KB Output is correct
46 Correct 21 ms 3412 KB Output is correct
47 Correct 21 ms 3412 KB Output is correct
48 Correct 22 ms 3448 KB Output is correct
49 Correct 23 ms 3412 KB Output is correct
50 Correct 28 ms 3444 KB Output is correct
51 Correct 21 ms 3440 KB Output is correct
52 Correct 21 ms 3440 KB Output is correct
53 Correct 22 ms 3412 KB Output is correct
54 Correct 22 ms 3448 KB Output is correct
55 Correct 29 ms 3436 KB Output is correct
56 Correct 20 ms 3464 KB Output is correct
57 Correct 27 ms 3420 KB Output is correct
58 Correct 34 ms 3384 KB Output is correct
59 Correct 29 ms 3444 KB Output is correct
60 Correct 35 ms 3444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1520 KB Output is correct
2 Correct 1 ms 1548 KB Output is correct
3 Correct 1 ms 1492 KB Output is correct
4 Correct 1 ms 1492 KB Output is correct
5 Correct 1 ms 1492 KB Output is correct
6 Correct 1 ms 1492 KB Output is correct
7 Correct 1 ms 1492 KB Output is correct
8 Correct 1 ms 1492 KB Output is correct
9 Correct 1 ms 1400 KB Output is correct
10 Correct 1 ms 1492 KB Output is correct
11 Correct 1 ms 1492 KB Output is correct
12 Correct 1 ms 1496 KB Output is correct
13 Correct 2 ms 1532 KB Output is correct
14 Correct 8 ms 2360 KB Output is correct
15 Correct 14 ms 3596 KB Output is correct
16 Correct 21 ms 3968 KB Output is correct
17 Correct 23 ms 5064 KB Output is correct
18 Correct 22 ms 3800 KB Output is correct
19 Correct 20 ms 3892 KB Output is correct
20 Correct 21 ms 4336 KB Output is correct
21 Correct 20 ms 4192 KB Output is correct
22 Correct 19 ms 3944 KB Output is correct
23 Correct 19 ms 3820 KB Output is correct
24 Correct 30 ms 4192 KB Output is correct
25 Correct 20 ms 4212 KB Output is correct
26 Correct 2 ms 1496 KB Output is correct
27 Correct 2 ms 1492 KB Output is correct
28 Correct 2 ms 1492 KB Output is correct
29 Correct 9 ms 2404 KB Output is correct
30 Correct 14 ms 3204 KB Output is correct
31 Correct 21 ms 4072 KB Output is correct
32 Correct 19 ms 3956 KB Output is correct
33 Correct 31 ms 4012 KB Output is correct
34 Correct 20 ms 3936 KB Output is correct
35 Correct 21 ms 3932 KB Output is correct
36 Correct 21 ms 3940 KB Output is correct
37 Correct 22 ms 3928 KB Output is correct
38 Correct 29 ms 4312 KB Output is correct
39 Correct 32 ms 3932 KB Output is correct
40 Correct 21 ms 3956 KB Output is correct
41 Correct 1 ms 1500 KB Output is correct
42 Correct 2 ms 1492 KB Output is correct
43 Correct 2 ms 1500 KB Output is correct
44 Correct 2 ms 1504 KB Output is correct
45 Correct 2 ms 1492 KB Output is correct
46 Correct 3 ms 1636 KB Output is correct
47 Correct 7 ms 1900 KB Output is correct
48 Correct 5 ms 1900 KB Output is correct
49 Correct 9 ms 2260 KB Output is correct
50 Correct 23 ms 3036 KB Output is correct
51 Correct 20 ms 3424 KB Output is correct
52 Correct 20 ms 3412 KB Output is correct
53 Correct 20 ms 3452 KB Output is correct
54 Correct 21 ms 3412 KB Output is correct
55 Correct 21 ms 3412 KB Output is correct
56 Correct 21 ms 3412 KB Output is correct
57 Correct 21 ms 3412 KB Output is correct
58 Correct 22 ms 3448 KB Output is correct
59 Correct 23 ms 3412 KB Output is correct
60 Correct 28 ms 3444 KB Output is correct
61 Correct 21 ms 3440 KB Output is correct
62 Correct 21 ms 3440 KB Output is correct
63 Correct 22 ms 3412 KB Output is correct
64 Correct 22 ms 3448 KB Output is correct
65 Correct 29 ms 3436 KB Output is correct
66 Correct 20 ms 3464 KB Output is correct
67 Correct 27 ms 3420 KB Output is correct
68 Correct 34 ms 3384 KB Output is correct
69 Correct 29 ms 3444 KB Output is correct
70 Correct 35 ms 3444 KB Output is correct
71 Correct 5 ms 1876 KB Output is correct
72 Correct 5 ms 1816 KB Output is correct
73 Correct 5 ms 1876 KB Output is correct
74 Correct 5 ms 1892 KB Output is correct
75 Correct 5 ms 1876 KB Output is correct
76 Correct 9 ms 2260 KB Output is correct
77 Correct 9 ms 2268 KB Output is correct
78 Correct 9 ms 2376 KB Output is correct
79 Correct 9 ms 2260 KB Output is correct
80 Correct 14 ms 2276 KB Output is correct
81 Correct 17 ms 3048 KB Output is correct
82 Correct 24 ms 3020 KB Output is correct
83 Correct 16 ms 3060 KB Output is correct
84 Correct 15 ms 3028 KB Output is correct
85 Correct 17 ms 3028 KB Output is correct
86 Correct 19 ms 3048 KB Output is correct
87 Correct 19 ms 3044 KB Output is correct
88 Correct 17 ms 3052 KB Output is correct
89 Correct 28 ms 3052 KB Output is correct
90 Correct 21 ms 2948 KB Output is correct
91 Correct 37 ms 3412 KB Output is correct
92 Correct 30 ms 3412 KB Output is correct
93 Correct 41 ms 3428 KB Output is correct
94 Correct 27 ms 3412 KB Output is correct
95 Correct 27 ms 3432 KB Output is correct
96 Correct 33 ms 3408 KB Output is correct
97 Correct 30 ms 3432 KB Output is correct
98 Correct 33 ms 3436 KB Output is correct
99 Correct 49 ms 3316 KB Output is correct
100 Correct 40 ms 3412 KB Output is correct
101 Correct 33 ms 3332 KB Output is correct
102 Correct 32 ms 3436 KB Output is correct
103 Correct 31 ms 3436 KB Output is correct
104 Correct 32 ms 3356 KB Output is correct
105 Correct 35 ms 3412 KB Output is correct
106 Correct 29 ms 3436 KB Output is correct
107 Correct 35 ms 3440 KB Output is correct
108 Correct 36 ms 3360 KB Output is correct
109 Correct 38 ms 3428 KB Output is correct
110 Correct 32 ms 3412 KB Output is correct
111 Correct 30 ms 3424 KB Output is correct
112 Correct 31 ms 3356 KB Output is correct
113 Correct 28 ms 3436 KB Output is correct
114 Correct 32 ms 3436 KB Output is correct
115 Correct 32 ms 3448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1520 KB Output is correct
2 Correct 1 ms 1548 KB Output is correct
3 Correct 1 ms 1492 KB Output is correct
4 Correct 1 ms 1492 KB Output is correct
5 Correct 1 ms 1492 KB Output is correct
6 Correct 1 ms 1492 KB Output is correct
7 Correct 1 ms 1492 KB Output is correct
8 Correct 1 ms 1492 KB Output is correct
9 Correct 1 ms 1400 KB Output is correct
10 Correct 1 ms 1492 KB Output is correct
11 Correct 1 ms 1492 KB Output is correct
12 Correct 1 ms 1496 KB Output is correct
13 Correct 2 ms 1532 KB Output is correct
14 Correct 8 ms 2360 KB Output is correct
15 Correct 14 ms 3596 KB Output is correct
16 Correct 21 ms 3968 KB Output is correct
17 Correct 23 ms 5064 KB Output is correct
18 Correct 22 ms 3800 KB Output is correct
19 Correct 20 ms 3892 KB Output is correct
20 Correct 21 ms 4336 KB Output is correct
21 Correct 20 ms 4192 KB Output is correct
22 Correct 19 ms 3944 KB Output is correct
23 Correct 19 ms 3820 KB Output is correct
24 Correct 30 ms 4192 KB Output is correct
25 Correct 20 ms 4212 KB Output is correct
26 Correct 2 ms 1496 KB Output is correct
27 Correct 2 ms 1492 KB Output is correct
28 Correct 2 ms 1492 KB Output is correct
29 Correct 9 ms 2404 KB Output is correct
30 Correct 14 ms 3204 KB Output is correct
31 Correct 21 ms 4072 KB Output is correct
32 Correct 19 ms 3956 KB Output is correct
33 Correct 31 ms 4012 KB Output is correct
34 Correct 20 ms 3936 KB Output is correct
35 Correct 21 ms 3932 KB Output is correct
36 Correct 21 ms 3940 KB Output is correct
37 Correct 22 ms 3928 KB Output is correct
38 Correct 29 ms 4312 KB Output is correct
39 Correct 32 ms 3932 KB Output is correct
40 Correct 21 ms 3956 KB Output is correct
41 Correct 1 ms 1500 KB Output is correct
42 Correct 2 ms 1492 KB Output is correct
43 Correct 2 ms 1500 KB Output is correct
44 Correct 2 ms 1504 KB Output is correct
45 Correct 2 ms 1492 KB Output is correct
46 Correct 3 ms 1636 KB Output is correct
47 Correct 7 ms 1900 KB Output is correct
48 Correct 5 ms 1900 KB Output is correct
49 Correct 9 ms 2260 KB Output is correct
50 Correct 23 ms 3036 KB Output is correct
51 Correct 20 ms 3424 KB Output is correct
52 Correct 20 ms 3412 KB Output is correct
53 Correct 20 ms 3452 KB Output is correct
54 Correct 21 ms 3412 KB Output is correct
55 Correct 21 ms 3412 KB Output is correct
56 Correct 21 ms 3412 KB Output is correct
57 Correct 21 ms 3412 KB Output is correct
58 Correct 22 ms 3448 KB Output is correct
59 Correct 23 ms 3412 KB Output is correct
60 Correct 28 ms 3444 KB Output is correct
61 Correct 21 ms 3440 KB Output is correct
62 Correct 21 ms 3440 KB Output is correct
63 Correct 22 ms 3412 KB Output is correct
64 Correct 22 ms 3448 KB Output is correct
65 Correct 29 ms 3436 KB Output is correct
66 Correct 20 ms 3464 KB Output is correct
67 Correct 27 ms 3420 KB Output is correct
68 Correct 34 ms 3384 KB Output is correct
69 Correct 29 ms 3444 KB Output is correct
70 Correct 35 ms 3444 KB Output is correct
71 Correct 5 ms 1876 KB Output is correct
72 Correct 5 ms 1816 KB Output is correct
73 Correct 5 ms 1876 KB Output is correct
74 Correct 5 ms 1892 KB Output is correct
75 Correct 5 ms 1876 KB Output is correct
76 Correct 9 ms 2260 KB Output is correct
77 Correct 9 ms 2268 KB Output is correct
78 Correct 9 ms 2376 KB Output is correct
79 Correct 9 ms 2260 KB Output is correct
80 Correct 14 ms 2276 KB Output is correct
81 Correct 17 ms 3048 KB Output is correct
82 Correct 24 ms 3020 KB Output is correct
83 Correct 16 ms 3060 KB Output is correct
84 Correct 15 ms 3028 KB Output is correct
85 Correct 17 ms 3028 KB Output is correct
86 Correct 19 ms 3048 KB Output is correct
87 Correct 19 ms 3044 KB Output is correct
88 Correct 17 ms 3052 KB Output is correct
89 Correct 28 ms 3052 KB Output is correct
90 Correct 21 ms 2948 KB Output is correct
91 Correct 37 ms 3412 KB Output is correct
92 Correct 30 ms 3412 KB Output is correct
93 Correct 41 ms 3428 KB Output is correct
94 Correct 27 ms 3412 KB Output is correct
95 Correct 27 ms 3432 KB Output is correct
96 Correct 33 ms 3408 KB Output is correct
97 Correct 30 ms 3432 KB Output is correct
98 Correct 33 ms 3436 KB Output is correct
99 Correct 49 ms 3316 KB Output is correct
100 Correct 40 ms 3412 KB Output is correct
101 Correct 33 ms 3332 KB Output is correct
102 Correct 32 ms 3436 KB Output is correct
103 Correct 31 ms 3436 KB Output is correct
104 Correct 32 ms 3356 KB Output is correct
105 Correct 35 ms 3412 KB Output is correct
106 Correct 29 ms 3436 KB Output is correct
107 Correct 35 ms 3440 KB Output is correct
108 Correct 36 ms 3360 KB Output is correct
109 Correct 38 ms 3428 KB Output is correct
110 Correct 32 ms 3412 KB Output is correct
111 Correct 30 ms 3424 KB Output is correct
112 Correct 31 ms 3356 KB Output is correct
113 Correct 28 ms 3436 KB Output is correct
114 Correct 32 ms 3436 KB Output is correct
115 Correct 32 ms 3448 KB Output is correct
116 Correct 365 ms 3432 KB Output is correct
117 Correct 367 ms 3444 KB Output is correct
118 Correct 560 ms 3948 KB Output is correct
119 Correct 543 ms 3996 KB Output is correct
120 Correct 427 ms 4004 KB Output is correct
121 Correct 705 ms 4208 KB Output is correct
122 Correct 559 ms 4208 KB Output is correct
123 Correct 1246 ms 4752 KB Output is correct
124 Correct 777 ms 4724 KB Output is correct
125 Correct 729 ms 4716 KB Output is correct
126 Correct 1933 ms 5052 KB Output is correct
127 Correct 1895 ms 5040 KB Output is correct
128 Correct 1911 ms 5084 KB Output is correct
129 Correct 1931 ms 5032 KB Output is correct
130 Correct 1893 ms 5040 KB Output is correct
131 Correct 2005 ms 5148 KB Output is correct
132 Correct 2020 ms 5148 KB Output is correct
133 Correct 2047 ms 5148 KB Output is correct
134 Correct 2068 ms 5148 KB Output is correct
135 Correct 2108 ms 5152 KB Output is correct
136 Correct 2063 ms 5300 KB Output is correct
137 Correct 2063 ms 5144 KB Output is correct
138 Correct 2052 ms 5176 KB Output is correct
139 Correct 2050 ms 5144 KB Output is correct
140 Correct 2073 ms 5168 KB Output is correct
141 Correct 1927 ms 5400 KB Output is correct
142 Correct 1932 ms 5404 KB Output is correct
143 Correct 1997 ms 5408 KB Output is correct
144 Correct 2040 ms 5540 KB Output is correct
145 Correct 2094 ms 5792 KB Output is correct
146 Correct 1350 ms 5300 KB Output is correct
147 Correct 1356 ms 5000 KB Output is correct
148 Correct 1377 ms 5004 KB Output is correct
149 Correct 1288 ms 5000 KB Output is correct
150 Correct 1250 ms 5000 KB Output is correct
151 Correct 1249 ms 4980 KB Output is correct
152 Correct 1208 ms 4984 KB Output is correct
153 Correct 1253 ms 4988 KB Output is correct
154 Correct 1252 ms 4984 KB Output is correct
155 Correct 1263 ms 4984 KB Output is correct
156 Correct 2011 ms 5324 KB Output is correct
157 Correct 1956 ms 5384 KB Output is correct
158 Correct 1920 ms 5152 KB Output is correct
159 Correct 1937 ms 5228 KB Output is correct
160 Correct 1915 ms 5228 KB Output is correct
161 Correct 1576 ms 5576 KB Output is correct
162 Correct 1532 ms 5348 KB Output is correct
163 Correct 1503 ms 5364 KB Output is correct
164 Correct 1531 ms 5348 KB Output is correct
165 Correct 1483 ms 5288 KB Output is correct
166 Correct 1852 ms 5144 KB Output is correct
167 Correct 1822 ms 4844 KB Output is correct
168 Correct 1795 ms 4860 KB Output is correct
169 Correct 1837 ms 4920 KB Output is correct
170 Correct 1841 ms 4500 KB Output is correct
171 Correct 1850 ms 4408 KB Output is correct
172 Correct 1884 ms 4364 KB Output is correct
173 Correct 1877 ms 4472 KB Output is correct
174 Correct 1885 ms 4384 KB Output is correct
175 Correct 1902 ms 4500 KB Output is correct