답안 #569096

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
569096 2022-05-26T16:19:51 Z SSRS 철인 이종 경기 (APIO18_duathlon) C++14
100 / 100
327 ms 46736 KB
#include <bits/stdc++.h>
using namespace std;
struct biconnected_components{
  int cnt;
  vector<int> bcc;
  biconnected_components(vector<vector<pair<int, int>>> &E){
    int N = E.size();
    vector<int> next(N, -1);
    vector<int> d(N, -1);
    vector<int> imos(N, 0);
    for (int i = 0; i < N; i++){
      if (d[i] == -1){
        d[i] = 0;
        dfs1(E, next, d, imos, i);
      }
    }
    int M = 0;
    for (int i = 0; i < N; i++){
      M += E[i].size();
    }
    M /= 2;
    bcc = vector<int>(M, -1);
    cnt = 0;
    for (int i = 0; i < N; i++){
      if (d[i] == 0){
        dfs2(E, d, imos, cnt, i);
      }
    }
  }
  void dfs1(vector<vector<pair<int, int>>> &E, vector<int> &next, vector<int> &d, vector<int> &imos, int v){
    for (auto P : E[v]){
      int w = P.second;
      if (d[w] == -1){
        d[w] = d[v] + 1;
        next[v] = w;
        dfs1(E, next, d, imos, w);
        imos[v] += imos[w];
      } else if (d[w] < d[v] - 1){
        imos[v]++;
        imos[next[w]]--;
      }
    }
  }
  void dfs2(vector<vector<pair<int, int>>> &E, vector<int> &d, vector<int> &imos, int b, int v){
    for (auto P : E[v]){
      int x = P.first;
      int w = P.second;
      if (d[w] < d[v]){
        bcc[x] = b;
      } else if (d[w] == d[v] + 1 && bcc[x] == -1){
        if (imos[w] > 0){
          bcc[x] = b;
        } else {
          bcc[x] = cnt;
          cnt++;
        }
        dfs2(E, d, imos, bcc[x], w);
      }
    }
  }
  int operator [](int k){
    return bcc[k];
  }
  int count(){
    return cnt;
  }
};
struct block_cut_tree{
  int V;
  vector<bool> cut;
  vector<vector<int>> G;
  vector<vector<int>> node;
  block_cut_tree(vector<vector<int>> &E){
    int N = E.size();
    int M = 0;
    vector<vector<pair<int, int>>> E2(N);
    for (int i = 0; i < N; i++){
      for (int j : E[i]){
        if (j > i){
          E2[i].push_back(make_pair(M, j));
          E2[j].push_back(make_pair(M, i));
          M++;
        }
      }
    }
    biconnected_components B(E2);
    vector<bool> art(N, false);
    int cnt = 0;
    for (int i = 0; i < N; i++){
      for (auto P : E2[i]){
        if (B[P.first] != B[E2[i][0].first]){
          art[i] = true;
        }
      }
      if (E2[i].empty()){
        art[i] = true;
      }
      if (art[i]){
        cnt++;
      }
    }
    V = cnt + B.count();
    cut = vector<bool>(V, false);
    G.resize(V);
    node.resize(V);
    int cnt2 = 0;
    vector<bool> used(B.count(), false);
    for (int i = 0; i < N; i++){
      if (art[i]){
        cut[cnt2] = true;
        node[cnt2].push_back(i);
        for (auto P : E2[i]){
          int b = B[P.first];
          if (!used[b]){
            used[b] = true;
            G[cnt + b].push_back(cnt2);
            G[cnt2].push_back(cnt + b);
            node[cnt + b].push_back(i);
          }
        }
        for (auto P : E2[i]){
          int b = B[P.first];
          used[b] = false;
        }
        cnt2++;
      } else {
        if (!E2[i].empty()){
          int b = B[E2[i][0].first];
          node[cnt + b].push_back(i);
        }
      }
    }
  }
};
int main(){
  int n, m;
  cin >> n >> m;
  vector<vector<int>> E(n);
  for (int i = 0; i < m; i++){
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    E[u].push_back(v);
    E[v].push_back(u);
  }
  block_cut_tree T(E);
  vector<int> id(n, -1);
  for (int i = 0; i < T.V; i++){
    for (int j : T.node[i]){
      if (id[j] == -1){
        id[j] = i;
      }
    }
  }
  vector<int> p(T.V, -1);
  vector<vector<int>> c(T.V);
  vector<int> r(T.V);
  vector<int> bfs;
  for (int i = 0; i < T.V; i++){
    if (p[i] == -1){
      queue<int> Q;
      Q.push(i);
      while (!Q.empty()){
        int v = Q.front();
        Q.pop();
        r[v] = i;
        bfs.push_back(v);
        for (int w : T.G[v]){
          if (w != p[v]){
            p[w] = v;
            c[v].push_back(w);
           Q.push(w);
          }
        }
      }
    }
  }
  reverse(bfs.begin(), bfs.end());
  vector<int> dp(T.V, 0);
  for (int i = 0; i < n; i++){
    dp[id[i]]++;
  }
  for (int v : bfs){
    for (int w : c[v]){
      dp[v] += dp[w];
    }
  }
  vector<long long> sum(T.V, 0);
  for (int i = 0; i < T.V; i++){
    for (int w : c[i]){
      sum[i] += (long long) dp[w] * (dp[w] - 1);
    }
  }
  long long ans = 0;
  for (int i = 0; i < T.V; i++){
    if (p[i] == -1){
      ans += (long long) dp[i] * (dp[i] - 1) * (dp[i] - 2);
    }
  }
  for (int i = 0; i < n; i++){
    if (!T.cut[id[i]]){
      ans -= sum[id[i]];
      ans -= (long long) (dp[r[id[i]]] - dp[id[i]]) * (dp[r[id[i]]] - dp[id[i]]  - 1);
    } else {
      for (int j : c[id[i]]){
        ans -= sum[j];
      }
      if (p[id[i]] != -1){
        ans -= sum[p[id[i]]];
        ans += (long long) dp[id[i]] * (dp[id[i]] -  1);
        ans -= (long long) (dp[r[id[i]]] - dp[p[id[i]]]) * (dp[r[id[i]]] - dp[p[id[i]]] - 1);
      }
    }
  }
  cout << ans << endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 300 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 296 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 304 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 300 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 296 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 304 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 300 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 296 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 300 KB Output is correct
41 Correct 1 ms 296 KB Output is correct
42 Correct 1 ms 300 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 296 KB Output is correct
51 Correct 1 ms 304 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 1 ms 300 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 1 ms 296 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 175 ms 18180 KB Output is correct
2 Correct 150 ms 18268 KB Output is correct
3 Correct 214 ms 27820 KB Output is correct
4 Correct 177 ms 22776 KB Output is correct
5 Correct 190 ms 22396 KB Output is correct
6 Correct 197 ms 30244 KB Output is correct
7 Correct 214 ms 31096 KB Output is correct
8 Correct 220 ms 31684 KB Output is correct
9 Correct 265 ms 30712 KB Output is correct
10 Correct 208 ms 27416 KB Output is correct
11 Correct 144 ms 20420 KB Output is correct
12 Correct 144 ms 20728 KB Output is correct
13 Correct 135 ms 19336 KB Output is correct
14 Correct 183 ms 19392 KB Output is correct
15 Correct 110 ms 17136 KB Output is correct
16 Correct 93 ms 17304 KB Output is correct
17 Correct 19 ms 15660 KB Output is correct
18 Correct 20 ms 15724 KB Output is correct
19 Correct 19 ms 15636 KB Output is correct
20 Correct 20 ms 15636 KB Output is correct
21 Correct 20 ms 15720 KB Output is correct
22 Correct 25 ms 15664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 2 ms 596 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 2 ms 724 KB Output is correct
5 Correct 2 ms 596 KB Output is correct
6 Correct 2 ms 596 KB Output is correct
7 Correct 2 ms 724 KB Output is correct
8 Correct 2 ms 596 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 2 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Correct 2 ms 584 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 2 ms 600 KB Output is correct
15 Correct 2 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 1 ms 468 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 2 ms 468 KB Output is correct
20 Correct 2 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 256 ms 33436 KB Output is correct
2 Correct 260 ms 33204 KB Output is correct
3 Correct 317 ms 33212 KB Output is correct
4 Correct 233 ms 33312 KB Output is correct
5 Correct 298 ms 33340 KB Output is correct
6 Correct 324 ms 46736 KB Output is correct
7 Correct 298 ms 40192 KB Output is correct
8 Correct 314 ms 38792 KB Output is correct
9 Correct 327 ms 37740 KB Output is correct
10 Correct 248 ms 33180 KB Output is correct
11 Correct 260 ms 33128 KB Output is correct
12 Correct 251 ms 33224 KB Output is correct
13 Correct 298 ms 33128 KB Output is correct
14 Correct 250 ms 30956 KB Output is correct
15 Correct 223 ms 27724 KB Output is correct
16 Correct 117 ms 20396 KB Output is correct
17 Correct 143 ms 24164 KB Output is correct
18 Correct 152 ms 24120 KB Output is correct
19 Correct 181 ms 24292 KB Output is correct
20 Correct 137 ms 24232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 2 ms 596 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 2 ms 468 KB Output is correct
5 Correct 2 ms 476 KB Output is correct
6 Correct 2 ms 468 KB Output is correct
7 Correct 2 ms 340 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 2 ms 340 KB Output is correct
12 Correct 3 ms 596 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 2 ms 596 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 2 ms 468 KB Output is correct
17 Correct 2 ms 568 KB Output is correct
18 Correct 2 ms 468 KB Output is correct
19 Correct 2 ms 432 KB Output is correct
20 Correct 2 ms 468 KB Output is correct
21 Correct 2 ms 468 KB Output is correct
22 Correct 3 ms 564 KB Output is correct
23 Correct 2 ms 468 KB Output is correct
24 Correct 2 ms 468 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 272 ms 33152 KB Output is correct
2 Correct 310 ms 35292 KB Output is correct
3 Correct 286 ms 31952 KB Output is correct
4 Correct 277 ms 26084 KB Output is correct
5 Correct 227 ms 19796 KB Output is correct
6 Correct 216 ms 17404 KB Output is correct
7 Correct 201 ms 16120 KB Output is correct
8 Correct 171 ms 14928 KB Output is correct
9 Correct 189 ms 14388 KB Output is correct
10 Correct 168 ms 14064 KB Output is correct
11 Correct 166 ms 13160 KB Output is correct
12 Correct 161 ms 13072 KB Output is correct
13 Correct 160 ms 12948 KB Output is correct
14 Correct 150 ms 13960 KB Output is correct
15 Correct 324 ms 36712 KB Output is correct
16 Correct 289 ms 34820 KB Output is correct
17 Correct 326 ms 32220 KB Output is correct
18 Correct 252 ms 30768 KB Output is correct
19 Correct 252 ms 26440 KB Output is correct
20 Correct 251 ms 27820 KB Output is correct
21 Correct 279 ms 27752 KB Output is correct
22 Correct 241 ms 24668 KB Output is correct
23 Correct 178 ms 20292 KB Output is correct
24 Correct 196 ms 30004 KB Output is correct
25 Correct 242 ms 30252 KB Output is correct
26 Correct 247 ms 27792 KB Output is correct
27 Correct 247 ms 27512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 300 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 296 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 304 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 300 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 296 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 300 KB Output is correct
41 Correct 1 ms 296 KB Output is correct
42 Correct 1 ms 300 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 296 KB Output is correct
51 Correct 1 ms 304 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 1 ms 300 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 1 ms 296 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 432 KB Output is correct
68 Correct 2 ms 432 KB Output is correct
69 Correct 2 ms 436 KB Output is correct
70 Correct 2 ms 496 KB Output is correct
71 Correct 2 ms 468 KB Output is correct
72 Correct 2 ms 468 KB Output is correct
73 Correct 1 ms 468 KB Output is correct
74 Correct 2 ms 468 KB Output is correct
75 Correct 2 ms 436 KB Output is correct
76 Correct 1 ms 212 KB Output is correct
77 Correct 2 ms 468 KB Output is correct
78 Correct 2 ms 432 KB Output is correct
79 Correct 2 ms 340 KB Output is correct
80 Correct 2 ms 428 KB Output is correct
81 Correct 2 ms 340 KB Output is correct
82 Correct 2 ms 340 KB Output is correct
83 Correct 2 ms 468 KB Output is correct
84 Correct 2 ms 468 KB Output is correct
85 Correct 2 ms 468 KB Output is correct
86 Correct 2 ms 436 KB Output is correct
87 Correct 3 ms 436 KB Output is correct
88 Correct 2 ms 468 KB Output is correct
89 Correct 2 ms 388 KB Output is correct
90 Correct 2 ms 340 KB Output is correct
91 Correct 3 ms 468 KB Output is correct
92 Correct 3 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 300 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 296 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 304 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 300 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 296 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 300 KB Output is correct
41 Correct 1 ms 296 KB Output is correct
42 Correct 1 ms 300 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 296 KB Output is correct
51 Correct 1 ms 304 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 1 ms 300 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 1 ms 296 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 175 ms 18180 KB Output is correct
67 Correct 150 ms 18268 KB Output is correct
68 Correct 214 ms 27820 KB Output is correct
69 Correct 177 ms 22776 KB Output is correct
70 Correct 190 ms 22396 KB Output is correct
71 Correct 197 ms 30244 KB Output is correct
72 Correct 214 ms 31096 KB Output is correct
73 Correct 220 ms 31684 KB Output is correct
74 Correct 265 ms 30712 KB Output is correct
75 Correct 208 ms 27416 KB Output is correct
76 Correct 144 ms 20420 KB Output is correct
77 Correct 144 ms 20728 KB Output is correct
78 Correct 135 ms 19336 KB Output is correct
79 Correct 183 ms 19392 KB Output is correct
80 Correct 110 ms 17136 KB Output is correct
81 Correct 93 ms 17304 KB Output is correct
82 Correct 19 ms 15660 KB Output is correct
83 Correct 20 ms 15724 KB Output is correct
84 Correct 19 ms 15636 KB Output is correct
85 Correct 20 ms 15636 KB Output is correct
86 Correct 20 ms 15720 KB Output is correct
87 Correct 25 ms 15664 KB Output is correct
88 Correct 2 ms 596 KB Output is correct
89 Correct 2 ms 596 KB Output is correct
90 Correct 2 ms 596 KB Output is correct
91 Correct 2 ms 724 KB Output is correct
92 Correct 2 ms 596 KB Output is correct
93 Correct 2 ms 596 KB Output is correct
94 Correct 2 ms 724 KB Output is correct
95 Correct 2 ms 596 KB Output is correct
96 Correct 2 ms 596 KB Output is correct
97 Correct 2 ms 596 KB Output is correct
98 Correct 2 ms 596 KB Output is correct
99 Correct 2 ms 584 KB Output is correct
100 Correct 2 ms 596 KB Output is correct
101 Correct 2 ms 600 KB Output is correct
102 Correct 2 ms 468 KB Output is correct
103 Correct 1 ms 468 KB Output is correct
104 Correct 1 ms 468 KB Output is correct
105 Correct 1 ms 468 KB Output is correct
106 Correct 2 ms 468 KB Output is correct
107 Correct 2 ms 468 KB Output is correct
108 Correct 256 ms 33436 KB Output is correct
109 Correct 260 ms 33204 KB Output is correct
110 Correct 317 ms 33212 KB Output is correct
111 Correct 233 ms 33312 KB Output is correct
112 Correct 298 ms 33340 KB Output is correct
113 Correct 324 ms 46736 KB Output is correct
114 Correct 298 ms 40192 KB Output is correct
115 Correct 314 ms 38792 KB Output is correct
116 Correct 327 ms 37740 KB Output is correct
117 Correct 248 ms 33180 KB Output is correct
118 Correct 260 ms 33128 KB Output is correct
119 Correct 251 ms 33224 KB Output is correct
120 Correct 298 ms 33128 KB Output is correct
121 Correct 250 ms 30956 KB Output is correct
122 Correct 223 ms 27724 KB Output is correct
123 Correct 117 ms 20396 KB Output is correct
124 Correct 143 ms 24164 KB Output is correct
125 Correct 152 ms 24120 KB Output is correct
126 Correct 181 ms 24292 KB Output is correct
127 Correct 137 ms 24232 KB Output is correct
128 Correct 2 ms 596 KB Output is correct
129 Correct 2 ms 596 KB Output is correct
130 Correct 2 ms 596 KB Output is correct
131 Correct 2 ms 468 KB Output is correct
132 Correct 2 ms 476 KB Output is correct
133 Correct 2 ms 468 KB Output is correct
134 Correct 2 ms 340 KB Output is correct
135 Correct 2 ms 340 KB Output is correct
136 Correct 2 ms 340 KB Output is correct
137 Correct 1 ms 340 KB Output is correct
138 Correct 2 ms 340 KB Output is correct
139 Correct 3 ms 596 KB Output is correct
140 Correct 2 ms 596 KB Output is correct
141 Correct 2 ms 596 KB Output is correct
142 Correct 2 ms 596 KB Output is correct
143 Correct 2 ms 468 KB Output is correct
144 Correct 2 ms 568 KB Output is correct
145 Correct 2 ms 468 KB Output is correct
146 Correct 2 ms 432 KB Output is correct
147 Correct 2 ms 468 KB Output is correct
148 Correct 2 ms 468 KB Output is correct
149 Correct 3 ms 564 KB Output is correct
150 Correct 2 ms 468 KB Output is correct
151 Correct 2 ms 468 KB Output is correct
152 Correct 1 ms 340 KB Output is correct
153 Correct 1 ms 340 KB Output is correct
154 Correct 1 ms 340 KB Output is correct
155 Correct 272 ms 33152 KB Output is correct
156 Correct 310 ms 35292 KB Output is correct
157 Correct 286 ms 31952 KB Output is correct
158 Correct 277 ms 26084 KB Output is correct
159 Correct 227 ms 19796 KB Output is correct
160 Correct 216 ms 17404 KB Output is correct
161 Correct 201 ms 16120 KB Output is correct
162 Correct 171 ms 14928 KB Output is correct
163 Correct 189 ms 14388 KB Output is correct
164 Correct 168 ms 14064 KB Output is correct
165 Correct 166 ms 13160 KB Output is correct
166 Correct 161 ms 13072 KB Output is correct
167 Correct 160 ms 12948 KB Output is correct
168 Correct 150 ms 13960 KB Output is correct
169 Correct 324 ms 36712 KB Output is correct
170 Correct 289 ms 34820 KB Output is correct
171 Correct 326 ms 32220 KB Output is correct
172 Correct 252 ms 30768 KB Output is correct
173 Correct 252 ms 26440 KB Output is correct
174 Correct 251 ms 27820 KB Output is correct
175 Correct 279 ms 27752 KB Output is correct
176 Correct 241 ms 24668 KB Output is correct
177 Correct 178 ms 20292 KB Output is correct
178 Correct 196 ms 30004 KB Output is correct
179 Correct 242 ms 30252 KB Output is correct
180 Correct 247 ms 27792 KB Output is correct
181 Correct 247 ms 27512 KB Output is correct
182 Correct 1 ms 340 KB Output is correct
183 Correct 1 ms 432 KB Output is correct
184 Correct 2 ms 432 KB Output is correct
185 Correct 2 ms 436 KB Output is correct
186 Correct 2 ms 496 KB Output is correct
187 Correct 2 ms 468 KB Output is correct
188 Correct 2 ms 468 KB Output is correct
189 Correct 1 ms 468 KB Output is correct
190 Correct 2 ms 468 KB Output is correct
191 Correct 2 ms 436 KB Output is correct
192 Correct 1 ms 212 KB Output is correct
193 Correct 2 ms 468 KB Output is correct
194 Correct 2 ms 432 KB Output is correct
195 Correct 2 ms 340 KB Output is correct
196 Correct 2 ms 428 KB Output is correct
197 Correct 2 ms 340 KB Output is correct
198 Correct 2 ms 340 KB Output is correct
199 Correct 2 ms 468 KB Output is correct
200 Correct 2 ms 468 KB Output is correct
201 Correct 2 ms 468 KB Output is correct
202 Correct 2 ms 436 KB Output is correct
203 Correct 3 ms 436 KB Output is correct
204 Correct 2 ms 468 KB Output is correct
205 Correct 2 ms 388 KB Output is correct
206 Correct 2 ms 340 KB Output is correct
207 Correct 3 ms 468 KB Output is correct
208 Correct 3 ms 468 KB Output is correct
209 Correct 20 ms 15668 KB Output is correct
210 Correct 133 ms 23404 KB Output is correct
211 Correct 197 ms 23612 KB Output is correct
212 Correct 250 ms 22164 KB Output is correct
213 Correct 270 ms 23084 KB Output is correct
214 Correct 124 ms 20212 KB Output is correct
215 Correct 128 ms 18636 KB Output is correct
216 Correct 257 ms 26072 KB Output is correct
217 Correct 249 ms 21212 KB Output is correct
218 Correct 187 ms 16292 KB Output is correct
219 Correct 183 ms 14896 KB Output is correct
220 Correct 168 ms 14408 KB Output is correct
221 Correct 127 ms 14156 KB Output is correct
222 Correct 140 ms 14844 KB Output is correct
223 Correct 260 ms 24376 KB Output is correct
224 Correct 246 ms 23336 KB Output is correct
225 Correct 208 ms 20276 KB Output is correct
226 Correct 230 ms 20276 KB Output is correct
227 Correct 202 ms 20164 KB Output is correct
228 Correct 195 ms 18660 KB Output is correct
229 Correct 196 ms 16428 KB Output is correct
230 Correct 211 ms 18964 KB Output is correct
231 Correct 214 ms 19132 KB Output is correct