Submission #133528

# Submission time Handle Problem Language Result Execution time Memory
133528 2019-07-21T03:41:30 Z 12tqian Duathlon (APIO18_duathlon) C++14
100 / 100
412 ms 58212 KB
#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#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;


const double PI = 4 * atan(1);

#define sz(x) (int)(x).size()
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define vi vector<int>
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define vpi vector<pair<int, int>>
#define vpd vector<pair<double, double>>
#define pd pair<double, double>

#define f0r(i,a) for(int i=0;i<a;i++)
#define f1r(i,a,b) for(int i=a;i<b;i++)
#define trav(a, x) for (auto& a : x)

void fast_io(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
void io(string taskname){
    string fin = taskname + ".in";
    string fout = taskname + ".out";
    const char* FIN = fin.c_str();
    const char* FOUT = fout.c_str();
    freopen(FIN, "r", stdin);
    //freopen(FOUT, "w", stdout);
    fast_io();
}
const int MAX = 1e5 + 5;
vi adj[MAX];
vi comp[MAX];
vi bcomp[MAX];
ll precomp[MAX];
ll vals[MAX];
int get_sz[MAX];
int bad[MAX];
int vis[2*MAX];
int sub[2*MAX];
int parent[2*MAX];
vi tree1[2*MAX];
vi cutpoints[MAX];
template<int SZ> struct DSU{
    int par[SZ], sz[SZ];
    DSU(){
        for(int i = 0; i<SZ; i++){
            par[i] = i;
            sz[i] = 1;
        }
    }
    inline int get(int x){
        if(par[x] != x){
            par[x] = get(par[x]);
        }
        return par[x];
    }
    inline bool unite(int x, int y){
        x = get(x);
        y = get(y);
        if(x == y){
            return false;
        }
        if(sz[x] < sz[y]){
            swap(x, y);
        }
        sz[x] += sz[y];
        par[y] = x;
        return true;
    }
};
DSU<MAX> d;
inline int dfs(int src, int par){
//    assert(times<=1e6);
    vis[src] = 1;
    parent[src] = par;
    sub[src] = sz(bcomp[src]);
    if(src>=MAX){
        sub[src] = sz(bcomp[src - MAX]) - bad[src-MAX];
    }
    else{
        sub[src] = 1;
    }
    for(int nxt: tree1[src]){
        if(nxt != par){
            sub[src] += dfs(nxt, src);
        }
    }
    return sub[src];
}
template<int SZ> struct BCC {
    int N;
    vi adj[SZ];
    vector<vpi> fin;

    inline void addEdge(int u, int v) { adj[u].pb(v), adj[v].pb(u); }

    int ti = 0, disc[SZ], low[SZ], comp[SZ], par[SZ];
    vpi st;

    inline void BCCutil(int u, bool root = 0) {
        disc[u] = low[u] = ti++;
        int child = 0;

        trav(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]);

                // disc[u] < low[i]: bridge
                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(int _N) {
        N = _N;
        f1r(i,1,N+1) par[i] = disc[i] = low[i] = -1;
        f1r(i,1,N+1) if (disc[i] == -1) {
            BCCutil(i,1);
            if (sz(st)) fin.pb(st);
            st.clear();
        }
    }
};
BCC<MAX> bcc;
int n;
inline int get(int above, int below){
    if(parent[below] == above){
        return sub[below];
    }
    else{
        return get_sz[below] - sub[above];
    }
}
int main(){
   // auto start = chrono::high_resolution_clock::now();
  //  io("test");
    fast_io();
    int m;
    //cin >> n >> m;
    scanf("%d %d", &n, &m);
    f0r(i, m){
        int u, v;
        scanf("%d %d", &u, &v);
      //  cin >> u >> v;
        u--;
        v--;
        d.unite(u, v);
        adj[u].eb(v);
        adj[v].eb(u);
        bcc.addEdge(u+1, v+1);
    }
    f0r(i, n){
        get_sz[i] = d.sz[d.get(i)];
    }
    bcc.bcc(n);
    int sz = sz(bcc.fin);
    f0r(i, sz){
        for(auto e: bcc.fin[i]){
            comp[e.f-1].eb(i);
            comp[e.s-1].eb(i);
            //bcomp[i].eb(e.f-1);
            //bcomp[i].eb(e.s-1);
        }
    }

    f0r(i, n){
       // set<int> s (all(comp[i]));
       // comp[i].assign(all(s));
        sort(all(comp[i]));
        comp[i].erase(unique(all(comp[i])), comp[i].end());
        for(auto x: comp[i]){
            bcomp[x].eb(i);
        }
    }
   /* f0r(i, sz){
        set<int> s (all(bcomp[i]));
        bcomp[i].assign(all(s));
    }*/

    f0r(i, n){
        if(sz(comp[i]) == 1)continue;
        for(int c: comp[i]){
            tree1[i].eb(c+MAX);
            tree1[c+MAX].eb(i);
        }
    }
    f0r(i,sz){
        for(int x: bcomp[i]){
            if(sz(comp[x]) >1){
                bad[i]++;
                cutpoints[i].eb(x);
            }
        }
    }
    //dfs(MAX, -1);

    f0r(i, sz){
        if(vis[i+MAX] == 0){
            dfs(i+MAX, -1);
        }
    }
    auto end1 = chrono::high_resolution_clock::now();

    // Calculating total time taken by the program.

    f0r(i, sz){
        for(int x: cutpoints[i]){
            ll val = get(i+MAX, x);
            precomp[i] += (val)*(val-1);
        }
    }
/*double time_taken1 =
      chrono::duration_cast<chrono::nanoseconds>(end1 - start).count();

    time_taken1 *= 1e-9;

    cout << "Time taken by program is : " << fixed
         << time_taken1 << setprecision(9);
    cout << " sec" << endl;
   // return 0;*/
    ll ans = 0;
    f0r(c, sz){
        ll tmp = 0;
        for(int pnt: cutpoints[c]){
        //    for(auto pnt: bcomp[c]){
            //if(sz(comp[pnt]) > 1){///cut point
                ll val = get(c+MAX, pnt);
                tmp += val*(val-1);
           // }
        }
        vals[c] = tmp;

    }
    f0r(i, n){
        ll cur = get_sz[i] - 1;
        if(sz(comp[i]) == 1){
            ///not a cut point
            cur *=(cur-1);
            int c = comp[i][0];
            /*for(int pnt: cutpoints[c]){
        //    for(auto pnt: bcomp[c]){
                //if(sz(comp[pnt]) > 1){///cut point
                    ll val = get(c+MAX, pnt);
                    cur -= val*(val-1);
               // }
            }*/
            cur -= vals[c];
            ans += cur;
        }
        else{
            cur *= (cur-1);
            for(int nxt: tree1[i]){
                ll val = precomp[nxt-MAX];
                ll subtract = get(nxt, i);
                val -= subtract*(subtract - 1);
                cur -= val;
            }
            ans += cur;
        }
        //cout << i << " " << cur << endl;
    }
    cout << ans << endl;
   // cout << parent[1]- MAX << endl;
    //cout << sub[3+MAX] << endl;
   // cout << sub[5]<< endl;
/*    auto end = chrono::high_resolution_clock::now();

    // Calculating total time taken by the program.
    double time_taken =
      chrono::duration_cast<chrono::nanoseconds>(end - start).count();

    time_taken *= 1e-9;

    cout << "Time taken by program is : " << fixed
         << time_taken << setprecision(9);
    cout << " sec" << endl;*/
    return 0;
}

Compilation message

count_triplets.cpp:1:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(linker, "/stack:200000000")
 
count_triplets.cpp: In function 'void io(std::__cxx11::string)':
count_triplets.cpp:47:17: warning: unused variable 'FOUT' [-Wunused-variable]
     const char* FOUT = fout.c_str();
                 ^~~~
count_triplets.cpp: In member function 'void BCC<SZ>::BCCutil(int, bool)':
count_triplets.cpp:126:27: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
         trav(i,adj[u]) if (i != par[u])
                           ^
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:233:10: warning: variable 'end1' set but not used [-Wunused-but-set-variable]
     auto end1 = chrono::high_resolution_clock::now();
          ^~~~
count_triplets.cpp: In function 'void io(std::__cxx11::string)':
count_triplets.cpp:48:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen(FIN, "r", stdin);
     ~~~~~~~^~~~~~~~~~~~~~~~~
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:171:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~~
count_triplets.cpp:174:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &u, &v);
         ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 19 ms 17656 KB Output is correct
