답안 #421965

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
421965 2021-06-09T14:14:57 Z pavement 푸드 코트 (JOI21_foodcourt) C++17
100 / 100
948 ms 105216 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ppb pop_back
#define eb emplace_back
#define g0(a) get<0>(a)
#define g1(a) get<1>(a)
#define g2(a) get<2>(a)
#define g3(a) get<3>(a)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef double db;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef tuple<int, int, int, int> iiii;
typedef tree<iii, null_type, greater<iii>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void read(int &v) {
	v = 0;
	char ch = getchar_unlocked();
	for (; ch < '0' || ch > '9'; ch = getchar_unlocked());
	for (; '0' <= ch && ch <= '9'; ch = getchar_unlocked())
		v = (v << 3ll) + (v << 1ll) + (ch & 15ll);
}

int N, M, Q, T, L, R, C, K, A, curq, q1, B, out[250005], ft[250005];
iiii vq1[250005];

struct node {
	node *left, *right;
	int S, E, val, pv, pmx;
	bool hasmx;
	node(int _s, int _e) : S(_s), E(_e),val(0), pv(0), pmx(-1e18), hasmx(0) {
		if (S == E) return;
		int M = (S + E) >> 1;
		left = new node(S, M);
		right = new node(M + 1, E);
	}
	void add_prop(bool t, int x) {
		if (t == 0) {
			pv += x;
			if (hasmx) pmx += x;
		} else {
			pmx = max(pmx, x);
			hasmx = 1;
		}
	}
	void prop() {
		if (S == E) return;
		left->val += pv;
		right->val += pv;
		left->add_prop(0, pv);
		right->add_prop(0, pv);
		pv = 0;
		if (hasmx) {
			left->val = max(left->val, pmx);
			right->val = max(right->val, pmx);
			left->add_prop(1, pmx);
			right->add_prop(1, pmx);
			pmx = -1e18;
		} else assert(pmx == -1e18);
		hasmx = 0;
	}
	void add(int l, int r, int v) {
		if (l > E || r < S) return;
		if (l <= S && E <= r) {
			add_prop(0, v);
			val += v;
			return;
		}
		prop();
		left->add(l, r, v);
		right->add(l, r, v);
	}
	int qry(int p) {
		if (S == E) return val;
		int M = (S + E) >> 1;
		prop();
		if (p <= M) return left->qry(p);
		else return right->qry(p);
	}
} *root;

inline int ls(int x) { return x & -x; }

void upd(int l, int r, int v) {
	for (; l <= N; l += ls(l)) ft[l] += v;
	for (r++; r <= N; r += ls(r)) ft[r] -= v;
}

int qry(int p) {
	int r = 0;
	for (; p; p -= ls(p)) r += ft[p];
	return r;
}

struct node2 {
	node2 *left, *right;
	int S, E, pos, pv;
	vector<ii> val;
	iii mv;
	node2(int _s, int _e) : S(_s), E(_e), pos(0), pv(0) {
		mv = mt(1e18, -1, -1);
		if (S == E) return;
		int M = (S + E) >> 1;
		left = new node2(S, M);
		right = new node2(M + 1, E);
	}
	void prop() {
		if (S == E || !pv) return;
		g0(left->mv) += pv;
		left->pv += pv;
		g0(right->mv) += pv;
		right->pv += pv;
		pv = 0;
	}
	void upd(int p, int a, int b) {
		if (S == E) {
			val.eb(a, b);
			return;
		}
		int M = (S + E) >> 1;
		prop();
		if (p <= M) left->upd(p, a, b);
		else right->upd(p, a, b);
	}
	void add(int l, int r, int v) {
		if (l > E || r < S) return;
		if (l <= S && E <= r) {
			g0(mv) += v;
			pv += v;
			return;
		}
		prop();
		left->add(l, r, v);
		right->add(l, r, v);
		mv = min(left->mv, right->mv);
	}
	void sortall() {
		if (S == E) {
			sort(val.begin(), val.end());
			if (!val.empty()) mv = mt(val[0].first, S, val[0].second);
			return;
		}
		prop();
		left->sortall();
		right->sortall();
		mv = min(left->mv, right->mv);
	}
	void del(int p) {
		if (S == E) {
			assert(pos < val.size());
			pos++;
			if (pos < val.size()) mv = mt(val[pos].first + pv, S, val[pos].second);
			else mv = mt(1e18, -1, -1);
			return;
		}
		int M = (S + E) >> 1;
		prop();
		if (p <= M) left->del(p);
		else right->del(p);
		mv = min(left->mv, right->mv);
	}
} *root2;

