Submission #713286

# Submission time Handle Problem Language Result Execution time Memory
713286 2023-03-21T15:54:11 Z MohammadAghil Duathlon (APIO18_duathlon) C++17
100 / 100
794 ms 57628 KB
      #include <bits/stdc++.h>
//   #pragma GCC optimize ("Ofast,unroll-loops")
// #pragma GCC target ("avx2")
 using namespace std;
  typedef long long ll;
   typedef pair<int, int> pp;
     #define per(i,r,l) for(int i = (r); i >= (l); i--)
       #define rep(i,l,r) for(int i = (l); i < (r); i++)
          #define all(x) begin(x), end(x)
             #define sz(x) (int)(x).size()
                 #define pb push_back
                     #define ss second
                          #define ff first
                                  void err(istringstream *iss){}template<typename T,typename ...Args> void err(istringstream *iss,const T &_val, const Args&...args){string _name;*iss>>_name;if(_name.back()==',')_name.pop_back();cerr<<_name<<" = "<<_val<<", ",err(iss,args...);}
void IOS(){
     cin.tie(0) -> sync_with_stdio(0);
     #ifndef ONLINE_JUDGE
          #define er(args ...) cerr << __LINE__ << ": ", err(new istringstream(string(#args)), args), cerr << endl
          // freopen("inp.txt", "r", stdin);
          // freopen("out.txt", "w", stdout);
     #else
          #define er(args ...) 0
     #endif
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod = 998244353, maxn = 4e5 + 5, lg = 22, inf = ll(1e9) + 5;
ll pw(ll a,ll b,ll md=mod){if(!b)return 1;ll k=pw(a,b>>1ll,md);return k*k%md*(b&1ll?a:1)%md;}

struct DSU{
     int par[maxn], cnt[maxn];
     bool f = false;
     DSU(bool f): f(f){
          fill(par, par + maxn, -1);
          fill(cnt, cnt + maxn, 1);
     }
     int get(int x){
          return par[x] == -1? x: (f? par[x] = get(par[x]): get(par[x]));
     }
     vector<pp> his;
     void unite(int u, int v){
          u = get(u), v = get(v);
          if(u - v){
               if(cnt[u] < cnt[v]) swap(u, v);
               par[v] = u, cnt[u] += v;
               his.pb({u, v});
          } else his.pb({-1, -1});
     }
     void undo(){
          auto[u, v] = his.back(); his.pop_back();
          if(u + 1){
               par[v] = -1, cnt[u] -= cnt[v];
          }
     } 
} node(false), edge(true);


vector<pp> adj[maxn];
vector<int> str[maxn];
bool vis[maxn], act[maxn];

void dvd(int l, int r){
     if(l + 1 == r){
          vector<int> tmp;
          for(auto[c, e]: adj[l]){
               int x = node.get(c);
               tmp.pb(x);
               str[x].pb(e);
          }
          for(int x: tmp) if(!vis[x]){
               vis[x] = true;
               rep(i,1,sz(str[x])){
                    edge.unite(str[x][i-1], str[x][i]);
               } 
               str[x].clear();
          }
          for(int x: tmp) vis[x] = false;
          return;
     }
     int mid = (l + r)>>1;
     int cnt = 0;
     rep(i,mid,r){
          for(auto[c, e]: adj[i]){
               if(act[c]){
                    node.unite(i, c);
                    cnt++;
               }
          }
          act[i] = true;
     }
     dvd(l, mid);
     while(cnt--) node.undo();
     cnt = 0;
     rep(i,mid,r) act[i] = false;
     rep(i,l,mid){
          for(auto[c, e]: adj[i]){
               if(act[c]){
                    node.unite(i, c);
                    cnt++;
               }
          }
          act[i] = true;
     }
     dvd(mid, r);
     while(cnt--) node.undo();
     rep(i,l,mid) act[i] = false;
}

vector<int> adj2[maxn];
int m, cnt[maxn], val[maxn];
ll ans = 0;

void dfs(int r, int p){
     vis[r] = true;
     cnt[r] = r >= m;
     for(int c: adj2[r]) if(c - p){
          dfs(c, r);
          cnt[r] += cnt[c];
     }
}

void dfs2(int r, int p, int tot){
     if(r >= m){
          for(int c: adj2[r]) if(c - p){
               ans -= 1ll*(tot - cnt[c])*(tot - cnt[c] - 1)*(val[c] - 1);
          }
          if(p + 1){
               ans -= 1ll*(cnt[r])*(cnt[r]-1)*(val[p] - 1);
          }
     }
     for(int c: adj2[r]) if(c - p){
          dfs2(c, r, tot);
     }
}

int main(){ IOS();
     int n; cin >> n >> m;
     rep(i,0,m){
          int u, v; cin >> u >> v; u--, v--;
          adj[u].pb({v, i}), adj[v].pb({u, i});
     }
     dvd(0, n);
     rep(r,0,n){
          vector<int> tmp;
          for(auto[c, e]: adj[r]){
               int x = edge.get(e);
               if(!vis[x]){
                    val[x]++;
                    vis[x] = true;
                    tmp.pb(x);
                    adj2[x].pb(r + m);
                    adj2[r + m].pb(x);
               }
          }
          for(int x: tmp) vis[x] = false;
     }
     rep(i,m,n+m){
          if(!vis[i]){
               dfs(i, -1);
               ans += 1ll*cnt[i]*(cnt[i]-1)*(cnt[i]-2);
               dfs2(i, -1, cnt[i]);
          }
     }
     cout << ans << '\n';
     return 0-0;
}
# Verdict Execution time Memory Grader output
1 Correct 24 ms 34772 KB Output is correct
2 Correct 20 ms 34780 KB Output is correct
3 Correct 18 ms 34772 KB Output is correct
4 Correct 18 ms 34736 KB Output is correct
5 Correct 20 ms 34764 KB Output is correct
6 Correct 17 ms 34772 KB Output is correct
7 Correct 18 ms 34732 KB Output is correct
8 Correct 17 ms 34772 KB Output is correct
9 Correct 20 ms 34760 KB Output is correct
10 Correct 17 ms 34772 KB Output is correct
11 Correct 17 ms 34772 KB Output is correct
12 Correct 19 ms 34704 KB Output is correct
13 Correct 19 ms 34688 KB Output is correct
14 Correct 19 ms 34772 KB Output is correct
15 Correct 17 ms 34772 KB Output is correct
16 Correct 17 ms 34792 KB Output is correct
17 Correct 17 ms 34760 KB Output is correct
18 Correct 16 ms 34772 KB Output is correct
19 Correct 18 ms 34732 KB Output is correct
20 Correct 17 ms 34744 KB Output is correct
21 Correct 18 ms 34772 KB Output is correct
22 Correct 17 ms 34772 KB Output is correct
23 Correct 17 ms 34792 KB Output is correct
24 Correct 17 ms 34728 KB Output is correct
25 Correct 16 ms 34772 KB Output is correct
26 Correct 18 ms 34772 KB Output is correct
27 Correct 17 ms 34780 KB Output is correct
28 Correct 18 ms 34704 KB Output is correct
29 Correct 17 ms 34680 KB Output is correct
30 Correct 18 ms 34716 KB Output is correct
31 Correct 17 ms 34772 KB Output is correct
32 Correct 17 ms 34772 KB Output is correct
33 Correct 17 ms 34772 KB Output is correct
34 Correct 19 ms 34688 KB Output is correct
35 Correct 20 ms 34724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 34772 KB Output is correct
2 Correct 20 ms 34780 KB Output is correct
3 Correct 18 ms 34772 KB Output is correct
4 Correct 18 ms 34736 KB Output is correct
5 Correct 20 ms 34764 KB Output is correct
6 Correct 17 ms 34772 KB Output is correct
7 Correct 18 ms 34732 KB Output is correct
8 Correct 17 ms 34772 KB Output is correct
9 Correct 20 ms 34760 KB Output is correct
10 Correct 17 ms 34772 KB Output is correct
11 Correct 17 ms 34772 KB Output is correct
12 Correct 19 ms 34704 KB Output is correct
13 Correct 19 ms 34688 KB Output is correct
14 Correct 19 ms 34772 KB Output is correct
15 Correct 17 ms 34772 KB Output is correct
16 Correct 17 ms 34792 KB Output is correct
17 Correct 17 ms 34760 KB Output is correct
18 Correct 16 ms 34772 KB Output is correct
19 Correct 18 ms 34732 KB Output is correct
20 Correct 17 ms 34744 KB Output is correct
21 Correct 18 ms 34772 KB Output is correct
22 Correct 17 ms 34772 KB Output is correct
23 Correct 17 ms 34792 KB Output is correct
24 Correct 17 ms 34728 KB Output is correct
25 Correct 16 ms 34772 KB Output is correct
26 Correct 18 ms 34772 KB Output is correct
27 Correct 17 ms 34780 KB Output is correct
28 Correct 18 ms 34704 KB Output is correct
29 Correct 17 ms 34680 KB Output is correct
30 Correct 18 ms 34716 KB Output is correct
31 Correct 17 ms 34772 KB Output is correct
32 Correct 17 ms 34772 KB Output is correct
33 Correct 17 ms 34772 KB Output is correct
34 Correct 19 ms 34688 KB Output is correct
35 Correct 20 ms 34724 KB Output is correct
36 Correct 18 ms 34772 KB Output is correct
37 Correct 17 ms 34784 KB Output is correct
38 Correct 17 ms 34712 KB Output is correct
39 Correct 17 ms 34736 KB Output is correct
40 Correct 18 ms 34776 KB Output is correct
41 Correct 17 ms 34712 KB Output is correct
42 Correct 17 ms 34788 KB Output is correct
43 Correct 20 ms 34680 KB Output is correct
44 Correct 19 ms 34788 KB Output is correct
45 Correct 22 ms 34772 KB Output is correct
46 Correct 18 ms 34772 KB Output is correct
47 Correct 19 ms 34684 KB Output is correct
48 Correct 19 ms 34780 KB Output is correct
49 Correct 18 ms 34728 KB Output is correct
50 Correct 17 ms 34768 KB Output is correct
51 Correct 17 ms 34716 KB Output is correct
52 Correct 18 ms 34692 KB Output is correct
53 Correct 18 ms 34784 KB Output is correct
54 Correct 17 ms 34748 KB Output is correct
55 Correct 21 ms 34736 KB Output is correct
56 Correct 18 ms 34736 KB Output is correct
57 Correct 17 ms 34708 KB Output is correct
58 Correct 17 ms 34772 KB Output is correct
59 Correct 17 ms 34772 KB Output is correct
60 Correct 17 ms 34772 KB Output is correct
61 Correct 21 ms 34780 KB Output is correct
62 Correct 18 ms 34736 KB Output is correct
63 Correct 18 ms 34772 KB Output is correct
64 Correct 18 ms 34784 KB Output is correct
65 Correct 18 ms 34784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 294 ms 46276 KB Output is correct
2 Correct 306 ms 46128 KB Output is correct
3 Correct 330 ms 54564 KB Output is correct
4 Correct 317 ms 49916 KB Output is correct
5 Correct 307 ms 51984 KB Output is correct
6 Correct 373 ms 53512 KB Output is correct
7 Correct 328 ms 51224 KB Output is correct
8 Correct 364 ms 51716 KB Output is correct
9 Correct 348 ms 49904 KB Output is correct
10 Correct 375 ms 50172 KB Output is correct
11 Correct 246 ms 47988 KB Output is correct
12 Correct 263 ms 47488 KB Output is correct
13 Correct 219 ms 47616 KB Output is correct
14 Correct 197 ms 47012 KB Output is correct
15 Correct 181 ms 45676 KB Output is correct
16 Correct 172 ms 45328 KB Output is correct
17 Correct 29 ms 35396 KB Output is correct
18 Correct 27 ms 35396 KB Output is correct
19 Correct 28 ms 35376 KB Output is correct
20 Correct 29 ms 35412 KB Output is correct
21 Correct 27 ms 35348 KB Output is correct
22 Correct 27 ms 35264 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 34928 KB Output is correct
2 Correct 19 ms 34852 KB Output is correct
3 Correct 20 ms 34892 KB Output is correct
4 Correct 20 ms 34908 KB Output is correct
5 Correct 21 ms 34896 KB Output is correct
6 Correct 23 ms 34908 KB Output is correct
7 Correct 21 ms 34900 KB Output is correct
8 Correct 21 ms 34880 KB Output is correct
9 Correct 20 ms 34900 KB Output is correct
10 Correct 21 ms 34896 KB Output is correct
11 Correct 20 ms 34884 KB Output is correct
12 Correct 20 ms 34920 KB Output is correct
13 Correct 20 ms 34868 KB Output is correct
14 Correct 21 ms 34920 KB Output is correct
15 Correct 21 ms 34904 KB Output is correct
16 Correct 23 ms 34772 KB Output is correct
17 Correct 19 ms 34900 KB Output is correct
18 Correct 19 ms 34916 KB Output is correct
19 Correct 18 ms 34924 KB Output is correct
20 Correct 19 ms 34920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 589 ms 50584 KB Output is correct
2 Correct 489 ms 50584 KB Output is correct
3 Correct 512 ms 50536 KB Output is correct
4 Correct 505 ms 50700 KB Output is correct
5 Correct 514 ms 50684 KB Output is correct
6 Correct 432 ms 57628 KB Output is correct
7 Correct 400 ms 55408 KB Output is correct
8 Correct 390 ms 54016 KB Output is correct
9 Correct 406 ms 52820 KB Output is correct
10 Correct 500 ms 50648 KB Output is correct
11 Correct 488 ms 50684 KB Output is correct
12 Correct 418 ms 50676 KB Output is correct
13 Correct 355 ms 50592 KB Output is correct
14 Correct 313 ms 49920 KB Output is correct
15 Correct 221 ms 49052 KB Output is correct
16 Correct 142 ms 45332 KB Output is correct
17 Correct 263 ms 52012 KB Output is correct
18 Correct 227 ms 52008 KB Output is correct
19 Correct 245 ms 51936 KB Output is correct
20 Correct 232 ms 52128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 34900 KB Output is correct
2 Correct 19 ms 34852 KB Output is correct
3 Correct 19 ms 34936 KB Output is correct
4 Correct 20 ms 34900 KB Output is correct
5 Correct 20 ms 34912 KB Output is correct
6 Correct 19 ms 34852 KB Output is correct
7 Correct 20 ms 34924 KB Output is correct
8 Correct 21 ms 34900 KB Output is correct
9 Correct 21 ms 34912 KB Output is correct
10 Correct 19 ms 34900 KB Output is correct
11 Correct 20 ms 34820 KB Output is correct
12 Correct 20 ms 35008 KB Output is correct
13 Correct 19 ms 34900 KB Output is correct
14 Correct 21 ms 34996 KB Output is correct
15 Correct 20 ms 34924 KB Output is correct
16 Correct 20 ms 34896 KB Output is correct
17 Correct 20 ms 34920 KB Output is correct
18 Correct 20 ms 34940 KB Output is correct
19 Correct 20 ms 34948 KB Output is correct
20 Correct 20 ms 34852 KB Output is correct
21 Correct 18 ms 34900 KB Output is correct
22 Correct 22 ms 34908 KB Output is correct
23 Correct 19 ms 34936 KB Output is correct
24 Correct 19 ms 34900 KB Output is correct
25 Correct 18 ms 34800 KB Output is correct
26 Correct 20 ms 34752 KB Output is correct
27 Correct 20 ms 34740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 520 ms 50712 KB Output is correct
2 Correct 600 ms 50208 KB Output is correct
3 Correct 591 ms 50308 KB Output is correct
4 Correct 609 ms 49692 KB Output is correct
5 Correct 447 ms 48292 KB Output is correct
6 Correct 462 ms 47644 KB Output is correct
7 Correct 449 ms 47372 KB Output is correct
8 Correct 420 ms 46856 KB Output is correct
9 Correct 442 ms 46676 KB Output is correct
10 Correct 402 ms 46688 KB Output is correct
11 Correct 378 ms 46524 KB Output is correct
12 Correct 292 ms 46160 KB Output is correct
13 Correct 291 ms 46328 KB Output is correct
14 Correct 276 ms 46136 KB Output is correct
15 Correct 480 ms 55892 KB Output is correct
16 Correct 451 ms 54184 KB Output is correct
17 Correct 434 ms 55008 KB Output is correct
18 Correct 451 ms 53364 KB Output is correct
19 Correct 505 ms 49556 KB Output is correct
20 Correct 499 ms 49632 KB Output is correct
21 Correct 399 ms 49600 KB Output is correct
22 Correct 308 ms 49100 KB Output is correct
23 Correct 266 ms 48152 KB Output is correct
24 Correct 493 ms 50864 KB Output is correct
25 Correct 499 ms 50976 KB Output is correct
26 Correct 554 ms 50240 KB Output is correct
27 Correct 541 ms 50316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 34772 KB Output is correct
2 Correct 20 ms 34780 KB Output is correct
3 Correct 18 ms 34772 KB Output is correct
4 Correct 18 ms 34736 KB Output is correct
5 Correct 20 ms 34764 KB Output is correct
6 Correct 17 ms 34772 KB Output is correct
7 Correct 18 ms 34732 KB Output is correct
8 Correct 17 ms 34772 KB Output is correct
9 Correct 20 ms 34760 KB Output is correct
10 Correct 17 ms 34772 KB Output is correct
11 Correct 17 ms 34772 KB Output is correct
12 Correct 19 ms 34704 KB Output is correct
13 Correct 19 ms 34688 KB Output is correct
14 Correct 19 ms 34772 KB Output is correct
15 Correct 17 ms 34772 KB Output is correct
16 Correct 17 ms 34792 KB Output is correct
17 Correct 17 ms 34760 KB Output is correct
18 Correct 16 ms 34772 KB Output is correct
19 Correct 18 ms 34732 KB Output is correct
20 Correct 17 ms 34744 KB Output is correct
21 Correct 18 ms 34772 KB Output is correct
22 Correct 17 ms 34772 KB Output is correct
23 Correct 17 ms 34792 KB Output is correct
24 Correct 17 ms 34728 KB Output is correct
25 Correct 16 ms 34772 KB Output is correct
26 Correct 18 ms 34772 KB Output is correct
27 Correct 17 ms 34780 KB Output is correct
28 Correct 18 ms 34704 KB Output is correct
29 Correct 17 ms 34680 KB Output is correct
30 Correct 18 ms 34716 KB Output is correct
31 Correct 17 ms 34772 KB Output is correct
32 Correct 17 ms 34772 KB Output is correct
33 Correct 17 ms 34772 KB Output is correct
34 Correct 19 ms 34688 KB Output is correct
35 Correct 20 ms 34724 KB Output is correct
36 Correct 18 ms 34772 KB Output is correct
37 Correct 17 ms 34784 KB Output is correct
38 Correct 17 ms 34712 KB Output is correct
39 Correct 17 ms 34736 KB Output is correct
40 Correct 18 ms 34776 KB Output is correct
41 Correct 17 ms 34712 KB Output is correct
42 Correct 17 ms 34788 KB Output is correct
43 Correct 20 ms 34680 KB Output is correct
44 Correct 19 ms 34788 KB Output is correct
45 Correct 22 ms 34772 KB Output is correct
46 Correct 18 ms 34772 KB Output is correct
47 Correct 19 ms 34684 KB Output is correct
48 Correct 19 ms 34780 KB Output is correct
49 Correct 18 ms 34728 KB Output is correct
50 Correct 17 ms 34768 KB Output is correct
51 Correct 17 ms 34716 KB Output is correct
52 Correct 18 ms 34692 KB Output is correct
53 Correct 18 ms 34784 KB Output is correct
54 Correct 17 ms 34748 KB Output is correct
55 Correct 21 ms 34736 KB Output is correct
56 Correct 18 ms 34736 KB Output is correct
57 Correct 17 ms 34708 KB Output is correct
58 Correct 17 ms 34772 KB Output is correct
59 Correct 17 ms 34772 KB Output is correct
60 Correct 17 ms 34772 KB Output is correct
61 Correct 21 ms 34780 KB Output is correct
62 Correct 18 ms 34736 KB Output is correct
63 Correct 18 ms 34772 KB Output is correct
64 Correct 18 ms 34784 KB Output is correct
65 Correct 18 ms 34784 KB Output is correct
66 Correct 19 ms 34772 KB Output is correct
67 Correct 20 ms 34836 KB Output is correct
68 Correct 20 ms 34912 KB Output is correct
69 Correct 19 ms 34936 KB Output is correct
70 Correct 21 ms 34960 KB Output is correct
71 Correct 18 ms 34892 KB Output is correct
72 Correct 22 ms 35156 KB Output is correct
73 Correct 20 ms 34864 KB Output is correct
74 Correct 20 ms 34868 KB Output is correct
75 Correct 22 ms 34916 KB Output is correct
76 Correct 18 ms 34696 KB Output is correct
77 Correct 19 ms 34868 KB Output is correct
78 Correct 19 ms 34900 KB Output is correct
79 Correct 21 ms 34944 KB Output is correct
80 Correct 22 ms 34864 KB Output is correct
81 Correct 24 ms 34856 KB Output is correct
82 Correct 21 ms 34900 KB Output is correct
83 Correct 21 ms 34900 KB Output is correct
84 Correct 20 ms 34900 KB Output is correct
85 Correct 21 ms 34920 KB Output is correct
86 Correct 19 ms 34912 KB Output is correct
87 Correct 20 ms 34912 KB Output is correct
88 Correct 19 ms 34928 KB Output is correct
89 Correct 18 ms 34848 KB Output is correct
90 Correct 19 ms 34920 KB Output is correct
91 Correct 19 ms 34900 KB Output is correct
92 Correct 19 ms 34964 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 34772 KB Output is correct
2 Correct 20 ms 34780 KB Output is correct
3 Correct 18 ms 34772 KB Output is correct
4 Correct 18 ms 34736 KB Output is correct
5 Correct 20 ms 34764 KB Output is correct
6 Correct 17 ms 34772 KB Output is correct
7 Correct 18 ms 34732 KB Output is correct
8 Correct 17 ms 34772 KB Output is correct
9 Correct 20 ms 34760 KB Output is correct
10 Correct 17 ms 34772 KB Output is correct
11 Correct 17 ms 34772 KB Output is correct
12 Correct 19 ms 34704 KB Output is correct
13 Correct 19 ms 34688 KB Output is correct
14 Correct 19 ms 34772 KB Output is correct
15 Correct 17 ms 34772 KB Output is correct
16 Correct 17 ms 34792 KB Output is correct
17 Correct 17 ms 34760 KB Output is correct
18 Correct 16 ms 34772 KB Output is correct
19 Correct 18 ms 34732 KB Output is correct
20 Correct 17 ms 34744 KB Output is correct
21 Correct 18 ms 34772 KB Output is correct
22 Correct 17 ms 34772 KB Output is correct
23 Correct 17 ms 34792 KB Output is correct
24 Correct 17 ms 34728 KB Output is correct
25 Correct 16 ms 34772 KB Output is correct
26 Correct 18 ms 34772 KB Output is correct
27 Correct 17 ms 34780 KB Output is correct
28 Correct 18 ms 34704 KB Output is correct
29 Correct 17 ms 34680 KB Output is correct
30 Correct 18 ms 34716 KB Output is correct
31 Correct 17 ms 34772 KB Output is correct
32 Correct 17 ms 34772 KB Output is correct
33 Correct 17 ms 34772 KB Output is correct
34 Correct 19 ms 34688 KB Output is correct
35 Correct 20 ms 34724 KB Output is correct
36 Correct 18 ms 34772 KB Output is correct
37 Correct 17 ms 34784 KB Output is correct
38 Correct 17 ms 34712 KB Output is correct
39 Correct 17 ms 34736 KB Output is correct
40 Correct 18 ms 34776 KB Output is correct
41 Correct 17 ms 34712 KB Output is correct
42 Correct 17 ms 34788 KB Output is correct
43 Correct 20 ms 34680 KB Output is correct
44 Correct 19 ms 34788 KB Output is correct
45 Correct 22 ms 34772 KB Output is correct
46 Correct 18 ms 34772 KB Output is correct
47 Correct 19 ms 34684 KB Output is correct
48 Correct 19 ms 34780 KB Output is correct
49 Correct 18 ms 34728 KB Output is correct
50 Correct 17 ms 34768 KB Output is correct
51 Correct 17 ms 34716 KB Output is correct
52 Correct 18 ms 34692 KB Output is correct
53 Correct 18 ms 34784 KB Output is correct
54 Correct 17 ms 34748 KB Output is correct
55 Correct 21 ms 34736 KB Output is correct
56 Correct 18 ms 34736 KB Output is correct
57 Correct 17 ms 34708 KB Output is correct
58 Correct 17 ms 34772 KB Output is correct
59 Correct 17 ms 34772 KB Output is correct
60 Correct 17 ms 34772 KB Output is correct
61 Correct 21 ms 34780 KB Output is correct
62 Correct 18 ms 34736 KB Output is correct
63 Correct 18 ms 34772 KB Output is correct
64 Correct 18 ms 34784 KB Output is correct
65 Correct 18 ms 34784 KB Output is correct
66 Correct 294 ms 46276 KB Output is correct
67 Correct 306 ms 46128 KB Output is correct
68 Correct 330 ms 54564 KB Output is correct
69 Correct 317 ms 49916 KB Output is correct
70 Correct 307 ms 51984 KB Output is correct
71 Correct 373 ms 53512 KB Output is correct
72 Correct 328 ms 51224 KB Output is correct
73 Correct 364 ms 51716 KB Output is correct
74 Correct 348 ms 49904 KB Output is correct
75 Correct 375 ms 50172 KB Output is correct
76 Correct 246 ms 47988 KB Output is correct
77 Correct 263 ms 47488 KB Output is correct
78 Correct 219 ms 47616 KB Output is correct
79 Correct 197 ms 47012 KB Output is correct
80 Correct 181 ms 45676 KB Output is correct
81 Correct 172 ms 45328 KB Output is correct
82 Correct 29 ms 35396 KB Output is correct
83 Correct 27 ms 35396 KB Output is correct
84 Correct 28 ms 35376 KB Output is correct
85 Correct 29 ms 35412 KB Output is correct
86 Correct 27 ms 35348 KB Output is correct
87 Correct 27 ms 35264 KB Output is correct
88 Correct 19 ms 34928 KB Output is correct
89 Correct 19 ms 34852 KB Output is correct
90 Correct 20 ms 34892 KB Output is correct
91 Correct 20 ms 34908 KB Output is correct
92 Correct 21 ms 34896 KB Output is correct
93 Correct 23 ms 34908 KB Output is correct
94 Correct 21 ms 34900 KB Output is correct
95 Correct 21 ms 34880 KB Output is correct
96 Correct 20 ms 34900 KB Output is correct
97 Correct 21 ms 34896 KB Output is correct
98 Correct 20 ms 34884 KB Output is correct
99 Correct 20 ms 34920 KB Output is correct
100 Correct 20 ms 34868 KB Output is correct
101 Correct 21 ms 34920 KB Output is correct
102 Correct 21 ms 34904 KB Output is correct
103 Correct 23 ms 34772 KB Output is correct
104 Correct 19 ms 34900 KB Output is correct
105 Correct 19 ms 34916 KB Output is correct
106 Correct 18 ms 34924 KB Output is correct
107 Correct 19 ms 34920 KB Output is correct
108 Correct 589 ms 50584 KB Output is correct
109 Correct 489 ms 50584 KB Output is correct
110 Correct 512 ms 50536 KB Output is correct
111 Correct 505 ms 50700 KB Output is correct
112 Correct 514 ms 50684 KB Output is correct
113 Correct 432 ms 57628 KB Output is correct
114 Correct 400 ms 55408 KB Output is correct
115 Correct 390 ms 54016 KB Output is correct
116 Correct 406 ms 52820 KB Output is correct
117 Correct 500 ms 50648 KB Output is correct
118 Correct 488 ms 50684 KB Output is correct
119 Correct 418 ms 50676 KB Output is correct
120 Correct 355 ms 50592 KB Output is correct
121 Correct 313 ms 49920 KB Output is correct
122 Correct 221 ms 49052 KB Output is correct
123 Correct 142 ms 45332 KB Output is correct
124 Correct 263 ms 52012 KB Output is correct
125 Correct 227 ms 52008 KB Output is correct
126 Correct 245 ms 51936 KB Output is correct
127 Correct 232 ms 52128 KB Output is correct
128 Correct 20 ms 34900 KB Output is correct
129 Correct 19 ms 34852 KB Output is correct
130 Correct 19 ms 34936 KB Output is correct
131 Correct 20 ms 34900 KB Output is correct
132 Correct 20 ms 34912 KB Output is correct
133 Correct 19 ms 34852 KB Output is correct
134 Correct 20 ms 34924 KB Output is correct
135 Correct 21 ms 34900 KB Output is correct
136 Correct 21 ms 34912 KB Output is correct
137 Correct 19 ms 34900 KB Output is correct
138 Correct 20 ms 34820 KB Output is correct
139 Correct 20 ms 35008 KB Output is correct
140 Correct 19 ms 34900 KB Output is correct
141 Correct 21 ms 34996 KB Output is correct
142 Correct 20 ms 34924 KB Output is correct
143 Correct 20 ms 34896 KB Output is correct
144 Correct 20 ms 34920 KB Output is correct
145 Correct 20 ms 34940 KB Output is correct
146 Correct 20 ms 34948 KB Output is correct
147 Correct 20 ms 34852 KB Output is correct
148 Correct 18 ms 34900 KB Output is correct
149 Correct 22 ms 34908 KB Output is correct
150 Correct 19 ms 34936 KB Output is correct
151 Correct 19 ms 34900 KB Output is correct
152 Correct 18 ms 34800 KB Output is correct
153 Correct 20 ms 34752 KB Output is correct
154 Correct 20 ms 34740 KB Output is correct
155 Correct 520 ms 50712 KB Output is correct
156 Correct 600 ms 50208 KB Output is correct
157 Correct 591 ms 50308 KB Output is correct
158 Correct 609 ms 49692 KB Output is correct
159 Correct 447 ms 48292 KB Output is correct
160 Correct 462 ms 47644 KB Output is correct
161 Correct 449 ms 47372 KB Output is correct
162 Correct 420 ms 46856 KB Output is correct
163 Correct 442 ms 46676 KB Output is correct
164 Correct 402 ms 46688 KB Output is correct
165 Correct 378 ms 46524 KB Output is correct
166 Correct 292 ms 46160 KB Output is correct
167 Correct 291 ms 46328 KB Output is correct
168 Correct 276 ms 46136 KB Output is correct
169 Correct 480 ms 55892 KB Output is correct
170 Correct 451 ms 54184 KB Output is correct
171 Correct 434 ms 55008 KB Output is correct
172 Correct 451 ms 53364 KB Output is correct
173 Correct 505 ms 49556 KB Output is correct
174 Correct 499 ms 49632 KB Output is correct
175 Correct 399 ms 49600 KB Output is correct
176 Correct 308 ms 49100 KB Output is correct
177 Correct 266 ms 48152 KB Output is correct
178 Correct 493 ms 50864 KB Output is correct
179 Correct 499 ms 50976 KB Output is correct
180 Correct 554 ms 50240 KB Output is correct
181 Correct 541 ms 50316 KB Output is correct
182 Correct 19 ms 34772 KB Output is correct
183 Correct 20 ms 34836 KB Output is correct
184 Correct 20 ms 34912 KB Output is correct
185 Correct 19 ms 34936 KB Output is correct
186 Correct 21 ms 34960 KB Output is correct
187 Correct 18 ms 34892 KB Output is correct
188 Correct 22 ms 35156 KB Output is correct
189 Correct 20 ms 34864 KB Output is correct
190 Correct 20 ms 34868 KB Output is correct
191 Correct 22 ms 34916 KB Output is correct
192 Correct 18 ms 34696 KB Output is correct
193 Correct 19 ms 34868 KB Output is correct
194 Correct 19 ms 34900 KB Output is correct
195 Correct 21 ms 34944 KB Output is correct
196 Correct 22 ms 34864 KB Output is correct
197 Correct 24 ms 34856 KB Output is correct
198 Correct 21 ms 34900 KB Output is correct
199 Correct 21 ms 34900 KB Output is correct
200 Correct 20 ms 34900 KB Output is correct
201 Correct 21 ms 34920 KB Output is correct
202 Correct 19 ms 34912 KB Output is correct
203 Correct 20 ms 34912 KB Output is correct
204 Correct 19 ms 34928 KB Output is correct
205 Correct 18 ms 34848 KB Output is correct
206 Correct 19 ms 34920 KB Output is correct
207 Correct 19 ms 34900 KB Output is correct
208 Correct 19 ms 34964 KB Output is correct
209 Correct 29 ms 35292 KB Output is correct
210 Correct 181 ms 44080 KB Output is correct
211 Correct 456 ms 47380 KB Output is correct
212 Correct 794 ms 50112 KB Output is correct
213 Correct 543 ms 53364 KB Output is correct
214 Correct 136 ms 49272 KB Output is correct
215 Correct 164 ms 49692 KB Output is correct
216 Correct 696 ms 51336 KB Output is correct
217 Correct 543 ms 49616 KB Output is correct
218 Correct 479 ms 47228 KB Output is correct
219 Correct 432 ms 46636 KB Output is correct
220 Correct 457 ms 46612 KB Output is correct
221 Correct 290 ms 46136 KB Output is correct
222 Correct 353 ms 46032 KB Output is correct
223 Correct 423 ms 52196 KB Output is correct
224 Correct 480 ms 51456 KB Output is correct
225 Correct 444 ms 49444 KB Output is correct
226 Correct 438 ms 49260 KB Output is correct
227 Correct 417 ms 49276 KB Output is correct
228 Correct 254 ms 48648 KB Output is correct
229 Correct 271 ms 47972 KB Output is correct
230 Correct 354 ms 50104 KB Output is correct
231 Correct 338 ms 50356 KB Output is correct