2 Correct 19 ms 17656 KB Output is correct
3 Correct 19 ms 17628 KB Output is correct
4 Correct 19 ms 17656 KB Output is correct
5 Correct 19 ms 17528 KB Output is correct
6 Correct 19 ms 17628 KB Output is correct
7 Correct 18 ms 17628 KB Output is correct
8 Correct 19 ms 17600 KB Output is correct
9 Correct 19 ms 17656 KB Output is correct
10 Correct 19 ms 17528 KB Output is correct
11 Correct 19 ms 17656 KB Output is correct
12 Correct 19 ms 17656 KB Output is correct
13 Correct 19 ms 17656 KB Output is correct
14 Correct 23 ms 17656 KB Output is correct
15 Correct 23 ms 17656 KB Output is correct
16 Correct 19 ms 17656 KB Output is correct
17 Correct 19 ms 17656 KB Output is correct
18 Correct 23 ms 17656 KB Output is correct
19 Correct 19 ms 17656 KB Output is correct
20 Correct 19 ms 17656 KB Output is correct
21 Correct 19 ms 17528 KB Output is correct
22 Correct 19 ms 17624 KB Output is correct
23 Correct 19 ms 17656 KB Output is correct
24 Correct 19 ms 17656 KB Output is correct
25 Correct 19 ms 17656 KB Output is correct
26 Correct 19 ms 17656 KB Output is correct
27 Correct 19 ms 17656 KB Output is correct
28 Correct 19 ms 17656 KB Output is correct
29 Correct 19 ms 17656 KB Output is correct
30 Correct 19 ms 17656 KB Output is correct
31 Correct 19 ms 17656 KB Output is correct
32 Correct 19 ms 17656 KB Output is correct
33 Correct 19 ms 17656 KB Output is correct
34 Correct 19 ms 17656 KB Output is correct
35 Correct 19 ms 17656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 17656 KB Output is correct
2 Correct 19 ms 17656 KB Output is correct
3 Correct 19 ms 17628 KB Output is correct
4 Correct 19 ms 17656 KB Output is correct
5 Correct 19 ms 17528 KB Output is correct
6 Correct 19 ms 17628 KB Output is correct
7 Correct 18 ms 17628 KB Output is correct
8 Correct 19 ms 17600 KB Output is correct
9 Correct 19 ms 17656 KB Output is correct
10 Correct 19 ms 17528 KB Output is correct
11 Correct 19 ms 17656 KB Output is correct
12 Correct 19 ms 17656 KB Output is correct
13 Correct 19 ms 17656 KB Output is correct
14 Correct 23 ms 17656 KB Output is correct
15 Correct 23 ms 17656 KB Output is correct
16 Correct 19 ms 17656 KB Output is correct
17 Correct 19 ms 17656 KB Output is correct
18 Correct 23 ms 17656 KB Output is correct
19 Correct 19 ms 17656 KB Output is correct
20 Correct 19 ms 17656 KB Output is correct
21 Correct 19 ms 17528 KB Output is correct
22 Correct 19 ms 17624 KB Output is correct
23 Correct 19 ms 17656 KB Output is correct
24 Correct 19 ms 17656 KB Output is correct
25 Correct 19 ms 17656 KB Output is correct
26 Correct 19 ms 17656 KB Output is correct
27 Correct 19 ms 17656 KB Output is correct
28 Correct 19 ms 17656 KB Output is correct
29 Correct 19 ms 17656 KB Output is correct
30 Correct 19 ms 17656 KB Output is correct
31 Correct 19 ms 17656 KB Output is correct
32 Correct 19 ms 17656 KB Output is correct
33 Correct 19 ms 17656 KB Output is correct
34 Correct 19 ms 17656 KB Output is correct
35 Correct 19 ms 17656 KB Output is correct
36 Correct 19 ms 17656 KB Output is correct
37 Correct 19 ms 17656 KB Output is correct
38 Correct 19 ms 17656 KB Output is correct
39 Correct 19 ms 17628 KB Output is correct
40 Correct 19 ms 17656 KB Output is correct
41 Correct 19 ms 17656 KB Output is correct
42 Correct 20 ms 17656 KB Output is correct
43 Correct 19 ms 17656 KB Output is correct
44 Correct 23 ms 17684 KB Output is correct
45 Correct 19 ms 17656 KB Output is correct
46 Correct 19 ms 17656 KB Output is correct
47 Correct 19 ms 17656 KB Output is correct
48 Correct 19 ms 17656 KB Output is correct
49 Correct 19 ms 17528 KB Output is correct
50 Correct 19 ms 17528 KB Output is correct
51 Correct 19 ms 17628 KB Output is correct
52 Correct 19 ms 17656 KB Output is correct
53 Correct 19 ms 17656 KB Output is correct
54 Correct 19 ms 17656 KB Output is correct
55 Correct 19 ms 17660 KB Output is correct
56 Correct 20 ms 17656 KB Output is correct
57 Correct 19 ms 17656 KB Output is correct
58 Correct 19 ms 17660 KB Output is correct
59 Correct 23 ms 17656 KB Output is correct
60 Correct 20 ms 17656 KB Output is correct
61 Correct 19 ms 17656 KB Output is correct
62 Correct 19 ms 17656 KB Output is correct
63 Correct 19 ms 17660 KB Output is correct
64 Correct 23 ms 17656 KB Output is correct
65 Correct 19 ms 17656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 213 ms 39692 KB Output is correct
2 Correct 198 ms 39788 KB Output is correct
3 Correct 284 ms 45548 KB Output is correct
4 Correct 237 ms 43048 KB Output is correct
5 Correct 263 ms 40868 KB Output is correct
6 Correct 304 ms 46048 KB Output is correct
7 Correct 321 ms 44940 KB Output is correct
8 Correct 308 ms 45620 KB Output is correct
9 Correct 306 ms 43948 KB Output is correct
10 Correct 289 ms 42820 KB Output is correct
11 Correct 213 ms 38696 KB Output is correct
12 Correct 218 ms 38312 KB Output is correct
13 Correct 193 ms 37548 KB Output is correct
14 Correct 274 ms 37008 KB Output is correct
15 Correct 151 ms 34216 KB Output is correct
16 Correct 149 ms 33724 KB Output is correct
17 Correct 22 ms 19152 KB Output is correct
18 Correct 21 ms 19192 KB Output is correct
19 Correct 22 ms 19192 KB Output is correct
20 Correct 22 ms 19164 KB Output is correct
21 Correct 22 ms 19192 KB Output is correct
22 Correct 21 ms 19192 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 17912 KB Output is correct
2 Correct 20 ms 17916 KB Output is correct
3 Correct 20 ms 17912 KB Output is correct
4 Correct 20 ms 18040 KB Output is correct
5 Correct 21 ms 17912 KB Output is correct
6 Correct 21 ms 18040 KB Output is correct
7 Correct 20 ms 18040 KB Output is correct
8 Correct 20 ms 18044 KB Output is correct
9 Correct 20 ms 17912 KB Output is correct
10 Correct 25 ms 17912 KB Output is correct
11 Correct 21 ms 17912 KB Output is correct
12 Correct 21 ms 17952 KB Output is correct
13 Correct 21 ms 17920 KB Output is correct
14 Correct 20 ms 17944 KB Output is correct
15 Correct 20 ms 17912 KB Output is correct
16 Correct 20 ms 17784 KB Output is correct
17 Correct 20 ms 17912 KB Output is correct
18 Correct 20 ms 17912 KB Output is correct
19 Correct 20 ms 18040 KB Output is correct
20 Correct 20 ms 17912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 349 ms 49884 KB Output is correct
2 Correct 331 ms 49680 KB Output is correct
3 Correct 411 ms 49696 KB Output is correct
4 Correct 335 ms 49696 KB Output is correct
5 Correct 338 ms 49828 KB Output is correct
6 Correct 399 ms 58212 KB Output is correct
7 Correct 363 ms 53600 KB Output is correct
8 Correct 363 ms 52584 KB Output is correct
9 Correct 337 ms 51576 KB Output is correct
10 Correct 307 ms 49700 KB Output is correct
11 Correct 322 ms 49792 KB Output is correct
12 Correct 317 ms 49700 KB Output is correct
13 Correct 325 ms 49860 KB Output is correct
14 Correct 290 ms 47528 KB Output is correct
15 Correct 272 ms 44896 KB Output is correct
16 Correct 166 ms 36260 KB Output is correct
17 Correct 237 ms 48220 KB Output is correct
18 Correct 234 ms 48152 KB Output is correct
19 Correct 239 ms 48144 KB Output is correct
20 Correct 242 ms 48308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 17912 KB Output is correct
2 Correct 20 ms 17912 KB Output is correct
3 Correct 21 ms 17912 KB Output is correct
4 Correct 21 ms 17872 KB Output is correct
5 Correct 20 ms 17784 KB Output is correct
6 Correct 21 ms 17784 KB Output is correct
7 Correct 20 ms 17756 KB Output is correct
8 Correct 20 ms 17784 KB Output is correct
9 Correct 20 ms 17784 KB Output is correct
10 Correct 20 ms 17732 KB Output is correct
11 Correct 20 ms 17784 KB Output is correct
12 Correct 20 ms 17912 KB Output is correct
13 Correct 21 ms 17912 KB Output is correct
14 Correct 20 ms 17784 KB Output is correct
15 Correct 20 ms 17912 KB Output is correct
16 Correct 20 ms 17912 KB Output is correct
17 Correct 20 ms 17912 KB Output is correct
18 Correct 21 ms 17912 KB Output is correct
19 Correct 21 ms 17912 KB Output is correct
20 Correct 20 ms 17784 KB Output is correct
21 Correct 20 ms 17912 KB Output is correct
22 Correct 20 ms 17912 KB Output is correct
23 Correct 20 ms 17912 KB Output is correct
24 Correct 20 ms 17912 KB Output is correct
25 Correct 20 ms 17660 KB Output is correct
26 Correct 19 ms 17656 KB Output is correct
27 Correct 19 ms 17656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 328 ms 49752 KB Output is correct
2 Correct 351 ms 49996 KB Output is correct
3 Correct 332 ms 46624 KB Output is correct
4 Correct 308 ms 42412 KB Output is correct
5 Correct 268 ms 37648 KB Output is correct
6 Correct 250 ms 35888 KB Output is correct
7 Correct 235 ms 34736 KB Output is correct
8 Correct 230 ms 33588 KB Output is correct
9 Correct 215 ms 33116 KB Output is correct
10 Correct 223 ms 32632 KB Output is correct
11 Correct 238 ms 32040 KB Output is correct
12 Correct 244 ms 31480 KB Output is correct
13 Correct 218 ms 31616 KB Output is correct
14 Correct 245 ms 33000 KB Output is correct
15 Correct 368 ms 50780 KB Output is correct
16 Correct 364 ms 49504 KB Output is correct
17 Correct 335 ms 48192 KB Output is correct
18 Correct 412 ms 46692 KB Output is correct
19 Correct 316 ms 42412 KB Output is correct
20 Correct 325 ms 42448 KB Output is correct
21 Correct 313 ms 42280 KB Output is correct
22 Correct 279 ms 39948 KB Output is correct
23 Correct 225 ms 37160 KB Output is correct
24 Correct 309 ms 46632 KB Output is correct
25 Correct 292 ms 46756 KB Output is correct
26 Correct 302 ms 44064 KB Output is correct
27 Correct 333 ms 44356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 17656 KB Output is correct
2 Correct 19 ms 17656 KB Output is correct
3 Correct 19 ms 17628 KB Output is correct
4 Correct 19 ms 17656 KB Output is correct
5 Correct 19 ms 17528 KB Output is correct
6 Correct 19 ms 17628 KB Output is correct
7 Correct 18 ms 17628 KB Output is correct
8 Correct 19 ms 17600 KB Output is correct
9 Correct 19 ms 17656 KB Output is correct
10 Correct 19 ms 17528 KB Output is correct
11 Correct 19 ms 17656 KB Output is correct
12 Correct 19 ms 17656 KB Output is correct
13 Correct 19 ms 17656 KB Output is correct
14 Correct 23 ms 17656 KB Output is correct
15 Correct 23 ms 17656 KB Output is correct
16 Correct 19 ms 17656 KB Output is correct
17 Correct 19 ms 17656 KB Output is correct
18 Correct 23 ms 17656 KB Output is correct
19 Correct 19 ms 17656 KB Output is correct
20 Correct 19 ms 17656 KB Output is correct
21 Correct 19 ms 17528 KB Output is correct
22 Correct 19 ms 17624 KB Output is correct
23 Correct 19 ms 17656 KB Output is correct
24 Correct 19 ms 17656 KB Output is correct
25 Correct 19 ms 17656 KB Output is correct
26 Correct 19 ms 17656 KB Output is correct
27 Correct 19 ms 17656 KB Output is correct
28 Correct 19 ms 17656 KB Output is correct
29 Correct 19 ms 17656 KB Output is correct
30 Correct 19 ms 17656 KB Output is correct
31 Correct 19 ms 17656 KB Output is correct
32 Correct 19 ms 17656 KB Output is correct
33 Correct 19 ms 17656 KB Output is correct
34 Correct 19 ms 17656 KB Output is correct
35 Correct 19 ms 17656 KB Output is correct
36 Correct 19 ms 17656 KB Output is correct
37 Correct 19 ms 17656 KB Output is correct
38 Correct 19 ms 17656 KB Output is correct
39 Correct 19 ms 17628 KB Output is correct
40 Correct 19 ms 17656 KB Output is correct
41 Correct 19 ms 17656 KB Output is correct
42 Correct 20 ms 17656 KB Output is correct
43 Correct 19 ms 17656 KB Output is correct
44 Correct 23 ms 17684 KB Output is correct
45 Correct 19 ms 17656 KB Output is correct
46 Correct 19 ms 17656 KB Output is correct
47 Correct 19 ms 17656 KB Output is correct
48 Correct 19 ms 17656 KB Output is correct
49 Correct 19 ms 17528 KB Output is correct
50 Correct 19 ms 17528 KB Output is correct
51 Correct 19 ms 17628 KB Output is correct
52 Correct 19 ms 17656 KB Output is correct
53 Correct 19 ms 17656 KB Output is correct
54 Correct 19 ms 17656 KB Output is correct
55 Correct 19 ms 17660 KB Output is correct
56 Correct 20 ms 17656 KB Output is correct
57 Correct 19 ms 17656 KB Output is correct
58 Correct 19 ms 17660 KB Output is correct
59 Correct 23 ms 17656 KB Output is correct
60 Correct 20 ms 17656 KB Output is correct
61 Correct 19 ms 17656 KB Output is correct
62 Correct 19 ms 17656 KB Output is correct
63 Correct 19 ms 17660 KB Output is correct
64 Correct 23 ms 17656 KB Output is correct
65 Correct 19 ms 17656 KB Output is correct
66 Correct 19 ms 17656 KB Output is correct
67 Correct 20 ms 17784 KB Output is correct
68 Correct 20 ms 17912 KB Output is correct
69 Correct 21 ms 17912 KB Output is correct
70 Correct 20 ms 17912 KB Output is correct
71 Correct 20 ms 17784 KB Output is correct
72 Correct 20 ms 17784 KB Output is correct
73 Correct 20 ms 17784 KB Output is correct
74 Correct 20 ms 17784 KB Output is correct
75 Correct 20 ms 17784 KB Output is correct
76 Correct 19 ms 17656 KB Output is correct
77 Correct 21 ms 17912 KB Output is correct
78 Correct 20 ms 17784 KB Output is correct
79 Correct 20 ms 17828 KB Output is correct
80 Correct 20 ms 17784 KB Output is correct
81 Correct 20 ms 17784 KB Output is correct
82 Correct 20 ms 17784 KB Output is correct
83 Correct 19 ms 17784 KB Output is correct
84 Correct 23 ms 18012 KB Output is correct
85 Correct 20 ms 17784 KB Output is correct
86 Correct 21 ms 17784 KB Output is correct
87 Correct 20 ms 17784 KB Output is correct
88 Correct 20 ms 17788 KB Output is correct
89 Correct 20 ms 17828 KB Output is correct
90 Correct 20 ms 17784 KB Output is correct
91 Correct 20 ms 17784 KB Output is correct
92 Correct 20 ms 17756 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 17656 KB Output is correct
2 Correct 19 ms 17656 KB Output is correct
3 Correct 19 ms 17628 KB Output is correct
4 Correct 19 ms 17656 KB Output is correct
5 Correct 19 ms 17528 KB Output is correct
6 Correct 19 ms 17628 KB Output is correct
7 Correct 18 ms 17628 KB Output is correct
8 Correct 19 ms 17600 KB Output is correct
9 Correct 19 ms 17656 KB Output is correct
10 Correct 19 ms 17528 KB Output is correct
11 Correct 19 ms 17656 KB Output is correct
12 Correct 19 ms 17656 KB Output is correct
13 Correct 19 ms 17656 KB Output is correct
14 Correct 23 ms 17656 KB Output is correct
15 Correct 23 ms 17656 KB Output is correct
16 Correct 19 ms 17656 KB Output is correct
17 Correct 19 ms 17656 KB Output is correct
18 Correct 23 ms 17656 KB Output is correct
19 Correct 19 ms 17656 KB Output is correct
20 Correct 19 ms 17656 KB Output is correct
21 Correct 19 ms 17528 KB Output is correct
22 Correct 19 ms 17624 KB Output is correct
23 Correct 19 ms 17656 KB Output is correct
24 Correct 19 ms 17656 KB Output is correct
25 Correct 19 ms 17656 KB Output is correct
26 Correct 19 ms 17656 KB Output is correct
27 Correct 19 ms 17656 KB Output is correct
28 Correct 19 ms 17656 KB Output is correct
29 Correct 19 ms 17656 KB Output is correct
30 Correct 19 ms 17656 KB Output is correct
31 Correct 19 ms 17656 KB Output is correct
32 Correct 19 ms 17656 KB Output is correct
33 Correct 19 ms 17656 KB Output is correct
34 Correct 19 ms 17656 KB Output is correct
35 Correct 19 ms 17656 KB Output is correct
36 Correct 19 ms 17656 KB Output is correct
37 Correct 19 ms 17656 KB Output is correct
38 Correct 19 ms 17656 KB Output is correct
39 Correct 19 ms 17628 KB Output is correct
40 Correct 19 ms 17656 KB Output is correct
41 Correct 19 ms 17656 KB Output is correct
42 Correct 20 ms 17656 KB Output is correct
43 Correct 19 ms 17656 KB Output is correct
44 Correct 23 ms 17684 KB Output is correct
45 Correct 19 ms 17656 KB Output is correct
46 Correct 19 ms 17656 KB Output is correct
47 Correct 19 ms 17656 KB Output is correct
48 Correct 19 ms 17656 KB Output is correct
49 Correct 19 ms 17528 KB Output is correct
50 Correct 19 ms 17528 KB Output is correct
51 Correct 19 ms 17628 KB Output is correct
52 Correct 19 ms 17656 KB Output is correct
53 Correct 19 ms 17656 KB Output is correct
54 Correct 19 ms 17656 KB Output is correct
55 Correct 19 ms 17660 KB Output is correct
56 Correct 20 ms 17656 KB Output is correct
57 Correct 19 ms 17656 KB Output is correct
58 Correct 19 ms 17660 KB Output is correct
59 Correct 23 ms 17656 KB Output is correct
60 Correct 20 ms 17656 KB Output is correct
61 Correct 19 ms 17656 KB Output is correct
62 Correct 19 ms 17656 KB Output is correct
63 Correct 19 ms 17660 KB Output is correct
64 Correct 23 ms 17656 KB Output is correct
65 Correct 19 ms 17656 KB Output is correct
66 Correct 213 ms 39692 KB Output is correct
67 Correct 198 ms 39788 KB Output is correct
68 Correct 284 ms 45548 KB Output is correct
69 Correct 237 ms 43048 KB Output is correct
70 Correct 263 ms 40868 KB Output is correct
71 Correct 304 ms 46048 KB Output is correct
72 Correct 321 ms 44940 KB Output is correct
73 Correct 308 ms 45620 KB Output is correct
74 Correct 306 ms 43948 KB Output is correct
75 Correct 289 ms 42820 KB Output is correct
76 Correct 213 ms 38696 KB Output is correct
77 Correct 218 ms 38312 KB Output is correct
78 Correct 193 ms 37548 KB Output is correct
79 Correct 274 ms 37008 KB Output is correct
80 Correct 151 ms 34216 KB Output is correct
81 Correct 149 ms 33724 KB Output is correct
82 Correct 22 ms 19152 KB Output is correct
83 Correct 21 ms 19192 KB Output is correct
84 Correct 22 ms 19192 KB Output is correct
85 Correct 22 ms 19164 KB Output is correct
86 Correct 22 ms 19192 KB Output is correct
87 Correct 21 ms 19192 KB Output is correct
88 Correct 20 ms 17912 KB Output is correct
89 Correct 20 ms 17916 KB Output is correct
90 Correct 20 ms 17912 KB Output is correct
91 Correct 20 ms 18040 KB Output is correct
92 Correct 21 ms 17912 KB Output is correct
93 Correct 21 ms 18040 KB Output is correct
94 Correct 20 ms 18040 KB Output is correct
95 Correct 20 ms 18044 KB Output is correct
96 Correct 20 ms 17912 KB Output is correct
97 Correct 25 ms 17912 KB Output is correct
98 Correct 21 ms 17912 KB Output is correct
99 Correct 21 ms 17952 KB Output is correct
100 Correct 21 ms 17920 KB Output is correct
101 Correct 20 ms 17944 KB Output is correct
102 Correct 20 ms 17912 KB Output is correct
103 Correct 20 ms 17784 KB Output is correct
104 Correct 20 ms 17912 KB Output is correct
105 Correct 20 ms 17912 KB Output is correct
106 Correct 20 ms 18040 KB Output is correct
107 Correct 20 ms 17912 KB Output is correct
108 Correct 349 ms 49884 KB Output is correct
109 Correct 331 ms 49680 KB Output is correct
110 Correct 411 ms 49696 KB Output is correct
111 Correct 335 ms 49696 KB Output is correct
112 Correct 338 ms 49828 KB Output is correct
113 Correct 399 ms 58212 KB Output is correct
114 Correct 363 ms 53600 KB Output is correct
115 Correct 363 ms 52584 KB Output is correct
116 Correct 337 ms 51576 KB Output is correct
117 Correct 307 ms 49700 KB Output is correct
118 Correct 322 ms 49792 KB Output is correct
119 Correct 317 ms 49700 KB Output is correct
120 Correct 325 ms 49860 KB Output is correct
121 Correct 290 ms 47528 KB Output is correct
122 Correct 272 ms 44896 KB Output is correct
123 Correct 166 ms 36260 KB Output is correct
124 Correct 237 ms 48220 KB Output is correct
125 Correct 234 ms 48152 KB Output is correct
126 Correct 239 ms 48144 KB Output is correct
127 Correct 242 ms 48308 KB Output is correct
128 Correct 20 ms 17912 KB Output is correct
129 Correct 20 ms 17912 KB Output is correct
130 Correct 21 ms 17912 KB Output is correct
131 Correct 21 ms 17872 KB Output is correct
132 Correct 20 ms 17784 KB Output is correct
133 Correct 21 ms 17784 KB Output is correct
134 Correct 20 ms 17756 KB Output is correct
135 Correct 20 ms 17784 KB Output is correct
136 Correct 20 ms 17784 KB Output is correct
137 Correct 20 ms 17732 KB Output is correct
138 Correct 20 ms 17784 KB Output is correct
139 Correct 20 ms 17912 KB Output is correct
140 Correct 21 ms 17912 KB Output is correct
141 Correct 20 ms 17784 KB Output is correct
142 Correct 20 ms 17912 KB Output is correct
143 Correct 20 ms 17912 KB Output is correct
144 Correct 20 ms 17912 KB Output is correct
145 Correct 21 ms 17912 KB Output is correct
146 Correct 21 ms 17912 KB Output is correct
147 Correct 20 ms 17784 KB Output is correct
148 Correct 20 ms 17912 KB Output is correct
149 Correct 20 ms 17912 KB Output is correct
150 Correct 20 ms 17912 KB Output is correct
151 Correct 20 ms 17912 KB Output is correct
152 Correct 20 ms 17660 KB Output is correct
153 Correct 19 ms 17656 KB Output is correct
154 Correct 19 ms 17656 KB Output is correct
155 Correct 328 ms 49752 KB Output is correct
156 Correct 351 ms 49996 KB Output is correct
157 Correct 332 ms 46624 KB Output is correct
158 Correct 308 ms 42412 KB Output is correct
159 Correct 268 ms 37648 KB Output is correct
160 Correct 250 ms 35888 KB Output is correct
161 Correct 235 ms 34736 KB Output is correct
162 Correct 230 ms 33588 KB Output is correct
163 Correct 215 ms 33116 KB Output is correct
164 Correct 223 ms 32632 KB Output is correct
165 Correct 238 ms 32040 KB Output is correct
166 Correct 244 ms 31480 KB Output is correct
167 Correct 218 ms 31616 KB Output is correct
168 Correct 245 ms 33000 KB Output is correct
169 Correct 368 ms 50780 KB Output is correct
170 Correct 364 ms 49504 KB Output is correct
171 Correct 335 ms 48192 KB Output is correct
172 Correct 412 ms 46692 KB Output is correct
173 Correct 316 ms 42412 KB Output is correct
174 Correct 325 ms 42448 KB Output is correct
175 Correct 313 ms 42280 KB Output is correct
176 Correct 279 ms 39948 KB Output is correct
177 Correct 225 ms 37160 KB Output is correct
178 Correct 309 ms 46632 KB Output is correct
179 Correct 292 ms 46756 KB Output is correct
180 Correct 302 ms 44064 KB Output is correct
181 Correct 333 ms 44356 KB Output is correct
182 Correct 19 ms 17656 KB Output is correct
183 Correct 20 ms 17784 KB Output is correct
184 Correct 20 ms 17912 KB Output is correct
185 Correct 21 ms 17912 KB Output is correct
186 Correct 20 ms 17912 KB Output is correct
187 Correct 20 ms 17784 KB Output is correct
188 Correct 20 ms 17784 KB Output is correct
189 Correct 20 ms 17784 KB Output is correct
190 Correct 20 ms 17784 KB Output is correct
191 Correct 20 ms 17784 KB Output is correct
192 Correct 19 ms 17656 KB Output is correct
193 Correct 21 ms 17912 KB Output is correct
194 Correct 20 ms 17784 KB Output is correct
195 Correct 20 ms 17828 KB Output is correct
196 Correct 20 ms 17784 KB Output is correct
197 Correct 20 ms 17784 KB Output is correct
198 Correct 20 ms 17784 KB Output is correct
199 Correct 19 ms 17784 KB Output is correct
200 Correct 23 ms 18012 KB Output is correct
201 Correct 20 ms 17784 KB Output is correct
202 Correct 21 ms 17784 KB Output is correct
203 Correct 20 ms 17784 KB Output is correct
204 Correct 20 ms 17788 KB Output is correct
205 Correct 20 ms 17828 KB Output is correct
206 Correct 20 ms 17784 KB Output is correct
207 Correct 20 ms 17784 KB Output is correct
208 Correct 20 ms 17756 KB Output is correct
209 Correct 22 ms 19192 KB Output is correct
210 Correct 165 ms 35728 KB Output is correct
211 Correct 250 ms 39664 KB Output is correct
212 Correct 290 ms 42344 KB Output is correct
213 Correct 352 ms 44540 KB Output is correct
214 Correct 133 ms 38568 KB Output is correct
215 Correct 128 ms 37044 KB Output is correct
216 Correct 314 ms 45320 KB Output is correct
217 Correct 331 ms 40360 KB Output is correct
218 Correct 264 ms 35124 KB Output is correct
219 Correct 225 ms 33852 KB Output is correct
220 Correct 215 ms 33400 KB Output is correct
221 Correct 203 ms 32824 KB Output is correct
222 Correct 191 ms 32940 KB Output is correct
223 Correct 318 ms 42916 KB Output is correct
224 Correct 319 ms 42248 KB Output is correct
225 Correct 291 ms 39132 KB Output is correct
226 Correct 282 ms 39080 KB Output is correct
227 Correct 286 ms 39208 KB Output is correct
228 Correct 345 ms 37680 KB Output is correct
229 Correct 205 ms 35620 KB Output is correct
230 Correct 257 ms 39104 KB Output is correct
231 Correct 266 ms 39300 KB Output is correct