Submission #968973

# Submission time Handle Problem Language Result Execution time Memory
968973 2024-04-24T10:32:16 Z marvinthang Diversity (CEOI21_diversity) C++17
100 / 100
1174 ms 7684 KB
/*************************************
*    author: marvinthang             *
*    created: 24.04.2024 16:30:43    *
*************************************/

#include <bits/stdc++.h>

using namespace std;

#define                  fi  first
#define                  se  second
#define                left  ___left
#define               right  ___right
#define                TIME  (1.0 * clock() / CLOCKS_PER_SEC)
#define             MASK(i)  (1LL << (i))
#define           BIT(x, i)  ((x) >> (i) & 1)
#define  __builtin_popcount  __builtin_popcountll
#define              ALL(v)  (v).begin(), (v).end()
#define           REP(i, n)  for (int i = 0, _n = (n); i < _n; ++i)
#define          REPD(i, n)  for (int i = (n); i-- > 0; )
#define        FOR(i, a, b)  for (int i = (a), _b = (b); i < _b; ++i) 
#define       FORD(i, b, a)  for (int i = (b), _a = (a); --i >= _a; ) 
#define       FORE(i, a, b)  for (int i = (a), _b = (b); i <= _b; ++i) 
#define      FORDE(i, b, a)  for (int i = (b), _a = (a); i >= _a; --i) 
#define        scan_op(...)  istream & operator >> (istream &in, __VA_ARGS__ &u)
#define       print_op(...)  ostream & operator << (ostream &out, const __VA_ARGS__ &u)
#ifdef LOCAL
    #include "debug.h"
#else
    #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
    #define DB(...) 23
    #define db(...) 23
    #define debug(...) 23
#endif

template <class U, class V> scan_op(pair <U, V>)  { return in >> u.first >> u.second; }
template <class T> scan_op(vector <T>)  { for (size_t i = 0; i < u.size(); ++i) in >> u[i]; return in; }
template <class U, class V> print_op(pair <U, V>)  { return out << '(' << u.first << ", " << u.second << ')'; }
template <size_t i, class T> ostream & print_tuple_utils(ostream &out, const T &tup) { if constexpr(i == tuple_size<T>::value) return out << ")";  else return print_tuple_utils<i + 1, T>(out << (i ? ", " : "(") << get<i>(tup), tup); }
template <class ...U> print_op(tuple<U...>) { return print_tuple_utils<0, tuple<U...>>(out, u); }
template <class Con, class = decltype(begin(declval<Con>()))> typename enable_if <!is_same<Con, string>::value, ostream&>::type operator << (ostream &out, const Con &con) { out << '{'; for (__typeof(con.begin()) it = con.begin(); it != con.end(); ++it) out << (it == con.begin() ? "" : ", ") << *it; return out << '}'; }

// end of template

const int BLOCK_SIZE = 450;

struct Query {
	int l, r, id;
	Query(int l, int r, int id): l(l), r(r), id(id) {}
	bool operator < (const Query &ot) { return pair{l / BLOCK_SIZE, r} < pair{ot.l / BLOCK_SIZE, ot.r}; }
};

