답안 #408674

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
408674 2021-05-19T12:58:14 Z RGBB 철인 이종 경기 (APIO18_duathlon) C++14
100 / 100
263 ms 69708 KB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>pp;
const int MAXN=2*1e5;
int n,m;
ll ans;
//biconnection stuffs
int t,cnt,low[MAXN],dist[MAXN],parent[MAXN];
bool vis[MAXN];
vector<int>adj[MAXN];
unordered_set<int>bcc[MAXN];
stack<pp>stk;
void dfs(int p){
    vis[p]=true;
    low[p]=t;
    dist[p]=t;
    t++;
    int children=0;
    for(int i:adj[p]){
        if(!vis[i]){
            children++;
            parent[i]=p;
            stk.push({p,i});
            dfs(i);
            low[p]=min(low[p],low[i]);
            if((dist[p]==0&&children>1)||(dist[p]>0&&low[i]>=dist[p])){
                while(true){
                    bcc[cnt].insert(stk.top().first);
                    bcc[cnt].insert(stk.top().second);
                    if(stk.top()==make_pair(p,i)){
                        stk.pop();
                        break;
                    }
                    stk.pop();
                }
                cnt++;
            }
        }
        else if(i!=parent[p]){
            low[p]=min(low[p],dist[i]);
            if(dist[i]<dist[p])stk.push({p,i});
        }
    }
}
unordered_set<int>art;
void dfs2(int p){
    vis[p]=true;
    dist[p]=t;
    low[p]=t;
    t++;
    int children=0;
    for(int i:adj[p]){
        if(i==parent[p])continue;
        if(vis[i])low[p]=min(low[p],dist[i]);
        else{
            parent[i]=p;
            dfs2(i);
            low[p]=min(low[p],low[i]);
            if(low[i]>=dist[p]&&parent[p]!=-1){
                art.insert(p);
                children++;
            }
        }
    }
    if(parent[p]==-1&&children>1)art.insert(p);
}
int num,si[MAXN],group[MAXN];
bool type[MAXN];
vector<int>edge[MAXN];
void construct(int p){
    vis[p]=true;
    queue<int>q;
    q.push(p);
    while(!q.empty()){
        int cur=q.front();
        q.pop();
        for(auto&i:edge[cur]){
            if(vis[i])continue;
            parent[i]=cur;
            vis[i]=true;
            q.push(i);
        }
    }
}
vector<int>roots;
ll freq[MAXN][2],dp[MAXN];
ll below(int p){
    for(auto&i:edge[p])if(i!=parent[p])freq[p][0]+=below(i)+si[i];
    return freq[p][0];
}
void above(int p){
    for(auto&i:edge[p]){
        if(i==parent[p])continue;
        freq[i][1]=freq[p][1]+si[p]+freq[p][0]-freq[i][0]-si[i];
        above(i);
    }
}
void solve(){
    for(int i=0;i<num;i++){
        if(type[i]){
            for(int y:edge[i]){
                ll a;
                if(y!=parent[i])a=freq[y][0]+1;
                else a=freq[i][1];
                ans-=si[i]*a*(a-1);
                dp[i]+=a*(a-1);
            }
        }
    }
    for(int i=0;i<num;i++){
        if(!type[i]){
            for(int y:edge[i]){
                if(y!=parent[i])ans-=dp[y]-freq[y][1]*(freq[y][1]-1);
                else ans-=dp[y]-(freq[i][0]+si[i])*(freq[i][0]+si[i]-1);
            }
        }
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //input
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        adj[a-1].push_back(b-1);
        adj[b-1].push_back(a-1);
    }
    //biconnect
    t=0;
    cnt=0;
    memset(low,0,sizeof(low));
    memset(dist,0,sizeof(dist));
    memset(parent,-1,sizeof(parent));
    memset(vis,false,sizeof(vis));
    for(int i=0;i<n;i++)if(!vis[i])dfs(i);
    if(!stk.empty()){
        while(!stk.empty()){
            bcc[cnt].insert(stk.top().first);
            bcc[cnt].insert(stk.top().second);
            stk.pop();
        }
        cnt++;
    }
    //articulation points
    memset(vis,false,sizeof(vis));
    for(int i=0;i<n;i++){
        if(!vis[i]){
            t=0;
            parent[i]=-1;
            dfs2(i);
        }
    }
    memset(vis,false,sizeof(vis));
    for(int i=n-1;i>=0;i--){
        if(!vis[i]){
            t=0;
            parent[i]=-1;
            dfs2(i);
        }
    }
    //construct forest nodes
    num=0;
    memset(si,0,sizeof(si));
    for(auto&i:art){
        group[i]=num;
        type[num]=false;
        si[num]=1;
        num++;
    }
    for(int i=0;i<cnt;i++){
        type[num]=true;
        for(auto&y:bcc[i]){
            if(art.find(y)!=art.end()){
                edge[num].push_back(group[y]);
                edge[group[y]].push_back(num);
            }
            else si[num]++;
        }
        num++;
    }
    //find roots and construct trees
    memset(vis,false,sizeof(vis));
    memset(parent,-1,sizeof(parent));
    for(int i=0;i<num;i++){
        if(!vis[i]){
            roots.push_back(i);
            construct(i);
        }
    }
    //tree dp
    ans=0;
    memset(freq,0,sizeof(freq));
    memset(dp,0,sizeof(dp));
    for(int i:roots){
        below(i);
        above(i);
        ll a=freq[i][0]+si[i];
        ans+=a*(a-1)*(a-2);
    }
    solve();
    //output answer
    cout<<ans<<"\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 28748 KB Output is correct
2 Correct 16 ms 28620 KB Output is correct
3 Correct 16 ms 28688 KB Output is correct
4 Correct 19 ms 28620 KB Output is correct
5 Correct 16 ms 28688 KB Output is correct
6 Correct 16 ms 28580 KB Output is correct
7 Correct 16 ms 28688 KB Output is correct
8 Correct 19 ms 28620 KB Output is correct
9 Correct 16 ms 28696 KB Output is correct
10 Correct 17 ms 28628 KB Output is correct
11 Correct 16 ms 28636 KB Output is correct
12 Correct 16 ms 28620 KB Output is correct
13 Correct 16 ms 28620 KB Output is correct
14 Correct 16 ms 28620 KB Output is correct
15 Correct 17 ms 28620 KB Output is correct
16 Correct 16 ms 28620 KB Output is correct
17 Correct 16 ms 28620 KB Output is correct
18 Correct 16 ms 28620 KB Output is correct
19 Correct 16 ms 28656 KB Output is correct
20 Correct 16 ms 28692 KB Output is correct
21 Correct 17 ms 28692 KB Output is correct
22 Correct 18 ms 28620 KB Output is correct
23 Correct 16 ms 28620 KB Output is correct
24 Correct 17 ms 28620 KB Output is correct
25 Correct 16 ms 28636 KB Output is correct
26 Correct 16 ms 28616 KB Output is correct
27 Correct 18 ms 28680 KB Output is correct
28 Correct 17 ms 28620 KB Output is correct
29 Correct 17 ms 28704 KB Output is correct
30 Correct 16 ms 28620 KB Output is correct
31 Correct 16 ms 28620 KB Output is correct
32 Correct 16 ms 28700 KB Output is correct
33 Correct 17 ms 28596 KB Output is correct
34 Correct 16 ms 28596 KB Output is correct
35 Correct 16 ms 28608 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 28748 KB Output is correct
2 Correct 16 ms 28620 KB Output is correct
3 Correct 16 ms 28688 KB Output is correct
4 Correct 19 ms 28620 KB Output is correct
5 Correct 16 ms 28688 KB Output is correct
6 Correct 16 ms 28580 KB Output is correct
7 Correct 16 ms 28688 KB Output is correct
8 Correct 19 ms 28620 KB Output is correct
9 Correct 16 ms 28696 KB Output is correct
10 Correct 17 ms 28628 KB Output is correct
11 Correct 16 ms 28636 KB Output is correct
12 Correct 16 ms 28620 KB Output is correct
13 Correct 16 ms 28620 KB Output is correct
14 Correct 16 ms 28620 KB Output is correct
15 Correct 17 ms 28620 KB Output is correct
16 Correct 16 ms 28620 KB Output is correct
17 Correct 16 ms 28620 KB Output is correct
18 Correct 16 ms 28620 KB Output is correct
19 Correct 16 ms 28656 KB Output is correct
20 Correct 16 ms 28692 KB Output is correct
21 Correct 17 ms 28692 KB Output is correct
22 Correct 18 ms 28620 KB Output is correct
23 Correct 16 ms 28620 KB Output is correct
24 Correct 17 ms 28620 KB Output is correct
25 Correct 16 ms 28636 KB Output is correct
26 Correct 16 ms 28616 KB Output is correct
27 Correct 18 ms 28680 KB Output is correct
28 Correct 17 ms 28620 KB Output is correct
29 Correct 17 ms 28704 KB Output is correct
30 Correct 16 ms 28620 KB Output is correct
31 Correct 16 ms 28620 KB Output is correct
32 Correct 16 ms 28700 KB Output is correct
33 Correct 17 ms 28596 KB Output is correct
34 Correct 16 ms 28596 KB Output is correct
35 Correct 16 ms 28608 KB Output is correct
36 Correct 16 ms 28584 KB Output is correct
37 Correct 17 ms 28620 KB Output is correct
38 Correct 17 ms 28644 KB Output is correct
39 Correct 17 ms 28620 KB Output is correct
40 Correct 17 ms 28588 KB Output is correct
41 Correct 16 ms 28632 KB Output is correct
42 Correct 17 ms 28620 KB Output is correct
43 Correct 17 ms 28612 KB Output is correct
44 Correct 18 ms 28620 KB Output is correct
45 Correct 16 ms 28620 KB Output is correct
46 Correct 18 ms 28672 KB Output is correct
47 Correct 16 ms 28640 KB Output is correct
48 Correct 17 ms 28620 KB Output is correct
49 Correct 16 ms 28620 KB Output is correct
50 Correct 17 ms 28672 KB Output is correct
51 Correct 16 ms 28656 KB Output is correct
52 Correct 16 ms 28620 KB Output is correct
53 Correct 16 ms 28620 KB Output is correct
54 Correct 16 ms 28708 KB Output is correct
55 Correct 16 ms 28644 KB Output is correct
56 Correct 16 ms 28620 KB Output is correct
57 Correct 16 ms 28632 KB Output is correct
58 Correct 17 ms 28600 KB Output is correct
59 Correct 17 ms 28688 KB Output is correct
60 Correct 16 ms 28620 KB Output is correct
61 Correct 17 ms 28696 KB Output is correct
62 Correct 16 ms 28632 KB Output is correct
63 Correct 16 ms 28620 KB Output is correct
64 Correct 16 ms 28680 KB Output is correct
65 Correct 17 ms 28620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 127 ms 48820 KB Output is correct
2 Correct 138 ms 48864 KB Output is correct
3 Correct 181 ms 54732 KB Output is correct
4 Correct 156 ms 51620 KB Output is correct
5 Correct 160 ms 48364 KB Output is correct
6 Correct 203 ms 53844 KB Output is correct
7 Correct 190 ms 53036 KB Output is correct
8 Correct 207 ms 54356 KB Output is correct
9 Correct 195 ms 51804 KB Output is correct
10 Correct 188 ms 50704 KB Output is correct
11 Correct 129 ms 44704 KB Output is correct
12 Correct 158 ms 44580 KB Output is correct
13 Correct 119 ms 43404 KB Output is correct
14 Correct 150 ms 43268 KB Output is correct
15 Correct 87 ms 40400 KB Output is correct
16 Correct 84 ms 40216 KB Output is correct
17 Correct 20 ms 28748 KB Output is correct
18 Correct 19 ms 28752 KB Output is correct
19 Correct 19 ms 28732 KB Output is correct
20 Correct 19 ms 28636 KB Output is correct
21 Correct 19 ms 28620 KB Output is correct
22 Correct 18 ms 28620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28924 KB Output is correct
2 Correct 18 ms 28980 KB Output is correct
3 Correct 18 ms 28980 KB Output is correct
4 Correct 18 ms 29024 KB Output is correct
5 Correct 18 ms 28952 KB Output is correct
6 Correct 18 ms 29044 KB Output is correct
7 Correct 18 ms 29076 KB Output is correct
8 Correct 17 ms 29004 KB Output is correct
9 Correct 18 ms 29004 KB Output is correct
10 Correct 18 ms 28988 KB Output is correct
11 Correct 17 ms 28884 KB Output is correct
12 Correct 17 ms 28980 KB Output is correct
13 Correct 18 ms 28876 KB Output is correct
14 Correct 18 ms 28896 KB Output is correct
15 Correct 17 ms 28876 KB Output is correct
16 Correct 17 ms 28748 KB Output is correct
17 Correct 18 ms 28928 KB Output is correct
18 Correct 18 ms 28840 KB Output is correct
19 Correct 18 ms 28948 KB Output is correct
20 Correct 19 ms 28856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 205 ms 56692 KB Output is correct
2 Correct 189 ms 56860 KB Output is correct
3 Correct 192 ms 56756 KB Output is correct
4 Correct 185 ms 56804 KB Output is correct
5 Correct 185 ms 56784 KB Output is correct
6 Correct 245 ms 69708 KB Output is correct
7 Correct 208 ms 64216 KB Output is correct
8 Correct 217 ms 62376 KB Output is correct
9 Correct 212 ms 60628 KB Output is correct
10 Correct 185 ms 56748 KB Output is correct
11 Correct 214 ms 56664 KB Output is correct
12 Correct 222 ms 56708 KB Output is correct
13 Correct 185 ms 56712 KB Output is correct
14 Correct 168 ms 54384 KB Output is correct
15 Correct 149 ms 51420 KB Output is correct
16 Correct 93 ms 42848 KB Output is correct
17 Correct 105 ms 53432 KB Output is correct
18 Correct 107 ms 53164 KB Output is correct
19 Correct 111 ms 53212 KB Output is correct
20 Correct 112 ms 53188 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28876 KB Output is correct
2 Correct 18 ms 28916 KB Output is correct
3 Correct 17 ms 28948 KB Output is correct
4 Correct 18 ms 28876 KB Output is correct
5 Correct 19 ms 28748 KB Output is correct
6 Correct 17 ms 28828 KB Output is correct
7 Correct 17 ms 28736 KB Output is correct
8 Correct 17 ms 28736 KB Output is correct
9 Correct 17 ms 28748 KB Output is correct
10 Correct 16 ms 28732 KB Output is correct
11 Correct 17 ms 28748 KB Output is correct
12 Correct 20 ms 29004 KB Output is correct
13 Correct 18 ms 28984 KB Output is correct
14 Correct 18 ms 28936 KB Output is correct
15 Correct 18 ms 28868 KB Output is correct
16 Correct 17 ms 28876 KB Output is correct
17 Correct 17 ms 28876 KB Output is correct
18 Correct 18 ms 28864 KB Output is correct
19 Correct 17 ms 28792 KB Output is correct
20 Correct 18 ms 28736 KB Output is correct
21 Correct 20 ms 28912 KB Output is correct
22 Correct 18 ms 28860 KB Output is correct
23 Correct 17 ms 28876 KB Output is correct
24 Correct 19 ms 28876 KB Output is correct
25 Correct 17 ms 28704 KB Output is correct
26 Correct 17 ms 28620 KB Output is correct
27 Correct 16 ms 28628 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 189 ms 56756 KB Output is correct
2 Correct 191 ms 57344 KB Output is correct
3 Correct 208 ms 54008 KB Output is correct
4 Correct 180 ms 49196 KB Output is correct
5 Correct 171 ms 43476 KB Output is correct
6 Correct 142 ms 41596 KB Output is correct
7 Correct 151 ms 40208 KB Output is correct
8 Correct 131 ms 38864 KB Output is correct
9 Correct 122 ms 38364 KB Output is correct
10 Correct 128 ms 37992 KB Output is correct
11 Correct 137 ms 37452 KB Output is correct
12 Correct 134 ms 36964 KB Output is correct
13 Correct 123 ms 36900 KB Output is correct
14 Correct 151 ms 39504 KB Output is correct
15 Correct 263 ms 61872 KB Output is correct
16 Correct 212 ms 59156 KB Output is correct
17 Correct 220 ms 58480 KB Output is correct
18 Correct 213 ms 55932 KB Output is correct
19 Correct 196 ms 49320 KB Output is correct
20 Correct 220 ms 49364 KB Output is correct
21 Correct 218 ms 49228 KB Output is correct
22 Correct 156 ms 46192 KB Output is correct
23 Correct 166 ms 42868 KB Output is correct
24 Correct 190 ms 52808 KB Output is correct
25 Correct 198 ms 52948 KB Output is correct
26 Correct 177 ms 50160 KB Output is correct
27 Correct 199 ms 50104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 28748 KB Output is correct
2 Correct 16 ms 28620 KB Output is correct
3 Correct 16 ms 28688 KB Output is correct
4 Correct 19 ms 28620 KB Output is correct
5 Correct 16 ms 28688 KB Output is correct
6 Correct 16 ms 28580 KB Output is correct
7 Correct 16 ms 28688 KB Output is correct
8 Correct 19 ms 28620 KB Output is correct
9 Correct 16 ms 28696 KB Output is correct
10 Correct 17 ms 28628 KB Output is correct
11 Correct 16 ms 28636 KB Output is correct
12 Correct 16 ms 28620 KB Output is correct
13 Correct 16 ms 28620 KB Output is correct
14 Correct 16 ms 28620 KB Output is correct
15 Correct 17 ms 28620 KB Output is correct
16 Correct 16 ms 28620 KB Output is correct
17 Correct 16 ms 28620 KB Output is correct
18 Correct 16 ms 28620 KB Output is correct
19 Correct 16 ms 28656 KB Output is correct
20 Correct 16 ms 28692 KB Output is correct
21 Correct 17 ms 28692 KB Output is correct
22 Correct 18 ms 28620 KB Output is correct
23 Correct 16 ms 28620 KB Output is correct
24 Correct 17 ms 28620 KB Output is correct
25 Correct 16 ms 28636 KB Output is correct
26 Correct 16 ms 28616 KB Output is correct
27 Correct 18 ms 28680 KB Output is correct
28 Correct 17 ms 28620 KB Output is correct
29 Correct 17 ms 28704 KB Output is correct
30 Correct 16 ms 28620 KB Output is correct
31 Correct 16 ms 28620 KB Output is correct
32 Correct 16 ms 28700 KB Output is correct
33 Correct 17 ms 28596 KB Output is correct
34 Correct 16 ms 28596 KB Output is correct
35 Correct 16 ms 28608 KB Output is correct
36 Correct 16 ms 28584 KB Output is correct
37 Correct 17 ms 28620 KB Output is correct
38 Correct 17 ms 28644 KB Output is correct
39 Correct 17 ms 28620 KB Output is correct
40 Correct 17 ms 28588 KB Output is correct
41 Correct 16 ms 28632 KB Output is correct
42 Correct 17 ms 28620 KB Output is correct
43 Correct 17 ms 28612 KB Output is correct
44 Correct 18 ms 28620 KB Output is correct
45 Correct 16 ms 28620 KB Output is correct
46 Correct 18 ms 28672 KB Output is correct
47 Correct 16 ms 28640 KB Output is correct
48 Correct 17 ms 28620 KB Output is correct
49 Correct 16 ms 28620 KB Output is correct
50 Correct 17 ms 28672 KB Output is correct
51 Correct 16 ms 28656 KB Output is correct
52 Correct 16 ms 28620 KB Output is correct
53 Correct 16 ms 28620 KB Output is correct
54 Correct 16 ms 28708 KB Output is correct
55 Correct 16 ms 28644 KB Output is correct
56 Correct 16 ms 28620 KB Output is correct
57 Correct 16 ms 28632 KB Output is correct
58 Correct 17 ms 28600 KB Output is correct
59 Correct 17 ms 28688 KB Output is correct
60 Correct 16 ms 28620 KB Output is correct
61 Correct 17 ms 28696 KB Output is correct
62 Correct 16 ms 28632 KB Output is correct
63 Correct 16 ms 28620 KB Output is correct
64 Correct 16 ms 28680 KB Output is correct
65 Correct 17 ms 28620 KB Output is correct
66 Correct 15 ms 28632 KB Output is correct
67 Correct 16 ms 28816 KB Output is correct
68 Correct 18 ms 28832 KB Output is correct
69 Correct 18 ms 28852 KB Output is correct
70 Correct 17 ms 28748 KB Output is correct
71 Correct 17 ms 28748 KB Output is correct
72 Correct 17 ms 28748 KB Output is correct
73 Correct 17 ms 28840 KB Output is correct
74 Correct 17 ms 28744 KB Output is correct
75 Correct 17 ms 28832 KB Output is correct
76 Correct 17 ms 28620 KB Output is correct
77 Correct 18 ms 28876 KB Output is correct
78 Correct 17 ms 28964 KB Output is correct
79 Correct 16 ms 28748 KB Output is correct
80 Correct 16 ms 28748 KB Output is correct
81 Correct 17 ms 28748 KB Output is correct
82 Correct 17 ms 28832 KB Output is correct
83 Correct 17 ms 28748 KB Output is correct
84 Correct 18 ms 28868 KB Output is correct
85 Correct 18 ms 28984 KB Output is correct
86 Correct 18 ms 28748 KB Output is correct
87 Correct 17 ms 28840 KB Output is correct
88 Correct 18 ms 28748 KB Output is correct
89 Correct 17 ms 28772 KB Output is correct
90 Correct 17 ms 28804 KB Output is correct
91 Correct 17 ms 28748 KB Output is correct
92 Correct 18 ms 28804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 28748 KB Output is correct
2 Correct 16 ms 28620 KB Output is correct
3 Correct 16 ms 28688 KB Output is correct
4 Correct 19 ms 28620 KB Output is correct
5 Correct 16 ms 28688 KB Output is correct
6 Correct 16 ms 28580 KB Output is correct
7 Correct 16 ms 28688 KB Output is correct
8 Correct 19 ms 28620 KB Output is correct
9 Correct 16 ms 28696 KB Output is correct
10 Correct 17 ms 28628 KB Output is correct
11 Correct 16 ms 28636 KB Output is correct
12 Correct 16 ms 28620 KB Output is correct
13 Correct 16 ms 28620 KB Output is correct
14 Correct 16 ms 28620 KB Output is correct
15 Correct 17 ms 28620 KB Output is correct
16 Correct 16 ms 28620 KB Output is correct
17 Correct 16 ms 28620 KB Output is correct
18 Correct 16 ms 28620 KB Output is correct
19 Correct 16 ms 28656 KB Output is correct
20 Correct 16 ms 28692 KB Output is correct
21 Correct 17 ms 28692 KB Output is correct
22 Correct 18 ms 28620 KB Output is correct
23 Correct 16 ms 28620 KB Output is correct
24 Correct 17 ms 28620 KB Output is correct
25 Correct 16 ms 28636 KB Output is correct
26 Correct 16 ms 28616 KB Output is correct
27 Correct 18 ms 28680 KB Output is correct
28 Correct 17 ms 28620 KB Output is correct
29 Correct 17 ms 28704 KB Output is correct
30 Correct 16 ms 28620 KB Output is correct
31 Correct 16 ms 28620 KB Output is correct
32 Correct 16 ms 28700 KB Output is correct
33 Correct 17 ms 28596 KB Output is correct
34 Correct 16 ms 28596 KB Output is correct
35 Correct 16 ms 28608 KB Output is correct
36 Correct 16 ms 28584 KB Output is correct
37 Correct 17 ms 28620 KB Output is correct
38 Correct 17 ms 28644 KB Output is correct
39 Correct 17 ms 28620 KB Output is correct
40 Correct 17 ms 28588 KB Output is correct
41 Correct 16 ms 28632 KB Output is correct
42 Correct 17 ms 28620 KB Output is correct
43 Correct 17 ms 28612 KB Output is correct
44 Correct 18 ms 28620 KB Output is correct
45 Correct 16 ms 28620 KB Output is correct
46 Correct 18 ms 28672 KB Output is correct
47 Correct 16 ms 28640 KB Output is correct
48 Correct 17 ms 28620 KB Output is correct
49 Correct 16 ms 28620 KB Output is correct
50 Correct 17 ms 28672 KB Output is correct
51 Correct 16 ms 28656 KB Output is correct
52 Correct 16 ms 28620 KB Output is correct
53 Correct 16 ms 28620 KB Output is correct
54 Correct 16 ms 28708 KB Output is correct
55 Correct 16 ms 28644 KB Output is correct
56 Correct 16 ms 28620 KB Output is correct
57 Correct 16 ms 28632 KB Output is correct
58 Correct 17 ms 28600 KB Output is correct
59 Correct 17 ms 28688 KB Output is correct
60 Correct 16 ms 28620 KB Output is correct
61 Correct 17 ms 28696 KB Output is correct
62 Correct 16 ms 28632 KB Output is correct
63 Correct 16 ms 28620 KB Output is correct
64 Correct 16 ms 28680 KB Output is correct
65 Correct 17 ms 28620 KB Output is correct
66 Correct 127 ms 48820 KB Output is correct
67 Correct 138 ms 48864 KB Output is correct
68 Correct 181 ms 54732 KB Output is correct
69 Correct 156 ms 51620 KB Output is correct
70 Correct 160 ms 48364 KB Output is correct
71 Correct 203 ms 53844 KB Output is correct
72 Correct 190 ms 53036 KB Output is correct
73 Correct 207 ms 54356 KB Output is correct
74 Correct 195 ms 51804 KB Output is correct
75 Correct 188 ms 50704 KB Output is correct
76 Correct 129 ms 44704 KB Output is correct
77 Correct 158 ms 44580 KB Output is correct
78 Correct 119 ms 43404 KB Output is correct
79 Correct 150 ms 43268 KB Output is correct
80 Correct 87 ms 40400 KB Output is correct
81 Correct 84 ms 40216 KB Output is correct
82 Correct 20 ms 28748 KB Output is correct
83 Correct 19 ms 28752 KB Output is correct
84 Correct 19 ms 28732 KB Output is correct
85 Correct 19 ms 28636 KB Output is correct
86 Correct 19 ms 28620 KB Output is correct
87 Correct 18 ms 28620 KB Output is correct
88 Correct 17 ms 28924 KB Output is correct
89 Correct 18 ms 28980 KB Output is correct
90 Correct 18 ms 28980 KB Output is correct
91 Correct 18 ms 29024 KB Output is correct
92 Correct 18 ms 28952 KB Output is correct
93 Correct 18 ms 29044 KB Output is correct
94 Correct 18 ms 29076 KB Output is correct
95 Correct 17 ms 29004 KB Output is correct
96 Correct 18 ms 29004 KB Output is correct
97 Correct 18 ms 28988 KB Output is correct
98 Correct 17 ms 28884 KB Output is correct
99 Correct 17 ms 28980 KB Output is correct
100 Correct 18 ms 28876 KB Output is correct
101 Correct 18 ms 28896 KB Output is correct
102 Correct 17 ms 28876 KB Output is correct
103 Correct 17 ms 28748 KB Output is correct
104 Correct 18 ms 28928 KB Output is correct
105 Correct 18 ms 28840 KB Output is correct
106 Correct 18 ms 28948 KB Output is correct
107 Correct 19 ms 28856 KB Output is correct
108 Correct 205 ms 56692 KB Output is correct
109 Correct 189 ms 56860 KB Output is correct
110 Correct 192 ms 56756 KB Output is correct
111 Correct 185 ms 56804 KB Output is correct
112 Correct 185 ms 56784 KB Output is correct
113 Correct 245 ms 69708 KB Output is correct
114 Correct 208 ms 64216 KB Output is correct
115 Correct 217 ms 62376 KB Output is correct
116 Correct 212 ms 60628 KB Output is correct
117 Correct 185 ms 56748 KB Output is correct
118 Correct 214 ms 56664 KB Output is correct
119 Correct 222 ms 56708 KB Output is correct
120 Correct 185 ms 56712 KB Output is correct
121 Correct 168 ms 54384 KB Output is correct
122 Correct 149 ms 51420 KB Output is correct
123 Correct 93 ms 42848 KB Output is correct
124 Correct 105 ms 53432 KB Output is correct
125 Correct 107 ms 53164 KB Output is correct
126 Correct 111 ms 53212 KB Output is correct
127 Correct 112 ms 53188 KB Output is correct
128 Correct 17 ms 28876 KB Output is correct
129 Correct 18 ms 28916 KB Output is correct
130 Correct 17 ms 28948 KB Output is correct
131 Correct 18 ms 28876 KB Output is correct
132 Correct 19 ms 28748 KB Output is correct
133 Correct 17 ms 28828 KB Output is correct
134 Correct 17 ms 28736 KB Output is correct
135 Correct 17 ms 28736 KB Output is correct
136 Correct 17 ms 28748 KB Output is correct
137 Correct 16 ms 28732 KB Output is correct
138 Correct 17 ms 28748 KB Output is correct
139 Correct 20 ms 29004 KB Output is correct
140 Correct 18 ms 28984 KB Output is correct
141 Correct 18 ms 28936 KB Output is correct
142 Correct 18 ms 28868 KB Output is correct
143 Correct 17 ms 28876 KB Output is correct
144 Correct 17 ms 28876 KB Output is correct
145 Correct 18 ms 28864 KB Output is correct
146 Correct 17 ms 28792 KB Output is correct
147 Correct 18 ms 28736 KB Output is correct
148 Correct 20 ms 28912 KB Output is correct
149 Correct 18 ms 28860 KB Output is correct
150 Correct 17 ms 28876 KB Output is correct
151 Correct 19 ms 28876 KB Output is correct
152 Correct 17 ms 28704 KB Output is correct
153 Correct 17 ms 28620 KB Output is correct
154 Correct 16 ms 28628 KB Output is correct
155 Correct 189 ms 56756 KB Output is correct
156 Correct 191 ms 57344 KB Output is correct
157 Correct 208 ms 54008 KB Output is correct
158 Correct 180 ms 49196 KB Output is correct
159 Correct 171 ms 43476 KB Output is correct
160 Correct 142 ms 41596 KB Output is correct
161 Correct 151 ms 40208 KB Output is correct
162 Correct 131 ms 38864 KB Output is correct
163 Correct 122 ms 38364 KB Output is correct
164 Correct 128 ms 37992 KB Output is correct
165 Correct 137 ms 37452 KB Output is correct
166 Correct 134 ms 36964 KB Output is correct
167 Correct 123 ms 36900 KB Output is correct
168 Correct 151 ms 39504 KB Output is correct
169 Correct 263 ms 61872 KB Output is correct
170 Correct 212 ms 59156 KB Output is correct
171 Correct 220 ms 58480 KB Output is correct
172 Correct 213 ms 55932 KB Output is correct
173 Correct 196 ms 49320 KB Output is correct
174 Correct 220 ms 49364 KB Output is correct
175 Correct 218 ms 49228 KB Output is correct
176 Correct 156 ms 46192 KB Output is correct
177 Correct 166 ms 42868 KB Output is correct
178 Correct 190 ms 52808 KB Output is correct
179 Correct 198 ms 52948 KB Output is correct
180 Correct 177 ms 50160 KB Output is correct
181 Correct 199 ms 50104 KB Output is correct
182 Correct 15 ms 28632 KB Output is correct
183 Correct 16 ms 28816 KB Output is correct
184 Correct 18 ms 28832 KB Output is correct
185 Correct 18 ms 28852 KB Output is correct
186 Correct 17 ms 28748 KB Output is correct
187 Correct 17 ms 28748 KB Output is correct
188 Correct 17 ms 28748 KB Output is correct
189 Correct 17 ms 28840 KB Output is correct
190 Correct 17 ms 28744 KB Output is correct
191 Correct 17 ms 28832 KB Output is correct
192 Correct 17 ms 28620 KB Output is correct
193 Correct 18 ms 28876 KB Output is correct
194 Correct 17 ms 28964 KB Output is correct
195 Correct 16 ms 28748 KB Output is correct
196 Correct 16 ms 28748 KB Output is correct
197 Correct 17 ms 28748 KB Output is correct
198 Correct 17 ms 28832 KB Output is correct
199 Correct 17 ms 28748 KB Output is correct
200 Correct 18 ms 28868 KB Output is correct
201 Correct 18 ms 28984 KB Output is correct
202 Correct 18 ms 28748 KB Output is correct
203 Correct 17 ms 28840 KB Output is correct
204 Correct 18 ms 28748 KB Output is correct
205 Correct 17 ms 28772 KB Output is correct
206 Correct 17 ms 28804 KB Output is correct
207 Correct 17 ms 28748 KB Output is correct
208 Correct 18 ms 28804 KB Output is correct
209 Correct 19 ms 28576 KB Output is correct
210 Correct 118 ms 43156 KB Output is correct
211 Correct 149 ms 46908 KB Output is correct
212 Correct 211 ms 46160 KB Output is correct
213 Correct 240 ms 46692 KB Output is correct
214 Correct 88 ms 42564 KB Output is correct
215 Correct 88 ms 40524 KB Output is correct
216 Correct 207 ms 49508 KB Output is correct
217 Correct 157 ms 44180 KB Output is correct
218 Correct 125 ms 38584 KB Output is correct
219 Correct 113 ms 37504 KB Output is correct
220 Correct 112 ms 37048 KB Output is correct
221 Correct 110 ms 36732 KB Output is correct
222 Correct 150 ms 38412 KB Output is correct
223 Correct 174 ms 49228 KB Output is correct
224 Correct 216 ms 47544 KB Output is correct
225 Correct 173 ms 42704 KB Output is correct
226 Correct 184 ms 42684 KB Output is correct
227 Correct 191 ms 42692 KB Output is correct
228 Correct 171 ms 41384 KB Output is correct
229 Correct 135 ms 39512 KB Output is correct
230 Correct 152 ms 42416 KB Output is correct
231 Correct 177 ms 42508 KB Output is correct