main() {
	read(N);
	read(M);
	read(Q);
	root = new node(1, N);
	root2 = new node2(1, N);
	for (int i = 1; i <= Q; i++) {
		read(T);
		if (T == 1) {
			read(L);
			read(R);
			read(C);
			read(K);
			q1++;
			vq1[q1] = mt(L, R, C, K);
			root->add(L, R, K);
			upd(L, R, K);
		} else if (T == 2) {
			read(L);
			read(R);
			read(K);
			root->add(L, R, -K);
			root->val = max(0ll, root->val);
			root->add_prop(1, 0);
		} else {
			read(A);
			read(B);
			curq++;
			int sz = root->qry(A), tmp = qry(A);
			assert(sz <= tmp);
			if (sz >= B) root2->upd(A, tmp - (sz - B), curq);
		}
	}
	root2->sortall();
	for (int i = 1; i <= q1; i++) {
		tie(L, R, C, K) = vq1[i];
		root2->add(L, R, -K);
		while (g0(root2->mv) <= 0) {
			out[g2(root2->mv)] = C;
			root2->del(g1(root2->mv));
		}
	}
	for (int i = 1; i <= curq; i++) printf("%lld\n", out[i]);
}

Compilation message

In file included from /usr/include/c++/10/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp:45,
                 from /usr/include/c++/10/ext/pb_ds/detail/container_base_dispatch.hpp:90,
                 from /usr/include/c++/10/ext/pb_ds/assoc_container.hpp:48,
                 from foodcourt.cpp:2:
foodcourt.cpp: In member function 'void node2::del(long long int)':
foodcourt.cpp:162:15: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  162 |    assert(pos < val.size());
      |           ~~~~^~~~~~~~~~~~
foodcourt.cpp:164:12: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  164 |    if (pos < val.size()) mv = mt(val[pos].first + pv, S, val[pos].second);
      |        ~~~~^~~~~~~~~~~~
