#include "bits/stdc++.h"
#define MAXN 400009
#define ll long long
#define pb(x) push_back(x)
#define debug(x) cerr<< #x <<" = "<< x<<endl;
using namespace std;
class Articulation {
public:
std::vector<int> keyV, bcc[MAXN];
int cnt;
int gao(int n, const std::vector<int> e[]) {
memset(tag, use = 0, sizeof(tag[0]) * n);
memset(low, cnt = 0, sizeof(low[0]) * n);
std::fill_n(bcc, n, keyV = std::vector<int>());
for (int i = 0; i < n; ++i) if (!tag[i]) dfs(i, 1, e);
return cnt;
}
private:
int tag[MAXN], low[MAXN], dot[MAXN], use;
void dfs(int x, int dep, const std::vector<int> e[]) {
int src = 0, out = 1 < dep; dot[use++] = x;
tag[x] = low[x] = dep;
for (auto &y: e[x]) {
if (!tag[y]) {
dfs(y, dep + 1, e);
low[x] = std::min(low[x], low[y]);
if (low[y] >= tag[x]) {
if (++out == 2) keyV.push_back(x);
while (dot[--use] != y) bcc[dot[use]].push_back(cnt);
bcc[x].push_back(cnt); bcc[y].push_back(cnt++);
}
} else if (tag[y] != tag[x] - 1 || src++) {
low[x] = std::min(low[x], tag[y]);
}
}
}
} bcc;
vector<int> G[MAXN];
//APIO 2018 Duathlon
/*
Articulation based BCC(Biconnected Component)
*/
vector<int>adj[MAXN];
void add(int u,int v){
adj[u].pb(v);
adj[v].pb(u);
}
int vis[MAXN],sub[MAXN],n,m;
int comp_sz[MAXN];
void dfs(int nd,int pr){
sub[nd]=(nd<n);
vis[nd]=1;
for(auto to:adj[nd])
if(to!=pr)
dfs(to,nd),sub[nd]+=sub[to];
}
ll C2(int x){
return (x*1LL*(x-1));
}
ll C3(int x){
return (C2(x)*1LL*(x-2));
}
ll ans=0;
void dfs1(int nd,int pr,int root){
if(nd<n){
for(auto to:adj[nd]){
if(to!=pr){
ans-=(comp_sz[to]-1)*1LL*C2(sub[root]-sub[to]);
dfs1(to,nd,root);
}
else{
ans-=(comp_sz[to]-1)*1LL*C2(sub[nd]);
}
}
}
else{
for(auto to:adj[nd])
if(to!=pr)
dfs1(to,nd,root);
}
}
int main(){
//freopen("file.in","r",stdin);
scanf("%d%d",&n,&m);
for(int i=0;i<m;i++){
int u,v;
scanf("%d%d",&u,&v);
u--;v--;
G[u].pb(v);G[v].pb(u);
}
int C = bcc.gao(n,G);
for(int i=0;i<n;i++)
for(auto to:bcc.bcc[i]){
add(i, to+n);
comp_sz[to+n]++;
}
vector<int>roots;
for(int i=n;i<n+C;i++)
if(!vis[i]){
roots.pb(i);
dfs(i,-1);
}
for(auto root:roots){
ans+=C3(sub[root]);
dfs1(root,-1,root);
}
printf("%lld\n",ans);
return 0;
}
Compilation message
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:84:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
84 | scanf("%d%d",&n,&m);
| ~~~~~^~~~~~~~~~~~~~
count_triplets.cpp:87:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
87 | scanf("%d%d",&u,&v);
| ~~~~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
28448 KB |
Output is correct |
2 |
Correct |
16 ms |
28476 KB |
Output is correct |
3 |
Correct |
19 ms |
28456 KB |
Output is correct |
4 |
Correct |
16 ms |
28464 KB |
Output is correct |
5 |
Correct |
17 ms |
28472 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28476 KB |
Output is correct |
9 |
Correct |
18 ms |
28576 KB |
Output is correct |
10 |
Correct |
16 ms |
28500 KB |
Output is correct |
11 |
Correct |
16 ms |
28440 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
17 ms |
28488 KB |
Output is correct |
14 |
Correct |
16 ms |
28424 KB |
Output is correct |
15 |
Correct |
20 ms |
28404 KB |
Output is correct |
16 |
Correct |
17 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28492 KB |
Output is correct |
19 |
Correct |
16 ms |
28404 KB |
Output is correct |
20 |
Correct |
16 ms |
28452 KB |
Output is correct |
21 |
Correct |
18 ms |
28620 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28508 KB |
Output is correct |
24 |
Correct |
16 ms |
28488 KB |
Output is correct |
25 |
Correct |
17 ms |
28444 KB |
Output is correct |
26 |
Correct |
16 ms |
28484 KB |
Output is correct |
27 |
Correct |
16 ms |
28492 KB |
Output is correct |
28 |
Correct |
18 ms |
28484 KB |
Output is correct |
29 |
Correct |
16 ms |
28484 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
16 ms |
28440 KB |
Output is correct |
32 |
Correct |
17 ms |
28464 KB |
Output is correct |
33 |
Correct |
19 ms |
28492 KB |
Output is correct |
34 |
Correct |
17 ms |
28484 KB |
Output is correct |
35 |
Correct |
16 ms |
28492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
28448 KB |
Output is correct |
2 |
Correct |
16 ms |
28476 KB |
Output is correct |
3 |
Correct |
19 ms |
28456 KB |
Output is correct |
4 |
Correct |
16 ms |
28464 KB |
Output is correct |
5 |
Correct |
17 ms |
28472 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28476 KB |
Output is correct |
9 |
Correct |
18 ms |
28576 KB |
Output is correct |
10 |
Correct |
16 ms |
28500 KB |
Output is correct |
11 |
Correct |
16 ms |
28440 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
17 ms |
28488 KB |
Output is correct |
14 |
Correct |
16 ms |
28424 KB |
Output is correct |
15 |
Correct |
20 ms |
28404 KB |
Output is correct |
16 |
Correct |
17 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28492 KB |
Output is correct |
19 |
Correct |
16 ms |
28404 KB |
Output is correct |
20 |
Correct |
16 ms |
28452 KB |
Output is correct |
21 |
Correct |
18 ms |
28620 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28508 KB |
Output is correct |
24 |
Correct |
16 ms |
28488 KB |
Output is correct |
25 |
Correct |
17 ms |
28444 KB |
Output is correct |
26 |
Correct |
16 ms |
28484 KB |
Output is correct |
27 |
Correct |
16 ms |
28492 KB |
Output is correct |
28 |
Correct |
18 ms |
28484 KB |
Output is correct |
29 |
Correct |
16 ms |
28484 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
16 ms |
28440 KB |
Output is correct |
32 |
Correct |
17 ms |
28464 KB |
Output is correct |
33 |
Correct |
19 ms |
28492 KB |
Output is correct |
34 |
Correct |
17 ms |
28484 KB |
Output is correct |
35 |
Correct |
16 ms |
28492 KB |
Output is correct |
36 |
Correct |
16 ms |
28484 KB |
Output is correct |
37 |
Correct |
16 ms |
28488 KB |
Output is correct |
38 |
Correct |
18 ms |
28492 KB |
Output is correct |
39 |
Correct |
17 ms |
28492 KB |
Output is correct |
40 |
Correct |
17 ms |
28484 KB |
Output is correct |
41 |
Correct |
16 ms |
28492 KB |
Output is correct |
42 |
Correct |
18 ms |
28516 KB |
Output is correct |
43 |
Correct |
16 ms |
28492 KB |
Output is correct |
44 |
Correct |
16 ms |
28440 KB |
Output is correct |
45 |
Correct |
18 ms |
28528 KB |
Output is correct |
46 |
Correct |
16 ms |
28488 KB |
Output is correct |
47 |
Correct |
16 ms |
28428 KB |
Output is correct |
48 |
Correct |
16 ms |
28492 KB |
Output is correct |
49 |
Correct |
19 ms |
28484 KB |
Output is correct |
50 |
Correct |
16 ms |
28444 KB |
Output is correct |
51 |
Correct |
16 ms |
28484 KB |
Output is correct |
52 |
Correct |
18 ms |
28492 KB |
Output is correct |
53 |
Correct |
17 ms |
28492 KB |
Output is correct |
54 |
Correct |
17 ms |
28492 KB |
Output is correct |
55 |
Correct |
17 ms |
28492 KB |
Output is correct |
56 |
Correct |
16 ms |
28492 KB |
Output is correct |
57 |
Correct |
17 ms |
28484 KB |
Output is correct |
58 |
Correct |
16 ms |
28520 KB |
Output is correct |
59 |
Correct |
17 ms |
28488 KB |
Output is correct |
60 |
Correct |
18 ms |
28484 KB |
Output is correct |
61 |
Correct |
17 ms |
28480 KB |
Output is correct |
62 |
Correct |
17 ms |
28480 KB |
Output is correct |
63 |
Correct |
17 ms |
28480 KB |
Output is correct |
64 |
Correct |
16 ms |
28492 KB |
Output is correct |
65 |
Correct |
17 ms |
28524 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
123 ms |
50356 KB |
Output is correct |
2 |
Correct |
107 ms |
50364 KB |
Output is correct |
3 |
Correct |
161 ms |
50584 KB |
Output is correct |
4 |
Correct |
133 ms |
48904 KB |
Output is correct |
5 |
Correct |
146 ms |
47340 KB |
Output is correct |
6 |
Correct |
157 ms |
51788 KB |
Output is correct |
7 |
Correct |
152 ms |
46208 KB |
Output is correct |
8 |
Correct |
171 ms |
48792 KB |
Output is correct |
9 |
Correct |
152 ms |
44608 KB |
Output is correct |
10 |
Correct |
160 ms |
45376 KB |
Output is correct |
11 |
Correct |
164 ms |
42540 KB |
Output is correct |
12 |
Correct |
137 ms |
42292 KB |
Output is correct |
13 |
Correct |
134 ms |
42216 KB |
Output is correct |
14 |
Correct |
128 ms |
41696 KB |
Output is correct |
15 |
Correct |
127 ms |
40504 KB |
Output is correct |
16 |
Correct |
103 ms |
40156 KB |
Output is correct |
17 |
Correct |
20 ms |
30408 KB |
Output is correct |
18 |
Correct |
20 ms |
30412 KB |
Output is correct |
19 |
Correct |
19 ms |
30352 KB |
Output is correct |
20 |
Correct |
19 ms |
30412 KB |
Output is correct |
21 |
Correct |
19 ms |
30276 KB |
Output is correct |
22 |
Correct |
19 ms |
30280 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
28600 KB |
Output is correct |
2 |
Correct |
17 ms |
28684 KB |
Output is correct |
3 |
Correct |
17 ms |
28644 KB |
Output is correct |
4 |
Correct |
18 ms |
28748 KB |
Output is correct |
5 |
Correct |
17 ms |
28768 KB |
Output is correct |
6 |
Correct |
18 ms |
28748 KB |
Output is correct |
7 |
Correct |
18 ms |
28752 KB |
Output is correct |
8 |
Correct |
18 ms |
28728 KB |
Output is correct |
9 |
Correct |
18 ms |
28688 KB |
Output is correct |
10 |
Correct |
18 ms |
28620 KB |
Output is correct |
11 |
Correct |
20 ms |
28668 KB |
Output is correct |
12 |
Correct |
18 ms |
28580 KB |
Output is correct |
13 |
Correct |
17 ms |
28620 KB |
Output is correct |
14 |
Correct |
18 ms |
28620 KB |
Output is correct |
15 |
Correct |
18 ms |
28620 KB |
Output is correct |
16 |
Correct |
18 ms |
28544 KB |
Output is correct |
17 |
Correct |
18 ms |
28688 KB |
Output is correct |
18 |
Correct |
18 ms |
28616 KB |
Output is correct |
19 |
Correct |
17 ms |
28640 KB |
Output is correct |
20 |
Correct |
18 ms |
28748 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
181 ms |
44964 KB |
Output is correct |
2 |
Correct |
188 ms |
44916 KB |
Output is correct |
3 |
Correct |
182 ms |
44804 KB |
Output is correct |
4 |
Correct |
196 ms |
44864 KB |
Output is correct |
5 |
Correct |
186 ms |
44884 KB |
Output is correct |
6 |
Correct |
216 ms |
60600 KB |
Output is correct |
7 |
Correct |
232 ms |
50520 KB |
Output is correct |
8 |
Correct |
220 ms |
49040 KB |
Output is correct |
9 |
Correct |
184 ms |
47592 KB |
Output is correct |
10 |
Correct |
192 ms |
44872 KB |
Output is correct |
11 |
Correct |
192 ms |
44908 KB |
Output is correct |
12 |
Correct |
176 ms |
44864 KB |
Output is correct |
13 |
Correct |
216 ms |
45024 KB |
Output is correct |
14 |
Correct |
160 ms |
44272 KB |
Output is correct |
15 |
Correct |
152 ms |
43524 KB |
Output is correct |
16 |
Correct |
96 ms |
40388 KB |
Output is correct |
17 |
Correct |
146 ms |
45592 KB |
Output is correct |
18 |
Correct |
140 ms |
45664 KB |
Output is correct |
19 |
Correct |
144 ms |
45496 KB |
Output is correct |
20 |
Correct |
144 ms |
45508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
28620 KB |
Output is correct |
2 |
Correct |
20 ms |
28632 KB |
Output is correct |
3 |
Correct |
19 ms |
28608 KB |
Output is correct |
4 |
Correct |
19 ms |
28584 KB |
Output is correct |
5 |
Correct |
18 ms |
28620 KB |
Output is correct |
6 |
Correct |
19 ms |
28620 KB |
Output is correct |
7 |
Correct |
18 ms |
28656 KB |
Output is correct |
8 |
Correct |
19 ms |
28620 KB |
Output is correct |
9 |
Correct |
19 ms |
28616 KB |
Output is correct |
10 |
Correct |
18 ms |
28620 KB |
Output is correct |
11 |
Correct |
19 ms |
28616 KB |
Output is correct |
12 |
Correct |
18 ms |
28748 KB |
Output is correct |
13 |
Correct |
18 ms |
28620 KB |
Output is correct |
14 |
Correct |
18 ms |
28620 KB |
Output is correct |
15 |
Correct |
18 ms |
28712 KB |
Output is correct |
16 |
Correct |
18 ms |
28608 KB |
Output is correct |
17 |
Correct |
17 ms |
28640 KB |
Output is correct |
18 |
Correct |
18 ms |
28620 KB |
Output is correct |
19 |
Correct |
21 ms |
28620 KB |
Output is correct |
20 |
Correct |
18 ms |
28668 KB |
Output is correct |
21 |
Correct |
17 ms |
28620 KB |
Output is correct |
22 |
Correct |
17 ms |
28620 KB |
Output is correct |
23 |
Correct |
18 ms |
28620 KB |
Output is correct |
24 |
Correct |
18 ms |
28620 KB |
Output is correct |
25 |
Correct |
18 ms |
28492 KB |
Output is correct |
26 |
Correct |
17 ms |
28484 KB |
Output is correct |
27 |
Correct |
17 ms |
28460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
190 ms |
44880 KB |
Output is correct |
2 |
Correct |
203 ms |
44792 KB |
Output is correct |
3 |
Correct |
214 ms |
43956 KB |
Output is correct |
4 |
Correct |
179 ms |
43812 KB |
Output is correct |
5 |
Correct |
141 ms |
42708 KB |
Output is correct |
6 |
Correct |
151 ms |
42312 KB |
Output is correct |
7 |
Correct |
197 ms |
42128 KB |
Output is correct |
8 |
Correct |
136 ms |
41744 KB |
Output is correct |
9 |
Correct |
133 ms |
41792 KB |
Output is correct |
10 |
Correct |
139 ms |
41640 KB |
Output is correct |
11 |
Correct |
129 ms |
41576 KB |
Output is correct |
12 |
Correct |
121 ms |
41584 KB |
Output is correct |
13 |
Correct |
108 ms |
41536 KB |
Output is correct |
14 |
Correct |
128 ms |
43756 KB |
Output is correct |
15 |
Correct |
224 ms |
50800 KB |
Output is correct |
16 |
Correct |
197 ms |
48724 KB |
Output is correct |
17 |
Correct |
227 ms |
49388 KB |
Output is correct |
18 |
Correct |
189 ms |
47624 KB |
Output is correct |
19 |
Correct |
170 ms |
43860 KB |
Output is correct |
20 |
Correct |
181 ms |
43784 KB |
Output is correct |
21 |
Correct |
172 ms |
43896 KB |
Output is correct |
22 |
Correct |
204 ms |
43200 KB |
Output is correct |
23 |
Correct |
137 ms |
42572 KB |
Output is correct |
24 |
Correct |
158 ms |
45128 KB |
Output is correct |
25 |
Correct |
190 ms |
45268 KB |
Output is correct |
26 |
Correct |
206 ms |
44612 KB |
Output is correct |
27 |
Correct |
178 ms |
44484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
28448 KB |
Output is correct |
2 |
Correct |
16 ms |
28476 KB |
Output is correct |
3 |
Correct |
19 ms |
28456 KB |
Output is correct |
4 |
Correct |
16 ms |
28464 KB |
Output is correct |
5 |
Correct |
17 ms |
28472 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28476 KB |
Output is correct |
9 |
Correct |
18 ms |
28576 KB |
Output is correct |
10 |
Correct |
16 ms |
28500 KB |
Output is correct |
11 |
Correct |
16 ms |
28440 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
17 ms |
28488 KB |
Output is correct |
14 |
Correct |
16 ms |
28424 KB |
Output is correct |
15 |
Correct |
20 ms |
28404 KB |
Output is correct |
16 |
Correct |
17 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28492 KB |
Output is correct |
19 |
Correct |
16 ms |
28404 KB |
Output is correct |
20 |
Correct |
16 ms |
28452 KB |
Output is correct |
21 |
Correct |
18 ms |
28620 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28508 KB |
Output is correct |
24 |
Correct |
16 ms |
28488 KB |
Output is correct |
25 |
Correct |
17 ms |
28444 KB |
Output is correct |
26 |
Correct |
16 ms |
28484 KB |
Output is correct |
27 |
Correct |
16 ms |
28492 KB |
Output is correct |
28 |
Correct |
18 ms |
28484 KB |
Output is correct |
29 |
Correct |
16 ms |
28484 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
16 ms |
28440 KB |
Output is correct |
32 |
Correct |
17 ms |
28464 KB |
Output is correct |
33 |
Correct |
19 ms |
28492 KB |
Output is correct |
34 |
Correct |
17 ms |
28484 KB |
Output is correct |
35 |
Correct |
16 ms |
28492 KB |
Output is correct |
36 |
Correct |
16 ms |
28484 KB |
Output is correct |
37 |
Correct |
16 ms |
28488 KB |
Output is correct |
38 |
Correct |
18 ms |
28492 KB |
Output is correct |
39 |
Correct |
17 ms |
28492 KB |
Output is correct |
40 |
Correct |
17 ms |
28484 KB |
Output is correct |
41 |
Correct |
16 ms |
28492 KB |
Output is correct |
42 |
Correct |
18 ms |
28516 KB |
Output is correct |
43 |
Correct |
16 ms |
28492 KB |
Output is correct |
44 |
Correct |
16 ms |
28440 KB |
Output is correct |
45 |
Correct |
18 ms |
28528 KB |
Output is correct |
46 |
Correct |
16 ms |
28488 KB |
Output is correct |
47 |
Correct |
16 ms |
28428 KB |
Output is correct |
48 |
Correct |
16 ms |
28492 KB |
Output is correct |
49 |
Correct |
19 ms |
28484 KB |
Output is correct |
50 |
Correct |
16 ms |
28444 KB |
Output is correct |
51 |
Correct |
16 ms |
28484 KB |
Output is correct |
52 |
Correct |
18 ms |
28492 KB |
Output is correct |
53 |
Correct |
17 ms |
28492 KB |
Output is correct |
54 |
Correct |
17 ms |
28492 KB |
Output is correct |
55 |
Correct |
17 ms |
28492 KB |
Output is correct |
56 |
Correct |
16 ms |
28492 KB |
Output is correct |
57 |
Correct |
17 ms |
28484 KB |
Output is correct |
58 |
Correct |
16 ms |
28520 KB |
Output is correct |
59 |
Correct |
17 ms |
28488 KB |
Output is correct |
60 |
Correct |
18 ms |
28484 KB |
Output is correct |
61 |
Correct |
17 ms |
28480 KB |
Output is correct |
62 |
Correct |
17 ms |
28480 KB |
Output is correct |
63 |
Correct |
17 ms |
28480 KB |
Output is correct |
64 |
Correct |
16 ms |
28492 KB |
Output is correct |
65 |
Correct |
17 ms |
28524 KB |
Output is correct |
66 |
Correct |
16 ms |
28520 KB |
Output is correct |
67 |
Correct |
17 ms |
28608 KB |
Output is correct |
68 |
Correct |
17 ms |
28620 KB |
Output is correct |
69 |
Correct |
18 ms |
28620 KB |
Output is correct |
70 |
Correct |
18 ms |
28620 KB |
Output is correct |
71 |
Correct |
18 ms |
28588 KB |
Output is correct |
72 |
Correct |
20 ms |
28608 KB |
Output is correct |
73 |
Correct |
19 ms |
28620 KB |
Output is correct |
74 |
Correct |
19 ms |
28612 KB |
Output is correct |
75 |
Correct |
20 ms |
28612 KB |
Output is correct |
76 |
Correct |
19 ms |
28428 KB |
Output is correct |
77 |
Correct |
21 ms |
28656 KB |
Output is correct |
78 |
Correct |
18 ms |
28620 KB |
Output is correct |
79 |
Correct |
19 ms |
28620 KB |
Output is correct |
80 |
Correct |
20 ms |
28620 KB |
Output is correct |
81 |
Correct |
17 ms |
28620 KB |
Output is correct |
82 |
Correct |
17 ms |
28716 KB |
Output is correct |
83 |
Correct |
17 ms |
28620 KB |
Output is correct |
84 |
Correct |
18 ms |
28608 KB |
Output is correct |
85 |
Correct |
21 ms |
28676 KB |
Output is correct |
86 |
Correct |
21 ms |
28616 KB |
Output is correct |
87 |
Correct |
20 ms |
28616 KB |
Output is correct |
88 |
Correct |
19 ms |
28616 KB |
Output is correct |
89 |
Correct |
18 ms |
28664 KB |
Output is correct |
90 |
Correct |
19 ms |
28612 KB |
Output is correct |
91 |
Correct |
17 ms |
28564 KB |
Output is correct |
92 |
Correct |
19 ms |
28620 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
28448 KB |
Output is correct |
2 |
Correct |
16 ms |
28476 KB |
Output is correct |
3 |
Correct |
19 ms |
28456 KB |
Output is correct |
4 |
Correct |
16 ms |
28464 KB |
Output is correct |
5 |
Correct |
17 ms |
28472 KB |
Output is correct |
6 |
Correct |
16 ms |
28484 KB |
Output is correct |
7 |
Correct |
16 ms |
28492 KB |
Output is correct |
8 |
Correct |
17 ms |
28476 KB |
Output is correct |
9 |
Correct |
18 ms |
28576 KB |
Output is correct |
10 |
Correct |
16 ms |
28500 KB |
Output is correct |
11 |
Correct |
16 ms |
28440 KB |
Output is correct |
12 |
Correct |
16 ms |
28492 KB |
Output is correct |
13 |
Correct |
17 ms |
28488 KB |
Output is correct |
14 |
Correct |
16 ms |
28424 KB |
Output is correct |
15 |
Correct |
20 ms |
28404 KB |
Output is correct |
16 |
Correct |
17 ms |
28492 KB |
Output is correct |
17 |
Correct |
16 ms |
28484 KB |
Output is correct |
18 |
Correct |
16 ms |
28492 KB |
Output is correct |
19 |
Correct |
16 ms |
28404 KB |
Output is correct |
20 |
Correct |
16 ms |
28452 KB |
Output is correct |
21 |
Correct |
18 ms |
28620 KB |
Output is correct |
22 |
Correct |
16 ms |
28412 KB |
Output is correct |
23 |
Correct |
16 ms |
28508 KB |
Output is correct |
24 |
Correct |
16 ms |
28488 KB |
Output is correct |
25 |
Correct |
17 ms |
28444 KB |
Output is correct |
26 |
Correct |
16 ms |
28484 KB |
Output is correct |
27 |
Correct |
16 ms |
28492 KB |
Output is correct |
28 |
Correct |
18 ms |
28484 KB |
Output is correct |
29 |
Correct |
16 ms |
28484 KB |
Output is correct |
30 |
Correct |
16 ms |
28492 KB |
Output is correct |
31 |
Correct |
16 ms |
28440 KB |
Output is correct |
32 |
Correct |
17 ms |
28464 KB |
Output is correct |
33 |
Correct |
19 ms |
28492 KB |
Output is correct |
34 |
Correct |
17 ms |
28484 KB |
Output is correct |
35 |
Correct |
16 ms |
28492 KB |
Output is correct |
36 |
Correct |
16 ms |
28484 KB |
Output is correct |
37 |
Correct |
16 ms |
28488 KB |
Output is correct |
38 |
Correct |
18 ms |
28492 KB |
Output is correct |
39 |
Correct |
17 ms |
28492 KB |
Output is correct |
40 |
Correct |
17 ms |
28484 KB |
Output is correct |
41 |
Correct |
16 ms |
28492 KB |
Output is correct |
42 |
Correct |
18 ms |
28516 KB |
Output is correct |
43 |
Correct |
16 ms |
28492 KB |
Output is correct |
44 |
Correct |
16 ms |
28440 KB |
Output is correct |
45 |
Correct |
18 ms |
28528 KB |
Output is correct |
46 |
Correct |
16 ms |
28488 KB |
Output is correct |
47 |
Correct |
16 ms |
28428 KB |
Output is correct |
48 |
Correct |
16 ms |
28492 KB |
Output is correct |
49 |
Correct |
19 ms |
28484 KB |
Output is correct |
50 |
Correct |
16 ms |
28444 KB |
Output is correct |
51 |
Correct |
16 ms |
28484 KB |
Output is correct |
52 |
Correct |
18 ms |
28492 KB |
Output is correct |
53 |
Correct |
17 ms |
28492 KB |
Output is correct |
54 |
Correct |
17 ms |
28492 KB |
Output is correct |
55 |
Correct |
17 ms |
28492 KB |
Output is correct |
56 |
Correct |
16 ms |
28492 KB |
Output is correct |
57 |
Correct |
17 ms |
28484 KB |
Output is correct |
58 |
Correct |
16 ms |
28520 KB |
Output is correct |
59 |
Correct |
17 ms |
28488 KB |
Output is correct |
60 |
Correct |
18 ms |
28484 KB |
Output is correct |
61 |
Correct |
17 ms |
28480 KB |
Output is correct |
62 |
Correct |
17 ms |
28480 KB |
Output is correct |
63 |
Correct |
17 ms |
28480 KB |
Output is correct |
64 |
Correct |
16 ms |
28492 KB |
Output is correct |
65 |
Correct |
17 ms |
28524 KB |
Output is correct |
66 |
Correct |
123 ms |
50356 KB |
Output is correct |
67 |
Correct |
107 ms |
50364 KB |
Output is correct |
68 |
Correct |
161 ms |
50584 KB |
Output is correct |
69 |
Correct |
133 ms |
48904 KB |
Output is correct |
70 |
Correct |
146 ms |
47340 KB |
Output is correct |
71 |
Correct |
157 ms |
51788 KB |
Output is correct |
72 |
Correct |
152 ms |
46208 KB |
Output is correct |
73 |
Correct |
171 ms |
48792 KB |
Output is correct |
74 |
Correct |
152 ms |
44608 KB |
Output is correct |
75 |
Correct |
160 ms |
45376 KB |
Output is correct |
76 |
Correct |
164 ms |
42540 KB |
Output is correct |
77 |
Correct |
137 ms |
42292 KB |
Output is correct |
78 |
Correct |
134 ms |
42216 KB |
Output is correct |
79 |
Correct |
128 ms |
41696 KB |
Output is correct |
80 |
Correct |
127 ms |
40504 KB |
Output is correct |
81 |
Correct |
103 ms |
40156 KB |
Output is correct |
82 |
Correct |
20 ms |
30408 KB |
Output is correct |
83 |
Correct |
20 ms |
30412 KB |
Output is correct |
84 |
Correct |
19 ms |
30352 KB |
Output is correct |
85 |
Correct |
19 ms |
30412 KB |
Output is correct |
86 |
Correct |
19 ms |
30276 KB |
Output is correct |
87 |
Correct |
19 ms |
30280 KB |
Output is correct |
88 |
Correct |
17 ms |
28600 KB |
Output is correct |
89 |
Correct |
17 ms |
28684 KB |
Output is correct |
90 |
Correct |
17 ms |
28644 KB |
Output is correct |
91 |
Correct |
18 ms |
28748 KB |
Output is correct |
92 |
Correct |
17 ms |
28768 KB |
Output is correct |
93 |
Correct |
18 ms |
28748 KB |
Output is correct |
94 |
Correct |
18 ms |
28752 KB |
Output is correct |
95 |
Correct |
18 ms |
28728 KB |
Output is correct |
96 |
Correct |
18 ms |
28688 KB |
Output is correct |
97 |
Correct |
18 ms |
28620 KB |
Output is correct |
98 |
Correct |
20 ms |
28668 KB |
Output is correct |
99 |
Correct |
18 ms |
28580 KB |
Output is correct |
100 |
Correct |
17 ms |
28620 KB |
Output is correct |
101 |
Correct |
18 ms |
28620 KB |
Output is correct |
102 |
Correct |
18 ms |
28620 KB |
Output is correct |
103 |
Correct |
18 ms |
28544 KB |
Output is correct |
104 |
Correct |
18 ms |
28688 KB |
Output is correct |
105 |
Correct |
18 ms |
28616 KB |
Output is correct |
106 |
Correct |
17 ms |
28640 KB |
Output is correct |
107 |
Correct |
18 ms |
28748 KB |
Output is correct |
108 |
Correct |
181 ms |
44964 KB |
Output is correct |
109 |
Correct |
188 ms |
44916 KB |
Output is correct |
110 |
Correct |
182 ms |
44804 KB |
Output is correct |
111 |
Correct |
196 ms |
44864 KB |
Output is correct |
112 |
Correct |
186 ms |
44884 KB |
Output is correct |
113 |
Correct |
216 ms |
60600 KB |
Output is correct |
114 |
Correct |
232 ms |
50520 KB |
Output is correct |
115 |
Correct |
220 ms |
49040 KB |
Output is correct |
116 |
Correct |
184 ms |
47592 KB |
Output is correct |
117 |
Correct |
192 ms |
44872 KB |
Output is correct |
118 |
Correct |
192 ms |
44908 KB |
Output is correct |
119 |
Correct |
176 ms |
44864 KB |
Output is correct |
120 |
Correct |
216 ms |
45024 KB |
Output is correct |
121 |
Correct |
160 ms |
44272 KB |
Output is correct |
122 |
Correct |
152 ms |
43524 KB |
Output is correct |
123 |
Correct |
96 ms |
40388 KB |
Output is correct |
124 |
Correct |
146 ms |
45592 KB |
Output is correct |
125 |
Correct |
140 ms |
45664 KB |
Output is correct |
126 |
Correct |
144 ms |
45496 KB |
Output is correct |
127 |
Correct |
144 ms |
45508 KB |
Output is correct |
128 |
Correct |
17 ms |
28620 KB |
Output is correct |
129 |
Correct |
20 ms |
28632 KB |
Output is correct |
130 |
Correct |
19 ms |
28608 KB |
Output is correct |
131 |
Correct |
19 ms |
28584 KB |
Output is correct |
132 |
Correct |
18 ms |
28620 KB |
Output is correct |
133 |
Correct |
19 ms |
28620 KB |
Output is correct |
134 |
Correct |
18 ms |
28656 KB |
Output is correct |
135 |
Correct |
19 ms |
28620 KB |
Output is correct |
136 |
Correct |
19 ms |
28616 KB |
Output is correct |
137 |
Correct |
18 ms |
28620 KB |
Output is correct |
138 |
Correct |
19 ms |
28616 KB |
Output is correct |
139 |
Correct |
18 ms |
28748 KB |
Output is correct |
140 |
Correct |
18 ms |
28620 KB |
Output is correct |
141 |
Correct |
18 ms |
28620 KB |
Output is correct |
142 |
Correct |
18 ms |
28712 KB |
Output is correct |
143 |
Correct |
18 ms |
28608 KB |
Output is correct |
144 |
Correct |
17 ms |
28640 KB |
Output is correct |
145 |
Correct |
18 ms |
28620 KB |
Output is correct |
146 |
Correct |
21 ms |
28620 KB |
Output is correct |
147 |
Correct |
18 ms |
28668 KB |
Output is correct |
148 |
Correct |
17 ms |
28620 KB |
Output is correct |
149 |
Correct |
17 ms |
28620 KB |
Output is correct |
150 |
Correct |
18 ms |
28620 KB |
Output is correct |
151 |
Correct |
18 ms |
28620 KB |
Output is correct |
152 |
Correct |
18 ms |
28492 KB |
Output is correct |
153 |
Correct |
17 ms |
28484 KB |
Output is correct |
154 |
Correct |
17 ms |
28460 KB |
Output is correct |
155 |
Correct |
190 ms |
44880 KB |
Output is correct |
156 |
Correct |
203 ms |
44792 KB |
Output is correct |
157 |
Correct |
214 ms |
43956 KB |
Output is correct |
158 |
Correct |
179 ms |
43812 KB |
Output is correct |
159 |
Correct |
141 ms |
42708 KB |
Output is correct |
160 |
Correct |
151 ms |
42312 KB |
Output is correct |
161 |
Correct |
197 ms |
42128 KB |
Output is correct |
162 |
Correct |
136 ms |
41744 KB |
Output is correct |
163 |
Correct |
133 ms |
41792 KB |
Output is correct |
164 |
Correct |
139 ms |
41640 KB |
Output is correct |
165 |
Correct |
129 ms |
41576 KB |
Output is correct |
166 |
Correct |
121 ms |
41584 KB |
Output is correct |
167 |
Correct |
108 ms |
41536 KB |
Output is correct |
168 |
Correct |
128 ms |
43756 KB |
Output is correct |
169 |
Correct |
224 ms |
50800 KB |
Output is correct |
170 |
Correct |
197 ms |
48724 KB |
Output is correct |
171 |
Correct |
227 ms |
49388 KB |
Output is correct |
172 |
Correct |
189 ms |
47624 KB |
Output is correct |
173 |
Correct |
170 ms |
43860 KB |
Output is correct |
174 |
Correct |
181 ms |
43784 KB |
Output is correct |
175 |
Correct |
172 ms |
43896 KB |
Output is correct |
176 |
Correct |
204 ms |
43200 KB |
Output is correct |
177 |
Correct |
137 ms |
42572 KB |
Output is correct |
178 |
Correct |
158 ms |
45128 KB |
Output is correct |
179 |
Correct |
190 ms |
45268 KB |
Output is correct |
180 |
Correct |
206 ms |
44612 KB |
Output is correct |
181 |
Correct |
178 ms |
44484 KB |
Output is correct |
182 |
Correct |
16 ms |
28520 KB |
Output is correct |
183 |
Correct |
17 ms |
28608 KB |
Output is correct |
184 |
Correct |
17 ms |
28620 KB |
Output is correct |
185 |
Correct |
18 ms |
28620 KB |
Output is correct |
186 |
Correct |
18 ms |
28620 KB |
Output is correct |
187 |
Correct |
18 ms |
28588 KB |
Output is correct |
188 |
Correct |
20 ms |
28608 KB |
Output is correct |
189 |
Correct |
19 ms |
28620 KB |
Output is correct |
190 |
Correct |
19 ms |
28612 KB |
Output is correct |
191 |
Correct |
20 ms |
28612 KB |
Output is correct |
192 |
Correct |
19 ms |
28428 KB |
Output is correct |
193 |
Correct |
21 ms |
28656 KB |
Output is correct |
194 |
Correct |
18 ms |
28620 KB |
Output is correct |
195 |
Correct |
19 ms |
28620 KB |
Output is correct |
196 |
Correct |
20 ms |
28620 KB |
Output is correct |
197 |
Correct |
17 ms |
28620 KB |
Output is correct |
198 |
Correct |
17 ms |
28716 KB |
Output is correct |
199 |
Correct |
17 ms |
28620 KB |
Output is correct |
200 |
Correct |
18 ms |
28608 KB |
Output is correct |
201 |
Correct |
21 ms |
28676 KB |
Output is correct |
202 |
Correct |
21 ms |
28616 KB |
Output is correct |
203 |
Correct |
20 ms |
28616 KB |
Output is correct |
204 |
Correct |
19 ms |
28616 KB |
Output is correct |
205 |
Correct |
18 ms |
28664 KB |
Output is correct |
206 |
Correct |
19 ms |
28612 KB |
Output is correct |
207 |
Correct |
17 ms |
28564 KB |
Output is correct |
208 |
Correct |
19 ms |
28620 KB |
Output is correct |
209 |
Correct |
19 ms |
29644 KB |
Output is correct |
210 |
Correct |
97 ms |
39236 KB |
Output is correct |
211 |
Correct |
138 ms |
44032 KB |
Output is correct |
212 |
Correct |
177 ms |
46924 KB |
Output is correct |
213 |
Correct |
179 ms |
49088 KB |
Output is correct |
214 |
Correct |
98 ms |
42668 KB |
Output is correct |
215 |
Correct |
94 ms |
42232 KB |
Output is correct |
216 |
Correct |
204 ms |
44604 KB |
Output is correct |
217 |
Correct |
157 ms |
43272 KB |
Output is correct |
218 |
Correct |
155 ms |
42008 KB |
Output is correct |
219 |
Correct |
149 ms |
41540 KB |
Output is correct |
220 |
Correct |
133 ms |
41548 KB |
Output is correct |
221 |
Correct |
120 ms |
41456 KB |
Output is correct |
222 |
Correct |
121 ms |
42680 KB |
Output is correct |
223 |
Correct |
161 ms |
45872 KB |
Output is correct |
224 |
Correct |
172 ms |
44980 KB |
Output is correct |
225 |
Correct |
146 ms |
42948 KB |
Output is correct |
226 |
Correct |
170 ms |
43068 KB |
Output is correct |
227 |
Correct |
165 ms |
43204 KB |
Output is correct |
228 |
Correct |
194 ms |
42672 KB |
Output is correct |
229 |
Correct |
130 ms |
42432 KB |
Output is correct |
230 |
Correct |
179 ms |
43464 KB |
Output is correct |
231 |
Correct |
180 ms |
43700 KB |
Output is correct |