Submission #792456

# Submission time Handle Problem Language Result Execution time Memory
792456 2023-07-25T05:08:41 Z GEN 이지후(#10086) Real Mountains (CCO23_day1problem2) C++17
25 / 25
1755 ms 71460 KB
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pi = array<int, 2>;
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
using llf = long double;
const int mod = 1e6 + 3; // 1e9 + 7;//993244853;
const int MAXN = 1000005;
const int MAXT = 2100000;

// I don't remember the credit of modint, but it's not mine.
// I don't remember the credit of FFT, but it's probably mine.
// Polynomial library is due to adamant:
// https://github.com/cp-algorithms/cp-algorithms-aux/blob/master/src/polynomial.cpp
// To use polynomial sqrt, need to amend sqrt for modint.

struct mint {
	int val;
	mint() { val = 0; }
	mint(const lint &v) {
		val = (-mod <= v && v < mod) ? v : v % mod;
		if (val < 0)
			val += mod;
	}

	friend ostream &operator<<(ostream &os, const mint &a) { return os << a.val; }
	friend bool operator==(const mint &a, const mint &b) { return a.val == b.val; }
	friend bool operator!=(const mint &a, const mint &b) { return !(a == b); }
	friend bool operator<(const mint &a, const mint &b) { return a.val < b.val; }

	mint operator-() const { return mint(-val); }
	mint &operator+=(const mint &m) {
		if ((val += m.val) >= mod)
			val -= mod;
		return *this;
	}
	mint &operator-=(const mint &m) {
		if ((val -= m.val) < 0)
			val += mod;
		return *this;
	}
	mint &operator*=(const mint &m) {
		val = (lint)val * m.val % mod;
		return *this;
	}
	friend mint ipow(mint a, lint p) {
		mint ans = 1;
		for (; p; p /= 2, a *= a)
			if (p & 1)
				ans *= a;
		return ans;
	}
	mint inv() const { return ipow(*this, mod - 2); }
	mint &operator/=(const mint &m) { return (*this) *= m.inv(); }

	friend mint operator+(mint a, const mint &b) { return a += b; }
	friend mint operator-(mint a, const mint &b) { return a -= b; }
	friend mint operator*(mint a, const mint &b) { return a *= b; }
	friend mint operator/(mint a, const mint &b) { return a /= b; }
	operator int64_t() const { return val; }
};

struct seg {
	int tree[MAXT], lim;
	void init(vector<int> &a) {
		memset(tree, 0x3f, sizeof(tree));
		for (lim = 1; lim <= sz(a); lim <<= 1)
			;
		for (int i = 0; i < sz(a); i++) {
			tree[i + lim] = a[i];
		}
		for (int i = lim - 1; i; i--)
			tree[i] = min(tree[2 * i], tree[2 * i + 1]);
	}
	void upd(int x, int v) {
		x += lim;
		tree[x] = v;
		while (x > 1) {
			x >>= 1;
			tree[x] = min(tree[2 * x], tree[2 * x + 1]);
		}
	}
	int query(int s, int e) {
		s += lim;
		e += lim;
		int ret = 1e9;
		while (s < e) {
			if (s % 2 == 1)
				ret = min(ret, tree[s++]);
			if (e % 2 == 0)
				ret = min(ret, tree[e--]);
			s >>= 1;
			e >>= 1;
		}
		if (s == e)
			ret = min(ret, tree[s]);
		return ret;
	}
} seg;

struct bit {
	int tree[MAXN];
	void add(int x, int v) {
		for (int i = x + 2; i < MAXN; i += i & -i)
			tree[i] += v;
	}
	int query(int x) {
		int ret = 0;
		for (int i = x + 2; i; i -= i & -i)
			ret += tree[i];
		return ret;
	}
} bit;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	vector<pi> byval;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		byval.push_back({a[i], i});
	}
	seg.init(a);
	sort(all(byval));
	mint tot = 0;
	auto sum = [&](int l, int r) { return mint(1ll * (r - l + 1) * (r + l) / 2); };
	int l = 0, r = n;
	set<int> s;
	for (int i = 0; i < sz(byval) - 1; i++) {
		s.insert(byval[i][1]);
		seg.upd(byval[i][1], 1e9);
		bit.add(byval[i][1], 1);
		if (byval[i][0] == byval[i + 1][0])
			continue;
		int C = byval[i][0];
		int D = byval[i + 1][0];
		while (l < n && a[l] <= C)
			l++;
		while (r > l && a[r - 1] <= C)
			r--;
		if (l == r)
			break;
		auto it = s.lower_bound(l);
		if (it == s.end() || *it >= r)
			continue;

		int fp = *it;
		int gp = *--s.lower_bound(r);
		if (fp == gp) {
			tot += mint(1ll * (D - C) * (seg.query(l, fp - 1) + seg.query(fp + 1, r))) + sum(C, D - 1);
			continue;
		}
		int pcnt = bit.query(r - 1) - bit.query(l - 1);
		tot += sum(C, D - 1) * mint(pcnt);
		tot += sum(C + 1, D) * mint(2 * pcnt - 2);
		tot += mint(1ll * seg.query(l, fp - 1) * (D - C));
		tot += mint(1ll * seg.query(gp + 1, r - 1) * (D - C));
		tot += mint(1ll * (D - C) * min(seg.query(fp + 1, r - 1), seg.query(l, gp - 1))) - sum(C + 1, D);
	}
	cout << tot << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
