답안 #280064

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
280064 2020-08-22T13:13:13 Z oolimry 철인 이종 경기 (APIO18_duathlon) C++14
100 / 100
407 ms 58808 KB
#include <bits/stdc++.h>

using namespace std;
int n, m;
typedef vector<int> vi;
typedef pair<int,int> ii;
struct node{
    int depth = -1;
    int low;
    int parent;
    bool vis = false;
    bool isArti = false;
    vi adj;
};
vector<unordered_set<int> > biconnected;
stack<int> s; ///this is only needed for biconnected components
///note: this will ignore single nodes with no edges
static node g[200005];
int rootChildren = 0;
void dfs(int u){
    if(g[u].depth == -1) g[u].depth = g[g[u].parent].depth + 1;
    g[u].low = g[u].depth;
    g[u].vis = true;
    for(int i = 0;i < g[u].adj.size();i++){
        int v = g[u].adj[i];
        if(!g[v].vis){
            g[v].parent = u;
            if(g[u].depth == 0) rootChildren++;
            s.push(u); ///s traces the path of tree traversal
            dfs(v);
            g[u].low = min(g[u].low,g[v].low);

            if(g[v].low >= g[u].depth){
                g[u].isArti = true;
                g[u].low = min(g[u].low,g[v].low);
                unordered_set<int> newSet;
                int nn;
                biconnected.push_back(newSet); ///create new biconnected component
                do{
                    assert(!s.empty());
                    nn = s.top();
                    s.pop();
                    biconnected.back().insert(nn);
                }while(nn != u);
            }
        }
        else if(v != g[u].parent){
            g[u].low = min(g[u].low,g[v].depth); ///g[v].depth not num!!!!!!
        }
        
    }
    s.push(u);
}
struct node2{
    long long sz;
    long long dp = 0;
    bool isArti = false;
    bool vis = false;
    int r;
    int p = -1;
    vi adj;
};

vector<node2> bct; ///block-cut tree
long long root = -1;
void dp(int u){
    if(bct[u].vis) return;
    bct[u].vis = true;
    bct[u].dp = bct[u].sz;
    bct[u].r = root;
    for(int i = 0;i < bct[u].adj.size();i++){
        int v = bct[u].adj[i];
        if(bct[v].vis) continue;
        bct[v].p = u;
        dp(v);
        bct[u].dp += bct[v].dp;
    }
}
int main()
{
    cin >> n >> m;
    ii edges[m];
    for(int i = 0;i < m;i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].adj.push_back(b);
        g[b].adj.push_back(a);
        edges[i] = ii(a,b);
    }

    for(int i = 0;i < n;i++){
        if(!g[i].vis){
            rootChildren = 0;
            g[i].depth = 0;
            dfs(i);
            if(rootChildren > 1) g[i].isArti = true;
            else g[i].isArti = false; ///this line is needed
        }
    }
    unordered_map<int,int> artis;
    for(int i = 0;i < n;i++){
        if(g[i].isArti){
            artis[i] = bct.size();
            node2 nn;
            nn.sz = 1;
            nn.isArti = true;
            bct.push_back(nn);
        }
    }


    for(int i = 0;i < biconnected.size();i++){
        node2 nn;
        nn.sz = biconnected[i].size();
        nn.isArti = false;
        for(unordered_set<int>::iterator it = biconnected[i].begin();it != biconnected[i].end();it++){
            if(artis.find(*it) != artis.end()){
                nn.adj.push_back(artis[*it]);
                bct[artis[*it]].adj.push_back(bct.size());
                nn.sz--;
            }
        }
        bct.push_back(nn);
    }
    for(int i = 0;i < bct.size();i++){
        root = i;
        dp(i);
    }

    long long ans = 0ll;
    for(int i = 0;i < bct.size();i++){
        vector<long long> branches;
        vector<long long> branchStart;
        long long total = 0ll;
        for(int j = 0;j < bct[i].adj.size();j++){
            if(bct[i].adj[j] != bct[i].p){
                branches.push_back(bct[bct[i].adj[j]].dp);
                branchStart.push_back(bct[bct[i].adj[j]].sz);
            }
        }
        if(bct[i].p >= 0){
            branches.push_back(bct[bct[i].r].dp - bct[i].dp);
            branchStart.push_back(bct[bct[i].p].sz);
        }
        for(int j = 0;j < branches.size();j++) total += branches[j];
        long long extra = 0ll;
        if(!bct[i].isArti) extra = max(0ll,(long long)(bct[i].adj.size())-2);
        for(int j = 0;j < branches.size();j++){

            ///branch1 to self or neighbor articulation point to branch2
            ans += branches[j] * (total - branches[j]) * (bct[i].sz + extra);

            ///branch to self to self or self to self to branch
            ans += 2 * (bct[i].sz) * (bct[i].sz - 1) * branches[j];


            if(bct[i].isArti){
                ///direct branch to self to same branch(not reverse) or its reverse
                ans += 2ll * bct[i].sz * branchStart[j] * (branches[j] - branchStart[j]);
                ///direct branch to self to direct or its reverse
                ans += bct[i].sz * (branchStart[j]) * (branchStart[j] - 1);

            }
        }

        ///self to self to self
        ans += (bct[i].sz) * (bct[i].sz - 1) * (bct[i].sz - 2);
    }
    cout << ans;
}