void process(void) {
	int n, q; cin >> n >> q;
	vector <int> a(n); cin >> a;
	vector <int> c(ALL(a));
	sort(ALL(c)); c.erase(unique(ALL(c)), c.end());
	REP(i, n) a[i] = lower_bound(ALL(c), a[i]) - c.begin();
	vector <int> cnt(c.size());
	REP(i, n) ++cnt[a[i]];
	vector <int> big;
	REP(i, c.size()) if (cnt[i] >= BLOCK_SIZE) big.push_back(i);
	vector <Query> queries;
	REP(i, q) {
		int l, r; cin >> l >> r; --l; --r;
		queries.emplace_back(l, r, i);
	}
	sort(ALL(queries));
	fill(ALL(cnt), 0);
	vector <int> cnt_cnt(n + 1);
	cnt_cnt[0] = c.size();
	auto add = [&] (int u, int v) {
		--cnt_cnt[cnt[u]];
		cnt[u] += v;
		++cnt_cnt[cnt[u]];
	};
	int cl = 0, cr = -1;
	vector <long long> res(q);
	for (auto [l, r, i]: queries) {
		while (cl > l) add(a[--cl], +1);
		while (cr < r) add(a[++cr], +1);
		while (cl < l) add(a[cl++], -1);
		while (cr > r) add(a[cr--], -1);
		vector <pair <int, int>> left, right;
		int n = 0;
		FOR(i, 1, min((int) cnt_cnt.size() + 1, BLOCK_SIZE)) if (cnt_cnt[i]) {
			if (n & 1) {
				right.emplace_back(i, (cnt_cnt[i] + 1) / 2);
				if (cnt_cnt[i] > 1) left.emplace_back(i, cnt_cnt[i] / 2);
			} else {
				left.emplace_back(i, (cnt_cnt[i] + 1) / 2);
				if (cnt_cnt[i] > 1) right.emplace_back(i, cnt_cnt[i] / 2);
			}
			n += cnt_cnt[i];
		}
		vector <int> v;
		for (int i: big) if (cnt[i] >= BLOCK_SIZE) v.push_back(cnt[i]);
		sort(ALL(v));
		for (int c: v) (++n & 1 ? left : right).emplace_back(c, 1);
		left.insert(left.end(), right.rbegin(), right.rend());
		n = r - l + 1;
		int pref = 0;
		for (auto [c, f]: left) {
			res[i] += 1LL * f * (1LL * c * (c + 1) / 2 + 1LL * c * (n - c));
			res[i] += 1LL * (n - c) * (1LL * pref * f + 1LL * f * (f - 1) / 2 * c);
			res[i] -= 1LL * pref * pref * f + 1LL * pref * f * (f - 1) * c + 1LL * c * c * (f - 1) * f * (f + f - 1) / 6;
			pref += c * f;
		}
	}
	REP(i, q) cout << res[i] << '\n';
}

int main(void) {
	ios_base::sync_with_stdio(false); cin.tie(nullptr); // cout.tie(nullptr);
	file("diversity");
	// int t; cin >> t; while (t--)
	process();
	// cerr << "Time elapsed: " << TIME << " s.\n";
	return (0^0);
}

Compilation message

diversity.cpp: In function 'int main()':
diversity.cpp:30:61: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
      |                                                      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
diversity.cpp:115:2: note: in expansion of macro 'file'
  115 |  file("diversity");
      |  ^~~~
diversity.cpp:30:94: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
      |                                                                                       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
diversity.cpp:115:2: note: in expansion of macro 'file'
  115 |  file("diversity");
      |  ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 11 ms 1628 KB Output is correct