foodcourt.cpp: At global scope:
foodcourt.cpp:176:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  176 | main() {
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 844 KB Output is correct
2 Correct 4 ms 1100 KB Output is correct
3 Correct 3 ms 968 KB Output is correct
4 Correct 4 ms 1100 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 4 ms 1100 KB Output is correct
8 Correct 3 ms 1100 KB Output is correct
9 Correct 3 ms 1100 KB Output is correct
10 Correct 3 ms 1108 KB Output is correct
11 Correct 3 ms 1100 KB Output is correct
12 Correct 3 ms 1100 KB Output is correct
13 Correct 2 ms 972 KB Output is correct
14 Correct 2 ms 1100 KB Output is correct
15 Correct 2 ms 972 KB Output is correct
16 Correct 2 ms 1100 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 3 ms 1100 KB Output is correct
19 Correct 3 ms 844 KB Output is correct
20 Correct 3 ms 1100 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 844 KB Output is correct
2 Correct 4 ms 1100 KB Output is correct
3 Correct 3 ms 968 KB Output is correct
4 Correct 4 ms 1100 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 4 ms 1100 KB Output is correct
8 Correct 3 ms 1100 KB Output is correct
9 Correct 3 ms 1100 KB Output is correct
10 Correct 3 ms 1108 KB Output is correct
11 Correct 3 ms 1100 KB Output is correct
12 Correct 3 ms 1100 KB Output is correct
13 Correct 2 ms 972 KB Output is correct
14 Correct 2 ms 1100 KB Output is correct
15 Correct 2 ms 972 KB Output is correct
16 Correct 2 ms 1100 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 3 ms 1100 KB Output is correct
19 Correct 3 ms 844 KB Output is correct
20 Correct 3 ms 1100 KB Output is correct
21 Correct 4 ms 972 KB Output is correct
22 Correct 4 ms 1100 KB Output is correct
23 Correct 3 ms 840 KB Output is correct
24 Correct 3 ms 1128 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 4 ms 1100 KB Output is correct
28 Correct 4 ms 1100 KB Output is correct
29 Correct 3 ms 1100 KB Output is correct
30 Correct 3 ms 1100 KB Output is correct
31 Correct 3 ms 1100 KB Output is correct
32 Correct 3 ms 1100 KB Output is correct
33 Correct 2 ms 972 KB Output is correct
34 Correct 2 ms 1100 KB Output is correct
35 Correct 3 ms 844 KB Output is correct
36 Correct 3 ms 1100 KB Output is correct
37 Correct 2 ms 844 KB Output is correct
38 Correct 3 ms 1100 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 133 ms 25908 KB Output is correct
2 Correct 140 ms 26324 KB Output is correct
3 Correct 106 ms 26016 KB Output is correct
4 Correct 101 ms 25916 KB Output is correct
5 Correct 130 ms 26424 KB Output is correct
6 Correct 141 ms 26240 KB Output is correct
7 Correct 7 ms 1340 KB Output is correct
8 Correct 8 ms 1380 KB Output is correct
9 Correct 100 ms 26012 KB Output is correct
10 Correct 131 ms 26012 KB Output is correct
11 Correct 126 ms 26008 KB Output is correct
12 Correct 115 ms 26004 KB Output is correct
13 Correct 85 ms 18516 KB Output is correct
14 Correct 101 ms 26668 KB Output is correct
15 Correct 100 ms 19008 KB Output is correct
16 Correct 138 ms 26936 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 698 ms 90996 KB Output is correct
2 Correct 564 ms 78532 KB Output is correct
3 Correct 871 ms 101180 KB Output is correct
4 Correct 646 ms 99456 KB Output is correct
5 Correct 626 ms 76408 KB Output is correct
6 Correct 926 ms 101968 KB Output is correct
7 Correct 35 ms 4716 KB Output is correct
8 Correct 38 ms 4676 KB Output is correct
9 Correct 907 ms 103552 KB Output is correct
10 Correct 884 ms 104636 KB Output is correct
11 Correct 725 ms 102108 KB Output is correct
12 Correct 813 ms 102080 KB Output is correct
13 Correct 752 ms 101992 KB Output is correct
14 Correct 795 ms 101912 KB Output is correct
15 Correct 814 ms 102036 KB Output is correct
16 Correct 817 ms 101996 KB Output is correct
17 Correct 791 ms 102004 KB Output is correct
18 Correct 813 ms 102052 KB Output is correct
19 Correct 830 ms 102016 KB Output is correct
20 Correct 784 ms 101992 KB Output is correct
21 Correct 800 ms 101980 KB Output is correct
22 Correct 821 ms 101980 KB Output is correct
23 Correct 821 ms 101920 KB Output is correct
24 Correct 789 ms 101976 KB Output is correct
25 Correct 501 ms 78680 KB Output is correct
26 Correct 533 ms 100280 KB Output is correct
27 Correct 499 ms 103552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 844 KB Output is correct
2 Correct 4 ms 1100 KB Output is correct
3 Correct 3 ms 968 KB Output is correct
4 Correct 4 ms 1100 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 4 ms 1100 KB Output is correct
8 Correct 3 ms 1100 KB Output is correct
9 Correct 3 ms 1100 KB Output is correct
10 Correct 3 ms 1108 KB Output is correct
11 Correct 3 ms 1100 KB Output is correct
12 Correct 3 ms 1100 KB Output is correct
13 Correct 2 ms 972 KB Output is correct
14 Correct 2 ms 1100 KB Output is correct
15 Correct 2 ms 972 KB Output is correct
16 Correct 2 ms 1100 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 3 ms 1100 KB Output is correct
19 Correct 3 ms 844 KB Output is correct
20 Correct 3 ms 1100 KB Output is correct
21 Correct 133 ms 25908 KB Output is correct
22 Correct 140 ms 26324 KB Output is correct
23 Correct 106 ms 26016 KB Output is correct
24 Correct 101 ms 25916 KB Output is correct
25 Correct 130 ms 26424 KB Output is correct
26 Correct 141 ms 26240 KB Output is correct
27 Correct 7 ms 1340 KB Output is correct
28 Correct 8 ms 1380 KB Output is correct
29 Correct 100 ms 26012 KB Output is correct
30 Correct 131 ms 26012 KB Output is correct
31 Correct 126 ms 26008 KB Output is correct
32 Correct 115 ms 26004 KB Output is correct
33 Correct 85 ms 18516 KB Output is correct
34 Correct 101 ms 26668 KB Output is correct
35 Correct 100 ms 19008 KB Output is correct
36 Correct 138 ms 26936 KB Output is correct
37 Correct 122 ms 24028 KB Output is correct
38 Correct 134 ms 24104 KB Output is correct
39 Correct 6 ms 1352 KB Output is correct
40 Correct 8 ms 1460 KB Output is correct
41 Correct 139 ms 26420 KB Output is correct
42 Correct 142 ms 26472 KB Output is correct
43 Correct 143 ms 26496 KB Output is correct
44 Correct 147 ms 26412 KB Output is correct
45 Correct 150 ms 26552 KB Output is correct
46 Correct 152 ms 26656 KB Output is correct
47 Correct 62 ms 26140 KB Output is correct
48 Correct 115 ms 26180 KB Output is correct
49 Correct 101 ms 18616 KB Output is correct
50 Correct 146 ms 25868 KB Output is correct
51 Correct 143 ms 26444 KB Output is correct
52 Correct 149 ms 26436 KB Output is correct
53 Correct 102 ms 23304 KB Output is correct
54 Correct 144 ms 26944 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 133 ms 26208 KB Output is correct
2 Correct 140 ms 23188 KB Output is correct
3 Correct 174 ms 27268 KB Output is correct
4 Correct 113 ms 25328 KB Output is correct
5 Correct 131 ms 26172 KB Output is correct
6 Correct 163 ms 27220 KB Output is correct
7 Correct 12 ms 1956 KB Output is correct
8 Correct 13 ms 1992 KB Output is correct
9 Correct 92 ms 26792 KB Output is correct
10 Correct 81 ms 23300 KB Output is correct
11 Correct 118 ms 26816 KB Output is correct
12 Correct 120 ms 26876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 844 KB Output is correct
2 Correct 4 ms 1100 KB Output is correct
3 Correct 3 ms 968 KB Output is correct
4 Correct 4 ms 1100 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 4 ms 1100 KB Output is correct
8 Correct 3 ms 1100 KB Output is correct
9 Correct 3 ms 1100 KB Output is correct
10 Correct 3 ms 1108 KB Output is correct
11 Correct 3 ms 1100 KB Output is correct
12 Correct 3 ms 1100 KB Output is correct
13 Correct 2 ms 972 KB Output is correct
14 Correct 2 ms 1100 KB Output is correct
15 Correct 2 ms 972 KB Output is correct
16 Correct 2 ms 1100 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 3 ms 1100 KB Output is correct
19 Correct 3 ms 844 KB Output is correct
20 Correct 3 ms 1100 KB Output is correct
21 Correct 4 ms 972 KB Output is correct
22 Correct 4 ms 1100 KB Output is correct
23 Correct 3 ms 840 KB Output is correct
24 Correct 3 ms 1128 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 4 ms 1100 KB Output is correct
28 Correct 4 ms 1100 KB Output is correct
29 Correct 3 ms 1100 KB Output is correct
30 Correct 3 ms 1100 KB Output is correct
31 Correct 3 ms 1100 KB Output is correct
32 Correct 3 ms 1100 KB Output is correct
33 Correct 2 ms 972 KB Output is correct
34 Correct 2 ms 1100 KB Output is correct
35 Correct 3 ms 844 KB Output is correct
36 Correct 3 ms 1100 KB Output is correct
37 Correct 2 ms 844 KB Output is correct
38 Correct 3 ms 1100 KB Output is correct
39 Correct 133 ms 25908 KB Output is correct
40 Correct 140 ms 26324 KB Output is correct
41 Correct 106 ms 26016 KB Output is correct
42 Correct 101 ms 25916 KB Output is correct
43 Correct 130 ms 26424 KB Output is correct
44 Correct 141 ms 26240 KB Output is correct
45 Correct 7 ms 1340 KB Output is correct
46 Correct 8 ms 1380 KB Output is correct
47 Correct 100 ms 26012 KB Output is correct
48 Correct 131 ms 26012 KB Output is correct
49 Correct 126 ms 26008 KB Output is correct
50 Correct 115 ms 26004 KB Output is correct
51 Correct 85 ms 18516 KB Output is correct
52 Correct 101 ms 26668 KB Output is correct
53 Correct 100 ms 19008 KB Output is correct
54 Correct 138 ms 26936 KB Output is correct
55 Correct 122 ms 24028 KB Output is correct
56 Correct 134 ms 24104 KB Output is correct
57 Correct 6 ms 1352 KB Output is correct
58 Correct 8 ms 1460 KB Output is correct
59 Correct 139 ms 26420 KB Output is correct
60 Correct 142 ms 26472 KB Output is correct
61 Correct 143 ms 26496 KB Output is correct
62 Correct 147 ms 26412 KB Output is correct
63 Correct 150 ms 26552 KB Output is correct
64 Correct 152 ms 26656 KB Output is correct
65 Correct 62 ms 26140 KB Output is correct
66 Correct 115 ms 26180 KB Output is correct
67 Correct 101 ms 18616 KB Output is correct
68 Correct 146 ms 25868 KB Output is correct
69 Correct 143 ms 26444 KB Output is correct
70 Correct 149 ms 26436 KB Output is correct
71 Correct 102 ms 23304 KB Output is correct
72 Correct 144 ms 26944 KB Output is correct
73 Correct 133 ms 26208 KB Output is correct
74 Correct 140 ms 23188 KB Output is correct
75 Correct 174 ms 27268 KB Output is correct
76 Correct 113 ms 25328 KB Output is correct
77 Correct 131 ms 26172 KB Output is correct
78 Correct 163 ms 27220 KB Output is correct
79 Correct 12 ms 1956 KB Output is correct
80 Correct 13 ms 1992 KB Output is correct
81 Correct 92 ms 26792 KB Output is correct
82 Correct 81 ms 23300 KB Output is correct
83 Correct 118 ms 26816 KB Output is correct
84 Correct 120 ms 26876 KB Output is correct
85 Correct 126 ms 20992 KB Output is correct
86 Correct 163 ms 26632 KB Output is correct
87 Correct 146 ms 24804 KB Output is correct
88 Correct 174 ms 26788 KB Output is correct
89 Correct 95 ms 20792 KB Output is correct
90 Correct 157 ms 26428 KB Output is correct
91 Correct 104 ms 17936 KB Output is correct
92 Correct 101 ms 18316 KB Output is correct
93 Correct 168 ms 26576 KB Output is correct
94 Correct 144 ms 26436 KB Output is correct
95 Correct 136 ms 24100 KB Output is correct
96 Correct 152 ms 26528 KB Output is correct
97 Correct 148 ms 26436 KB Output is correct
98 Correct 116 ms 19048 KB Output is correct
99 Correct 66 ms 26116 KB Output is correct
100 Correct 96 ms 22352 KB Output is correct
101 Correct 119 ms 26036 KB Output is correct
102 Correct 106 ms 26928 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 844 KB Output is correct
2 Correct 4 ms 1100 KB Output is correct
3 Correct 3 ms 968 KB Output is correct
4 Correct 4 ms 1100 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 4 ms 1100 KB Output is correct
8 Correct 3 ms 1100 KB Output is correct
9 Correct 3 ms 1100 KB Output is correct
10 Correct 3 ms 1108 KB Output is correct
11 Correct 3 ms 1100 KB Output is correct
12 Correct 3 ms 1100 KB Output is correct
13 Correct 2 ms 972 KB Output is correct
14 Correct 2 ms 1100 KB Output is correct
15 Correct 2 ms 972 KB Output is correct
16 Correct 2 ms 1100 KB Output is correct
17 Correct 3 ms 844 KB Output is correct
18 Correct 3 ms 1100 KB Output is correct
19 Correct 3 ms 844 KB Output is correct
20 Correct 3 ms 1100 KB Output is correct
21 Correct 4 ms 972 KB Output is correct
22 Correct 4 ms 1100 KB Output is correct
23 Correct 3 ms 840 KB Output is correct
24 Correct 3 ms 1128 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 4 ms 1100 KB Output is correct
28 Correct 4 ms 1100 KB Output is correct
29 Correct 3 ms 1100 KB Output is correct
30 Correct 3 ms 1100 KB Output is correct
31 Correct 3 ms 1100 KB Output is correct
32 Correct 3 ms 1100 KB Output is correct
33 Correct 2 ms 972 KB Output is correct
34 Correct 2 ms 1100 KB Output is correct
35 Correct 3 ms 844 KB Output is correct
36 Correct 3 ms 1100 KB Output is correct
37 Correct 2 ms 844 KB Output is correct
38 Correct 3 ms 1100 KB Output is correct
39 Correct 133 ms 25908 KB Output is correct
40 Correct 140 ms 26324 KB Output is correct
41 Correct 106 ms 26016 KB Output is correct
42 Correct 101 ms 25916 KB Output is correct
43 Correct 130 ms 26424 KB Output is correct
44 Correct 141 ms 26240 KB Output is correct
45 Correct 7 ms 1340 KB Output is correct
46 Correct 8 ms 1380 KB Output is correct
47 Correct 100 ms 26012 KB Output is correct
48 Correct 131 ms 26012 KB Output is correct
49 Correct 126 ms 26008 KB Output is correct
50 Correct 115 ms 26004 KB Output is correct
51 Correct 85 ms 18516 KB Output is correct
52 Correct 101 ms 26668 KB Output is correct
53 Correct 100 ms 19008 KB Output is correct
54 Correct 138 ms 26936 KB Output is correct
55 Correct 698 ms 90996 KB Output is correct
56 Correct 564 ms 78532 KB Output is correct
57 Correct 871 ms 101180 KB Output is correct
58 Correct 646 ms 99456 KB Output is correct
59 Correct 626 ms 76408 KB Output is correct
60 Correct 926 ms 101968 KB Output is correct
61 Correct 35 ms 4716 KB Output is correct
62 Correct 38 ms 4676 KB Output is correct
63 Correct 907 ms 103552 KB Output is correct
64 Correct 884 ms 104636 KB Output is correct
65 Correct 725 ms 102108 KB Output is correct
66 Correct 813 ms 102080 KB Output is correct
67 Correct 752 ms 101992 KB Output is correct
68 Correct 795 ms 101912 KB Output is correct
69 Correct 814 ms 102036 KB Output is correct
70 Correct 817 ms 101996 KB Output is correct
71 Correct 791 ms 102004 KB Output is correct
72 Correct 813 ms 102052 KB Output is correct
73 Correct 830 ms 102016 KB Output is correct
74 Correct 784 ms 101992 KB Output is correct
75 Correct 800 ms 101980 KB Output is correct
76 Correct 821 ms 101980 KB Output is correct
77 Correct 821 ms 101920 KB Output is correct
78 Correct 789 ms 101976 KB Output is correct
79 Correct 501 ms 78680 KB Output is correct
80 Correct 533 ms 100280 KB Output is correct
81 Correct 499 ms 103552 KB Output is correct
82 Correct 122 ms 24028 KB Output is correct
83 Correct 134 ms 24104 KB Output is correct
84 Correct 6 ms 1352 KB Output is correct
85 Correct 8 ms 1460 KB Output is correct
86 Correct 139 ms 26420 KB Output is correct
87 Correct 142 ms 26472 KB Output is correct
88 Correct 143 ms 26496 KB Output is correct
89 Correct 147 ms 26412 KB Output is correct
90 Correct 150 ms 26552 KB Output is correct
91 Correct 152 ms 26656 KB Output is correct
92 Correct 62 ms 26140 KB Output is correct
93 Correct 115 ms 26180 KB Output is correct
94 Correct 101 ms 18616 KB Output is correct
95 Correct 146 ms 25868 KB Output is correct
96 Correct 143 ms 26444 KB Output is correct
97 Correct 149 ms 26436 KB Output is correct
98 Correct 102 ms 23304 KB Output is correct
99 Correct 144 ms 26944 KB Output is correct
100 Correct 133 ms 26208 KB Output is correct
101 Correct 140 ms 23188 KB Output is correct
102 Correct 174 ms 27268 KB Output is correct
103 Correct 113 ms 25328 KB Output is correct
104 Correct 131 ms 26172 KB Output is correct
105 Correct 163 ms 27220 KB Output is correct
106 Correct 12 ms 1956 KB Output is correct
107 Correct 13 ms 1992 KB Output is correct
108 Correct 92 ms 26792 KB Output is correct
109 Correct 81 ms 23300 KB Output is correct
110 Correct 118 ms 26816 KB Output is correct
111 Correct 120 ms 26876 KB Output is correct
112 Correct 126 ms 20992 KB Output is correct
113 Correct 163 ms 26632 KB Output is correct
114 Correct 146 ms 24804 KB Output is correct
115 Correct 174 ms 26788 KB Output is correct
116 Correct 95 ms 20792 KB Output is correct
117 Correct 157 ms 26428 KB Output is correct
118 Correct 104 ms 17936 KB Output is correct
119 Correct 101 ms 18316 KB Output is correct
120 Correct 168 ms 26576 KB Output is correct
121 Correct 144 ms 26436 KB Output is correct
122 Correct 136 ms 24100 KB Output is correct
123 Correct 152 ms 26528 KB Output is correct
124 Correct 148 ms 26436 KB Output is correct
125 Correct 116 ms 19048 KB Output is correct
126 Correct 66 ms 26116 KB Output is correct
127 Correct 96 ms 22352 KB Output is correct
128 Correct 119 ms 26036 KB Output is correct
129 Correct 106 ms 26928 KB Output is correct
130 Correct 762 ms 100132 KB Output is correct
131 Correct 541 ms 76728 KB Output is correct
132 Correct 766 ms 102604 KB Output is correct
133 Correct 862 ms 99124 KB Output is correct
134 Correct 728 ms 98640 KB Output is correct
135 Correct 834 ms 103152 KB Output is correct
136 Correct 911 ms 105212 KB Output is correct
137 Correct 948 ms 105216 KB Output is correct
138 Correct 757 ms 102460 KB Output is correct
139 Correct 783 ms 102648 KB Output is correct
140 Correct 791 ms 102484 KB Output is correct
141 Correct 775 ms 102416 KB Output is correct
142 Correct 784 ms 102432 KB Output is correct
143 Correct 761 ms 102596 KB Output is correct
144 Correct 752 ms 102592 KB Output is correct
145 Correct 755 ms 102460 KB Output is correct
146 Correct 754 ms 102640 KB Output is correct
147 Correct 764 ms 102488 KB Output is correct
148 Correct 768 ms 102440 KB Output is correct
149 Correct 779 ms 102452 KB Output is correct
150 Correct 308 ms 100804 KB Output is correct
151 Correct 522 ms 100916 KB Output is correct
152 Correct 540 ms 101016 KB Output is correct
153 Correct 491 ms 104144 KB Output is correct