Submission #792517

# Submission time Handle Problem Language Result Execution time Memory
792517 2023-07-25T06:16:27 Z 이온조(#10087) Real Mountains (CCO23_day1problem2) C++17
25 / 25
2474 ms 102844 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9;
const int MOD = 1e6 + 3;

int A[1000009], L[1000009], R[1000009], T[2323232];

void init(int idx, int s, int e) {
	if(s == e) {
		T[idx] = A[s];
		return;
	}
	int m = s+e >> 1;
	init(idx*2, s, m);
	init(idx*2+1, m+1, e);
	T[idx] = min(T[idx*2], T[idx*2+1]);
}

void upd(int idx, int s, int e, int p, int v) {
	if(p < s || e < p) return;
	if(s == e) {
		T[idx] = v;
		return;
	}
	int m = s+e >> 1;
	upd(idx*2, s, m, p, v);
	upd(idx*2+1, m+1, e, p, v);
	T[idx] = min(T[idx*2], T[idx*2+1]);
}

int get(int idx, int s, int e, int l, int r) {
	if(r < s || e < l) return INF;
	if(l <= s && e <= r) return T[idx];
	int m = s+e >> 1;
	return min(get(idx*2, s, m, l, r), get(idx*2+1, m+1, e, l, r));
}

long long f(int l, int r) {
	return (1LL*r*(r+1)/2 - 1LL*l*(l-1)/2) % MOD;
}

signed main() {
	vector<int> I, X;
	int N; scanf("%lld", &N);
	for(int i=1; i<=N; i++) {
		scanf("%lld", &A[i]);
		X.push_back(A[i]);
		I.push_back(i);
	}
	init(1, 1, N);
	for(int i=1; i<=N; i++) L[i] = max(L[i-1], A[i]);
	for(int i=N; i>=1; i--) R[i] = max(R[i+1], A[i]);
	sort(I.begin(), I.end(), [&](int p, int q) { return A[p] < A[q]; });
	sort(X.begin(), X.end()); X.resize(unique(X.begin(), X.end()) - X.begin());
	set<int> U;
	int i = 0, j = 0;
	long long ans = 0;
	for(auto& h: X) if(++j < X.size()) {
		while(i < N && A[I[i]] <= h) {
			upd(1, 1, N, I[i], INF);
			if(L[I[i]] != A[I[i]] && R[I[i]] != A[I[i]]) U.insert(I[i]);
			++i;
		}
		while(U.size() && L[*U.begin()] == h) U.erase(U.begin());
		while(U.size() && R[*U.rbegin()] == h) U.erase(prev(U.end()));
		int g = X[j] - h;
		if(U.size()) {
			int l = get(1, 1, N, 1, *U.begin()) % MOD, r = get(1, 1, N, *U.rbegin(), N) % MOD;
			int v = min(get(1, 1, N, *U.begin(), N), get(1, 1, N, 1, *U.rbegin())) % MOD;
			if(U.size() == 1) ans += 1LL * (l + r) * g + f(h, X[j] - 1);
			else ans += 1LL * (1LL * v + l + r) * g + 1LL * U.size() * f(h, X[j] - 1) + 1LL * (2*U.size() - 3) * f(h+1, X[j]);
		}
		ans %= MOD;
		/*
		printf("h: %lld, nxt_h: %lld, ans: %lld\nU: ", h, X[j], ans);
		for(auto& it: U) printf("%lld ", it);
		puts("");
		*/
	}
	printf("%lld", ans);
	return 0;
}

Compilation message

Main.cpp: In function 'void init(long long int, long long int, long long int)':
Main.cpp:14:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   14 |  int m = s+e >> 1;
      |          ~^~
Main.cpp: In function 'void upd(long long int, long long int, long long int, long long int, long long int)':
Main.cpp:26:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   26 |  int m = s+e >> 1;
      |          ~^~
Main.cpp: In function 'long long int get(long long int, long long int, long long int, long long int, long long int)':
Main.cpp:35:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   35 |  int m = s+e >> 1;
      |          ~^~
Main.cpp: In function 'int main()':
Main.cpp:59:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |  for(auto& h: X) if(++j < X.size()) {
      |                     ~~~~^~~~~~~~~~
Main.cpp:45:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |  int N; scanf("%lld", &N);
      |         ~~~~~^~~~~~~~~~~~
Main.cpp:47:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   47 |   scanf("%lld", &A[i]);
      |   ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 3 ms 880 KB Output is correct
17 Correct 2 ms 852 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 2 ms 852 KB Output is correct
21 Correct 2 ms 852 KB Output is correct
22 Correct 2 ms 852 KB Output is correct
23 Correct 2 ms 852 KB Output is correct
24 Correct 2 ms 852 KB Output is correct
25 Correct 2 ms 852 KB Output is correct
26 Correct 2 ms 852 KB Output is correct
27 Correct 2 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 3 ms 880 KB Output is correct
17 Correct 2 ms 852 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 2 ms 852 KB Output is correct
21 Correct 2 ms 852 KB Output is correct
22 Correct 2 ms 852 KB Output is correct
23 Correct 2 ms 852 KB Output is correct
24 Correct 2 ms 852 KB Output is correct
25 Correct 2 ms 852 KB Output is correct
26 Correct 2 ms 852 KB Output is correct
27 Correct 2 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 4 ms 852 KB Output is correct
36 Correct 4 ms 852 KB Output is correct
37 Correct 5 ms 844 KB Output is correct
38 Correct 4 ms 852 KB Output is correct
39 Correct 5 ms 852 KB Output is correct
40 Correct 2 ms 852 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 4 ms 852 KB Output is correct
44 Correct 4 ms 852 KB Output is correct
45 Correct 4 ms 876 KB Output is correct
46 Correct 4 ms 852 KB Output is correct
47 Correct 4 ms 852 KB Output is correct
48 Correct 4 ms 852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 3 ms 880 KB Output is correct
17 Correct 2 ms 852 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 2 ms 852 KB Output is correct
21 Correct 2 ms 852 KB Output is correct
22 Correct 2 ms 852 KB Output is correct
23 Correct 2 ms 852 KB Output is correct
24 Correct 2 ms 852 KB Output is correct
25 Correct 2 ms 852 KB Output is correct
26 Correct 2 ms 852 KB Output is correct
27 Correct 2 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 4 ms 852 KB Output is correct
36 Correct 4 ms 852 KB Output is correct
37 Correct 5 ms 844 KB Output is correct
38 Correct 4 ms 852 KB Output is correct
39 Correct 5 ms 852 KB Output is correct
40 Correct 2 ms 852 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 4 ms 852 KB Output is correct
44 Correct 4 ms 852 KB Output is correct
45 Correct 4 ms 876 KB Output is correct
46 Correct 4 ms 852 KB Output is correct
47 Correct 4 ms 852 KB Output is correct
48 Correct 4 ms 852 KB Output is correct
49 Correct 4 ms 852 KB Output is correct
50 Correct 5 ms 812 KB Output is correct
51 Correct 4 ms 852 KB Output is correct
52 Correct 4 ms 852 KB Output is correct
53 Correct 4 ms 852 KB Output is correct
54 Correct 3 ms 852 KB Output is correct
55 Correct 2 ms 852 KB Output is correct
56 Correct 2 ms 852 KB Output is correct
57 Correct 5 ms 852 KB Output is correct
58 Correct 4 ms 852 KB Output is correct
59 Correct 4 ms 788 KB Output is correct
60 Correct 4 ms 852 KB Output is correct
61 Correct 5 ms 852 KB Output is correct
62 Correct 4 ms 852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 3 ms 880 KB Output is correct
17 Correct 2 ms 852 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 2 ms 852 KB Output is correct
21 Correct 2 ms 852 KB Output is correct
22 Correct 2 ms 852 KB Output is correct
23 Correct 2 ms 852 KB Output is correct
24 Correct 2 ms 852 KB Output is correct
25 Correct 2 ms 852 KB Output is correct
26 Correct 2 ms 852 KB Output is correct
27 Correct 2 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 1425 ms 102356 KB Output is correct
36 Correct 1455 ms 102284 KB Output is correct
37 Correct 1463 ms 102320 KB Output is correct
38 Correct 1498 ms 102284 KB Output is correct
39 Correct 1419 ms 102332 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 958 ms 102788 KB Output is correct
43 Correct 996 ms 102708 KB Output is correct
44 Correct 950 ms 102744 KB Output is correct
45 Correct 484 ms 102256 KB Output is correct
46 Correct 485 ms 102280 KB Output is correct
47 Correct 442 ms 102300 KB Output is correct
48 Correct 696 ms 102344 KB Output is correct
49 Correct 687 ms 102284 KB Output is correct
50 Correct 641 ms 102212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 3 ms 880 KB Output is correct
17 Correct 2 ms 852 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 2 ms 852 KB Output is correct
21 Correct 2 ms 852 KB Output is correct
22 Correct 2 ms 852 KB Output is correct
23 Correct 2 ms 852 KB Output is correct
24 Correct 2 ms 852 KB Output is correct
25 Correct 2 ms 852 KB Output is correct
26 Correct 2 ms 852 KB Output is correct
27 Correct 2 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 4 ms 852 KB Output is correct
36 Correct 4 ms 852 KB Output is correct
37 Correct 5 ms 844 KB Output is correct
38 Correct 4 ms 852 KB Output is correct
39 Correct 5 ms 852 KB Output is correct
40 Correct 2 ms 852 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 4 ms 852 KB Output is correct
44 Correct 4 ms 852 KB Output is correct
45 Correct 4 ms 876 KB Output is correct
46 Correct 4 ms 852 KB Output is correct
47 Correct 4 ms 852 KB Output is correct
48 Correct 4 ms 852 KB Output is correct
49 Correct 1425 ms 102356 KB Output is correct
50 Correct 1455 ms 102284 KB Output is correct
51 Correct 1463 ms 102320 KB Output is correct
52 Correct 1498 ms 102284 KB Output is correct
53 Correct 1419 ms 102332 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 0 ms 340 KB Output is correct
56 Correct 958 ms 102788 KB Output is correct
57 Correct 996 ms 102708 KB Output is correct
58 Correct 950 ms 102744 KB Output is correct
59 Correct 484 ms 102256 KB Output is correct
60 Correct 485 ms 102280 KB Output is correct
61 Correct 442 ms 102300 KB Output is correct
62 Correct 696 ms 102344 KB Output is correct
63 Correct 687 ms 102284 KB Output is correct
64 Correct 641 ms 102212 KB Output is correct
65 Correct 2036 ms 102724 KB Output is correct
66 Correct 1957 ms 102800 KB Output is correct
67 Correct 2101 ms 102584 KB Output is correct
68 Correct 2259 ms 102732 KB Output is correct
69 Correct 2268 ms 102720 KB Output is correct
70 Correct 1024 ms 102832 KB Output is correct
71 Correct 976 ms 102836 KB Output is correct
72 Correct 927 ms 102720 KB Output is correct
73 Correct 1047 ms 102836 KB Output is correct
74 Correct 976 ms 102796 KB Output is correct
75 Correct 950 ms 102744 KB Output is correct
76 Correct 1245 ms 102560 KB Output is correct
77 Correct 1212 ms 102488 KB Output is correct
78 Correct 1153 ms 102368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 852 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
6 Correct 2 ms 724 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 1 ms 724 KB Output is correct
10 Correct 1 ms 724 KB Output is correct
11 Correct 2 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 3 ms 880 KB Output is correct
17 Correct 2 ms 852 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 2 ms 852 KB Output is correct
21 Correct 2 ms 852 KB Output is correct
22 Correct 2 ms 852 KB Output is correct
23 Correct 2 ms 852 KB Output is correct
24 Correct 2 ms 852 KB Output is correct
25 Correct 2 ms 852 KB Output is correct
26 Correct 2 ms 852 KB Output is correct
27 Correct 2 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 4 ms 852 KB Output is correct
36 Correct 4 ms 852 KB Output is correct
37 Correct 5 ms 844 KB Output is correct
38 Correct 4 ms 852 KB Output is correct
39 Correct 5 ms 852 KB Output is correct
40 Correct 2 ms 852 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 4 ms 852 KB Output is correct
44 Correct 4 ms 852 KB Output is correct
45 Correct 4 ms 876 KB Output is correct
46 Correct 4 ms 852 KB Output is correct
47 Correct 4 ms 852 KB Output is correct
48 Correct 4 ms 852 KB Output is correct
49 Correct 4 ms 852 KB Output is correct
50 Correct 5 ms 812 KB Output is correct
51 Correct 4 ms 852 KB Output is correct
52 Correct 4 ms 852 KB Output is correct
53 Correct 4 ms 852 KB Output is correct
54 Correct 3 ms 852 KB Output is correct
55 Correct 2 ms 852 KB Output is correct
56 Correct 2 ms 852 KB Output is correct
57 Correct 5 ms 852 KB Output is correct
58 Correct 4 ms 852 KB Output is correct
59 Correct 4 ms 788 KB Output is correct
60 Correct 4 ms 852 KB Output is correct
61 Correct 5 ms 852 KB Output is correct
62 Correct 4 ms 852 KB Output is correct
63 Correct 1425 ms 102356 KB Output is correct
64 Correct 1455 ms 102284 KB Output is correct
65 Correct 1463 ms 102320 KB Output is correct
66 Correct 1498 ms 102284 KB Output is correct
67 Correct 1419 ms 102332 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 0 ms 340 KB Output is correct
70 Correct 958 ms 102788 KB Output is correct
71 Correct 996 ms 102708 KB Output is correct
72 Correct 950 ms 102744 KB Output is correct
73 Correct 484 ms 102256 KB Output is correct
74 Correct 485 ms 102280 KB Output is correct
75 Correct 442 ms 102300 KB Output is correct
76 Correct 696 ms 102344 KB Output is correct
77 Correct 687 ms 102284 KB Output is correct
78 Correct 641 ms 102212 KB Output is correct
79 Correct 2036 ms 102724 KB Output is correct
80 Correct 1957 ms 102800 KB Output is correct
81 Correct 2101 ms 102584 KB Output is correct
82 Correct 2259 ms 102732 KB Output is correct
83 Correct 2268 ms 102720 KB Output is correct
84 Correct 1024 ms 102832 KB Output is correct
85 Correct 976 ms 102836 KB Output is correct
86 Correct 927 ms 102720 KB Output is correct
87 Correct 1047 ms 102836 KB Output is correct
88 Correct 976 ms 102796 KB Output is correct
89 Correct 950 ms 102744 KB Output is correct
90 Correct 1245 ms 102560 KB Output is correct
91 Correct 1212 ms 102488 KB Output is correct
92 Correct 1153 ms 102368 KB Output is correct
93 Correct 1066 ms 102828 KB Output is correct
94 Correct 1185 ms 102844 KB Output is correct
95 Correct 1167 ms 102740 KB Output is correct
96 Correct 1194 ms 102800 KB Output is correct
97 Correct 1385 ms 102432 KB Output is correct
98 Correct 1317 ms 102544 KB Output is correct
99 Correct 1387 ms 102388 KB Output is correct
100 Correct 2316 ms 102792 KB Output is correct
101 Correct 2217 ms 102664 KB Output is correct
102 Correct 2296 ms 102792 KB Output is correct
103 Correct 2339 ms 102652 KB Output is correct
104 Correct 2474 ms 102696 KB Output is correct
105 Correct 878 ms 102844 KB Output is correct
106 Correct 994 ms 102812 KB Output is correct