5 Correct 23 ms 3156 KB Output is correct
6 Correct 27 ms 4448 KB Output is correct
7 Correct 25 ms 4444 KB Output is correct
8 Correct 40 ms 4328 KB Output is correct
9 Correct 38 ms 4436 KB Output is correct
10 Correct 38 ms 4328 KB Output is correct
11 Correct 27 ms 4272 KB Output is correct
12 Correct 34 ms 4252 KB Output is correct
13 Correct 28 ms 4444 KB Output is correct
14 Correct 26 ms 4344 KB Output is correct
15 Correct 27 ms 4404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 11 ms 1628 KB Output is correct
5 Correct 23 ms 3156 KB Output is correct
6 Correct 27 ms 4448 KB Output is correct
7 Correct 25 ms 4444 KB Output is correct
8 Correct 40 ms 4328 KB Output is correct
9 Correct 38 ms 4436 KB Output is correct
10 Correct 38 ms 4328 KB Output is correct
11 Correct 27 ms 4272 KB Output is correct
12 Correct 34 ms 4252 KB Output is correct
13 Correct 28 ms 4444 KB Output is correct
14 Correct 26 ms 4344 KB Output is correct
15 Correct 27 ms 4404 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 2 ms 600 KB Output is correct
19 Correct 10 ms 1884 KB Output is correct
20 Correct 19 ms 3160 KB Output is correct
21 Correct 39 ms 4588 KB Output is correct
22 Correct 31 ms 4588 KB Output is correct
23 Correct 30 ms 4604 KB Output is correct
24 Correct 30 ms 4696 KB Output is correct
25 Correct 34 ms 4608 KB Output is correct
26 Correct 30 ms 4340 KB Output is correct
27 Correct 31 ms 4688 KB Output is correct
28 Correct 32 ms 4428 KB Output is correct
29 Correct 29 ms 4440 KB Output is correct
30 Correct 40 ms 4692 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 11 ms 1628 KB Output is correct
5 Correct 23 ms 3156 KB Output is correct
6 Correct 27 ms 4448 KB Output is correct
7 Correct 25 ms 4444 KB Output is correct
8 Correct 40 ms 4328 KB Output is correct
9 Correct 38 ms 4436 KB Output is correct
10 Correct 38 ms 4328 KB Output is correct
11 Correct 27 ms 4272 KB Output is correct
12 Correct 34 ms 4252 KB Output is correct
13 Correct 28 ms 4444 KB Output is correct
14 Correct 26 ms 4344 KB Output is correct
15 Correct 27 ms 4404 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 2 ms 600 KB Output is correct
19 Correct 10 ms 1884 KB Output is correct
20 Correct 19 ms 3160 KB Output is correct
21 Correct 39 ms 4588 KB Output is correct
22 Correct 31 ms 4588 KB Output is correct
23 Correct 30 ms 4604 KB Output is correct
24 Correct 30 ms 4696 KB Output is correct
25 Correct 34 ms 4608 KB Output is correct
26 Correct 30 ms 4340 KB Output is correct
27 Correct 31 ms 4688 KB Output is correct
28 Correct 32 ms 4428 KB Output is correct
29 Correct 29 ms 4440 KB Output is correct
30 Correct 40 ms 4692 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 756 KB Output is correct
35 Correct 2 ms 532 KB Output is correct
36 Correct 2 ms 476 KB Output is correct
37 Correct 8 ms 1180 KB Output is correct
38 Correct 10 ms 1116 KB Output is correct
39 Correct 16 ms 1892 KB Output is correct
40 Correct 33 ms 3312 KB Output is correct
41 Correct 47 ms 4584 KB Output is correct
42 Correct 49 ms 4580 KB Output is correct
43 Correct 54 ms 4816 KB Output is correct
44 Correct 44 ms 4588 KB Output is correct
45 Correct 46 ms 4600 KB Output is correct
46 Correct 60 ms 4712 KB Output is correct
47 Correct 56 ms 4692 KB Output is correct
48 Correct 59 ms 4684 KB Output is correct
49 Correct 56 ms 4556 KB Output is correct
50 Correct 45 ms 4584 KB Output is correct
51 Correct 61 ms 4604 KB Output is correct
52 Correct 45 ms 4700 KB Output is correct
53 Correct 50 ms 4692 KB Output is correct
54 Correct 45 ms 4736 KB Output is correct
55 Correct 60 ms 4692 KB Output is correct
56 Correct 62 ms 4688 KB Output is correct
57 Correct 45 ms 4584 KB Output is correct
58 Correct 49 ms 4712 KB Output is correct
59 Correct 60 ms 4660 KB Output is correct
60 Correct 45 ms 4688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 2 ms 348 KB Output is correct
14 Correct 11 ms 1628 KB Output is correct
15 Correct 23 ms 3156 KB Output is correct
16 Correct 27 ms 4448 KB Output is correct
17 Correct 25 ms 4444 KB Output is correct
18 Correct 40 ms 4328 KB Output is correct
19 Correct 38 ms 4436 KB Output is correct
20 Correct 38 ms 4328 KB Output is correct
21 Correct 27 ms 4272 KB Output is correct
22 Correct 34 ms 4252 KB Output is correct
23 Correct 28 ms 4444 KB Output is correct
24 Correct 26 ms 4344 KB Output is correct
25 Correct 27 ms 4404 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 2 ms 600 KB Output is correct
29 Correct 10 ms 1884 KB Output is correct
30 Correct 19 ms 3160 KB Output is correct
31 Correct 39 ms 4588 KB Output is correct
32 Correct 31 ms 4588 KB Output is correct
33 Correct 30 ms 4604 KB Output is correct
34 Correct 30 ms 4696 KB Output is correct
35 Correct 34 ms 4608 KB Output is correct
36 Correct 30 ms 4340 KB Output is correct
37 Correct 31 ms 4688 KB Output is correct
38 Correct 32 ms 4428 KB Output is correct
39 Correct 29 ms 4440 KB Output is correct
40 Correct 40 ms 4692 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 2 ms 756 KB Output is correct
45 Correct 2 ms 532 KB Output is correct
46 Correct 2 ms 476 KB Output is correct
47 Correct 8 ms 1180 KB Output is correct
48 Correct 10 ms 1116 KB Output is correct
49 Correct 16 ms 1892 KB Output is correct
50 Correct 33 ms 3312 KB Output is correct
51 Correct 47 ms 4584 KB Output is correct
52 Correct 49 ms 4580 KB Output is correct
53 Correct 54 ms 4816 KB Output is correct
54 Correct 44 ms 4588 KB Output is correct
55 Correct 46 ms 4600 KB Output is correct
56 Correct 60 ms 4712 KB Output is correct
57 Correct 56 ms 4692 KB Output is correct
58 Correct 59 ms 4684 KB Output is correct
59 Correct 56 ms 4556 KB Output is correct
60 Correct 45 ms 4584 KB Output is correct
61 Correct 61 ms 4604 KB Output is correct
62 Correct 45 ms 4700 KB Output is correct
63 Correct 50 ms 4692 KB Output is correct
64 Correct 45 ms 4736 KB Output is correct
65 Correct 60 ms 4692 KB Output is correct
66 Correct 62 ms 4688 KB Output is correct
67 Correct 45 ms 4584 KB Output is correct
68 Correct 49 ms 4712 KB Output is correct
69 Correct 60 ms 4660 KB Output is correct
70 Correct 45 ms 4688 KB Output is correct
71 Correct 12 ms 1116 KB Output is correct
72 Correct 9 ms 1112 KB Output is correct
73 Correct 9 ms 1116 KB Output is correct
74 Correct 11 ms 1084 KB Output is correct
75 Correct 9 ms 1112 KB Output is correct
76 Correct 18 ms 1876 KB Output is correct
77 Correct 18 ms 2140 KB Output is correct
78 Correct 22 ms 1972 KB Output is correct
79 Correct 24 ms 2140 KB Output is correct
80 Correct 18 ms 1872 KB Output is correct
81 Correct 49 ms 3556 KB Output is correct
82 Correct 42 ms 3552 KB Output is correct
83 Correct 37 ms 3800 KB Output is correct
84 Correct 40 ms 3416 KB Output is correct
85 Correct 37 ms 3552 KB Output is correct
86 Correct 49 ms 3552 KB Output is correct
87 Correct 45 ms 3548 KB Output is correct
88 Correct 47 ms 3556 KB Output is correct
89 Correct 55 ms 3552 KB Output is correct
90 Correct 42 ms 3548 KB Output is correct
91 Correct 70 ms 5352 KB Output is correct
92 Correct 88 ms 5200 KB Output is correct
93 Correct 74 ms 5356 KB Output is correct
94 Correct 88 ms 5236 KB Output is correct
95 Correct 77 ms 5200 KB Output is correct
96 Correct 77 ms 5864 KB Output is correct
97 Correct 88 ms 5972 KB Output is correct
98 Correct 77 ms 5892 KB Output is correct
99 Correct 97 ms 5864 KB Output is correct
100 Correct 78 ms 5864 KB Output is correct
101 Correct 78 ms 5980 KB Output is correct
102 Correct 86 ms 5872 KB Output is correct
103 Correct 77 ms 5864 KB Output is correct
104 Correct 99 ms 6004 KB Output is correct
105 Correct 76 ms 5984 KB Output is correct
106 Correct 84 ms 6004 KB Output is correct
107 Correct 77 ms 5992 KB Output is correct
108 Correct 76 ms 6164 KB Output is correct
109 Correct 90 ms 6124 KB Output is correct
110 Correct 78 ms 6120 KB Output is correct
111 Correct 80 ms 6120 KB Output is correct
112 Correct 80 ms 6124 KB Output is correct
113 Correct 78 ms 5980 KB Output is correct
114 Correct 95 ms 6180 KB Output is correct
115 Correct 85 ms 6120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 2 ms 348 KB Output is correct
14 Correct 11 ms 1628 KB Output is correct
15 Correct 23 ms 3156 KB Output is correct
16 Correct 27 ms 4448 KB Output is correct
17 Correct 25 ms 4444 KB Output is correct
18 Correct 40 ms 4328 KB Output is correct
19 Correct 38 ms 4436 KB Output is correct
20 Correct 38 ms 4328 KB Output is correct
21 Correct 27 ms 4272 KB Output is correct
22 Correct 34 ms 4252 KB Output is correct
23 Correct 28 ms 4444 KB Output is correct
24 Correct 26 ms 4344 KB Output is correct
25 Correct 27 ms 4404 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 2 ms 600 KB Output is correct
29 Correct 10 ms 1884 KB Output is correct
30 Correct 19 ms 3160 KB Output is correct
31 Correct 39 ms 4588 KB Output is correct
32 Correct 31 ms 4588 KB Output is correct
33 Correct 30 ms 4604 KB Output is correct
34 Correct 30 ms 4696 KB Output is correct
35 Correct 34 ms 4608 KB Output is correct
36 Correct 30 ms 4340 KB Output is correct
37 Correct 31 ms 4688 KB Output is correct
38 Correct 32 ms 4428 KB Output is correct
39 Correct 29 ms 4440 KB Output is correct
40 Correct 40 ms 4692 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 2 ms 756 KB Output is correct
45 Correct 2 ms 532 KB Output is correct
46 Correct 2 ms 476 KB Output is correct
47 Correct 8 ms 1180 KB Output is correct
48 Correct 10 ms 1116 KB Output is correct
49 Correct 16 ms 1892 KB Output is correct
50 Correct 33 ms 3312 KB Output is correct
51 Correct 47 ms 4584 KB Output is correct
52 Correct 49 ms 4580 KB Output is correct
53 Correct 54 ms 4816 KB Output is correct
54 Correct 44 ms 4588 KB Output is correct
55 Correct 46 ms 4600 KB Output is correct
56 Correct 60 ms 4712 KB Output is correct
57 Correct 56 ms 4692 KB Output is correct
58 Correct 59 ms 4684 KB Output is correct
59 Correct 56 ms 4556 KB Output is correct
60 Correct 45 ms 4584 KB Output is correct
61 Correct 61 ms 4604 KB Output is correct
62 Correct 45 ms 4700 KB Output is correct
63 Correct 50 ms 4692 KB Output is correct
64 Correct 45 ms 4736 KB Output is correct
65 Correct 60 ms 4692 KB Output is correct
66 Correct 62 ms 4688 KB Output is correct
67 Correct 45 ms 4584 KB Output is correct
68 Correct 49 ms 4712 KB Output is correct
69 Correct 60 ms 4660 KB Output is correct
70 Correct 45 ms 4688 KB Output is correct
71 Correct 12 ms 1116 KB Output is correct
72 Correct 9 ms 1112 KB Output is correct
73 Correct 9 ms 1116 KB Output is correct
74 Correct 11 ms 1084 KB Output is correct
75 Correct 9 ms 1112 KB Output is correct
76 Correct 18 ms 1876 KB Output is correct
77 Correct 18 ms 2140 KB Output is correct
78 Correct 22 ms 1972 KB Output is correct
79 Correct 24 ms 2140 KB Output is correct
80 Correct 18 ms 1872 KB Output is correct
81 Correct 49 ms 3556 KB Output is correct
82 Correct 42 ms 3552 KB Output is correct
83 Correct 37 ms 3800 KB Output is correct
84 Correct 40 ms 3416 KB Output is correct
85 Correct 37 ms 3552 KB Output is correct
86 Correct 49 ms 3552 KB Output is correct
87 Correct 45 ms 3548 KB Output is correct
88 Correct 47 ms 3556 KB Output is correct
89 Correct 55 ms 3552 KB Output is correct
90 Correct 42 ms 3548 KB Output is correct
91 Correct 70 ms 5352 KB Output is correct
92 Correct 88 ms 5200 KB Output is correct
93 Correct 74 ms 5356 KB Output is correct
94 Correct 88 ms 5236 KB Output is correct
95 Correct 77 ms 5200 KB Output is correct
96 Correct 77 ms 5864 KB Output is correct
97 Correct 88 ms 5972 KB Output is correct
98 Correct 77 ms 5892 KB Output is correct
99 Correct 97 ms 5864 KB Output is correct
100 Correct 78 ms 5864 KB Output is correct
101 Correct 78 ms 5980 KB Output is correct
102 Correct 86 ms 5872 KB Output is correct
103 Correct 77 ms 5864 KB Output is correct
104 Correct 99 ms 6004 KB Output is correct
105 Correct 76 ms 5984 KB Output is correct
106 Correct 84 ms 6004 KB Output is correct
107 Correct 77 ms 5992 KB Output is correct
108 Correct 76 ms 6164 KB Output is correct
109 Correct 90 ms 6124 KB Output is correct
110 Correct 78 ms 6120 KB Output is correct
111 Correct 80 ms 6120 KB Output is correct
112 Correct 80 ms 6124 KB Output is correct
113 Correct 78 ms 5980 KB Output is correct
114 Correct 95 ms 6180 KB Output is correct
115 Correct 85 ms 6120 KB Output is correct
116 Correct 167 ms 2396 KB Output is correct
117 Correct 149 ms 2392 KB Output is correct
118 Correct 209 ms 3064 KB Output is correct
119 Correct 211 ms 3016 KB Output is correct
120 Correct 186 ms 3140 KB Output is correct
121 Correct 301 ms 3252 KB Output is correct
122 Correct 240 ms 3164 KB Output is correct
123 Correct 667 ms 4428 KB Output is correct
124 Correct 414 ms 4448 KB Output is correct
125 Correct 326 ms 4436 KB Output is correct
126 Correct 981 ms 5592 KB Output is correct
127 Correct 939 ms 5832 KB Output is correct
128 Correct 944 ms 5580 KB Output is correct
129 Correct 942 ms 5588 KB Output is correct
130 Correct 948 ms 5608 KB Output is correct
131 Correct 911 ms 5604 KB Output is correct
132 Correct 894 ms 5600 KB Output is correct
133 Correct 913 ms 5616 KB Output is correct
134 Correct 891 ms 5596 KB Output is correct
135 Correct 904 ms 5600 KB Output is correct
136 Correct 930 ms 5592 KB Output is correct
137 Correct 907 ms 5632 KB Output is correct
138 Correct 965 ms 5840 KB Output is correct
139 Correct 927 ms 5596 KB Output is correct
140 Correct 895 ms 5604 KB Output is correct
141 Correct 816 ms 5592 KB Output is correct
142 Correct 821 ms 5600 KB Output is correct
143 Correct 822 ms 5600 KB Output is correct
144 Correct 829 ms 5828 KB Output is correct
145 Correct 754 ms 5600 KB Output is correct
146 Correct 582 ms 5608 KB Output is correct
147 Correct 596 ms 5580 KB Output is correct
148 Correct 726 ms 5616 KB Output is correct
149 Correct 596 ms 5604 KB Output is correct
150 Correct 607 ms 5608 KB Output is correct
151 Correct 649 ms 7168 KB Output is correct
152 Correct 623 ms 7168 KB Output is correct
153 Correct 751 ms 7168 KB Output is correct
154 Correct 660 ms 7164 KB Output is correct
155 Correct 613 ms 7116 KB Output is correct
156 Correct 1054 ms 7584 KB Output is correct
157 Correct 1060 ms 7588 KB Output is correct
158 Correct 1008 ms 7588 KB Output is correct
159 Correct 955 ms 7580 KB Output is correct
160 Correct 1032 ms 7588 KB Output is correct
161 Correct 1155 ms 7504 KB Output is correct
162 Correct 1154 ms 7500 KB Output is correct
163 Correct 1092 ms 7684 KB Output is correct
164 Correct 1109 ms 7504 KB Output is correct
165 Correct 1083 ms 7588 KB Output is correct
166 Correct 1038 ms 7128 KB Output is correct
167 Correct 994 ms 7132 KB Output is correct
168 Correct 982 ms 7140 KB Output is correct
169 Correct 1061 ms 7148 KB Output is correct
170 Correct 1024 ms 7164 KB Output is correct
171 Correct 1162 ms 6356 KB Output is correct
172 Correct 1090 ms 5712 KB Output is correct
173 Correct 1085 ms 5592 KB Output is correct
174 Correct 1166 ms 5592 KB Output is correct
175 Correct 1174 ms 5592 KB Output is correct