Submission #55067

# Submission time Handle Problem Language Result Execution time Memory
55067 2018-07-06T01:49:16 Z ainta(#1558) Telegraph (JOI16_telegraph) C++11
100 / 100
111 ms 64392 KB
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
vector<int>E[101000];
int n, C[101000], w[101000], Deg[101000], Q[101000], head, tail, v[101000], chk;
long long res;
void Do(int a) {
	int t = a, i, rr = 1e9;
	vector<int>T;
	while (1) {
		v[t] = 1;
		T.push_back(t);
		t = w[t];
		if (t == a)break;
	}
	if (T.size() == n) {
		chk = 1;
		return;
	}
	for (auto &x : T) {
		int Mx1 = -1, Mx2 = 0;
		for (auto &y : E[x]) {
			if (Deg[y])Mx1 = max(Mx1, C[y]);
			else Mx2 = max(Mx2, C[y]);
		}
		rr = min(rr, Mx1 - Mx2);
	}
	rr = max(rr, 0);
	res += rr;
}
int main() {
	int i;
	scanf("%d", &n);
	for (i = 1; i <= n; i++) {
		scanf("%d%d", &w[i],&C[i]);
		Deg[w[i]]++;
		E[w[i]].push_back(i);
	}
	for (i = 1; i <= n; i++) {
		vector<int>T;
		for (auto &t : E[i]) {
			T.push_back(C[t]);
		}
		if (!T.empty()) {
			sort(T.begin(), T.end());
			for (int j = 0; j < T.size() - 1; j++) {
				res += T[j];
			}
		}
	}
	for (i = 1; i <= n; i++)if (!Deg[i])Q[++tail] = i;
	while (head < tail) {
		int x = Q[++head];
		v[x] = 1;
		Deg[w[x]]--;
		if (!Deg[w[x]])Q[++tail] = w[x];
	}
	for (i = 1; i <= n; i++) {
		if (!v[i]) {
			Do(i);
		}
	}
	if (chk) {
		printf("0\n");
		return 0;
	}
	printf("%lld\n", res);
}

Compilation message

telegraph.cpp: In function 'void Do(int)':
telegraph.cpp:17:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (T.size() == n) {
      ~~~~~~~~~^~~~
telegraph.cpp:9:13: warning: unused variable 'i' [-Wunused-variable]
  int t = a, i, rr = 1e9;
             ^
telegraph.cpp: In function 'int main()':
telegraph.cpp:47:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int j = 0; j < T.size() - 1; j++) {
                    ~~^~~~~~~~~~~~~~
telegraph.cpp:34:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
telegraph.cpp:36:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &w[i],&C[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2936 KB Output is correct
2 Correct 3 ms 3068 KB Output is correct
3 Correct 3 ms 3068 KB Output is correct
4 Correct 3 ms 3068 KB Output is correct
5 Correct 4 ms 3068 KB Output is correct
6 Correct 4 ms 3068 KB Output is correct
7 Correct 4 ms 3068 KB Output is correct
8 Correct 5 ms 3068 KB Output is correct
9 Correct 5 ms 3136 KB Output is correct
10 Correct 5 ms 3136 KB Output is correct
11 Correct 4 ms 3136 KB Output is correct
12 Correct 5 ms 3136 KB Output is correct
13 Correct 4 ms 3136 KB Output is correct
14 Correct 4 ms 3136 KB Output is correct
15 Correct 4 ms 3140 KB Output is correct
16 Correct 5 ms 3140 KB Output is correct
17 Correct 4 ms 3320 KB Output is correct
18 Correct 5 ms 3320 KB Output is correct
19 Correct 4 ms 3320 KB Output is correct
20 Correct 5 ms 3320 KB Output is correct
21 Correct 5 ms 3320 KB Output is correct
22 Correct 4 ms 3320 KB Output is correct
23 Correct 4 ms 3320 KB Output is correct
24 Correct 4 ms 3320 KB Output is correct
25 Correct 4 ms 3320 KB Output is correct
26 Correct 4 ms 3320 KB Output is correct
27 Correct 5 ms 3320 KB Output is correct
28 Correct 5 ms 3320 KB Output is correct
29 Correct 4 ms 3320 KB Output is correct
30 Correct 4 ms 3320 KB Output is correct
31 Correct 4 ms 3320 KB Output is correct
32 Correct 6 ms 3320 KB Output is correct
33 Correct 4 ms 3320 KB Output is correct
34 Correct 5 ms 3320 KB Output is correct
35 Correct 5 ms 3320 KB Output is correct
36 Correct 4 ms 3320 KB Output is correct
37 Correct 4 ms 3320 KB Output is correct
38 Correct 5 ms 3320 KB Output is correct
39 Correct 4 ms 3320 KB Output is correct
40 Correct 4 ms 3324 KB Output is correct
41 Correct 6 ms 3328 KB Output is correct
42 Correct 4 ms 3332 KB Output is correct
43 Correct 4 ms 3336 KB Output is correct
44 Correct 5 ms 3344 KB Output is correct
45 Correct 4 ms 3344 KB Output is correct
46 Correct 4 ms 3348 KB Output is correct
47 Correct 5 ms 3352 KB Output is correct
48 Correct 4 ms 3356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2936 KB Output is correct
2 Correct 3 ms 3068 KB Output is correct
3 Correct 3 ms 3068 KB Output is correct
4 Correct 3 ms 3068 KB Output is correct
5 Correct 4 ms 3068 KB Output is correct
6 Correct 4 ms 3068 KB Output is correct
7 Correct 4 ms 3068 KB Output is correct
8 Correct 5 ms 3068 KB Output is correct
9 Correct 5 ms 3136 KB Output is correct
10 Correct 5 ms 3136 KB Output is correct
11 Correct 4 ms 3136 KB Output is correct
12 Correct 5 ms 3136 KB Output is correct
13 Correct 4 ms 3136 KB Output is correct
14 Correct 4 ms 3136 KB Output is correct
15 Correct 4 ms 3140 KB Output is correct
16 Correct 5 ms 3140 KB Output is correct
17 Correct 4 ms 3320 KB Output is correct
18 Correct 5 ms 3320 KB Output is correct
19 Correct 4 ms 3320 KB Output is correct
20 Correct 5 ms 3320 KB Output is correct
21 Correct 5 ms 3320 KB Output is correct
22 Correct 4 ms 3320 KB Output is correct
23 Correct 4 ms 3320 KB Output is correct
24 Correct 4 ms 3320 KB Output is correct
25 Correct 4 ms 3320 KB Output is correct
26 Correct 4 ms 3320 KB Output is correct
27 Correct 5 ms 3320 KB Output is correct
28 Correct 5 ms 3320 KB Output is correct
29 Correct 4 ms 3320 KB Output is correct
30 Correct 4 ms 3320 KB Output is correct
31 Correct 4 ms 3320 KB Output is correct
32 Correct 6 ms 3320 KB Output is correct
33 Correct 4 ms 3320 KB Output is correct
34 Correct 5 ms 3320 KB Output is correct
35 Correct 5 ms 3320 KB Output is correct
36 Correct 4 ms 3320 KB Output is correct
37 Correct 4 ms 3320 KB Output is correct
38 Correct 5 ms 3320 KB Output is correct
39 Correct 4 ms 3320 KB Output is correct
40 Correct 4 ms 3324 KB Output is correct
41 Correct 6 ms 3328 KB Output is correct
42 Correct 4 ms 3332 KB Output is correct
43 Correct 4 ms 3336 KB Output is correct
44 Correct 5 ms 3344 KB Output is correct
45 Correct 4 ms 3344 KB Output is correct
46 Correct 4 ms 3348 KB Output is correct
47 Correct 5 ms 3352 KB Output is correct
48 Correct 4 ms 3356 KB Output is correct
49 Correct 4 ms 3360 KB Output is correct
50 Correct 4 ms 3364 KB Output is correct
51 Correct 2 ms 3368 KB Output is correct
52 Correct 5 ms 3372 KB Output is correct
53 Correct 4 ms 3376 KB Output is correct
54 Correct 4 ms 3380 KB Output is correct
55 Correct 5 ms 3384 KB Output is correct
56 Correct 6 ms 3388 KB Output is correct
57 Correct 5 ms 3392 KB Output is correct
58 Correct 5 ms 3396 KB Output is correct
59 Correct 4 ms 3400 KB Output is correct
60 Correct 4 ms 3456 KB Output is correct
61 Correct 5 ms 3456 KB Output is correct
62 Correct 4 ms 3468 KB Output is correct
63 Correct 5 ms 3544 KB Output is correct
64 Correct 4 ms 3544 KB Output is correct
65 Correct 5 ms 3544 KB Output is correct
66 Correct 4 ms 3544 KB Output is correct
67 Correct 5 ms 3544 KB Output is correct
68 Correct 4 ms 3544 KB Output is correct
69 Correct 4 ms 3544 KB Output is correct
70 Correct 4 ms 3544 KB Output is correct
71 Correct 5 ms 3544 KB Output is correct
72 Correct 5 ms 3544 KB Output is correct
73 Correct 4 ms 3544 KB Output is correct
74 Correct 4 ms 3544 KB Output is correct
75 Correct 6 ms 3544 KB Output is correct
76 Correct 5 ms 3544 KB Output is correct
77 Correct 5 ms 3544 KB Output is correct
78 Correct 4 ms 3544 KB Output is correct
79 Correct 4 ms 3544 KB Output is correct
80 Correct 4 ms 3544 KB Output is correct
81 Correct 4 ms 3544 KB Output is correct
82 Correct 4 ms 3544 KB Output is correct
83 Correct 5 ms 3632 KB Output is correct
84 Correct 4 ms 3632 KB Output is correct
85 Correct 32 ms 3632 KB Output is correct
86 Correct 4 ms 3632 KB Output is correct
87 Correct 4 ms 3632 KB Output is correct
88 Correct 4 ms 3632 KB Output is correct
89 Correct 4 ms 3632 KB Output is correct
90 Correct 4 ms 3632 KB Output is correct
91 Correct 3 ms 3632 KB Output is correct
92 Correct 5 ms 3632 KB Output is correct
93 Correct 4 ms 3632 KB Output is correct
94 Correct 4 ms 3632 KB Output is correct
95 Correct 3 ms 3632 KB Output is correct
96 Correct 3 ms 3632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2936 KB Output is correct
2 Correct 3 ms 3068 KB Output is correct
3 Correct 3 ms 3068 KB Output is correct
4 Correct 3 ms 3068 KB Output is correct
5 Correct 4 ms 3068 KB Output is correct
6 Correct 4 ms 3068 KB Output is correct
7 Correct 4 ms 3068 KB Output is correct
8 Correct 5 ms 3068 KB Output is correct
9 Correct 5 ms 3136 KB Output is correct
10 Correct 5 ms 3136 KB Output is correct
11 Correct 4 ms 3136 KB Output is correct
12 Correct 5 ms 3136 KB Output is correct
13 Correct 4 ms 3136 KB Output is correct
14 Correct 4 ms 3136 KB Output is correct
15 Correct 4 ms 3140 KB Output is correct
16 Correct 5 ms 3140 KB Output is correct
17 Correct 4 ms 3320 KB Output is correct
18 Correct 5 ms 3320 KB Output is correct
19 Correct 4 ms 3320 KB Output is correct
20 Correct 5 ms 3320 KB Output is correct
21 Correct 5 ms 3320 KB Output is correct
22 Correct 4 ms 3320 KB Output is correct
23 Correct 4 ms 3320 KB Output is correct
24 Correct 4 ms 3320 KB Output is correct
25 Correct 4 ms 3320 KB Output is correct
26 Correct 4 ms 3320 KB Output is correct
27 Correct 5 ms 3320 KB Output is correct
28 Correct 5 ms 3320 KB Output is correct
29 Correct 4 ms 3320 KB Output is correct
30 Correct 4 ms 3320 KB Output is correct
31 Correct 4 ms 3320 KB Output is correct
32 Correct 6 ms 3320 KB Output is correct
33 Correct 4 ms 3320 KB Output is correct
34 Correct 5 ms 3320 KB Output is correct
35 Correct 5 ms 3320 KB Output is correct
36 Correct 4 ms 3320 KB Output is correct
37 Correct 4 ms 3320 KB Output is correct
38 Correct 5 ms 3320 KB Output is correct
39 Correct 4 ms 3320 KB Output is correct
40 Correct 4 ms 3324 KB Output is correct
41 Correct 6 ms 3328 KB Output is correct
42 Correct 4 ms 3332 KB Output is correct
43 Correct 4 ms 3336 KB Output is correct
44 Correct 5 ms 3344 KB Output is correct
45 Correct 4 ms 3344 KB Output is correct
46 Correct 4 ms 3348 KB Output is correct
47 Correct 5 ms 3352 KB Output is correct
48 Correct 4 ms 3356 KB Output is correct
49 Correct 4 ms 3360 KB Output is correct
50 Correct 4 ms 3364 KB Output is correct
51 Correct 2 ms 3368 KB Output is correct
52 Correct 5 ms 3372 KB Output is correct
53 Correct 4 ms 3376 KB Output is correct
54 Correct 4 ms 3380 KB Output is correct
55 Correct 5 ms 3384 KB Output is correct
56 Correct 6 ms 3388 KB Output is correct
57 Correct 5 ms 3392 KB Output is correct
58 Correct 5 ms 3396 KB Output is correct
59 Correct 4 ms 3400 KB Output is correct
60 Correct 4 ms 3456 KB Output is correct
61 Correct 5 ms 3456 KB Output is correct
62 Correct 4 ms 3468 KB Output is correct
63 Correct 5 ms 3544 KB Output is correct
64 Correct 4 ms 3544 KB Output is correct
65 Correct 5 ms 3544 KB Output is correct
66 Correct 4 ms 3544 KB Output is correct
67 Correct 5 ms 3544 KB Output is correct
68 Correct 4 ms 3544 KB Output is correct
69 Correct 4 ms 3544 KB Output is correct
70 Correct 4 ms 3544 KB Output is correct
71 Correct 5 ms 3544 KB Output is correct
72 Correct 5 ms 3544 KB Output is correct
73 Correct 4 ms 3544 KB Output is correct
74 Correct 4 ms 3544 KB Output is correct
75 Correct 6 ms 3544 KB Output is correct
76 Correct 5 ms 3544 KB Output is correct
77 Correct 5 ms 3544 KB Output is correct
78 Correct 4 ms 3544 KB Output is correct
79 Correct 4 ms 3544 KB Output is correct
80 Correct 4 ms 3544 KB Output is correct
81 Correct 4 ms 3544 KB Output is correct
82 Correct 4 ms 3544 KB Output is correct
83 Correct 5 ms 3632 KB Output is correct
84 Correct 4 ms 3632 KB Output is correct
85 Correct 32 ms 3632 KB Output is correct
86 Correct 4 ms 3632 KB Output is correct
87 Correct 4 ms 3632 KB Output is correct
88 Correct 4 ms 3632 KB Output is correct
89 Correct 4 ms 3632 KB Output is correct
90 Correct 4 ms 3632 KB Output is correct
91 Correct 3 ms 3632 KB Output is correct
92 Correct 5 ms 3632 KB Output is correct
93 Correct 4 ms 3632 KB Output is correct
94 Correct 4 ms 3632 KB Output is correct
95 Correct 3 ms 3632 KB Output is correct
96 Correct 3 ms 3632 KB Output is correct
97 Correct 5 ms 3688 KB Output is correct
98 Correct 9 ms 3736 KB Output is correct
99 Correct 6 ms 3920 KB Output is correct
100 Correct 6 ms 3920 KB Output is correct
101 Correct 5 ms 3932 KB Output is correct
102 Correct 6 ms 4128 KB Output is correct
103 Correct 7 ms 4164 KB Output is correct
104 Correct 6 ms 4208 KB Output is correct
105 Correct 6 ms 4252 KB Output is correct
106 Correct 7 ms 4312 KB Output is correct
107 Correct 5 ms 4312 KB Output is correct
108 Correct 6 ms 4312 KB Output is correct
109 Correct 6 ms 4316 KB Output is correct
110 Correct 5 ms 4360 KB Output is correct
111 Correct 6 ms 4432 KB Output is correct
112 Correct 8 ms 4448 KB Output is correct
113 Correct 6 ms 4492 KB Output is correct
114 Correct 7 ms 4536 KB Output is correct
115 Correct 7 ms 4640 KB Output is correct
116 Correct 7 ms 4640 KB Output is correct
117 Correct 6 ms 4652 KB Output is correct
118 Correct 5 ms 4824 KB Output is correct
119 Correct 6 ms 4868 KB Output is correct
120 Correct 5 ms 4868 KB Output is correct
121 Correct 6 ms 4868 KB Output is correct
122 Correct 5 ms 4868 KB Output is correct
123 Correct 5 ms 4868 KB Output is correct
124 Correct 5 ms 4868 KB Output is correct
125 Correct 6 ms 4884 KB Output is correct
126 Correct 6 ms 4904 KB Output is correct
127 Correct 5 ms 4924 KB Output is correct
128 Correct 6 ms 4944 KB Output is correct
129 Correct 6 ms 5144 KB Output is correct
130 Correct 6 ms 5144 KB Output is correct
131 Correct 6 ms 5144 KB Output is correct
132 Correct 7 ms 5144 KB Output is correct
133 Correct 6 ms 5144 KB Output is correct
134 Correct 7 ms 5144 KB Output is correct
135 Correct 7 ms 5144 KB Output is correct
136 Correct 7 ms 5176 KB Output is correct
137 Correct 5 ms 5220 KB Output is correct
138 Correct 4 ms 5220 KB Output is correct
139 Correct 6 ms 5220 KB Output is correct
140 Correct 4 ms 5276 KB Output is correct
141 Correct 8 ms 5296 KB Output is correct
142 Correct 5 ms 5296 KB Output is correct
143 Correct 5 ms 5336 KB Output is correct
144 Correct 6 ms 5352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2936 KB Output is correct
2 Correct 3 ms 3068 KB Output is correct
3 Correct 3 ms 3068 KB Output is correct
4 Correct 3 ms 3068 KB Output is correct
5 Correct 4 ms 3068 KB Output is correct
6 Correct 4 ms 3068 KB Output is correct
7 Correct 4 ms 3068 KB Output is correct
8 Correct 5 ms 3068 KB Output is correct
9 Correct 5 ms 3136 KB Output is correct
10 Correct 5 ms 3136 KB Output is correct
11 Correct 4 ms 3136 KB Output is correct
12 Correct 5 ms 3136 KB Output is correct
13 Correct 4 ms 3136 KB Output is correct
14 Correct 4 ms 3136 KB Output is correct
15 Correct 4 ms 3140 KB Output is correct
16 Correct 5 ms 3140 KB Output is correct
17 Correct 4 ms 3320 KB Output is correct
18 Correct 5 ms 3320 KB Output is correct
19 Correct 4 ms 3320 KB Output is correct
20 Correct 5 ms 3320 KB Output is correct
21 Correct 5 ms 3320 KB Output is correct
22 Correct 4 ms 3320 KB Output is correct
23 Correct 4 ms 3320 KB Output is correct
24 Correct 4 ms 3320 KB Output is correct
25 Correct 4 ms 3320 KB Output is correct
26 Correct 4 ms 3320 KB Output is correct
27 Correct 5 ms 3320 KB Output is correct
28 Correct 5 ms 3320 KB Output is correct
29 Correct 4 ms 3320 KB Output is correct
30 Correct 4 ms 3320 KB Output is correct
31 Correct 4 ms 3320 KB Output is correct
32 Correct 6 ms 3320 KB Output is correct
33 Correct 4 ms 3320 KB Output is correct
34 Correct 5 ms 3320 KB Output is correct
35 Correct 5 ms 3320 KB Output is correct
36 Correct 4 ms 3320 KB Output is correct
37 Correct 4 ms 3320 KB Output is correct
38 Correct 5 ms 3320 KB Output is correct
39 Correct 4 ms 3320 KB Output is correct
40 Correct 4 ms 3324 KB Output is correct
41 Correct 6 ms 3328 KB Output is correct
42 Correct 4 ms 3332 KB Output is correct
43 Correct 4 ms 3336 KB Output is correct
44 Correct 5 ms 3344 KB Output is correct
45 Correct 4 ms 3344 KB Output is correct
46 Correct 4 ms 3348 KB Output is correct
47 Correct 5 ms 3352 KB Output is correct
48 Correct 4 ms 3356 KB Output is correct
49 Correct 4 ms 3360 KB Output is correct
50 Correct 4 ms 3364 KB Output is correct
51 Correct 2 ms 3368 KB Output is correct
52 Correct 5 ms 3372 KB Output is correct
53 Correct 4 ms 3376 KB Output is correct
54 Correct 4 ms 3380 KB Output is correct
55 Correct 5 ms 3384 KB Output is correct
56 Correct 6 ms 3388 KB Output is correct
57 Correct 5 ms 3392 KB Output is correct
58 Correct 5 ms 3396 KB Output is correct
59 Correct 4 ms 3400 KB Output is correct
60 Correct 4 ms 3456 KB Output is correct
61 Correct 5 ms 3456 KB Output is correct
62 Correct 4 ms 3468 KB Output is correct
63 Correct 5 ms 3544 KB Output is correct
64 Correct 4 ms 3544 KB Output is correct
65 Correct 5 ms 3544 KB Output is correct
66 Correct 4 ms 3544 KB Output is correct
67 Correct 5 ms 3544 KB Output is correct
68 Correct 4 ms 3544 KB Output is correct
69 Correct 4 ms 3544 KB Output is correct
70 Correct 4 ms 3544 KB Output is correct
71 Correct 5 ms 3544 KB Output is correct
72 Correct 5 ms 3544 KB Output is correct
73 Correct 4 ms 3544 KB Output is correct
74 Correct 4 ms 3544 KB Output is correct
75 Correct 6 ms 3544 KB Output is correct
76 Correct 5 ms 3544 KB Output is correct
77 Correct 5 ms 3544 KB Output is correct
78 Correct 4 ms 3544 KB Output is correct
79 Correct 4 ms 3544 KB Output is correct
80 Correct 4 ms 3544 KB Output is correct
81 Correct 4 ms 3544 KB Output is correct
82 Correct 4 ms 3544 KB Output is correct
83 Correct 5 ms 3632 KB Output is correct
84 Correct 4 ms 3632 KB Output is correct
85 Correct 32 ms 3632 KB Output is correct
86 Correct 4 ms 3632 KB Output is correct
87 Correct 4 ms 3632 KB Output is correct
88 Correct 4 ms 3632 KB Output is correct
89 Correct 4 ms 3632 KB Output is correct
90 Correct 4 ms 3632 KB Output is correct
91 Correct 3 ms 3632 KB Output is correct
92 Correct 5 ms 3632 KB Output is correct
93 Correct 4 ms 3632 KB Output is correct
94 Correct 4 ms 3632 KB Output is correct
95 Correct 3 ms 3632 KB Output is correct
96 Correct 3 ms 3632 KB Output is correct
97 Correct 5 ms 3688 KB Output is correct
98 Correct 9 ms 3736 KB Output is correct
99 Correct 6 ms 3920 KB Output is correct
100 Correct 6 ms 3920 KB Output is correct
101 Correct 5 ms 3932 KB Output is correct
102 Correct 6 ms 4128 KB Output is correct
103 Correct 7 ms 4164 KB Output is correct
104 Correct 6 ms 4208 KB Output is correct
105 Correct 6 ms 4252 KB Output is correct
106 Correct 7 ms 4312 KB Output is correct
107 Correct 5 ms 4312 KB Output is correct
108 Correct 6 ms 4312 KB Output is correct
109 Correct 6 ms 4316 KB Output is correct
110 Correct 5 ms 4360 KB Output is correct
111 Correct 6 ms 4432 KB Output is correct
112 Correct 8 ms 4448 KB Output is correct
113 Correct 6 ms 4492 KB Output is correct
114 Correct 7 ms 4536 KB Output is correct
115 Correct 7 ms 4640 KB Output is correct
116 Correct 7 ms 4640 KB Output is correct
117 Correct 6 ms 4652 KB Output is correct
118 Correct 5 ms 4824 KB Output is correct
119 Correct 6 ms 4868 KB Output is correct
120 Correct 5 ms 4868 KB Output is correct
121 Correct 6 ms 4868 KB Output is correct
122 Correct 5 ms 4868 KB Output is correct
123 Correct 5 ms 4868 KB Output is correct
124 Correct 5 ms 4868 KB Output is correct
125 Correct 6 ms 4884 KB Output is correct
126 Correct 6 ms 4904 KB Output is correct
127 Correct 5 ms 4924 KB Output is correct
128 Correct 6 ms 4944 KB Output is correct
129 Correct 6 ms 5144 KB Output is correct
130 Correct 6 ms 5144 KB Output is correct
131 Correct 6 ms 5144 KB Output is correct
132 Correct 7 ms 5144 KB Output is correct
133 Correct 6 ms 5144 KB Output is correct
134 Correct 7 ms 5144 KB Output is correct
135 Correct 7 ms 5144 KB Output is correct
136 Correct 7 ms 5176 KB Output is correct
137 Correct 5 ms 5220 KB Output is correct
138 Correct 4 ms 5220 KB Output is correct
139 Correct 6 ms 5220 KB Output is correct
140 Correct 4 ms 5276 KB Output is correct
141 Correct 8 ms 5296 KB Output is correct
142 Correct 5 ms 5296 KB Output is correct
143 Correct 5 ms 5336 KB Output is correct
144 Correct 6 ms 5352 KB Output is correct
145 Correct 92 ms 10716 KB Output is correct
146 Correct 65 ms 12340 KB Output is correct
147 Correct 75 ms 13800 KB Output is correct
148 Correct 91 ms 15412 KB Output is correct
149 Correct 65 ms 16948 KB Output is correct
150 Correct 69 ms 19912 KB Output is correct
151 Correct 89 ms 21452 KB Output is correct
152 Correct 87 ms 22992 KB Output is correct
153 Correct 95 ms 24664 KB Output is correct
154 Correct 101 ms 26148 KB Output is correct
155 Correct 85 ms 26148 KB Output is correct
156 Correct 87 ms 27528 KB Output is correct
157 Correct 72 ms 29076 KB Output is correct
158 Correct 73 ms 30624 KB Output is correct
159 Correct 63 ms 32168 KB Output is correct
160 Correct 66 ms 33780 KB Output is correct
161 Correct 73 ms 35392 KB Output is correct
162 Correct 57 ms 36124 KB Output is correct
163 Correct 77 ms 36852 KB Output is correct
164 Correct 101 ms 39416 KB Output is correct
165 Correct 101 ms 40932 KB Output is correct
166 Correct 93 ms 42944 KB Output is correct
167 Correct 92 ms 44440 KB Output is correct
168 Correct 69 ms 44440 KB Output is correct
169 Correct 73 ms 44992 KB Output is correct
170 Correct 70 ms 45692 KB Output is correct
171 Correct 74 ms 46428 KB Output is correct
172 Correct 70 ms 47176 KB Output is correct
173 Correct 81 ms 47948 KB Output is correct
174 Correct 77 ms 48720 KB Output is correct
175 Correct 54 ms 49492 KB Output is correct
176 Correct 99 ms 50348 KB Output is correct
177 Correct 86 ms 52428 KB Output is correct
178 Correct 81 ms 53216 KB Output is correct
179 Correct 90 ms 54044 KB Output is correct
180 Correct 84 ms 54772 KB Output is correct
181 Correct 57 ms 54772 KB Output is correct
182 Correct 54 ms 54772 KB Output is correct
183 Correct 111 ms 58756 KB Output is correct
184 Correct 102 ms 60328 KB Output is correct
185 Correct 56 ms 60328 KB Output is correct
186 Correct 42 ms 60328 KB Output is correct
187 Correct 21 ms 60328 KB Output is correct
188 Correct 104 ms 63244 KB Output is correct
189 Correct 68 ms 63412 KB Output is correct
190 Correct 44 ms 64392 KB Output is correct
191 Correct 27 ms 64392 KB Output is correct
192 Correct 9 ms 64392 KB Output is correct