# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
134626 |
2019-07-23T05:50:49 Z |
임유진(#3241) |
Telegraph (JOI16_telegraph) |
C++14 |
|
65 ms |
18160 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
const int MAXN = 100005;
const int INF = 1 << 30;
const lint LINF = 1ll << 60;
int A[MAXN], C[MAXN];
bool chk[MAXN], cyc[MAXN];
int cycn;
vector<int> chi[MAXN], cn[MAXN];
int mx[MAXN], mxt[MAXN];
vector<int> nv;
void chkcyc(int x, int c) {
cyc[x] = true;
nv.push_back(x);
cn[c].push_back(x);
if(!cyc[A[x]]) chkcyc(A[x], c);
}
void dfs(int x) {
chk[x] = true;
nv.push_back(x);
if(chk[A[x]]) chkcyc(x, ++cycn);
else dfs(A[x]);
}
void chktree(int x) {
chk[x] = true;
for(auto a : chi[x]) if(!chk[a]) chktree(a);
}
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int N;
lint ans = 0ll;
cin >> N;
for(int i = 1; i <= N; i++) cin >> A[i] >> C[i];
for(int i = 1; i <= N; i++) chi[A[i]].push_back(i);
for(int i = 1; i <= N; i++) if(!chk[i] && chi[i].empty()) {
dfs(i);
for(auto a : nv) chktree(a);
nv.clear();
}
for(int i = 1; i <= N; i++) if(!chk[i]) dfs(i);
/*
for(int i = 1; i <= cycn; i++) {
printf("cn[%d] = [", i);
for(auto a : cn[i]) printf("%d ", a);
printf("]\n");
}
*/
bool b = true;
for(int i = 1; i <= N; i++) if(!cyc[i]) b = false;
if(b && cycn == 1) {
cout << 0;
return 0;
}
for(int i = 1; i <= N; i++) {
for(auto a : chi[i]) {
ans += C[a];
mx[i] = max(mx[i], C[a]);
}
ans -= mx[i];
}
for(int i = 1; i <= N; i++) if(!cyc[i]) mxt[A[i]] = max(mxt[A[i]], C[i]);
for(int i = 1; i <= cycn; i++) {
bool b = true;
for(int j = 0; j < cn[i].size(); j++) if(mx[cn[i][(j + 1) % cn[i].size()]] != C[cn[i][j]]) b = false;
if(!b) continue;
int mn = INF;
for(int j = 0; j < cn[i].size(); j++)
mn = min(mn, mx[cn[i][j]] - mxt[cn[i][j]]);
ans += mn;
}
cout << ans;
return 0;
}
Compilation message
telegraph.cpp: In function 'int main()':
telegraph.cpp:79:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 0; j < cn[i].size(); j++) if(mx[cn[i][(j + 1) % cn[i].size()]] != C[cn[i][j]]) b = false;
~~^~~~~~~~~~~~~~
telegraph.cpp:82:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 0; j < cn[i].size(); j++)
~~^~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
5112 KB |
Output is correct |
2 |
Correct |
6 ms |
5112 KB |
Output is correct |
3 |
Correct |
6 ms |
5112 KB |
Output is correct |
4 |
Correct |
6 ms |
5112 KB |
Output is correct |
5 |
Correct |
6 ms |
5112 KB |
Output is correct |
6 |
Correct |
6 ms |
5112 KB |
Output is correct |
7 |
Correct |
7 ms |
5112 KB |
Output is correct |
8 |
Correct |
6 ms |
5112 KB |
Output is correct |
9 |
Correct |
6 ms |
4984 KB |
Output is correct |
10 |
Correct |
6 ms |
4984 KB |
Output is correct |
11 |
Correct |
6 ms |
5112 KB |
Output is correct |
12 |
Correct |
6 ms |
5112 KB |
Output is correct |
13 |
Correct |
6 ms |
5112 KB |
Output is correct |
14 |
Correct |
6 ms |
5112 KB |
Output is correct |
15 |
Correct |
6 ms |
5112 KB |
Output is correct |
16 |
Correct |
6 ms |
4984 KB |
Output is correct |
17 |
Correct |
6 ms |
4984 KB |
Output is correct |
18 |
Correct |
6 ms |
5112 KB |
Output is correct |
19 |
Correct |
6 ms |
5112 KB |
Output is correct |
20 |
Correct |
6 ms |
5112 KB |
Output is correct |
21 |
Correct |
7 ms |
5116 KB |
Output is correct |
22 |
Correct |
6 ms |
5084 KB |
Output is correct |
23 |
Correct |
6 ms |
5112 KB |
Output is correct |
24 |
Correct |
6 ms |
4984 KB |
Output is correct |
25 |
Correct |
6 ms |
4984 KB |
Output is correct |
26 |
Correct |
6 ms |
5112 KB |
Output is correct |
27 |
Correct |
6 ms |
5116 KB |
Output is correct |
28 |
Correct |
6 ms |
5112 KB |
Output is correct |
29 |
Correct |
8 ms |
5112 KB |
Output is correct |
30 |
Correct |
6 ms |
4984 KB |
Output is correct |
31 |
Correct |
6 ms |
5112 KB |
Output is correct |
32 |
Correct |
6 ms |
5112 KB |
Output is correct |
33 |
Correct |
6 ms |
5112 KB |
Output is correct |
34 |
Correct |
6 ms |
5112 KB |
Output is correct |
35 |
Correct |
6 ms |
4984 KB |
Output is correct |
36 |
Correct |
8 ms |
4984 KB |
Output is correct |
37 |
Correct |
6 ms |
5112 KB |
Output is correct |
38 |
Correct |
6 ms |
5112 KB |
Output is correct |
39 |
Correct |
7 ms |
5112 KB |
Output is correct |
40 |
Correct |
6 ms |
4984 KB |
Output is correct |
41 |
Correct |
6 ms |
4984 KB |
Output is correct |
42 |
Correct |
6 ms |
4984 KB |
Output is correct |
43 |
Correct |
6 ms |
5112 KB |
Output is correct |
44 |
Correct |
6 ms |
4984 KB |
Output is correct |
45 |
Correct |
7 ms |
4984 KB |
Output is correct |
46 |
Correct |
6 ms |
4984 KB |
Output is correct |
47 |
Correct |
7 ms |
5112 KB |
Output is correct |
48 |
Correct |
6 ms |
4984 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
5112 KB |
Output is correct |
2 |
Correct |
6 ms |
5112 KB |
Output is correct |
3 |
Correct |
6 ms |
5112 KB |
Output is correct |
4 |
Correct |
6 ms |
5112 KB |
Output is correct |
5 |
Correct |
6 ms |
5112 KB |
Output is correct |
6 |
Correct |
6 ms |
5112 KB |
Output is correct |
7 |
Correct |
7 ms |
5112 KB |
Output is correct |
8 |
Correct |
6 ms |
5112 KB |
Output is correct |
9 |
Correct |
6 ms |
4984 KB |
Output is correct |
10 |
Correct |
6 ms |
4984 KB |
Output is correct |
11 |
Correct |
6 ms |
5112 KB |
Output is correct |
12 |
Correct |
6 ms |
5112 KB |
Output is correct |
13 |
Correct |
6 ms |
5112 KB |
Output is correct |
14 |
Correct |
6 ms |
5112 KB |
Output is correct |
15 |
Correct |
6 ms |
5112 KB |
Output is correct |
16 |
Correct |
6 ms |
4984 KB |
Output is correct |
17 |
Correct |
6 ms |
4984 KB |
Output is correct |
18 |
Correct |
6 ms |
5112 KB |
Output is correct |
19 |
Correct |
6 ms |
5112 KB |
Output is correct |
20 |
Correct |
6 ms |
5112 KB |
Output is correct |
21 |
Correct |
7 ms |
5116 KB |
Output is correct |
22 |
Correct |
6 ms |
5084 KB |
Output is correct |
23 |
Correct |
6 ms |
5112 KB |
Output is correct |
24 |
Correct |
6 ms |
4984 KB |
Output is correct |
25 |
Correct |
6 ms |
4984 KB |
Output is correct |
26 |
Correct |
6 ms |
5112 KB |
Output is correct |
27 |
Correct |
6 ms |
5116 KB |
Output is correct |
28 |
Correct |
6 ms |
5112 KB |
Output is correct |
29 |
Correct |
8 ms |
5112 KB |
Output is correct |
30 |
Correct |
6 ms |
4984 KB |
Output is correct |
31 |
Correct |
6 ms |
5112 KB |
Output is correct |
32 |
Correct |
6 ms |
5112 KB |
Output is correct |
33 |
Correct |
6 ms |
5112 KB |
Output is correct |
34 |
Correct |
6 ms |
5112 KB |
Output is correct |
35 |
Correct |
6 ms |
4984 KB |
Output is correct |
36 |
Correct |
8 ms |
4984 KB |
Output is correct |
37 |
Correct |
6 ms |
5112 KB |
Output is correct |
38 |
Correct |
6 ms |
5112 KB |
Output is correct |
39 |
Correct |
7 ms |
5112 KB |
Output is correct |
40 |
Correct |
6 ms |
4984 KB |
Output is correct |
41 |
Correct |
6 ms |
4984 KB |
Output is correct |
42 |
Correct |
6 ms |
4984 KB |
Output is correct |
43 |
Correct |
6 ms |
5112 KB |
Output is correct |
44 |
Correct |
6 ms |
4984 KB |
Output is correct |
45 |
Correct |
7 ms |
4984 KB |
Output is correct |
46 |
Correct |
6 ms |
4984 KB |
Output is correct |
47 |
Correct |
7 ms |
5112 KB |
Output is correct |
48 |
Correct |
6 ms |
4984 KB |
Output is correct |
49 |
Correct |
6 ms |
5112 KB |
Output is correct |
50 |
Correct |
6 ms |
5084 KB |
Output is correct |
51 |
Correct |
6 ms |
5084 KB |
Output is correct |
52 |
Correct |
6 ms |
5188 KB |
Output is correct |
53 |
Correct |
6 ms |
4984 KB |
Output is correct |
54 |
Correct |
6 ms |
4984 KB |
Output is correct |
55 |
Correct |
6 ms |
4984 KB |
Output is correct |
56 |
Correct |
6 ms |
4984 KB |
Output is correct |
57 |
Correct |
6 ms |
5112 KB |
Output is correct |
58 |
Correct |
6 ms |
5112 KB |
Output is correct |
59 |
Correct |
6 ms |
4984 KB |
Output is correct |
60 |
Correct |
6 ms |
5112 KB |
Output is correct |
61 |
Correct |
6 ms |
4984 KB |
Output is correct |
62 |
Correct |
6 ms |
5112 KB |
Output is correct |
63 |
Correct |
6 ms |
5112 KB |
Output is correct |
64 |
Correct |
6 ms |
5112 KB |
Output is correct |
65 |
Correct |
6 ms |
5112 KB |
Output is correct |
66 |
Correct |
6 ms |
5112 KB |
Output is correct |
67 |
Correct |
6 ms |
5116 KB |
Output is correct |
68 |
Correct |
6 ms |
5112 KB |
Output is correct |
69 |
Correct |
6 ms |
5112 KB |
Output is correct |
70 |
Correct |
6 ms |
4984 KB |
Output is correct |
71 |
Correct |
6 ms |
5112 KB |
Output is correct |
72 |
Correct |
6 ms |
5112 KB |
Output is correct |
73 |
Correct |
6 ms |
5112 KB |
Output is correct |
74 |
Correct |
6 ms |
5112 KB |
Output is correct |
75 |
Correct |
6 ms |
5112 KB |
Output is correct |
76 |
Correct |
6 ms |
5112 KB |
Output is correct |
77 |
Correct |
6 ms |
5112 KB |
Output is correct |
78 |
Correct |
6 ms |
5112 KB |
Output is correct |
79 |
Correct |
6 ms |
4984 KB |
Output is correct |
80 |
Correct |
6 ms |
4984 KB |
Output is correct |
81 |
Correct |
6 ms |
5084 KB |
Output is correct |
82 |
Correct |
6 ms |
5112 KB |
Output is correct |
83 |
Correct |
6 ms |
5112 KB |
Output is correct |
84 |
Correct |
6 ms |
4984 KB |
Output is correct |
85 |
Correct |
6 ms |
5112 KB |
Output is correct |
86 |
Correct |
6 ms |
5112 KB |
Output is correct |
87 |
Correct |
6 ms |
4984 KB |
Output is correct |
88 |
Correct |
6 ms |
5112 KB |
Output is correct |
89 |
Correct |
6 ms |
4984 KB |
Output is correct |
90 |
Correct |
6 ms |
4984 KB |
Output is correct |
91 |
Correct |
6 ms |
5112 KB |
Output is correct |
92 |
Correct |
6 ms |
4984 KB |
Output is correct |
93 |
Correct |
6 ms |
5112 KB |
Output is correct |
94 |
Correct |
6 ms |
5112 KB |
Output is correct |
95 |
Correct |
6 ms |
5112 KB |
Output is correct |
96 |
Correct |
6 ms |
5112 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
5112 KB |
Output is correct |
2 |
Correct |
6 ms |
5112 KB |
Output is correct |
3 |
Correct |
6 ms |
5112 KB |
Output is correct |
4 |
Correct |
6 ms |
5112 KB |
Output is correct |
5 |
Correct |
6 ms |
5112 KB |
Output is correct |
6 |
Correct |
6 ms |
5112 KB |
Output is correct |
7 |
Correct |
7 ms |
5112 KB |
Output is correct |
8 |
Correct |
6 ms |
5112 KB |
Output is correct |
9 |
Correct |
6 ms |
4984 KB |
Output is correct |
10 |
Correct |
6 ms |
4984 KB |
Output is correct |
11 |
Correct |
6 ms |
5112 KB |
Output is correct |
12 |
Correct |
6 ms |
5112 KB |
Output is correct |
13 |
Correct |
6 ms |
5112 KB |
Output is correct |
14 |
Correct |
6 ms |
5112 KB |
Output is correct |
15 |
Correct |
6 ms |
5112 KB |
Output is correct |
16 |
Correct |
6 ms |
4984 KB |
Output is correct |
17 |
Correct |
6 ms |
4984 KB |
Output is correct |
18 |
Correct |
6 ms |
5112 KB |
Output is correct |
19 |
Correct |
6 ms |
5112 KB |
Output is correct |
20 |
Correct |
6 ms |
5112 KB |
Output is correct |
21 |
Correct |
7 ms |
5116 KB |
Output is correct |
22 |
Correct |
6 ms |
5084 KB |
Output is correct |
23 |
Correct |
6 ms |
5112 KB |
Output is correct |
24 |
Correct |
6 ms |
4984 KB |
Output is correct |
25 |
Correct |
6 ms |
4984 KB |
Output is correct |
26 |
Correct |
6 ms |
5112 KB |
Output is correct |
27 |
Correct |
6 ms |
5116 KB |
Output is correct |
28 |
Correct |
6 ms |
5112 KB |
Output is correct |
29 |
Correct |
8 ms |
5112 KB |
Output is correct |
30 |
Correct |
6 ms |
4984 KB |
Output is correct |
31 |
Correct |
6 ms |
5112 KB |
Output is correct |
32 |
Correct |
6 ms |
5112 KB |
Output is correct |
33 |
Correct |
6 ms |
5112 KB |
Output is correct |
34 |
Correct |
6 ms |
5112 KB |
Output is correct |
35 |
Correct |
6 ms |
4984 KB |
Output is correct |
36 |
Correct |
8 ms |
4984 KB |
Output is correct |
37 |
Correct |
6 ms |
5112 KB |
Output is correct |
38 |
Correct |
6 ms |
5112 KB |
Output is correct |
39 |
Correct |
7 ms |
5112 KB |
Output is correct |
40 |
Correct |
6 ms |
4984 KB |
Output is correct |
41 |
Correct |
6 ms |
4984 KB |
Output is correct |
42 |
Correct |
6 ms |
4984 KB |
Output is correct |
43 |
Correct |
6 ms |
5112 KB |
Output is correct |
44 |
Correct |
6 ms |
4984 KB |
Output is correct |
45 |
Correct |
7 ms |
4984 KB |
Output is correct |
46 |
Correct |
6 ms |
4984 KB |
Output is correct |
47 |
Correct |
7 ms |
5112 KB |
Output is correct |
48 |
Correct |
6 ms |
4984 KB |
Output is correct |
49 |
Correct |
6 ms |
5112 KB |
Output is correct |
50 |
Correct |
6 ms |
5084 KB |
Output is correct |
51 |
Correct |
6 ms |
5084 KB |
Output is correct |
52 |
Correct |
6 ms |
5188 KB |
Output is correct |
53 |
Correct |
6 ms |
4984 KB |
Output is correct |
54 |
Correct |
6 ms |
4984 KB |
Output is correct |
55 |
Correct |
6 ms |
4984 KB |
Output is correct |
56 |
Correct |
6 ms |
4984 KB |
Output is correct |
57 |
Correct |
6 ms |
5112 KB |
Output is correct |
58 |
Correct |
6 ms |
5112 KB |
Output is correct |
59 |
Correct |
6 ms |
4984 KB |
Output is correct |
60 |
Correct |
6 ms |
5112 KB |
Output is correct |
61 |
Correct |
6 ms |
4984 KB |
Output is correct |
62 |
Correct |
6 ms |
5112 KB |
Output is correct |
63 |
Correct |
6 ms |
5112 KB |
Output is correct |
64 |
Correct |
6 ms |
5112 KB |
Output is correct |
65 |
Correct |
6 ms |
5112 KB |
Output is correct |
66 |
Correct |
6 ms |
5112 KB |
Output is correct |
67 |
Correct |
6 ms |
5116 KB |
Output is correct |
68 |
Correct |
6 ms |
5112 KB |
Output is correct |
69 |
Correct |
6 ms |
5112 KB |
Output is correct |
70 |
Correct |
6 ms |
4984 KB |
Output is correct |
71 |
Correct |
6 ms |
5112 KB |
Output is correct |
72 |
Correct |
6 ms |
5112 KB |
Output is correct |
73 |
Correct |
6 ms |
5112 KB |
Output is correct |
74 |
Correct |
6 ms |
5112 KB |
Output is correct |
75 |
Correct |
6 ms |
5112 KB |
Output is correct |
76 |
Correct |
6 ms |
5112 KB |
Output is correct |
77 |
Correct |
6 ms |
5112 KB |
Output is correct |
78 |
Correct |
6 ms |
5112 KB |
Output is correct |
79 |
Correct |
6 ms |
4984 KB |
Output is correct |
80 |
Correct |
6 ms |
4984 KB |
Output is correct |
81 |
Correct |
6 ms |
5084 KB |
Output is correct |
82 |
Correct |
6 ms |
5112 KB |
Output is correct |
83 |
Correct |
6 ms |
5112 KB |
Output is correct |
84 |
Correct |
6 ms |
4984 KB |
Output is correct |
85 |
Correct |
6 ms |
5112 KB |
Output is correct |
86 |
Correct |
6 ms |
5112 KB |
Output is correct |
87 |
Correct |
6 ms |
4984 KB |
Output is correct |
88 |
Correct |
6 ms |
5112 KB |
Output is correct |
89 |
Correct |
6 ms |
4984 KB |
Output is correct |
90 |
Correct |
6 ms |
4984 KB |
Output is correct |
91 |
Correct |
6 ms |
5112 KB |
Output is correct |
92 |
Correct |
6 ms |
4984 KB |
Output is correct |
93 |
Correct |
6 ms |
5112 KB |
Output is correct |
94 |
Correct |
6 ms |
5112 KB |
Output is correct |
95 |
Correct |
6 ms |
5112 KB |
Output is correct |
96 |
Correct |
6 ms |
5112 KB |
Output is correct |
97 |
Correct |
7 ms |
5240 KB |
Output is correct |
98 |
Correct |
7 ms |
5240 KB |
Output is correct |
99 |
Correct |
7 ms |
5240 KB |
Output is correct |
100 |
Correct |
7 ms |
5240 KB |
Output is correct |
101 |
Correct |
8 ms |
5240 KB |
Output is correct |
102 |
Correct |
7 ms |
5496 KB |
Output is correct |
103 |
Correct |
7 ms |
5496 KB |
Output is correct |
104 |
Correct |
7 ms |
5468 KB |
Output is correct |
105 |
Correct |
8 ms |
5416 KB |
Output is correct |
106 |
Correct |
7 ms |
5496 KB |
Output is correct |
107 |
Correct |
8 ms |
5368 KB |
Output is correct |
108 |
Correct |
7 ms |
5368 KB |
Output is correct |
109 |
Correct |
8 ms |
5368 KB |
Output is correct |
110 |
Correct |
8 ms |
5368 KB |
Output is correct |
111 |
Correct |
7 ms |
5368 KB |
Output is correct |
112 |
Correct |
7 ms |
5240 KB |
Output is correct |
113 |
Correct |
9 ms |
5240 KB |
Output is correct |
114 |
Correct |
7 ms |
5240 KB |
Output is correct |
115 |
Correct |
7 ms |
5372 KB |
Output is correct |
116 |
Correct |
8 ms |
5240 KB |
Output is correct |
117 |
Correct |
8 ms |
5368 KB |
Output is correct |
118 |
Correct |
8 ms |
5368 KB |
Output is correct |
119 |
Correct |
9 ms |
5368 KB |
Output is correct |
120 |
Correct |
8 ms |
5240 KB |
Output is correct |
121 |
Correct |
7 ms |
5240 KB |
Output is correct |
122 |
Correct |
7 ms |
5240 KB |
Output is correct |
123 |
Correct |
7 ms |
5112 KB |
Output is correct |
124 |
Correct |
7 ms |
5112 KB |
Output is correct |
125 |
Correct |
7 ms |
5112 KB |
Output is correct |
126 |
Correct |
7 ms |
5240 KB |
Output is correct |
127 |
Correct |
7 ms |
5112 KB |
Output is correct |
128 |
Correct |
7 ms |
5240 KB |
Output is correct |
129 |
Correct |
7 ms |
5496 KB |
Output is correct |
130 |
Correct |
8 ms |
5500 KB |
Output is correct |
131 |
Correct |
8 ms |
5496 KB |
Output is correct |
132 |
Correct |
7 ms |
5496 KB |
Output is correct |
133 |
Correct |
7 ms |
5112 KB |
Output is correct |
134 |
Correct |
7 ms |
5112 KB |
Output is correct |
135 |
Correct |
8 ms |
5368 KB |
Output is correct |
136 |
Correct |
8 ms |
5368 KB |
Output is correct |
137 |
Correct |
7 ms |
5112 KB |
Output is correct |
138 |
Correct |
6 ms |
5112 KB |
Output is correct |
139 |
Correct |
6 ms |
5112 KB |
Output is correct |
140 |
Correct |
7 ms |
5240 KB |
Output is correct |
141 |
Correct |
7 ms |
5112 KB |
Output is correct |
142 |
Correct |
6 ms |
5112 KB |
Output is correct |
143 |
Correct |
6 ms |
5240 KB |
Output is correct |
144 |
Correct |
7 ms |
5240 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
5112 KB |
Output is correct |
2 |
Correct |
6 ms |
5112 KB |
Output is correct |
3 |
Correct |
6 ms |
5112 KB |
Output is correct |
4 |
Correct |
6 ms |
5112 KB |
Output is correct |
5 |
Correct |
6 ms |
5112 KB |
Output is correct |
6 |
Correct |
6 ms |
5112 KB |
Output is correct |
7 |
Correct |
7 ms |
5112 KB |
Output is correct |
8 |
Correct |
6 ms |
5112 KB |
Output is correct |
9 |
Correct |
6 ms |
4984 KB |
Output is correct |
10 |
Correct |
6 ms |
4984 KB |
Output is correct |
11 |
Correct |
6 ms |
5112 KB |
Output is correct |
12 |
Correct |
6 ms |
5112 KB |
Output is correct |
13 |
Correct |
6 ms |
5112 KB |
Output is correct |
14 |
Correct |
6 ms |
5112 KB |
Output is correct |
15 |
Correct |
6 ms |
5112 KB |
Output is correct |
16 |
Correct |
6 ms |
4984 KB |
Output is correct |
17 |
Correct |
6 ms |
4984 KB |
Output is correct |
18 |
Correct |
6 ms |
5112 KB |
Output is correct |
19 |
Correct |
6 ms |
5112 KB |
Output is correct |
20 |
Correct |
6 ms |
5112 KB |
Output is correct |
21 |
Correct |
7 ms |
5116 KB |
Output is correct |
22 |
Correct |
6 ms |
5084 KB |
Output is correct |
23 |
Correct |
6 ms |
5112 KB |
Output is correct |
24 |
Correct |
6 ms |
4984 KB |
Output is correct |
25 |
Correct |
6 ms |
4984 KB |
Output is correct |
26 |
Correct |
6 ms |
5112 KB |
Output is correct |
27 |
Correct |
6 ms |
5116 KB |
Output is correct |
28 |
Correct |
6 ms |
5112 KB |
Output is correct |
29 |
Correct |
8 ms |
5112 KB |
Output is correct |
30 |
Correct |
6 ms |
4984 KB |
Output is correct |
31 |
Correct |
6 ms |
5112 KB |
Output is correct |
32 |
Correct |
6 ms |
5112 KB |
Output is correct |
33 |
Correct |
6 ms |
5112 KB |
Output is correct |
34 |
Correct |
6 ms |
5112 KB |
Output is correct |
35 |
Correct |
6 ms |
4984 KB |
Output is correct |
36 |
Correct |
8 ms |
4984 KB |
Output is correct |
37 |
Correct |
6 ms |
5112 KB |
Output is correct |
38 |
Correct |
6 ms |
5112 KB |
Output is correct |
39 |
Correct |
7 ms |
5112 KB |
Output is correct |
40 |
Correct |
6 ms |
4984 KB |
Output is correct |
41 |
Correct |
6 ms |
4984 KB |
Output is correct |
42 |
Correct |
6 ms |
4984 KB |
Output is correct |
43 |
Correct |
6 ms |
5112 KB |
Output is correct |
44 |
Correct |
6 ms |
4984 KB |
Output is correct |
45 |
Correct |
7 ms |
4984 KB |
Output is correct |
46 |
Correct |
6 ms |
4984 KB |
Output is correct |
47 |
Correct |
7 ms |
5112 KB |
Output is correct |
48 |
Correct |
6 ms |
4984 KB |
Output is correct |
49 |
Correct |
6 ms |
5112 KB |
Output is correct |
50 |
Correct |
6 ms |
5084 KB |
Output is correct |
51 |
Correct |
6 ms |
5084 KB |
Output is correct |
52 |
Correct |
6 ms |
5188 KB |
Output is correct |
53 |
Correct |
6 ms |
4984 KB |
Output is correct |
54 |
Correct |
6 ms |
4984 KB |
Output is correct |
55 |
Correct |
6 ms |
4984 KB |
Output is correct |
56 |
Correct |
6 ms |
4984 KB |
Output is correct |
57 |
Correct |
6 ms |
5112 KB |
Output is correct |
58 |
Correct |
6 ms |
5112 KB |
Output is correct |
59 |
Correct |
6 ms |
4984 KB |
Output is correct |
60 |
Correct |
6 ms |
5112 KB |
Output is correct |
61 |
Correct |
6 ms |
4984 KB |
Output is correct |
62 |
Correct |
6 ms |
5112 KB |
Output is correct |
63 |
Correct |
6 ms |
5112 KB |
Output is correct |
64 |
Correct |
6 ms |
5112 KB |
Output is correct |
65 |
Correct |
6 ms |
5112 KB |
Output is correct |
66 |
Correct |
6 ms |
5112 KB |
Output is correct |
67 |
Correct |
6 ms |
5116 KB |
Output is correct |
68 |
Correct |
6 ms |
5112 KB |
Output is correct |
69 |
Correct |
6 ms |
5112 KB |
Output is correct |
70 |
Correct |
6 ms |
4984 KB |
Output is correct |
71 |
Correct |
6 ms |
5112 KB |
Output is correct |
72 |
Correct |
6 ms |
5112 KB |
Output is correct |
73 |
Correct |
6 ms |
5112 KB |
Output is correct |
74 |
Correct |
6 ms |
5112 KB |
Output is correct |
75 |
Correct |
6 ms |
5112 KB |
Output is correct |
76 |
Correct |
6 ms |
5112 KB |
Output is correct |
77 |
Correct |
6 ms |
5112 KB |
Output is correct |
78 |
Correct |
6 ms |
5112 KB |
Output is correct |
79 |
Correct |
6 ms |
4984 KB |
Output is correct |
80 |
Correct |
6 ms |
4984 KB |
Output is correct |
81 |
Correct |
6 ms |
5084 KB |
Output is correct |
82 |
Correct |
6 ms |
5112 KB |
Output is correct |
83 |
Correct |
6 ms |
5112 KB |
Output is correct |
84 |
Correct |
6 ms |
4984 KB |
Output is correct |
85 |
Correct |
6 ms |
5112 KB |
Output is correct |
86 |
Correct |
6 ms |
5112 KB |
Output is correct |
87 |
Correct |
6 ms |
4984 KB |
Output is correct |
88 |
Correct |
6 ms |
5112 KB |
Output is correct |
89 |
Correct |
6 ms |
4984 KB |
Output is correct |
90 |
Correct |
6 ms |
4984 KB |
Output is correct |
91 |
Correct |
6 ms |
5112 KB |
Output is correct |
92 |
Correct |
6 ms |
4984 KB |
Output is correct |
93 |
Correct |
6 ms |
5112 KB |
Output is correct |
94 |
Correct |
6 ms |
5112 KB |
Output is correct |
95 |
Correct |
6 ms |
5112 KB |
Output is correct |
96 |
Correct |
6 ms |
5112 KB |
Output is correct |
97 |
Correct |
7 ms |
5240 KB |
Output is correct |
98 |
Correct |
7 ms |
5240 KB |
Output is correct |
99 |
Correct |
7 ms |
5240 KB |
Output is correct |
100 |
Correct |
7 ms |
5240 KB |
Output is correct |
101 |
Correct |
8 ms |
5240 KB |
Output is correct |
102 |
Correct |
7 ms |
5496 KB |
Output is correct |
103 |
Correct |
7 ms |
5496 KB |
Output is correct |
104 |
Correct |
7 ms |
5468 KB |
Output is correct |
105 |
Correct |
8 ms |
5416 KB |
Output is correct |
106 |
Correct |
7 ms |
5496 KB |
Output is correct |
107 |
Correct |
8 ms |
5368 KB |
Output is correct |
108 |
Correct |
7 ms |
5368 KB |
Output is correct |
109 |
Correct |
8 ms |
5368 KB |
Output is correct |
110 |
Correct |
8 ms |
5368 KB |
Output is correct |
111 |
Correct |
7 ms |
5368 KB |
Output is correct |
112 |
Correct |
7 ms |
5240 KB |
Output is correct |
113 |
Correct |
9 ms |
5240 KB |
Output is correct |
114 |
Correct |
7 ms |
5240 KB |
Output is correct |
115 |
Correct |
7 ms |
5372 KB |
Output is correct |
116 |
Correct |
8 ms |
5240 KB |
Output is correct |
117 |
Correct |
8 ms |
5368 KB |
Output is correct |
118 |
Correct |
8 ms |
5368 KB |
Output is correct |
119 |
Correct |
9 ms |
5368 KB |
Output is correct |
120 |
Correct |
8 ms |
5240 KB |
Output is correct |
121 |
Correct |
7 ms |
5240 KB |
Output is correct |
122 |
Correct |
7 ms |
5240 KB |
Output is correct |
123 |
Correct |
7 ms |
5112 KB |
Output is correct |
124 |
Correct |
7 ms |
5112 KB |
Output is correct |
125 |
Correct |
7 ms |
5112 KB |
Output is correct |
126 |
Correct |
7 ms |
5240 KB |
Output is correct |
127 |
Correct |
7 ms |
5112 KB |
Output is correct |
128 |
Correct |
7 ms |
5240 KB |
Output is correct |
129 |
Correct |
7 ms |
5496 KB |
Output is correct |
130 |
Correct |
8 ms |
5500 KB |
Output is correct |
131 |
Correct |
8 ms |
5496 KB |
Output is correct |
132 |
Correct |
7 ms |
5496 KB |
Output is correct |
133 |
Correct |
7 ms |
5112 KB |
Output is correct |
134 |
Correct |
7 ms |
5112 KB |
Output is correct |
135 |
Correct |
8 ms |
5368 KB |
Output is correct |
136 |
Correct |
8 ms |
5368 KB |
Output is correct |
137 |
Correct |
7 ms |
5112 KB |
Output is correct |
138 |
Correct |
6 ms |
5112 KB |
Output is correct |
139 |
Correct |
6 ms |
5112 KB |
Output is correct |
140 |
Correct |
7 ms |
5240 KB |
Output is correct |
141 |
Correct |
7 ms |
5112 KB |
Output is correct |
142 |
Correct |
6 ms |
5112 KB |
Output is correct |
143 |
Correct |
6 ms |
5240 KB |
Output is correct |
144 |
Correct |
7 ms |
5240 KB |
Output is correct |
145 |
Correct |
53 ms |
9336 KB |
Output is correct |
146 |
Correct |
52 ms |
9336 KB |
Output is correct |
147 |
Correct |
54 ms |
9420 KB |
Output is correct |
148 |
Correct |
51 ms |
9336 KB |
Output is correct |
149 |
Correct |
53 ms |
9336 KB |
Output is correct |
150 |
Correct |
60 ms |
17640 KB |
Output is correct |
151 |
Correct |
65 ms |
17648 KB |
Output is correct |
152 |
Correct |
61 ms |
17644 KB |
Output is correct |
153 |
Correct |
61 ms |
17644 KB |
Output is correct |
154 |
Correct |
62 ms |
17644 KB |
Output is correct |
155 |
Correct |
63 ms |
12916 KB |
Output is correct |
156 |
Correct |
61 ms |
12892 KB |
Output is correct |
157 |
Correct |
62 ms |
12916 KB |
Output is correct |
158 |
Correct |
61 ms |
12916 KB |
Output is correct |
159 |
Correct |
62 ms |
12888 KB |
Output is correct |
160 |
Correct |
60 ms |
12888 KB |
Output is correct |
161 |
Correct |
61 ms |
12884 KB |
Output is correct |
162 |
Correct |
53 ms |
12912 KB |
Output is correct |
163 |
Correct |
53 ms |
12920 KB |
Output is correct |
164 |
Correct |
60 ms |
12520 KB |
Output is correct |
165 |
Correct |
63 ms |
12416 KB |
Output is correct |
166 |
Correct |
61 ms |
14700 KB |
Output is correct |
167 |
Correct |
62 ms |
14704 KB |
Output is correct |
168 |
Correct |
47 ms |
9336 KB |
Output is correct |
169 |
Correct |
45 ms |
9336 KB |
Output is correct |
170 |
Correct |
50 ms |
9380 KB |
Output is correct |
171 |
Correct |
46 ms |
9464 KB |
Output is correct |
172 |
Correct |
48 ms |
9336 KB |
Output is correct |
173 |
Correct |
48 ms |
9336 KB |
Output is correct |
174 |
Correct |
46 ms |
9436 KB |
Output is correct |
175 |
Correct |
44 ms |
9464 KB |
Output is correct |
176 |
Correct |
46 ms |
9464 KB |
Output is correct |
177 |
Correct |
58 ms |
18160 KB |
Output is correct |
178 |
Correct |
58 ms |
18028 KB |
Output is correct |
179 |
Correct |
57 ms |
18116 KB |
Output is correct |
180 |
Correct |
57 ms |
18028 KB |
Output is correct |
181 |
Correct |
35 ms |
7032 KB |
Output is correct |
182 |
Correct |
34 ms |
7032 KB |
Output is correct |
183 |
Correct |
58 ms |
11624 KB |
Output is correct |
184 |
Correct |
55 ms |
11628 KB |
Output is correct |
185 |
Correct |
38 ms |
8184 KB |
Output is correct |
186 |
Correct |
28 ms |
7416 KB |
Output is correct |
187 |
Correct |
17 ms |
6364 KB |
Output is correct |
188 |
Correct |
54 ms |
9308 KB |
Output is correct |
189 |
Correct |
46 ms |
8568 KB |
Output is correct |
190 |
Correct |
35 ms |
12400 KB |
Output is correct |
191 |
Correct |
22 ms |
9176 KB |
Output is correct |
192 |
Correct |
11 ms |
6008 KB |
Output is correct |