Submission #62296

# Submission time Handle Problem Language Result Execution time Memory
62296 2018-07-28T03:54:38 Z Benq Duathlon (APIO18_duathlon) C++11
100 / 100
497 ms 55052 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

vi ADJ[2*MX];
int n,m,totsz[2*MX];

void ad(int a, int b) {
    ADJ[a].pb(b), ADJ[b].pb(a);
}

template<int SZ> struct BCC {
    int N, ti = 0;
    vi adj[SZ];
    int disc[SZ], low[SZ], comp[SZ], par[SZ];
    vector<vpi> fin;
    int compsz[SZ];
    vpi st;
    
    void addEdge(int u, int v) {
        adj[u].pb(v), adj[v].pb(u);
    }
    
    void BCCutil(int u, bool root = 0) {
        disc[u] = low[u] = ti++;
        int child = 0;
        
        for (int i: adj[u]) if (i != par[u]) {
            if (disc[i] == -1) {
                child ++; par[i] = u;
                st.pb({u,i});
                BCCutil(i);
                low[u] = min(low[u],low[i]);
                
                if ((root && child > 1) || (!root && disc[u] <= low[i])) { // articulation point!
                    vpi tmp;
                    while (st.back() != mp(u,i)) tmp.pb(st.back()), st.pop_back();
                    tmp.pb(st.back()), st.pop_back();
                    fin.pb(tmp);
                }
            } else if (disc[i] < disc[u]) {
                low[u] = min(low[u],disc[i]);
                st.pb({u,i});
            }
        }
    }
    
    void bcc() {
        FOR(i,1,N+1) par[i] = disc[i] = low[i] = -1;
        FOR(i,1,N+1) if (disc[i] == -1) {
            BCCutil(i,1);
            if (sz(st)) fin.pb(st);
            st.clear();
        }
        int co = 0;
        for (auto a: fin) {
            set<int> s;
            for (auto b: a) s.insert(b.f), s.insert(b.s);
            co ++;
            compsz[co] = sz(s);
            for (int i: s) ad(i,n+co);
        }
    }
};

ll ans = 0;
BCC<MX> B;
bool visit[2*MX];

void dfs1(int x, int y = 0) {
    visit[x] = 1; if (x <= n) totsz[x] = 1;
    for (int i: ADJ[x]) if (i != y) {
        dfs1(i,x);
        totsz[x] += totsz[i];
    }
}

void dfs2(int x, int p, int y = 0) {
    if (x <= n) {
        for (int i: ADJ[x]) {
            assert(i > n);
            if (i != y) {
                ans -= (ll)(B.compsz[i-n]-1)*(totsz[p]-totsz[i])*(totsz[p]-totsz[i]-1);
            } else {
                ans -= (ll)(B.compsz[i-n]-1)*totsz[x]*(totsz[x]-1);
            }
        }
    }
    for (int i: ADJ[x]) if (i != y) dfs2(i,p,x);
}

void init() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n >> m;
    F0R(i,m) {
        int a,b; cin >> a >> b;
        B.addEdge(a,b);
    }
    B.N = n;
    B.bcc();
}

void genTree() {
    FOR(i,1,n+1) if (!visit[i]) {
        dfs1(i);
        ans += (ll)totsz[i]*(totsz[i]-1)*(totsz[i]-2);
        // cout << i << " "  << totsz[i] << "\n";
        dfs2(i,i);
    }
}

int main() {
    init();
    genTree();
    cout << ans;
}