Compilation message

count_triplets.cpp: In function 'void dfs(int)':
count_triplets.cpp:24:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int i = 0;i < g[u].adj.size();i++){
      |                   ~~^~~~~~~~~~~~~~~~~
count_triplets.cpp: In function 'void dp(int)':
count_triplets.cpp:71:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   71 |     for(int i = 0;i < bct[u].adj.size();i++){
      |                   ~~^~~~~~~~~~~~~~~~~~~
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:114:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::unordered_set<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  114 |     for(int i = 0;i < biconnected.size();i++){
      |                   ~~^~~~~~~~~~~~~~~~~~~~
count_triplets.cpp:127:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<node2>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  127 |     for(int i = 0;i < bct.size();i++){
      |                   ~~^~~~~~~~~~~~
count_triplets.cpp:133:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<node2>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  133 |     for(int i = 0;i < bct.size();i++){
      |                   ~~^~~~~~~~~~~~
count_triplets.cpp:137:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  137 |         for(int j = 0;j < bct[i].adj.size();j++){
      |                       ~~^~~~~~~~~~~~~~~~~~~
count_triplets.cpp:147:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  147 |         for(int j = 0;j < branches.size();j++) total += branches[j];
      |                       ~~^~~~~~~~~~~~~~~~~
count_triplets.cpp:150:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  150 |         for(int j = 0;j < branches.size();j++){
      |                       ~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 6 ms 8192 KB Output is correct
6 Correct 5 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 5 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 6 ms 8192 KB Output is correct
16 Correct 6 ms 8192 KB Output is correct
17 Correct 6 ms 8192 KB Output is correct
18 Correct 6 ms 8192 KB Output is correct
19 Correct 11 ms 8192 KB Output is correct
20 Correct 5 ms 8192 KB Output is correct
21 Correct 6 ms 8192 KB Output is correct
22 Correct 7 ms 8192 KB Output is correct
23 Correct 6 ms 8192 KB Output is correct
24 Correct 6 ms 8192 KB Output is correct
25 Correct 5 ms 8192 KB Output is correct
26 Correct 6 ms 8192 KB Output is correct
27 Correct 6 ms 8192 KB Output is correct
28 Correct 6 ms 8192 KB Output is correct
29 Correct 6 ms 8192 KB Output is correct
30 Correct 5 ms 8192 KB Output is correct
31 Correct 12 ms 8192 KB Output is correct
32 Correct 7 ms 8192 KB Output is correct
33 Correct 6 ms 8192 KB Output is correct
34 Correct 5 ms 8192 KB Output is correct
35 Correct 5 ms 8192 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 6 ms 8192 KB Output is correct
6 Correct 5 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 5 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 6 ms 8192 KB Output is correct
16 Correct 6 ms 8192 KB Output is correct
17 Correct 6 ms 8192 KB Output is correct
18 Correct 6 ms 8192 KB Output is correct
19 Correct 11 ms 8192 KB Output is correct
20 Correct 5 ms 8192 KB Output is correct
21 Correct 6 ms 8192 KB Output is correct
22 Correct 7 ms 8192 KB Output is correct
23 Correct 6 ms 8192 KB Output is correct
24 Correct 6 ms 8192 KB Output is correct
25 Correct 5 ms 8192 KB Output is correct
26 Correct 6 ms 8192 KB Output is correct
27 Correct 6 ms 8192 KB Output is correct
28 Correct 6 ms 8192 KB Output is correct
29 Correct 6 ms 8192 KB Output is correct
30 Correct 5 ms 8192 KB Output is correct
31 Correct 12 ms 8192 KB Output is correct
32 Correct 7 ms 8192 KB Output is correct
33 Correct 6 ms 8192 KB Output is correct
34 Correct 5 ms 8192 KB Output is correct
35 Correct 5 ms 8192 KB Output is correct
36 Correct 6 ms 8192 KB Output is correct
37 Correct 6 ms 8192 KB Output is correct
38 Correct 5 ms 8192 KB Output is correct
39 Correct 6 ms 8192 KB Output is correct
40 Correct 6 ms 8192 KB Output is correct
41 Correct 6 ms 8192 KB Output is correct
42 Correct 5 ms 8188 KB Output is correct
43 Correct 5 ms 8200 KB Output is correct
44 Correct 5 ms 8192 KB Output is correct
45 Correct 6 ms 8192 KB Output is correct
46 Correct 5 ms 8192 KB Output is correct
47 Correct 6 ms 8192 KB Output is correct
48 Correct 5 ms 8192 KB Output is correct
49 Correct 6 ms 8192 KB Output is correct
50 Correct 7 ms 8200 KB Output is correct
51 Correct 6 ms 8192 KB Output is correct
52 Correct 6 ms 8192 KB Output is correct
53 Correct 5 ms 8192 KB Output is correct
54 Correct 5 ms 8192 KB Output is correct
55 Correct 5 ms 8192 KB Output is correct
56 Correct 6 ms 8192 KB Output is correct
57 Correct 5 ms 8192 KB Output is correct
58 Correct 5 ms 8192 KB Output is correct
59 Correct 6 ms 8192 KB Output is correct
60 Correct 6 ms 8192 KB Output is correct
61 Correct 5 ms 8192 KB Output is correct
62 Correct 5 ms 8192 KB Output is correct
63 Correct 6 ms 8192 KB Output is correct
64 Correct 6 ms 8192 KB Output is correct
65 Correct 6 ms 8192 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 208 ms 33460 KB Output is correct
2 Correct 221 ms 33564 KB Output is correct
3 Correct 305 ms 41908 KB Output is correct
4 Correct 258 ms 37704 KB Output is correct
5 Correct 268 ms 37916 KB Output is correct
6 Correct 329 ms 40556 KB Output is correct
7 Correct 337 ms 39864 KB Output is correct
8 Correct 332 ms 41084 KB Output is correct
9 Correct 346 ms 38320 KB Output is correct
10 Correct 320 ms 37184 KB Output is correct
11 Correct 237 ms 32188 KB Output is correct
12 Correct 244 ms 32064 KB Output is correct
13 Correct 207 ms 31556 KB Output is correct
14 Correct 203 ms 31172 KB Output is correct
15 Correct 154 ms 24900 KB Output is correct
16 Correct 171 ms 24520 KB Output is correct
17 Correct 9 ms 8576 KB Output is correct
18 Correct 9 ms 8576 KB Output is correct
19 Correct 13 ms 8576 KB Output is correct
20 Correct 8 ms 8576 KB Output is correct
21 Correct 13 ms 8576 KB Output is correct
22 Correct 8 ms 8576 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 8576 KB Output is correct
2 Correct 8 ms 8576 KB Output is correct
3 Correct 7 ms 8576 KB Output is correct
4 Correct 9 ms 8704 KB Output is correct
5 Correct 8 ms 8576 KB Output is correct
6 Correct 8 ms 8576 KB Output is correct
7 Correct 8 ms 8704 KB Output is correct
8 Correct 8 ms 8576 KB Output is correct
9 Correct 7 ms 8576 KB Output is correct
10 Correct 7 ms 8576 KB Output is correct
11 Correct 8 ms 8576 KB Output is correct
12 Correct 8 ms 8576 KB Output is correct
13 Correct 7 ms 8576 KB Output is correct
14 Correct 11 ms 8448 KB Output is correct
15 Correct 7 ms 8448 KB Output is correct
16 Correct 7 ms 8320 KB Output is correct
17 Correct 7 ms 8448 KB Output is correct
18 Correct 7 ms 8448 KB Output is correct
19 Correct 7 ms 8448 KB Output is correct
20 Correct 7 ms 8448 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 322 ms 50380 KB Output is correct
2 Correct 370 ms 50332 KB Output is correct
3 Correct 349 ms 50360 KB Output is correct
4 Correct 343 ms 50360 KB Output is correct
5 Correct 350 ms 50364 KB Output is correct
6 Correct 407 ms 58808 KB Output is correct
7 Correct 388 ms 55940 KB Output is correct
8 Correct 371 ms 54456 KB Output is correct
9 Correct 367 ms 53096 KB Output is correct
10 Correct 331 ms 50312 KB Output is correct
11 Correct 327 ms 50416 KB Output is correct
12 Correct 335 ms 50368 KB Output is correct
13 Correct 353 ms 50360 KB Output is correct
14 Correct 349 ms 48568 KB Output is correct
15 Correct 276 ms 39096 KB Output is correct
16 Correct 154 ms 29888 KB Output is correct
17 Correct 226 ms 41240 KB Output is correct
18 Correct 226 ms 41268 KB Output is correct
19 Correct 228 ms 41268 KB Output is correct
20 Correct 222 ms 41276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 8576 KB Output is correct
2 Correct 7 ms 8576 KB Output is correct
3 Correct 8 ms 8576 KB Output is correct
4 Correct 7 ms 8448 KB Output is correct
5 Correct 7 ms 8320 KB Output is correct
6 Correct 8 ms 8320 KB Output is correct
7 Correct 7 ms 8320 KB Output is correct
8 Correct 6 ms 8320 KB Output is correct
9 Correct 6 ms 8320 KB Output is correct
10 Correct 6 ms 8320 KB Output is correct
11 Correct 6 ms 8320 KB Output is correct
12 Correct 7 ms 8576 KB Output is correct
13 Correct 9 ms 8576 KB Output is correct
14 Correct 7 ms 8576 KB Output is correct
15 Correct 9 ms 8576 KB Output is correct
16 Correct 7 ms 8448 KB Output is correct
17 Correct 7 ms 8448 KB Output is correct
18 Correct 7 ms 8448 KB Output is correct
19 Correct 7 ms 8448 KB Output is correct
20 Correct 8 ms 8320 KB Output is correct
21 Correct 8 ms 8448 KB Output is correct
22 Correct 8 ms 8448 KB Output is correct
23 Correct 7 ms 8472 KB Output is correct
24 Correct 9 ms 8448 KB Output is correct
25 Correct 5 ms 8192 KB Output is correct
26 Correct 6 ms 8192 KB Output is correct
27 Correct 5 ms 8192 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 330 ms 50332 KB Output is correct
2 Correct 347 ms 50224 KB Output is correct
3 Correct 355 ms 48948 KB Output is correct
4 Correct 335 ms 35480 KB Output is correct
5 Correct 289 ms 28456 KB Output is correct
6 Correct 246 ms 25800 KB Output is correct
7 Correct 247 ms 25164 KB Output is correct
8 Correct 240 ms 21848 KB Output is correct
9 Correct 243 ms 21464 KB Output is correct
10 Correct 224 ms 20048 KB Output is correct
11 Correct 227 ms 19068 KB Output is correct
12 Correct 203 ms 18556 KB Output is correct
13 Correct 203 ms 18552 KB Output is correct
14 Correct 199 ms 21868 KB Output is correct
15 Correct 386 ms 55316 KB Output is correct
16 Correct 372 ms 53180 KB Output is correct
17 Correct 379 ms 46120 KB Output is correct
18 Correct 382 ms 43924 KB Output is correct
19 Correct 330 ms 35524 KB Output is correct
20 Correct 326 ms 35524 KB Output is correct
21 Correct 317 ms 35520 KB Output is correct
22 Correct 301 ms 33960 KB Output is correct
23 Correct 245 ms 27716 KB Output is correct
24 Correct 297 ms 41152 KB Output is correct
25 Correct 331 ms 41144 KB Output is correct
26 Correct 309 ms 38196 KB Output is correct
27 Correct 309 ms 38200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 6 ms 8192 KB Output is correct
6 Correct 5 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 5 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 6 ms 8192 KB Output is correct
16 Correct 6 ms 8192 KB Output is correct
17 Correct 6 ms 8192 KB Output is correct
18 Correct 6 ms 8192 KB Output is correct
19 Correct 11 ms 8192 KB Output is correct
20 Correct 5 ms 8192 KB Output is correct
21 Correct 6 ms 8192 KB Output is correct
22 Correct 7 ms 8192 KB Output is correct
23 Correct 6 ms 8192 KB Output is correct
24 Correct 6 ms 8192 KB Output is correct
25 Correct 5 ms 8192 KB Output is correct
26 Correct 6 ms 8192 KB Output is correct
27 Correct 6 ms 8192 KB Output is correct
28 Correct 6 ms 8192 KB Output is correct
29 Correct 6 ms 8192 KB Output is correct
30 Correct 5 ms 8192 KB Output is correct
31 Correct 12 ms 8192 KB Output is correct
32 Correct 7 ms 8192 KB Output is correct
33 Correct 6 ms 8192 KB Output is correct
34 Correct 5 ms 8192 KB Output is correct
35 Correct 5 ms 8192 KB Output is correct
36 Correct 6 ms 8192 KB Output is correct
37 Correct 6 ms 8192 KB Output is correct
38 Correct 5 ms 8192 KB Output is correct
39 Correct 6 ms 8192 KB Output is correct
40 Correct 6 ms 8192 KB Output is correct
41 Correct 6 ms 8192 KB Output is correct
42 Correct 5 ms 8188 KB Output is correct
43 Correct 5 ms 8200 KB Output is correct
44 Correct 5 ms 8192 KB Output is correct
45 Correct 6 ms 8192 KB Output is correct
46 Correct 5 ms 8192 KB Output is correct
47 Correct 6 ms 8192 KB Output is correct
48 Correct 5 ms 8192 KB Output is correct
49 Correct 6 ms 8192 KB Output is correct
50 Correct 7 ms 8200 KB Output is correct
51 Correct 6 ms 8192 KB Output is correct
52 Correct 6 ms 8192 KB Output is correct
53 Correct 5 ms 8192 KB Output is correct
54 Correct 5 ms 8192 KB Output is correct
55 Correct 5 ms 8192 KB Output is correct
56 Correct 6 ms 8192 KB Output is correct
57 Correct 5 ms 8192 KB Output is correct
58 Correct 5 ms 8192 KB Output is correct
59 Correct 6 ms 8192 KB Output is correct
60 Correct 6 ms 8192 KB Output is correct
61 Correct 5 ms 8192 KB Output is correct
62 Correct 5 ms 8192 KB Output is correct
63 Correct 6 ms 8192 KB Output is correct
64 Correct 6 ms 8192 KB Output is correct
65 Correct 6 ms 8192 KB Output is correct
66 Correct 6 ms 8192 KB Output is correct
67 Correct 7 ms 8352 KB Output is correct
68 Correct 9 ms 8448 KB Output is correct
69 Correct 7 ms 8320 KB Output is correct
70 Correct 10 ms 8320 KB Output is correct
71 Correct 8 ms 8320 KB Output is correct
72 Correct 7 ms 8320 KB Output is correct
73 Correct 7 ms 8320 KB Output is correct
74 Correct 8 ms 8420 KB Output is correct
75 Correct 7 ms 8320 KB Output is correct
76 Correct 6 ms 8192 KB Output is correct
77 Correct 8 ms 8448 KB Output is correct
78 Correct 8 ms 8320 KB Output is correct
79 Correct 8 ms 8320 KB Output is correct
80 Correct 8 ms 8320 KB Output is correct
81 Correct 7 ms 8320 KB Output is correct
82 Correct 6 ms 8320 KB Output is correct
83 Correct 6 ms 8320 KB Output is correct
84 Correct 8 ms 8448 KB Output is correct
85 Correct 8 ms 8448 KB Output is correct
86 Correct 7 ms 8320 KB Output is correct
87 Correct 9 ms 8320 KB Output is correct
88 Correct 8 ms 8320 KB Output is correct
89 Correct 7 ms 8320 KB Output is correct
90 Correct 7 ms 8320 KB Output is correct
91 Correct 7 ms 8320 KB Output is correct
92 Correct 8 ms 8320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 6 ms 8192 KB Output is correct
6 Correct 5 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 5 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 6 ms 8192 KB Output is correct
16 Correct 6 ms 8192 KB Output is correct
17 Correct 6 ms 8192 KB Output is correct
18 Correct 6 ms 8192 KB Output is correct
19 Correct 11 ms 8192 KB Output is correct
20 Correct 5 ms 8192 KB Output is correct
21 Correct 6 ms 8192 KB Output is correct
22 Correct 7 ms 8192 KB Output is correct
23 Correct 6 ms 8192 KB Output is correct
24 Correct 6 ms 8192 KB Output is correct
25 Correct 5 ms 8192 KB Output is correct
26 Correct 6 ms 8192 KB Output is correct
27 Correct 6 ms 8192 KB Output is correct
28 Correct 6 ms 8192 KB Output is correct
29 Correct 6 ms 8192 KB Output is correct
30 Correct 5 ms 8192 KB Output is correct
31 Correct 12 ms 8192 KB Output is correct
32 Correct 7 ms 8192 KB Output is correct
33 Correct 6 ms 8192 KB Output is correct
34 Correct 5 ms 8192 KB Output is correct
35 Correct 5 ms 8192 KB Output is correct
36 Correct 6 ms 8192 KB Output is correct
37 Correct 6 ms 8192 KB Output is correct
38 Correct 5 ms 8192 KB Output is correct
39 Correct 6 ms 8192 KB Output is correct
40 Correct 6 ms 8192 KB Output is correct
41 Correct 6 ms 8192 KB Output is correct
42 Correct 5 ms 8188 KB Output is correct
43 Correct 5 ms 8200 KB Output is correct
44 Correct 5 ms 8192 KB Output is correct
45 Correct 6 ms 8192 KB Output is correct
46 Correct 5 ms 8192 KB Output is correct
47 Correct 6 ms 8192 KB Output is correct
48 Correct 5 ms 8192 KB Output is correct
49 Correct 6 ms 8192 KB Output is correct
50 Correct 7 ms 8200 KB Output is correct
51 Correct 6 ms 8192 KB Output is correct
52 Correct 6 ms 8192 KB Output is correct
53 Correct 5 ms 8192 KB Output is correct
54 Correct 5 ms 8192 KB Output is correct
55 Correct 5 ms 8192 KB Output is correct
56 Correct 6 ms 8192 KB Output is correct
57 Correct 5 ms 8192 KB Output is correct
58 Correct 5 ms 8192 KB Output is correct
59 Correct 6 ms 8192 KB Output is correct
60 Correct 6 ms 8192 KB Output is correct
61 Correct 5 ms 8192 KB Output is correct
62 Correct 5 ms 8192 KB Output is correct
63 Correct 6 ms 8192 KB Output is correct
64 Correct 6 ms 8192 KB Output is correct
65 Correct 6 ms 8192 KB Output is correct
66 Correct 208 ms 33460 KB Output is correct
67 Correct 221 ms 33564 KB Output is correct
68 Correct 305 ms 41908 KB Output is correct
69 Correct 258 ms 37704 KB Output is correct
70 Correct 268 ms 37916 KB Output is correct
71 Correct 329 ms 40556 KB Output is correct
72 Correct 337 ms 39864 KB Output is correct
73 Correct 332 ms 41084 KB Output is correct
74 Correct 346 ms 38320 KB Output is correct
75 Correct 320 ms 37184 KB Output is correct
76 Correct 237 ms 32188 KB Output is correct
77 Correct 244 ms 32064 KB Output is correct
78 Correct 207 ms 31556 KB Output is correct
79 Correct 203 ms 31172 KB Output is correct
80 Correct 154 ms 24900 KB Output is correct
81 Correct 171 ms 24520 KB Output is correct
82 Correct 9 ms 8576 KB Output is correct
83 Correct 9 ms 8576 KB Output is correct
84 Correct 13 ms 8576 KB Output is correct
85 Correct 8 ms 8576 KB Output is correct
86 Correct 13 ms 8576 KB Output is correct
87 Correct 8 ms 8576 KB Output is correct
88 Correct 8 ms 8576 KB Output is correct
89 Correct 8 ms 8576 KB Output is correct
90 Correct 7 ms 8576 KB Output is correct
91 Correct 9 ms 8704 KB Output is correct
92 Correct 8 ms 8576 KB Output is correct
93 Correct 8 ms 8576 KB Output is correct
94 Correct 8 ms 8704 KB Output is correct
95 Correct 8 ms 8576 KB Output is correct
96 Correct 7 ms 8576 KB Output is correct
97 Correct 7 ms 8576 KB Output is correct
98 Correct 8 ms 8576 KB Output is correct
99 Correct 8 ms 8576 KB Output is correct
100 Correct 7 ms 8576 KB Output is correct
101 Correct 11 ms 8448 KB Output is correct
102 Correct 7 ms 8448 KB Output is correct
103 Correct 7 ms 8320 KB Output is correct
104 Correct 7 ms 8448 KB Output is correct
105 Correct 7 ms 8448 KB Output is correct
106 Correct 7 ms 8448 KB Output is correct
107 Correct 7 ms 8448 KB Output is correct
108 Correct 322 ms 50380 KB Output is correct
109 Correct 370 ms 50332 KB Output is correct
110 Correct 349 ms 50360 KB Output is correct
111 Correct 343 ms 50360 KB Output is correct
112 Correct 350 ms 50364 KB Output is correct
113 Correct 407 ms 58808 KB Output is correct
114 Correct 388 ms 55940 KB Output is correct
115 Correct 371 ms 54456 KB Output is correct
116 Correct 367 ms 53096 KB Output is correct
117 Correct 331 ms 50312 KB Output is correct
118 Correct 327 ms 50416 KB Output is correct
119 Correct 335 ms 50368 KB Output is correct
120 Correct 353 ms 50360 KB Output is correct
121 Correct 349 ms 48568 KB Output is correct
122 Correct 276 ms 39096 KB Output is correct
123 Correct 154 ms 29888 KB Output is correct
124 Correct 226 ms 41240 KB Output is correct
125 Correct 226 ms 41268 KB Output is correct
126 Correct 228 ms 41268 KB Output is correct
127 Correct 222 ms 41276 KB Output is correct
128 Correct 9 ms 8576 KB Output is correct
129 Correct 7 ms 8576 KB Output is correct
130 Correct 8 ms 8576 KB Output is correct
131 Correct 7 ms 8448 KB Output is correct
132 Correct 7 ms 8320 KB Output is correct
133 Correct 8 ms 8320 KB Output is correct
134 Correct 7 ms 8320 KB Output is correct
135 Correct 6 ms 8320 KB Output is correct
136 Correct 6 ms 8320 KB Output is correct
137 Correct 6 ms 8320 KB Output is correct
138 Correct 6 ms 8320 KB Output is correct
139 Correct 7 ms 8576 KB Output is correct
140 Correct 9 ms 8576 KB Output is correct
141 Correct 7 ms 8576 KB Output is correct
142 Correct 9 ms 8576 KB Output is correct
143 Correct 7 ms 8448 KB Output is correct
144 Correct 7 ms 8448 KB Output is correct
145 Correct 7 ms 8448 KB Output is correct
146 Correct 7 ms 8448 KB Output is correct
147 Correct 8 ms 8320 KB Output is correct
148 Correct 8 ms 8448 KB Output is correct
149 Correct 8 ms 8448 KB Output is correct
150 Correct 7 ms 8472 KB Output is correct
151 Correct 9 ms 8448 KB Output is correct
152 Correct 5 ms 8192 KB Output is correct
153 Correct 6 ms 8192 KB Output is correct
154 Correct 5 ms 8192 KB Output is correct
155 Correct 330 ms 50332 KB Output is correct
156 Correct 347 ms 50224 KB Output is correct
157 Correct 355 ms 48948 KB Output is correct
158 Correct 335 ms 35480 KB Output is correct
159 Correct 289 ms 28456 KB Output is correct
160 Correct 246 ms 25800 KB Output is correct
161 Correct 247 ms 25164 KB Output is correct
162 Correct 240 ms 21848 KB Output is correct
163 Correct 243 ms 21464 KB Output is correct
164 Correct 224 ms 20048 KB Output is correct
165 Correct 227 ms 19068 KB Output is correct
166 Correct 203 ms 18556 KB Output is correct
167 Correct 203 ms 18552 KB Output is correct
168 Correct 199 ms 21868 KB Output is correct
169 Correct 386 ms 55316 KB Output is correct
170 Correct 372 ms 53180 KB Output is correct
171 Correct 379 ms 46120 KB Output is correct
172 Correct 382 ms 43924 KB Output is correct
173 Correct 330 ms 35524 KB Output is correct
174 Correct 326 ms 35524 KB Output is correct
175 Correct 317 ms 35520 KB Output is correct
176 Correct 301 ms 33960 KB Output is correct
177 Correct 245 ms 27716 KB Output is correct
178 Correct 297 ms 41152 KB Output is correct
179 Correct 331 ms 41144 KB Output is correct
180 Correct 309 ms 38196 KB Output is correct
181 Correct 309 ms 38200 KB Output is correct
182 Correct 6 ms 8192 KB Output is correct
183 Correct 7 ms 8352 KB Output is correct
184 Correct 9 ms 8448 KB Output is correct
185 Correct 7 ms 8320 KB Output is correct
186 Correct 10 ms 8320 KB Output is correct
187 Correct 8 ms 8320 KB Output is correct
188 Correct 7 ms 8320 KB Output is correct
189 Correct 7 ms 8320 KB Output is correct
190 Correct 8 ms 8420 KB Output is correct
191 Correct 7 ms 8320 KB Output is correct
192 Correct 6 ms 8192 KB Output is correct
193 Correct 8 ms 8448 KB Output is correct
194 Correct 8 ms 8320 KB Output is correct
195 Correct 8 ms 8320 KB Output is correct
196 Correct 8 ms 8320 KB Output is correct
197 Correct 7 ms 8320 KB Output is correct
198 Correct 6 ms 8320 KB Output is correct
199 Correct 6 ms 8320 KB Output is correct
200 Correct 8 ms 8448 KB Output is correct
201 Correct 8 ms 8448 KB Output is correct
202 Correct 7 ms 8320 KB Output is correct
203 Correct 9 ms 8320 KB Output is correct
204 Correct 8 ms 8320 KB Output is correct
205 Correct 7 ms 8320 KB Output is correct
206 Correct 7 ms 8320 KB Output is correct
207 Correct 7 ms 8320 KB Output is correct
208 Correct 8 ms 8320 KB Output is correct
209 Correct 7 ms 8576 KB Output is correct
210 Correct 160 ms 29636 KB Output is correct
211 Correct 251 ms 31680 KB Output is correct
212 Correct 306 ms 33352 KB Output is correct
213 Correct 374 ms 32312 KB Output is correct
214 Correct 204 ms 27844 KB Output is correct
215 Correct 210 ms 25800 KB Output is correct
216 Correct 328 ms 38216 KB Output is correct
217 Correct 295 ms 29376 KB Output is correct
218 Correct 239 ms 22224 KB Output is correct
219 Correct 225 ms 19864 KB Output is correct
220 Correct 219 ms 18836 KB Output is correct
221 Correct 210 ms 18168 KB Output is correct
222 Correct 203 ms 20088 KB Output is correct
223 Correct 332 ms 37700 KB Output is correct
224 Correct 333 ms 36544 KB Output is correct
225 Correct 301 ms 28292 KB Output is correct
226 Correct 301 ms 28280 KB Output is correct
227 Correct 296 ms 28488 KB Output is correct
228 Correct 283 ms 26056 KB Output is correct
229 Correct 220 ms 23248 KB Output is correct
230 Correct 262 ms 28616 KB Output is correct
231 Correct 276 ms 28696 KB Output is correct