13 Correct 5 ms 8788 KB Output is correct
14 Correct 3 ms 8532 KB Output is correct
15 Correct 3 ms 8532 KB Output is correct
16 Correct 5 ms 8788 KB Output is correct
17 Correct 5 ms 8788 KB Output is correct
18 Correct 5 ms 8788 KB Output is correct
19 Correct 5 ms 8916 KB Output is correct
20 Correct 5 ms 8816 KB Output is correct
21 Correct 5 ms 8788 KB Output is correct
22 Correct 7 ms 8932 KB Output is correct
23 Correct 6 ms 8788 KB Output is correct
24 Correct 5 ms 8788 KB Output is correct
25 Correct 7 ms 8804 KB Output is correct
26 Correct 5 ms 8788 KB Output is correct
27 Correct 5 ms 8788 KB Output is correct
28 Correct 5 ms 8964 KB Output is correct
29 Correct 4 ms 8532 KB Output is correct
30 Correct 4 ms 8532 KB Output is correct
31 Correct 5 ms 8496 KB Output is correct
32 Correct 3 ms 8532 KB Output is correct
33 Correct 3 ms 8532 KB Output is correct
34 Correct 3 ms 8552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
13 Correct 5 ms 8788 KB Output is correct
14 Correct 3 ms 8532 KB Output is correct
15 Correct 3 ms 8532 KB Output is correct
16 Correct 5 ms 8788 KB Output is correct
17 Correct 5 ms 8788 KB Output is correct
18 Correct 5 ms 8788 KB Output is correct
19 Correct 5 ms 8916 KB Output is correct
20 Correct 5 ms 8816 KB Output is correct
21 Correct 5 ms 8788 KB Output is correct
22 Correct 7 ms 8932 KB Output is correct
23 Correct 6 ms 8788 KB Output is correct
24 Correct 5 ms 8788 KB Output is correct
25 Correct 7 ms 8804 KB Output is correct
26 Correct 5 ms 8788 KB Output is correct
27 Correct 5 ms 8788 KB Output is correct
28 Correct 5 ms 8964 KB Output is correct
29 Correct 4 ms 8532 KB Output is correct
30 Correct 4 ms 8532 KB Output is correct
31 Correct 5 ms 8496 KB Output is correct
32 Correct 3 ms 8532 KB Output is correct
33 Correct 3 ms 8532 KB Output is correct
34 Correct 3 ms 8552 KB Output is correct
35 Correct 5 ms 8788 KB Output is correct
36 Correct 7 ms 8788 KB Output is correct
37 Correct 5 ms 8788 KB Output is correct
38 Correct 7 ms 8788 KB Output is correct
39 Correct 5 ms 8788 KB Output is correct
40 Correct 4 ms 8788 KB Output is correct
41 Correct 6 ms 8788 KB Output is correct
42 Correct 6 ms 8788 KB Output is correct
43 Correct 8 ms 8788 KB Output is correct
44 Correct 8 ms 8876 KB Output is correct
45 Correct 6 ms 8788 KB Output is correct
46 Correct 5 ms 8876 KB Output is correct
47 Correct 5 ms 8788 KB Output is correct
48 Correct 7 ms 8804 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
13 Correct 5 ms 8788 KB Output is correct
14 Correct 3 ms 8532 KB Output is correct
15 Correct 3 ms 8532 KB Output is correct
16 Correct 5 ms 8788 KB Output is correct
17 Correct 5 ms 8788 KB Output is correct
18 Correct 5 ms 8788 KB Output is correct
19 Correct 5 ms 8916 KB Output is correct
20 Correct 5 ms 8816 KB Output is correct
21 Correct 5 ms 8788 KB Output is correct
22 Correct 7 ms 8932 KB Output is correct
23 Correct 6 ms 8788 KB Output is correct
24 Correct 5 ms 8788 KB Output is correct
25 Correct 7 ms 8804 KB Output is correct
26 Correct 5 ms 8788 KB Output is correct
27 Correct 5 ms 8788 KB Output is correct
28 Correct 5 ms 8964 KB Output is correct
29 Correct 4 ms 8532 KB Output is correct
30 Correct 4 ms 8532 KB Output is correct
31 Correct 5 ms 8496 KB Output is correct
32 Correct 3 ms 8532 KB Output is correct
33 Correct 3 ms 8532 KB Output is correct
34 Correct 3 ms 8552 KB Output is correct
35 Correct 5 ms 8788 KB Output is correct
36 Correct 7 ms 8788 KB Output is correct
37 Correct 5 ms 8788 KB Output is correct
38 Correct 7 ms 8788 KB Output is correct
39 Correct 5 ms 8788 KB Output is correct
40 Correct 4 ms 8788 KB Output is correct
41 Correct 6 ms 8788 KB Output is correct
42 Correct 6 ms 8788 KB Output is correct
43 Correct 8 ms 8788 KB Output is correct
44 Correct 8 ms 8876 KB Output is correct
45 Correct 6 ms 8788 KB Output is correct
46 Correct 5 ms 8876 KB Output is correct
47 Correct 5 ms 8788 KB Output is correct
48 Correct 7 ms 8804 KB Output is correct
49 Correct 5 ms 8824 KB Output is correct
50 Correct 7 ms 8900 KB Output is correct
51 Correct 5 ms 8788 KB Output is correct
52 Correct 7 ms 8788 KB Output is correct
53 Correct 5 ms 8788 KB Output is correct
54 Correct 5 ms 8788 KB Output is correct
55 Correct 6 ms 8796 KB Output is correct
56 Correct 6 ms 8788 KB Output is correct
57 Correct 8 ms 8788 KB Output is correct
58 Correct 7 ms 8788 KB Output is correct
59 Correct 6 ms 8788 KB Output is correct
60 Correct 6 ms 8816 KB Output is correct
61 Correct 8 ms 8788 KB Output is correct
62 Correct 7 ms 8820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
13 Correct 5 ms 8788 KB Output is correct
14 Correct 3 ms 8532 KB Output is correct
15 Correct 3 ms 8532 KB Output is correct
16 Correct 5 ms 8788 KB Output is correct
17 Correct 5 ms 8788 KB Output is correct
18 Correct 5 ms 8788 KB Output is correct
19 Correct 5 ms 8916 KB Output is correct
20 Correct 5 ms 8816 KB Output is correct
21 Correct 5 ms 8788 KB Output is correct
22 Correct 7 ms 8932 KB Output is correct
23 Correct 6 ms 8788 KB Output is correct
24 Correct 5 ms 8788 KB Output is correct
25 Correct 7 ms 8804 KB Output is correct
26 Correct 5 ms 8788 KB Output is correct
27 Correct 5 ms 8788 KB Output is correct
28 Correct 5 ms 8964 KB Output is correct
29 Correct 4 ms 8532 KB Output is correct
30 Correct 4 ms 8532 KB Output is correct
31 Correct 5 ms 8496 KB Output is correct
32 Correct 3 ms 8532 KB Output is correct
33 Correct 3 ms 8532 KB Output is correct
34 Correct 3 ms 8552 KB Output is correct
35 Correct 991 ms 71144 KB Output is correct
36 Correct 1045 ms 71108 KB Output is correct
37 Correct 1061 ms 71104 KB Output is correct
38 Correct 1052 ms 71096 KB Output is correct
39 Correct 892 ms 71128 KB Output is correct
40 Correct 3 ms 8532 KB Output is correct
41 Correct 3 ms 8532 KB Output is correct
42 Correct 441 ms 71112 KB Output is correct
43 Correct 439 ms 71084 KB Output is correct
44 Correct 447 ms 71128 KB Output is correct
45 Correct 388 ms 71168 KB Output is correct
46 Correct 345 ms 71216 KB Output is correct
47 Correct 365 ms 71120 KB Output is correct
48 Correct 451 ms 71120 KB Output is correct
49 Correct 479 ms 71080 KB Output is correct
50 Correct 494 ms 71064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
13 Correct 5 ms 8788 KB Output is correct
14 Correct 3 ms 8532 KB Output is correct
15 Correct 3 ms 8532 KB Output is correct
16 Correct 5 ms 8788 KB Output is correct
17 Correct 5 ms 8788 KB Output is correct
18 Correct 5 ms 8788 KB Output is correct
19 Correct 5 ms 8916 KB Output is correct
20 Correct 5 ms 8816 KB Output is correct
21 Correct 5 ms 8788 KB Output is correct
22 Correct 7 ms 8932 KB Output is correct
23 Correct 6 ms 8788 KB Output is correct
24 Correct 5 ms 8788 KB Output is correct
25 Correct 7 ms 8804 KB Output is correct
26 Correct 5 ms 8788 KB Output is correct
27 Correct 5 ms 8788 KB Output is correct
28 Correct 5 ms 8964 KB Output is correct
29 Correct 4 ms 8532 KB Output is correct
30 Correct 4 ms 8532 KB Output is correct
31 Correct 5 ms 8496 KB Output is correct
32 Correct 3 ms 8532 KB Output is correct
33 Correct 3 ms 8532 KB Output is correct
34 Correct 3 ms 8552 KB Output is correct
35 Correct 5 ms 8788 KB Output is correct
36 Correct 7 ms 8788 KB Output is correct
37 Correct 5 ms 8788 KB Output is correct
38 Correct 7 ms 8788 KB Output is correct
39 Correct 5 ms 8788 KB Output is correct
40 Correct 4 ms 8788 KB Output is correct
41 Correct 6 ms 8788 KB Output is correct
42 Correct 6 ms 8788 KB Output is correct
43 Correct 8 ms 8788 KB Output is correct
44 Correct 8 ms 8876 KB Output is correct
45 Correct 6 ms 8788 KB Output is correct
46 Correct 5 ms 8876 KB Output is correct
47 Correct 5 ms 8788 KB Output is correct
48 Correct 7 ms 8804 KB Output is correct
49 Correct 991 ms 71144 KB Output is correct
50 Correct 1045 ms 71108 KB Output is correct
51 Correct 1061 ms 71104 KB Output is correct
52 Correct 1052 ms 71096 KB Output is correct
53 Correct 892 ms 71128 KB Output is correct
54 Correct 3 ms 8532 KB Output is correct
55 Correct 3 ms 8532 KB Output is correct
56 Correct 441 ms 71112 KB Output is correct
57 Correct 439 ms 71084 KB Output is correct
58 Correct 447 ms 71128 KB Output is correct
59 Correct 388 ms 71168 KB Output is correct
60 Correct 345 ms 71216 KB Output is correct
61 Correct 365 ms 71120 KB Output is correct
62 Correct 451 ms 71120 KB Output is correct
63 Correct 479 ms 71080 KB Output is correct
64 Correct 494 ms 71064 KB Output is correct
65 Correct 1525 ms 71108 KB Output is correct
66 Correct 1557 ms 71460 KB Output is correct
67 Correct 1519 ms 71344 KB Output is correct
68 Correct 1471 ms 71248 KB Output is correct
69 Correct 1546 ms 71240 KB Output is correct
70 Correct 442 ms 71132 KB Output is correct
71 Correct 418 ms 71156 KB Output is correct
72 Correct 434 ms 71156 KB Output is correct
73 Correct 771 ms 71068 KB Output is correct
74 Correct 730 ms 71156 KB Output is correct
75 Correct 753 ms 71092 KB Output is correct
76 Correct 757 ms 71096 KB Output is correct
77 Correct 770 ms 71136 KB Output is correct
78 Correct 839 ms 71108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 8532 KB Output is correct
2 Correct 3 ms 8532 KB Output is correct
3 Correct 3 ms 8532 KB Output is correct
4 Correct 5 ms 8788 KB Output is correct
5 Correct 4 ms 8788 KB Output is correct
6 Correct 5 ms 8788 KB Output is correct
7 Correct 4 ms 8868 KB Output is correct
8 Correct 4 ms 8788 KB Output is correct
9 Correct 6 ms 8788 KB Output is correct
10 Correct 5 ms 8788 KB Output is correct
11 Correct 4 ms 8788 KB Output is correct
12 Correct 4 ms 8808 KB Output is correct
13 Correct 5 ms 8788 KB Output is correct
14 Correct 3 ms 8532 KB Output is correct
15 Correct 3 ms 8532 KB Output is correct
16 Correct 5 ms 8788 KB Output is correct
17 Correct 5 ms 8788 KB Output is correct
18 Correct 5 ms 8788 KB Output is correct
19 Correct 5 ms 8916 KB Output is correct
20 Correct 5 ms 8816 KB Output is correct
21 Correct 5 ms 8788 KB Output is correct
22 Correct 7 ms 8932 KB Output is correct
23 Correct 6 ms 8788 KB Output is correct
24 Correct 5 ms 8788 KB Output is correct
25 Correct 7 ms 8804 KB Output is correct
26 Correct 5 ms 8788 KB Output is correct
27 Correct 5 ms 8788 KB Output is correct
28 Correct 5 ms 8964 KB Output is correct
29 Correct 4 ms 8532 KB Output is correct
30 Correct 4 ms 8532 KB Output is correct
31 Correct 5 ms 8496 KB Output is correct
32 Correct 3 ms 8532 KB Output is correct
33 Correct 3 ms 8532 KB Output is correct
34 Correct 3 ms 8552 KB Output is correct
35 Correct 5 ms 8788 KB Output is correct
36 Correct 7 ms 8788 KB Output is correct
37 Correct 5 ms 8788 KB Output is correct
38 Correct 7 ms 8788 KB Output is correct
39 Correct 5 ms 8788 KB Output is correct
40 Correct 4 ms 8788 KB Output is correct
41 Correct 6 ms 8788 KB Output is correct
42 Correct 6 ms 8788 KB Output is correct
43 Correct 8 ms 8788 KB Output is correct
44 Correct 8 ms 8876 KB Output is correct
45 Correct 6 ms 8788 KB Output is correct
46 Correct 5 ms 8876 KB Output is correct
47 Correct 5 ms 8788 KB Output is correct
48 Correct 7 ms 8804 KB Output is correct
49 Correct 5 ms 8824 KB Output is correct
50 Correct 7 ms 8900 KB Output is correct
51 Correct 5 ms 8788 KB Output is correct
52 Correct 7 ms 8788 KB Output is correct
53 Correct 5 ms 8788 KB Output is correct
54 Correct 5 ms 8788 KB Output is correct
55 Correct 6 ms 8796 KB Output is correct
56 Correct 6 ms 8788 KB Output is correct
57 Correct 8 ms 8788 KB Output is correct
58 Correct 7 ms 8788 KB Output is correct
59 Correct 6 ms 8788 KB Output is correct
60 Correct 6 ms 8816 KB Output is correct
61 Correct 8 ms 8788 KB Output is correct
62 Correct 7 ms 8820 KB Output is correct
63 Correct 991 ms 71144 KB Output is correct
64 Correct 1045 ms 71108 KB Output is correct
65 Correct 1061 ms 71104 KB Output is correct
66 Correct 1052 ms 71096 KB Output is correct
67 Correct 892 ms 71128 KB Output is correct
68 Correct 3 ms 8532 KB Output is correct
69 Correct 3 ms 8532 KB Output is correct
70 Correct 441 ms 71112 KB Output is correct
71 Correct 439 ms 71084 KB Output is correct
72 Correct 447 ms 71128 KB Output is correct
73 Correct 388 ms 71168 KB Output is correct
74 Correct 345 ms 71216 KB Output is correct
75 Correct 365 ms 71120 KB Output is correct
76 Correct 451 ms 71120 KB Output is correct
77 Correct 479 ms 71080 KB Output is correct
78 Correct 494 ms 71064 KB Output is correct
79 Correct 1525 ms 71108 KB Output is correct
80 Correct 1557 ms 71460 KB Output is correct
81 Correct 1519 ms 71344 KB Output is correct
82 Correct 1471 ms 71248 KB Output is correct
83 Correct 1546 ms 71240 KB Output is correct
84 Correct 442 ms 71132 KB Output is correct
85 Correct 418 ms 71156 KB Output is correct
86 Correct 434 ms 71156 KB Output is correct
87 Correct 771 ms 71068 KB Output is correct
88 Correct 730 ms 71156 KB Output is correct
89 Correct 753 ms 71092 KB Output is correct
90 Correct 757 ms 71096 KB Output is correct
91 Correct 770 ms 71136 KB Output is correct
92 Correct 839 ms 71108 KB Output is correct
93 Correct 425 ms 71108 KB Output is correct
94 Correct 884 ms 71132 KB Output is correct
95 Correct 1012 ms 71084 KB Output is correct
96 Correct 883 ms 71040 KB Output is correct
97 Correct 894 ms 71200 KB Output is correct
98 Correct 934 ms 71068 KB Output is correct
99 Correct 906 ms 71100 KB Output is correct
100 Correct 1699 ms 71248 KB Output is correct
101 Correct 1755 ms 71060 KB Output is correct
102 Correct 1654 ms 71176 KB Output is correct
103 Correct 1552 ms 71100 KB Output is correct
104 Correct 1648 ms 71124 KB Output is correct
105 Correct 427 ms 71112 KB Output is correct
106 Correct 432 ms 71112 KB Output is correct