/* Look for:
* the exact constraints (multiple sets are too slow for n=10^6 :( ) 
* special cases (n=1?)
* overflow (ll vs int?)
* array bounds
*/
# Verdict Execution time Memory Grader output
1 Correct 9 ms 7416 KB Output is correct
2 Correct 9 ms 7416 KB Output is correct
3 Correct 10 ms 7432 KB Output is correct
4 Correct 11 ms 7508 KB Output is correct
5 Correct 10 ms 7584 KB Output is correct
6 Correct 11 ms 7632 KB Output is correct
7 Correct 9 ms 7760 KB Output is correct
8 Correct 11 ms 7760 KB Output is correct
9 Correct 10 ms 7760 KB Output is correct
10 Correct 9 ms 7760 KB Output is correct
11 Correct 12 ms 7788 KB Output is correct
12 Correct 11 ms 7788 KB Output is correct
13 Correct 9 ms 7788 KB Output is correct
14 Correct 13 ms 7800 KB Output is correct
15 Correct 9 ms 7800 KB Output is correct
16 Correct 13 ms 7800 KB Output is correct
17 Correct 10 ms 7800 KB Output is correct
18 Correct 10 ms 7800 KB Output is correct
19 Correct 11 ms 7800 KB Output is correct
20 Correct 10 ms 7800 KB Output is correct
21 Correct 10 ms 7800 KB Output is correct
22 Correct 10 ms 7800 KB Output is correct
23 Correct 13 ms 7800 KB Output is correct
24 Correct 12 ms 7800 KB Output is correct
25 Correct 10 ms 7800 KB Output is correct
26 Correct 10 ms 7800 KB Output is correct
27 Correct 12 ms 7800 KB Output is correct
28 Correct 12 ms 7800 KB Output is correct
29 Correct 10 ms 7800 KB Output is correct
30 Correct 8 ms 7800 KB Output is correct
31 Correct 10 ms 7800 KB Output is correct
32 Correct 10 ms 7800 KB Output is correct
33 Correct 10 ms 7800 KB Output is correct
34 Correct 11 ms 7800 KB Output is correct
35 Correct 9 ms 7908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 7416 KB Output is correct
2 Correct 9 ms 7416 KB Output is correct
3 Correct 10 ms 7432 KB Output is correct
4 Correct 11 ms 7508 KB Output is correct
5 Correct 10 ms 7584 KB Output is correct
6 Correct 11 ms 7632 KB Output is correct
7 Correct 9 ms 7760 KB Output is correct
8 Correct 11 ms 7760 KB Output is correct
9 Correct 10 ms 7760 KB Output is correct
10 Correct 9 ms 7760 KB Output is correct
11 Correct 12 ms 7788 KB Output is correct
12 Correct 11 ms 7788 KB Output is correct
13 Correct 9 ms 7788 KB Output is correct
14 Correct 13 ms 7800 KB Output is correct
15 Correct 9 ms 7800 KB Output is correct
16 Correct 13 ms 7800 KB Output is correct
17 Correct 10 ms 7800 KB Output is correct
18 Correct 10 ms 7800 KB Output is correct
19 Correct 11 ms 7800 KB Output is correct
20 Correct 10 ms 7800 KB Output is correct
21 Correct 10 ms 7800 KB Output is correct
22 Correct 10 ms 7800 KB Output is correct
23 Correct 13 ms 7800 KB Output is correct
24 Correct 12 ms 7800 KB Output is correct
25 Correct 10 ms 7800 KB Output is correct
26 Correct 10 ms 7800 KB Output is correct
27 Correct 12 ms 7800 KB Output is correct
28 Correct 12 ms 7800 KB Output is correct
29 Correct 10 ms 7800 KB Output is correct
30 Correct 8 ms 7800 KB Output is correct
31 Correct 10 ms 7800 KB Output is correct
32 Correct 10 ms 7800 KB Output is correct
33 Correct 10 ms 7800 KB Output is correct
34 Correct 11 ms 7800 KB Output is correct
35 Correct 9 ms 7908 KB Output is correct
36 Correct 10 ms 7908 KB Output is correct
37 Correct 11 ms 7908 KB Output is correct
38 Correct 12 ms 7908 KB Output is correct
39 Correct 10 ms 7912 KB Output is correct
40 Correct 9 ms 7912 KB Output is correct
41 Correct 14 ms 7912 KB Output is correct
42 Correct 11 ms 7912 KB Output is correct
43 Correct 9 ms 7912 KB Output is correct
44 Correct 9 ms 7912 KB Output is correct
45 Correct 10 ms 7912 KB Output is correct
46 Correct 10 ms 7912 KB Output is correct
47 Correct 9 ms 7912 KB Output is correct
48 Correct 11 ms 7916 KB Output is correct
49 Correct 11 ms 7920 KB Output is correct
50 Correct 10 ms 7924 KB Output is correct
51 Correct 12 ms 7928 KB Output is correct
52 Correct 12 ms 7932 KB Output is correct
53 Correct 11 ms 7936 KB Output is correct
54 Correct 11 ms 7940 KB Output is correct
55 Correct 10 ms 7940 KB Output is correct
56 Correct 10 ms 7948 KB Output is correct
57 Correct 9 ms 7956 KB Output is correct
58 Correct 9 ms 7960 KB Output is correct
59 Correct 12 ms 7964 KB Output is correct
60 Correct 12 ms 7972 KB Output is correct
61 Correct 8 ms 7972 KB Output is correct
62 Correct 10 ms 7976 KB Output is correct
63 Correct 12 ms 7988 KB Output is correct
64 Correct 10 ms 7988 KB Output is correct
65 Correct 9 ms 7988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 258 ms 30760 KB Output is correct
2 Correct 286 ms 30760 KB Output is correct
3 Correct 265 ms 30760 KB Output is correct
4 Correct 225 ms 30760 KB Output is correct
5 Correct 321 ms 30760 KB Output is correct
6 Correct 293 ms 30760 KB Output is correct
7 Correct 235 ms 30760 KB Output is correct
8 Correct 252 ms 30760 KB Output is correct
9 Correct 315 ms 30760 KB Output is correct
10 Correct 228 ms 30760 KB Output is correct
11 Correct 191 ms 30760 KB Output is correct
12 Correct 171 ms 30760 KB Output is correct
13 Correct 237 ms 30760 KB Output is correct
14 Correct 141 ms 30760 KB Output is correct
15 Correct 120 ms 30760 KB Output is correct
16 Correct 138 ms 30760 KB Output is correct
17 Correct 12 ms 30760 KB Output is correct
18 Correct 14 ms 30760 KB Output is correct
19 Correct 13 ms 30760 KB Output is correct
20 Correct 13 ms 30760 KB Output is correct
21 Correct 15 ms 30760 KB Output is correct
22 Correct 17 ms 30760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 30760 KB Output is correct
2 Correct 13 ms 30760 KB Output is correct
3 Correct 13 ms 30760 KB Output is correct
4 Correct 12 ms 30760 KB Output is correct
5 Correct 10 ms 30760 KB Output is correct
6 Correct 18 ms 30760 KB Output is correct
7 Correct 11 ms 30760 KB Output is correct
8 Correct 11 ms 30760 KB Output is correct
9 Correct 12 ms 30760 KB Output is correct
10 Correct 13 ms 30760 KB Output is correct
11 Correct 12 ms 30760 KB Output is correct
12 Correct 14 ms 30760 KB Output is correct
13 Correct 11 ms 30760 KB Output is correct
14 Correct 11 ms 30760 KB Output is correct
15 Correct 10 ms 30760 KB Output is correct
16 Correct 9 ms 30760 KB Output is correct
17 Correct 13 ms 30760 KB Output is correct
18 Correct 13 ms 30760 KB Output is correct
19 Correct 10 ms 30760 KB Output is correct
20 Correct 13 ms 30760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 263 ms 30760 KB Output is correct
2 Correct 240 ms 30760 KB Output is correct
3 Correct 336 ms 30760 KB Output is correct
4 Correct 325 ms 30760 KB Output is correct
5 Correct 315 ms 30760 KB Output is correct
6 Correct 350 ms 32688 KB Output is correct
7 Correct 289 ms 32688 KB Output is correct
8 Correct 296 ms 32688 KB Output is correct
9 Correct 281 ms 32688 KB Output is correct
10 Correct 340 ms 32688 KB Output is correct
11 Correct 246 ms 32688 KB Output is correct
12 Correct 285 ms 32688 KB Output is correct
13 Correct 268 ms 32688 KB Output is correct
14 Correct 240 ms 32688 KB Output is correct
15 Correct 195 ms 32688 KB Output is correct
16 Correct 137 ms 32688 KB Output is correct
17 Correct 282 ms 32688 KB Output is correct
18 Correct 331 ms 32688 KB Output is correct
19 Correct 271 ms 32688 KB Output is correct
20 Correct 301 ms 32688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 32688 KB Output is correct
2 Correct 13 ms 32688 KB Output is correct
3 Correct 13 ms 32688 KB Output is correct
4 Correct 10 ms 32688 KB Output is correct
5 Correct 12 ms 32688 KB Output is correct
6 Correct 12 ms 32688 KB Output is correct
7 Correct 10 ms 32688 KB Output is correct
8 Correct 11 ms 32688 KB Output is correct
9 Correct 12 ms 32688 KB Output is correct
10 Correct 13 ms 32688 KB Output is correct
11 Correct 12 ms 32688 KB Output is correct
12 Correct 13 ms 32688 KB Output is correct
13 Correct 12 ms 32688 KB Output is correct
14 Correct 15 ms 32688 KB Output is correct
15 Correct 11 ms 32688 KB Output is correct
16 Correct 14 ms 32688 KB Output is correct
17 Correct 12 ms 32688 KB Output is correct
18 Correct 11 ms 32688 KB Output is correct
19 Correct 13 ms 32688 KB Output is correct
20 Correct 6 ms 32688 KB Output is correct
21 Correct 11 ms 32688 KB Output is correct
22 Correct 12 ms 32688 KB Output is correct
23 Correct 13 ms 32688 KB Output is correct
24 Correct 13 ms 32688 KB Output is correct
25 Correct 10 ms 32688 KB Output is correct
26 Correct 10 ms 32688 KB Output is correct
27 Correct 9 ms 32688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 363 ms 32688 KB Output is correct
2 Correct 368 ms 32688 KB Output is correct
3 Correct 327 ms 32688 KB Output is correct
4 Correct 349 ms 32688 KB Output is correct
5 Correct 286 ms 32688 KB Output is correct
6 Correct 214 ms 32688 KB Output is correct
7 Correct 204 ms 32688 KB Output is correct
8 Correct 221 ms 32688 KB Output is correct
9 Correct 216 ms 32688 KB Output is correct
10 Correct 204 ms 32688 KB Output is correct
11 Correct 210 ms 32688 KB Output is correct
12 Correct 206 ms 32688 KB Output is correct
13 Correct 191 ms 32688 KB Output is correct
14 Correct 220 ms 32688 KB Output is correct
15 Correct 322 ms 32688 KB Output is correct
16 Correct 273 ms 32688 KB Output is correct
17 Correct 256 ms 32688 KB Output is correct
18 Correct 260 ms 32688 KB Output is correct
19 Correct 243 ms 32688 KB Output is correct
20 Correct 280 ms 32688 KB Output is correct
21 Correct 273 ms 32688 KB Output is correct
22 Correct 227 ms 32688 KB Output is correct
23 Correct 217 ms 32688 KB Output is correct
24 Correct 296 ms 32688 KB Output is correct
25 Correct 272 ms 32688 KB Output is correct
26 Correct 269 ms 32688 KB Output is correct
27 Correct 271 ms 32688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 7416 KB Output is correct
2 Correct 9 ms 7416 KB Output is correct
3 Correct 10 ms 7432 KB Output is correct
4 Correct 11 ms 7508 KB Output is correct
5 Correct 10 ms 7584 KB Output is correct
6 Correct 11 ms 7632 KB Output is correct
7 Correct 9 ms 7760 KB Output is correct
8 Correct 11 ms 7760 KB Output is correct
9 Correct 10 ms 7760 KB Output is correct
10 Correct 9 ms 7760 KB Output is correct
11 Correct 12 ms 7788 KB Output is correct
12 Correct 11 ms 7788 KB Output is correct
13 Correct 9 ms 7788 KB Output is correct
14 Correct 13 ms 7800 KB Output is correct
15 Correct 9 ms 7800 KB Output is correct
16 Correct 13 ms 7800 KB Output is correct
17 Correct 10 ms 7800 KB Output is correct
18 Correct 10 ms 7800 KB Output is correct
19 Correct 11 ms 7800 KB Output is correct
20 Correct 10 ms 7800 KB Output is correct
21 Correct 10 ms 7800 KB Output is correct
22 Correct 10 ms 7800 KB Output is correct
23 Correct 13 ms 7800 KB Output is correct
24 Correct 12 ms 7800 KB Output is correct
25 Correct 10 ms 7800 KB Output is correct
26 Correct 10 ms 7800 KB Output is correct
27 Correct 12 ms 7800 KB Output is correct
28 Correct 12 ms 7800 KB Output is correct
29 Correct 10 ms 7800 KB Output is correct
30 Correct 8 ms 7800 KB Output is correct
31 Correct 10 ms 7800 KB Output is correct
32 Correct 10 ms 7800 KB Output is correct
33 Correct 10 ms 7800 KB Output is correct
34 Correct 11 ms 7800 KB Output is correct
35 Correct 9 ms 7908 KB Output is correct
36 Correct 10 ms 7908 KB Output is correct
37 Correct 11 ms 7908 KB Output is correct
38 Correct 12 ms 7908 KB Output is correct
39 Correct 10 ms 7912 KB Output is correct
40 Correct 9 ms 7912 KB Output is correct
41 Correct 14 ms 7912 KB Output is correct
42 Correct 11 ms 7912 KB Output is correct
43 Correct 9 ms 7912 KB Output is correct
44 Correct 9 ms 7912 KB Output is correct
45 Correct 10 ms 7912 KB Output is correct
46 Correct 10 ms 7912 KB Output is correct
47 Correct 9 ms 7912 KB Output is correct
48 Correct 11 ms 7916 KB Output is correct
49 Correct 11 ms 7920 KB Output is correct
50 Correct 10 ms 7924 KB Output is correct
51 Correct 12 ms 7928 KB Output is correct
52 Correct 12 ms 7932 KB Output is correct
53 Correct 11 ms 7936 KB Output is correct
54 Correct 11 ms 7940 KB Output is correct
55 Correct 10 ms 7940 KB Output is correct
56 Correct 10 ms 7948 KB Output is correct
57 Correct 9 ms 7956 KB Output is correct
58 Correct 9 ms 7960 KB Output is correct
59 Correct 12 ms 7964 KB Output is correct
60 Correct 12 ms 7972 KB Output is correct
61 Correct 8 ms 7972 KB Output is correct
62 Correct 10 ms 7976 KB Output is correct
63 Correct 12 ms 7988 KB Output is correct
64 Correct 10 ms 7988 KB Output is correct
65 Correct 9 ms 7988 KB Output is correct
66 Correct 9 ms 32688 KB Output is correct
67 Correct 10 ms 32688 KB Output is correct
68 Correct 12 ms 32688 KB Output is correct
69 Correct 12 ms 32688 KB Output is correct
70 Correct 13 ms 32688 KB Output is correct
71 Correct 13 ms 32688 KB Output is correct
72 Correct 10 ms 32688 KB Output is correct
73 Correct 11 ms 32688 KB Output is correct
74 Correct 10 ms 32688 KB Output is correct
75 Correct 11 ms 32688 KB Output is correct
76 Correct 11 ms 32688 KB Output is correct
77 Correct 14 ms 32688 KB Output is correct
78 Correct 13 ms 32688 KB Output is correct
79 Correct 12 ms 32688 KB Output is correct
80 Correct 14 ms 32688 KB Output is correct
81 Correct 11 ms 32688 KB Output is correct
82 Correct 14 ms 32688 KB Output is correct
83 Correct 11 ms 32688 KB Output is correct
84 Correct 14 ms 32688 KB Output is correct
85 Correct 16 ms 32688 KB Output is correct
86 Correct 12 ms 32688 KB Output is correct
87 Correct 12 ms 32688 KB Output is correct
88 Correct 13 ms 32688 KB Output is correct
89 Correct 11 ms 32688 KB Output is correct
90 Correct 11 ms 32688 KB Output is correct
91 Correct 11 ms 32688 KB Output is correct
92 Correct 13 ms 32688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 7416 KB Output is correct
2 Correct 9 ms 7416 KB Output is correct
3 Correct 10 ms 7432 KB Output is correct
4 Correct 11 ms 7508 KB Output is correct
5 Correct 10 ms 7584 KB Output is correct
6 Correct 11 ms 7632 KB Output is correct
7 Correct 9 ms 7760 KB Output is correct
8 Correct 11 ms 7760 KB Output is correct
9 Correct 10 ms 7760 KB Output is correct
10 Correct 9 ms 7760 KB Output is correct
11 Correct 12 ms 7788 KB Output is correct
12 Correct 11 ms 7788 KB Output is correct
13 Correct 9 ms 7788 KB Output is correct
14 Correct 13 ms 7800 KB Output is correct
15 Correct 9 ms 7800 KB Output is correct
16 Correct 13 ms 7800 KB Output is correct
17 Correct 10 ms 7800 KB Output is correct
18 Correct 10 ms 7800 KB Output is correct
19 Correct 11 ms 7800 KB Output is correct
20 Correct 10 ms 7800 KB Output is correct
21 Correct 10 ms 7800 KB Output is correct
22 Correct 10 ms 7800 KB Output is correct
23 Correct 13 ms 7800 KB Output is correct
24 Correct 12 ms 7800 KB Output is correct
25 Correct 10 ms 7800 KB Output is correct
26 Correct 10 ms 7800 KB Output is correct
27 Correct 12 ms 7800 KB Output is correct
28 Correct 12 ms 7800 KB Output is correct
29 Correct 10 ms 7800 KB Output is correct
30 Correct 8 ms 7800 KB Output is correct
31 Correct 10 ms 7800 KB Output is correct
32 Correct 10 ms 7800 KB Output is correct
33 Correct 10 ms 7800 KB Output is correct
34 Correct 11 ms 7800 KB Output is correct
35 Correct 9 ms 7908 KB Output is correct
36 Correct 10 ms 7908 KB Output is correct
37 Correct 11 ms 7908 KB Output is correct
38 Correct 12 ms 7908 KB Output is correct
39 Correct 10 ms 7912 KB Output is correct
40 Correct 9 ms 7912 KB Output is correct
41 Correct 14 ms 7912 KB Output is correct
42 Correct 11 ms 7912 KB Output is correct
43 Correct 9 ms 7912 KB Output is correct
44 Correct 9 ms 7912 KB Output is correct
45 Correct 10 ms 7912 KB Output is correct
46 Correct 10 ms 7912 KB Output is correct
47 Correct 9 ms 7912 KB Output is correct
48 Correct 11 ms 7916 KB Output is correct
49 Correct 11 ms 7920 KB Output is correct
50 Correct 10 ms 7924 KB Output is correct
51 Correct 12 ms 7928 KB Output is correct
52 Correct 12 ms 7932 KB Output is correct
53 Correct 11 ms 7936 KB Output is correct
54 Correct 11 ms 7940 KB Output is correct
55 Correct 10 ms 7940 KB Output is correct
56 Correct 10 ms 7948 KB Output is correct
57 Correct 9 ms 7956 KB Output is correct
58 Correct 9 ms 7960 KB Output is correct
59 Correct 12 ms 7964 KB Output is correct
60 Correct 12 ms 7972 KB Output is correct
61 Correct 8 ms 7972 KB Output is correct
62 Correct 10 ms 7976 KB Output is correct
63 Correct 12 ms 7988 KB Output is correct
64 Correct 10 ms 7988 KB Output is correct
65 Correct 9 ms 7988 KB Output is correct
66 Correct 258 ms 30760 KB Output is correct
67 Correct 286 ms 30760 KB Output is correct
68 Correct 265 ms 30760 KB Output is correct
69 Correct 225 ms 30760 KB Output is correct
70 Correct 321 ms 30760 KB Output is correct
71 Correct 293 ms 30760 KB Output is correct
72 Correct 235 ms 30760 KB Output is correct
73 Correct 252 ms 30760 KB Output is correct
74 Correct 315 ms 30760 KB Output is correct
75 Correct 228 ms 30760 KB Output is correct
76 Correct 191 ms 30760 KB Output is correct
77 Correct 171 ms 30760 KB Output is correct
78 Correct 237 ms 30760 KB Output is correct
79 Correct 141 ms 30760 KB Output is correct
80 Correct 120 ms 30760 KB Output is correct
81 Correct 138 ms 30760 KB Output is correct
82 Correct 12 ms 30760 KB Output is correct
83 Correct 14 ms 30760 KB Output is correct
84 Correct 13 ms 30760 KB Output is correct
85 Correct 13 ms 30760 KB Output is correct
86 Correct 15 ms 30760 KB Output is correct
87 Correct 17 ms 30760 KB Output is correct
88 Correct 11 ms 30760 KB Output is correct
89 Correct 13 ms 30760 KB Output is correct
90 Correct 13 ms 30760 KB Output is correct
91 Correct 12 ms 30760 KB Output is correct
92 Correct 10 ms 30760 KB Output is correct
93 Correct 18 ms 30760 KB Output is correct
94 Correct 11 ms 30760 KB Output is correct
95 Correct 11 ms 30760 KB Output is correct
96 Correct 12 ms 30760 KB Output is correct
97 Correct 13 ms 30760 KB Output is correct
98 Correct 12 ms 30760 KB Output is correct
99 Correct 14 ms 30760 KB Output is correct
100 Correct 11 ms 30760 KB Output is correct
101 Correct 11 ms 30760 KB Output is correct
102 Correct 10 ms 30760 KB Output is correct
103 Correct 9 ms 30760 KB Output is correct
104 Correct 13 ms 30760 KB Output is correct
105 Correct 13 ms 30760 KB Output is correct
106 Correct 10 ms 30760 KB Output is correct
107 Correct 13 ms 30760 KB Output is correct
108 Correct 263 ms 30760 KB Output is correct
109 Correct 240 ms 30760 KB Output is correct
110 Correct 336 ms 30760 KB Output is correct
111 Correct 325 ms 30760 KB Output is correct
112 Correct 315 ms 30760 KB Output is correct
113 Correct 350 ms 32688 KB Output is correct
114 Correct 289 ms 32688 KB Output is correct
115 Correct 296 ms 32688 KB Output is correct
116 Correct 281 ms 32688 KB Output is correct
117 Correct 340 ms 32688 KB Output is correct
118 Correct 246 ms 32688 KB Output is correct
119 Correct 285 ms 32688 KB Output is correct
120 Correct 268 ms 32688 KB Output is correct
121 Correct 240 ms 32688 KB Output is correct
122 Correct 195 ms 32688 KB Output is correct
123 Correct 137 ms 32688 KB Output is correct
124 Correct 282 ms 32688 KB Output is correct
125 Correct 331 ms 32688 KB Output is correct
126 Correct 271 ms 32688 KB Output is correct
127 Correct 301 ms 32688 KB Output is correct
128 Correct 11 ms 32688 KB Output is correct
129 Correct 13 ms 32688 KB Output is correct
130 Correct 13 ms 32688 KB Output is correct
131 Correct 10 ms 32688 KB Output is correct
132 Correct 12 ms 32688 KB Output is correct
133 Correct 12 ms 32688 KB Output is correct
134 Correct 10 ms 32688 KB Output is correct
135 Correct 11 ms 32688 KB Output is correct
136 Correct 12 ms 32688 KB Output is correct
137 Correct 13 ms 32688 KB Output is correct
138 Correct 12 ms 32688 KB Output is correct
139 Correct 13 ms 32688 KB Output is correct
140 Correct 12 ms 32688 KB Output is correct
141 Correct 15 ms 32688 KB Output is correct
142 Correct 11 ms 32688 KB Output is correct
143 Correct 14 ms 32688 KB Output is correct
144 Correct 12 ms 32688 KB Output is correct
145 Correct 11 ms 32688 KB Output is correct
146 Correct 13 ms 32688 KB Output is correct
147 Correct 6 ms 32688 KB Output is correct
148 Correct 11 ms 32688 KB Output is correct
149 Correct 12 ms 32688 KB Output is correct
150 Correct 13 ms 32688 KB Output is correct
151 Correct 13 ms 32688 KB Output is correct
152 Correct 10 ms 32688 KB Output is correct
153 Correct 10 ms 32688 KB Output is correct
154 Correct 9 ms 32688 KB Output is correct
155 Correct 363 ms 32688 KB Output is correct
156 Correct 368 ms 32688 KB Output is correct
157 Correct 327 ms 32688 KB Output is correct
158 Correct 349 ms 32688 KB Output is correct
159 Correct 286 ms 32688 KB Output is correct
160 Correct 214 ms 32688 KB Output is correct
161 Correct 204 ms 32688 KB Output is correct
162 Correct 221 ms 32688 KB Output is correct
163 Correct 216 ms 32688 KB Output is correct
164 Correct 204 ms 32688 KB Output is correct
165 Correct 210 ms 32688 KB Output is correct
166 Correct 206 ms 32688 KB Output is correct
167 Correct 191 ms 32688 KB Output is correct
168 Correct 220 ms 32688 KB Output is correct
169 Correct 322 ms 32688 KB Output is correct
170 Correct 273 ms 32688 KB Output is correct
171 Correct 256 ms 32688 KB Output is correct
172 Correct 260 ms 32688 KB Output is correct
173 Correct 243 ms 32688 KB Output is correct
174 Correct 280 ms 32688 KB Output is correct
175 Correct 273 ms 32688 KB Output is correct
176 Correct 227 ms 32688 KB Output is correct
177 Correct 217 ms 32688 KB Output is correct
178 Correct 296 ms 32688 KB Output is correct
179 Correct 272 ms 32688 KB Output is correct
180 Correct 269 ms 32688 KB Output is correct
181 Correct 271 ms 32688 KB Output is correct
182 Correct 9 ms 32688 KB Output is correct
183 Correct 10 ms 32688 KB Output is correct
184 Correct 12 ms 32688 KB Output is correct
185 Correct 12 ms 32688 KB Output is correct
186 Correct 13 ms 32688 KB Output is correct
187 Correct 13 ms 32688 KB Output is correct
188 Correct 10 ms 32688 KB Output is correct
189 Correct 11 ms 32688 KB Output is correct
190 Correct 10 ms 32688 KB Output is correct
191 Correct 11 ms 32688 KB Output is correct
192 Correct 11 ms 32688 KB Output is correct
193 Correct 14 ms 32688 KB Output is correct
194 Correct 13 ms 32688 KB Output is correct
195 Correct 12 ms 32688 KB Output is correct
196 Correct 14 ms 32688 KB Output is correct
197 Correct 11 ms 32688 KB Output is correct
198 Correct 14 ms 32688 KB Output is correct
199 Correct 11 ms 32688 KB Output is correct
200 Correct 14 ms 32688 KB Output is correct
201 Correct 16 ms 32688 KB Output is correct
202 Correct 12 ms 32688 KB Output is correct
203 Correct 12 ms 32688 KB Output is correct
204 Correct 13 ms 32688 KB Output is correct
205 Correct 11 ms 32688 KB Output is correct
206 Correct 11 ms 32688 KB Output is correct
207 Correct 11 ms 32688 KB Output is correct
208 Correct 13 ms 32688 KB Output is correct
209 Correct 15 ms 32688 KB Output is correct
210 Correct 149 ms 32688 KB Output is correct
211 Correct 317 ms 32688 KB Output is correct
212 Correct 394 ms 32688 KB Output is correct
213 Correct 497 ms 37028 KB Output is correct
214 Correct 119 ms 37028 KB Output is correct
215 Correct 124 ms 37028 KB Output is correct
216 Correct 297 ms 37028 KB Output is correct
217 Correct 278 ms 37028 KB Output is correct
218 Correct 218 ms 37028 KB Output is correct
219 Correct 211 ms 37028 KB Output is correct
220 Correct 212 ms 37028 KB Output is correct
221 Correct 207 ms 37028 KB Output is correct
222 Correct 222 ms 38596 KB Output is correct
223 Correct 305 ms 43996 KB Output is correct
224 Correct 266 ms 44856 KB Output is correct
225 Correct 246 ms 44856 KB Output is correct
226 Correct 284 ms 46236 KB Output is correct
227 Correct 279 ms 47808 KB Output is correct
228 Correct 240 ms 48832 KB Output is correct
229 Correct 197 ms 49792 KB Output is correct
230 Correct 265 ms 53184 KB Output is correct
231 Correct 242 ms 55052 KB Output is correct