Submission #283007

# Submission time Handle Problem Language Result Execution time Memory
283007 2020-08-25T08:33:12 Z 문홍윤(#5763) Iqea (innopolis2018_final_C) C++17
100 / 100
1378 ms 168804 KB
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
#define svec(x) sort(x.begin(), x.end())
#define press(x) x.erase(unique(x.begin(), x.end()), x.end())
using namespace std;
typedef pair<int, int> pii;
const int inf=1e9;

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<int, int, hash<int>> ht;

int n, rex, rey;
ht mx[100010], my[100010];
pii p[100010];
vector<int> lx[100010], ly[100010];

bool cmp(pii a, pii b){return mp(a.S, a.F)<mp(b.S, b.F);}
inline void make_tree(){
    sort(p+1, p+n+1);
    for(int i=1; i<=n; i++){
        if(p[i].F!=p[i-1].F||p[i].S!=p[i-1].S+1)rex++;
        mx[p[i].F][p[i].S]=rex;
    }
    sort(p+1, p+n+1, cmp);
    for(int i=1; i<=n; i++){
        if(p[i].S!=p[i-1].S||p[i].F!=p[i-1].F+1)rey++;
        my[p[i].F][p[i].S]=rey;
    }
    for(int i=1; i<=n; i++){
        if(mx[p[i].F+1][p[i].S]){
            lx[mx[p[i].F][p[i].S]].eb(mx[p[i].F+1][p[i].S]);
            lx[mx[p[i].F+1][p[i].S]].eb(mx[p[i].F][p[i].S]);
        }
        if(my[p[i].F][p[i].S+1]){
            ly[my[p[i].F][p[i].S]].eb(my[p[i].F][p[i].S+1]);
            ly[my[p[i].F][p[i].S+1]].eb(my[p[i].F][p[i].S]);
        }
    }
    for(int i=1; i<=rex; i++){
        svec(lx[i]);
        press(lx[i]);
    }
    for(int i=1; i<=rey; i++){
        svec(ly[i]);
        press(ly[i]);
    }
}

int sz[100010];
bool ch[100010];
void dfs_x(int num, int par){
    sz[num]=1;
    for(auto i:lx[num]){
        if(i==par||ch[i])continue;
        dfs_x(i, num);
        sz[num]+=sz[i];
    }
}
int get_cen_x(int num, int siz){
    int ov=0;
    for(auto i:lx[num]){
        if(ch[i])continue;
        if(sz[i]>siz/2){
            ov=i;
            break;
        }
    }
    if(!ov)return num;
    sz[num]=siz-sz[ov];
    sz[ov]=siz;
    return get_cen_x(ov, siz);
}
void dfs_y(int num, int par){
    sz[num]=1;
    for(auto i:ly[num]){
        if(i==par||ch[i])continue;
        dfs_y(i, num);
        sz[num]+=sz[i];
    }
}
int get_cen_y(int num, int siz){
    int ov=0;
    for(auto i:ly[num]){
        if(ch[i])continue;
        if(sz[i]>siz/2){
            ov=i;
            break;
        }
    }
    if(!ov)return num;
    sz[num]=siz-sz[ov];
    sz[ov]=siz;
    return get_cen_y(ov, siz);
}

int cpar_x[100010], cpar_y[100010];
int d_x[100010][20], d_y[100010][20];

void make_cen_x(int num, int par){
    dfs_x(num, par);
    int cen=get_cen_x(num, sz[num]);
    cpar_x[cen]=par;
    ch[cen]=true;
    for(auto i:lx[cen]){
        if(ch[i])continue;
        make_cen_x(i, cen);
    }
}
void make_cen_y(int num, int par){
    dfs_y(num, par);
    int cen=get_cen_y(num, sz[num]);
    cpar_y[cen]=par;
    ch[cen]=true;
    for(auto i:ly[cen]){
        if(ch[i])continue;
        make_cen_y(i, cen);
    }
}

int dep_x[100010], dep_y[100010];
int sp_x[100010][20], sp_y[100010][20];
void dfs2_x(int num, int par){
    dep_x[num]=dep_x[par]+1;
    sp_x[num][0]=par;
    for(auto i:lx[num]){
        if(i==par)continue;
        dfs2_x(i, num);
    }
}
void dfs2_y(int num, int par){
    dep_y[num]=dep_y[par]+1;
    sp_y[num][0]=par;
    for(auto i:ly[num]){
        if(i==par)continue;
        dfs2_y(i, num);
    }
}

inline int lca_x(int x, int y){
    if(dep_x[x]>dep_x[y])swap(x, y);
    for(int i=19; i>=0; i--){
        if(dep_x[y]-dep_x[x]>=(1<<i))y=sp_x[y][i];
    }
    if(x==y)return x;
    for(int i=19; i>=0; i--){
        if(sp_x[x][i]!=sp_x[y][i]){
            x=sp_x[x][i];
            y=sp_x[y][i];
        }
    }
    return sp_x[x][0];
}
inline int lca_y(int x, int y){
    if(dep_y[x]>dep_y[y])swap(x, y);
    for(int i=19; i>=0; i--){
        if(dep_y[y]-dep_y[x]>=(1<<i))y=sp_y[y][i];
    }
    if(x==y)return x;
    for(int i=19; i>=0; i--){
        if(sp_y[x][i]!=sp_y[y][i]){
            x=sp_y[x][i];
            y=sp_y[y][i];
        }
    }
    return sp_y[x][0];
}
inline int getd_x(int x, int y){return dep_x[x]+dep_x[y]-2*dep_x[lca_x(x, y)];}
inline int getd_y(int x, int y){return dep_y[x]+dep_y[y]-2*dep_y[lca_y(x, y)];}

inline void get_cend_x(){
    for(int i=1; i<=rex; i++){
        int nw=cpar_x[i];
        for(int j=1; nw; j++, nw=cpar_x[nw])d_x[i][j]=getd_x(i, nw);
    }
}
inline void get_cend_y(){
    for(int i=1; i<=rey; i++){
        int nw=cpar_y[i];
        for(int j=1; nw; j++, nw=cpar_y[nw])d_y[i][j]=getd_y(i, nw);
    }
}

ht arr[100010];

inline void upd(int x, int y){
    int nx=mx[x][y], ny=my[x][y];
    int tx=nx, ty=ny;
    for(int i=0; tx; i++, tx=cpar_x[tx]){
        ty=ny;
        for(int j=0; ty; j++, ty=cpar_y[ty]){
            int tmp=d_x[nx][i]+d_y[ny][j]+1;
            if(!arr[tx][ty])arr[tx][ty]=inf;
            arr[tx][ty]=min(tmp, arr[tx][ty]);
        }
    }
}
inline int query(int x, int y){
    int nx=mx[x][y], ny=my[x][y], ret=inf;
    int tx=nx, ty=ny;
    for(int i=0; tx; i++, tx=cpar_x[tx]){
        ty=ny;
        for(int j=0; ty; j++, ty=cpar_y[ty]){
            if(!arr[tx][ty])continue;
            int tmp=d_x[nx][i]+d_y[ny][j];
            ret=min(ret, arr[tx][ty]+tmp-1);
        }
    }
    return ret==inf?-1:ret;
}

inline int readChar();
template<class T=int> inline T readInt();
static const int buf_size=4096;
inline int getChar(){
    static char buf[buf_size];
    static int len=0, pos=0;
    if(pos==len)pos=0, len=fread(buf, 1, buf_size, stdin);
    if(pos==len)return -1;
    return buf[pos++];
}
inline int readChar(){
    int c=getChar();
    while(c<=32)c=getChar();
    return c;
}
template <class T>
inline T readInt(){
    int s=1, c=readChar();
    T x=0;
    if(c=='-')s=-1, c=getChar();
    while('0'<= c&&c<='9')x=x*10+c-'0', c=getChar();
    return s==1?x:-x;
}

int main(){
    //scanf("%d", &n);
    n=readInt();
    for(int i=1; i<=n; i++){
        //scanf("%d %d", &p[i].F, &p[i].S);
        p[i].F=readInt(); p[i].S=readInt();
    }
    make_tree();
    make_cen_x(1, 0);
    memset(ch, 0, sizeof ch);
    make_cen_y(1, 0);
    dfs2_x(1, 0);
    dfs2_y(1, 0);
    for(int j=1; j<20; j++){
        for(int i=1; i<=rex; i++)sp_x[i][j]=sp_x[sp_x[i][j-1]][j-1];
        for(int i=1; i<=rey; i++)sp_y[i][j]=sp_y[sp_y[i][j-1]][j-1];
    }
    get_cend_x();
    get_cend_y();
    int q;
    //scanf("%d", &q);
    q=readInt();
    for(int i=1; i<=q; i++){
        int a, b, c;
        //scanf("%d %d %d", &a, &b, &c);
        a=readInt(); b=readInt(); c=readInt();
        if(a==1)upd(b, c);
        else printf("%d\n", query(b, c));
    }
}

# Verdict Execution time Memory Grader output
1 Correct 68 ms 59128 KB Output is correct
2 Correct 71 ms 59128 KB Output is correct
3 Correct 71 ms 59236 KB Output is correct
4 Correct 92 ms 60280 KB Output is correct
5 Correct 79 ms 60264 KB Output is correct
6 Correct 79 ms 60480 KB Output is correct
7 Correct 92 ms 62328 KB Output is correct
8 Correct 96 ms 62636 KB Output is correct
9 Correct 92 ms 62584 KB Output is correct
10 Correct 89 ms 62328 KB Output is correct
11 Correct 90 ms 62528 KB Output is correct
12 Correct 91 ms 62584 KB Output is correct
13 Correct 90 ms 62584 KB Output is correct
14 Correct 89 ms 62456 KB Output is correct
15 Correct 96 ms 62584 KB Output is correct
16 Correct 93 ms 62456 KB Output is correct
17 Correct 92 ms 62072 KB Output is correct
18 Correct 90 ms 62456 KB Output is correct
19 Correct 87 ms 62072 KB Output is correct
20 Correct 92 ms 62584 KB Output is correct
21 Correct 92 ms 62456 KB Output is correct
22 Correct 95 ms 63096 KB Output is correct
23 Correct 94 ms 62844 KB Output is correct
24 Correct 97 ms 63224 KB Output is correct
25 Correct 81 ms 61560 KB Output is correct
26 Correct 86 ms 62200 KB Output is correct
27 Correct 80 ms 61816 KB Output is correct
28 Correct 95 ms 63184 KB Output is correct
29 Correct 94 ms 63096 KB Output is correct
30 Correct 95 ms 63224 KB Output is correct
31 Correct 110 ms 63224 KB Output is correct
32 Correct 97 ms 63480 KB Output is correct
33 Correct 96 ms 63224 KB Output is correct
34 Correct 109 ms 63096 KB Output is correct
35 Correct 94 ms 63504 KB Output is correct
36 Correct 80 ms 61176 KB Output is correct
37 Correct 95 ms 63500 KB Output is correct
38 Correct 94 ms 63224 KB Output is correct
39 Correct 92 ms 63352 KB Output is correct
40 Correct 92 ms 63352 KB Output is correct
41 Correct 97 ms 62840 KB Output is correct
42 Correct 91 ms 62840 KB Output is correct
43 Correct 83 ms 61280 KB Output is correct
44 Correct 93 ms 62968 KB Output is correct
45 Correct 90 ms 62936 KB Output is correct
46 Correct 83 ms 61688 KB Output is correct
47 Correct 88 ms 61816 KB Output is correct
48 Correct 84 ms 61244 KB Output is correct
49 Correct 86 ms 61048 KB Output is correct
50 Correct 82 ms 60920 KB Output is correct
51 Correct 81 ms 60536 KB Output is correct
52 Correct 86 ms 61816 KB Output is correct
53 Correct 86 ms 61688 KB Output is correct
54 Correct 87 ms 61944 KB Output is correct
55 Correct 88 ms 61816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 59128 KB Output is correct
2 Correct 71 ms 59128 KB Output is correct
3 Correct 71 ms 59236 KB Output is correct
4 Correct 92 ms 60280 KB Output is correct
5 Correct 79 ms 60264 KB Output is correct
6 Correct 79 ms 60480 KB Output is correct
7 Correct 92 ms 62328 KB Output is correct
8 Correct 96 ms 62636 KB Output is correct
9 Correct 92 ms 62584 KB Output is correct
10 Correct 89 ms 62328 KB Output is correct
11 Correct 90 ms 62528 KB Output is correct
12 Correct 91 ms 62584 KB Output is correct
13 Correct 90 ms 62584 KB Output is correct
14 Correct 89 ms 62456 KB Output is correct
15 Correct 96 ms 62584 KB Output is correct
16 Correct 93 ms 62456 KB Output is correct
17 Correct 92 ms 62072 KB Output is correct
18 Correct 90 ms 62456 KB Output is correct
19 Correct 87 ms 62072 KB Output is correct
20 Correct 92 ms 62584 KB Output is correct
21 Correct 92 ms 62456 KB Output is correct
22 Correct 95 ms 63096 KB Output is correct
23 Correct 94 ms 62844 KB Output is correct
24 Correct 97 ms 63224 KB Output is correct
25 Correct 81 ms 61560 KB Output is correct
26 Correct 86 ms 62200 KB Output is correct
27 Correct 80 ms 61816 KB Output is correct
28 Correct 95 ms 63184 KB Output is correct
29 Correct 94 ms 63096 KB Output is correct
30 Correct 95 ms 63224 KB Output is correct
31 Correct 110 ms 63224 KB Output is correct
32 Correct 97 ms 63480 KB Output is correct
33 Correct 96 ms 63224 KB Output is correct
34 Correct 109 ms 63096 KB Output is correct
35 Correct 94 ms 63504 KB Output is correct
36 Correct 80 ms 61176 KB Output is correct
37 Correct 95 ms 63500 KB Output is correct
38 Correct 94 ms 63224 KB Output is correct
39 Correct 92 ms 63352 KB Output is correct
40 Correct 92 ms 63352 KB Output is correct
41 Correct 97 ms 62840 KB Output is correct
42 Correct 91 ms 62840 KB Output is correct
43 Correct 83 ms 61280 KB Output is correct
44 Correct 93 ms 62968 KB Output is correct
45 Correct 90 ms 62936 KB Output is correct
46 Correct 83 ms 61688 KB Output is correct
47 Correct 88 ms 61816 KB Output is correct
48 Correct 84 ms 61244 KB Output is correct
49 Correct 86 ms 61048 KB Output is correct
50 Correct 82 ms 60920 KB Output is correct
51 Correct 81 ms 60536 KB Output is correct
52 Correct 86 ms 61816 KB Output is correct
53 Correct 86 ms 61688 KB Output is correct
54 Correct 87 ms 61944 KB Output is correct
55 Correct 88 ms 61816 KB Output is correct
56 Correct 124 ms 60664 KB Output is correct
57 Correct 127 ms 60664 KB Output is correct
58 Correct 125 ms 60664 KB Output is correct
59 Correct 182 ms 62968 KB Output is correct
60 Correct 197 ms 63208 KB Output is correct
61 Correct 259 ms 63232 KB Output is correct
62 Correct 179 ms 63096 KB Output is correct
63 Correct 175 ms 62968 KB Output is correct
64 Correct 193 ms 63224 KB Output is correct
65 Correct 185 ms 63224 KB Output is correct
66 Correct 196 ms 63352 KB Output is correct
67 Correct 196 ms 63352 KB Output is correct
68 Correct 216 ms 62968 KB Output is correct
69 Correct 184 ms 62712 KB Output is correct
70 Correct 195 ms 63096 KB Output is correct
71 Correct 167 ms 62584 KB Output is correct
72 Correct 188 ms 63096 KB Output is correct
73 Correct 184 ms 63224 KB Output is correct
74 Correct 129 ms 61944 KB Output is correct
75 Correct 127 ms 63096 KB Output is correct
76 Correct 106 ms 62200 KB Output is correct
77 Correct 228 ms 63864 KB Output is correct
78 Correct 238 ms 64036 KB Output is correct
79 Correct 128 ms 61560 KB Output is correct
80 Correct 228 ms 64000 KB Output is correct
81 Correct 230 ms 63944 KB Output is correct
82 Correct 231 ms 63608 KB Output is correct
83 Correct 233 ms 63480 KB Output is correct
84 Correct 133 ms 61688 KB Output is correct
85 Correct 205 ms 63736 KB Output is correct
86 Correct 208 ms 63724 KB Output is correct
87 Correct 107 ms 62072 KB Output is correct
88 Correct 174 ms 62216 KB Output is correct
89 Correct 161 ms 61688 KB Output is correct
90 Correct 153 ms 61432 KB Output is correct
91 Correct 145 ms 61184 KB Output is correct
92 Correct 131 ms 60792 KB Output is correct
93 Correct 175 ms 62328 KB Output is correct
94 Correct 181 ms 62328 KB Output is correct
95 Correct 175 ms 62328 KB Output is correct
96 Correct 182 ms 62328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 425 ms 114888 KB Output is correct
2 Correct 439 ms 102660 KB Output is correct
3 Correct 1206 ms 164196 KB Output is correct
4 Correct 1210 ms 168804 KB Output is correct
5 Correct 1111 ms 160364 KB Output is correct
6 Correct 1108 ms 159980 KB Output is correct
7 Correct 414 ms 90520 KB Output is correct
8 Correct 349 ms 104804 KB Output is correct
9 Correct 350 ms 108940 KB Output is correct
10 Correct 475 ms 89976 KB Output is correct
11 Correct 404 ms 105444 KB Output is correct
12 Correct 398 ms 108900 KB Output is correct
13 Correct 367 ms 109160 KB Output is correct
14 Correct 379 ms 109012 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 995 ms 139116 KB Output is correct
2 Correct 1031 ms 141808 KB Output is correct
3 Correct 1064 ms 141424 KB Output is correct
4 Correct 1070 ms 143560 KB Output is correct
5 Correct 1090 ms 142692 KB Output is correct
6 Correct 1070 ms 143376 KB Output is correct
7 Correct 1025 ms 141800 KB Output is correct
8 Correct 1008 ms 141540 KB Output is correct
9 Correct 1047 ms 143588 KB Output is correct
10 Correct 1195 ms 156400 KB Output is correct
11 Correct 1145 ms 153064 KB Output is correct
12 Correct 1208 ms 157548 KB Output is correct
13 Correct 480 ms 109428 KB Output is correct
14 Correct 548 ms 133484 KB Output is correct
15 Correct 355 ms 110052 KB Output is correct
16 Correct 1125 ms 156764 KB Output is correct
17 Correct 1193 ms 156876 KB Output is correct
18 Correct 1167 ms 159748 KB Output is correct
19 Correct 1190 ms 159732 KB Output is correct
20 Correct 1343 ms 165460 KB Output is correct
21 Correct 1378 ms 165216 KB Output is correct
22 Correct 1261 ms 157504 KB Output is correct
23 Correct 1325 ms 168580 KB Output is correct
24 Correct 441 ms 101928 KB Output is correct
25 Correct 1261 ms 164560 KB Output is correct
26 Correct 1278 ms 164784 KB Output is correct
27 Correct 1164 ms 167772 KB Output is correct
28 Correct 1177 ms 167212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 59128 KB Output is correct
2 Correct 71 ms 59128 KB Output is correct
3 Correct 71 ms 59236 KB Output is correct
4 Correct 92 ms 60280 KB Output is correct
5 Correct 79 ms 60264 KB Output is correct
6 Correct 79 ms 60480 KB Output is correct
7 Correct 92 ms 62328 KB Output is correct
8 Correct 96 ms 62636 KB Output is correct
9 Correct 92 ms 62584 KB Output is correct
10 Correct 89 ms 62328 KB Output is correct
11 Correct 90 ms 62528 KB Output is correct
12 Correct 91 ms 62584 KB Output is correct
13 Correct 90 ms 62584 KB Output is correct
14 Correct 89 ms 62456 KB Output is correct
15 Correct 96 ms 62584 KB Output is correct
16 Correct 93 ms 62456 KB Output is correct
17 Correct 92 ms 62072 KB Output is correct
18 Correct 90 ms 62456 KB Output is correct
19 Correct 87 ms 62072 KB Output is correct
20 Correct 92 ms 62584 KB Output is correct
21 Correct 92 ms 62456 KB Output is correct
22 Correct 95 ms 63096 KB Output is correct
23 Correct 94 ms 62844 KB Output is correct
24 Correct 97 ms 63224 KB Output is correct
25 Correct 81 ms 61560 KB Output is correct
26 Correct 86 ms 62200 KB Output is correct
27 Correct 80 ms 61816 KB Output is correct
28 Correct 95 ms 63184 KB Output is correct
29 Correct 94 ms 63096 KB Output is correct
30 Correct 95 ms 63224 KB Output is correct
31 Correct 110 ms 63224 KB Output is correct
32 Correct 97 ms 63480 KB Output is correct
33 Correct 96 ms 63224 KB Output is correct
34 Correct 109 ms 63096 KB Output is correct
35 Correct 94 ms 63504 KB Output is correct
36 Correct 80 ms 61176 KB Output is correct
37 Correct 95 ms 63500 KB Output is correct
38 Correct 94 ms 63224 KB Output is correct
39 Correct 92 ms 63352 KB Output is correct
40 Correct 92 ms 63352 KB Output is correct
41 Correct 97 ms 62840 KB Output is correct
42 Correct 91 ms 62840 KB Output is correct
43 Correct 83 ms 61280 KB Output is correct
44 Correct 93 ms 62968 KB Output is correct
45 Correct 90 ms 62936 KB Output is correct
46 Correct 83 ms 61688 KB Output is correct
47 Correct 88 ms 61816 KB Output is correct
48 Correct 84 ms 61244 KB Output is correct
49 Correct 86 ms 61048 KB Output is correct
50 Correct 82 ms 60920 KB Output is correct
51 Correct 81 ms 60536 KB Output is correct
52 Correct 86 ms 61816 KB Output is correct
53 Correct 86 ms 61688 KB Output is correct
54 Correct 87 ms 61944 KB Output is correct
55 Correct 88 ms 61816 KB Output is correct
56 Correct 124 ms 60664 KB Output is correct
57 Correct 127 ms 60664 KB Output is correct
58 Correct 125 ms 60664 KB Output is correct
59 Correct 182 ms 62968 KB Output is correct
60 Correct 197 ms 63208 KB Output is correct
61 Correct 259 ms 63232 KB Output is correct
62 Correct 179 ms 63096 KB Output is correct
63 Correct 175 ms 62968 KB Output is correct
64 Correct 193 ms 63224 KB Output is correct
65 Correct 185 ms 63224 KB Output is correct
66 Correct 196 ms 63352 KB Output is correct
67 Correct 196 ms 63352 KB Output is correct
68 Correct 216 ms 62968 KB Output is correct
69 Correct 184 ms 62712 KB Output is correct
70 Correct 195 ms 63096 KB Output is correct
71 Correct 167 ms 62584 KB Output is correct
72 Correct 188 ms 63096 KB Output is correct
73 Correct 184 ms 63224 KB Output is correct
74 Correct 129 ms 61944 KB Output is correct
75 Correct 127 ms 63096 KB Output is correct
76 Correct 106 ms 62200 KB Output is correct
77 Correct 228 ms 63864 KB Output is correct
78 Correct 238 ms 64036 KB Output is correct
79 Correct 128 ms 61560 KB Output is correct
80 Correct 228 ms 64000 KB Output is correct
81 Correct 230 ms 63944 KB Output is correct
82 Correct 231 ms 63608 KB Output is correct
83 Correct 233 ms 63480 KB Output is correct
84 Correct 133 ms 61688 KB Output is correct
85 Correct 205 ms 63736 KB Output is correct
86 Correct 208 ms 63724 KB Output is correct
87 Correct 107 ms 62072 KB Output is correct
88 Correct 174 ms 62216 KB Output is correct
89 Correct 161 ms 61688 KB Output is correct
90 Correct 153 ms 61432 KB Output is correct
91 Correct 145 ms 61184 KB Output is correct
92 Correct 131 ms 60792 KB Output is correct
93 Correct 175 ms 62328 KB Output is correct
94 Correct 181 ms 62328 KB Output is correct
95 Correct 175 ms 62328 KB Output is correct
96 Correct 182 ms 62328 KB Output is correct
97 Correct 425 ms 114888 KB Output is correct
98 Correct 439 ms 102660 KB Output is correct
99 Correct 1206 ms 164196 KB Output is correct
100 Correct 1210 ms 168804 KB Output is correct
101 Correct 1111 ms 160364 KB Output is correct
102 Correct 1108 ms 159980 KB Output is correct
103 Correct 414 ms 90520 KB Output is correct
104 Correct 349 ms 104804 KB Output is correct
105 Correct 350 ms 108940 KB Output is correct
106 Correct 475 ms 89976 KB Output is correct
107 Correct 404 ms 105444 KB Output is correct
108 Correct 398 ms 108900 KB Output is correct
109 Correct 367 ms 109160 KB Output is correct
110 Correct 379 ms 109012 KB Output is correct
111 Correct 995 ms 139116 KB Output is correct
112 Correct 1031 ms 141808 KB Output is correct
113 Correct 1064 ms 141424 KB Output is correct
114 Correct 1070 ms 143560 KB Output is correct
115 Correct 1090 ms 142692 KB Output is correct
116 Correct 1070 ms 143376 KB Output is correct
117 Correct 1025 ms 141800 KB Output is correct
118 Correct 1008 ms 141540 KB Output is correct
119 Correct 1047 ms 143588 KB Output is correct
120 Correct 1195 ms 156400 KB Output is correct
121 Correct 1145 ms 153064 KB Output is correct
122 Correct 1208 ms 157548 KB Output is correct
123 Correct 480 ms 109428 KB Output is correct
124 Correct 548 ms 133484 KB Output is correct
125 Correct 355 ms 110052 KB Output is correct
126 Correct 1125 ms 156764 KB Output is correct
127 Correct 1193 ms 156876 KB Output is correct
128 Correct 1167 ms 159748 KB Output is correct
129 Correct 1190 ms 159732 KB Output is correct
130 Correct 1343 ms 165460 KB Output is correct
131 Correct 1378 ms 165216 KB Output is correct
132 Correct 1261 ms 157504 KB Output is correct
133 Correct 1325 ms 168580 KB Output is correct
134 Correct 441 ms 101928 KB Output is correct
135 Correct 1261 ms 164560 KB Output is correct
136 Correct 1278 ms 164784 KB Output is correct
137 Correct 1164 ms 167772 KB Output is correct
138 Correct 1177 ms 167212 KB Output is correct
139 Correct 311 ms 74488 KB Output is correct
140 Correct 352 ms 81864 KB Output is correct
141 Correct 342 ms 80764 KB Output is correct
142 Correct 338 ms 82424 KB Output is correct
143 Correct 1000 ms 137552 KB Output is correct
144 Correct 969 ms 134764 KB Output is correct
145 Correct 1012 ms 138744 KB Output is correct
146 Correct 889 ms 127972 KB Output is correct
147 Correct 1080 ms 143460 KB Output is correct
148 Correct 1077 ms 141692 KB Output is correct
149 Correct 1060 ms 152604 KB Output is correct
150 Correct 1068 ms 147892 KB Output is correct
151 Correct 457 ms 100088 KB Output is correct
152 Correct 1123 ms 157408 KB Output is correct
153 Correct 1107 ms 152612 KB Output is correct
154 Correct 375 ms 110544 KB Output is correct
155 Correct 898 ms 121912 KB Output is correct
156 Correct 740 ms 111436 KB Output is correct
157 Correct 654 ms 105708 KB Output is correct
158 Correct 585 ms 99576 KB Output is correct
159 Correct 466 ms 90232 KB Output is correct
160 Correct 811 ms 127212 KB Output is correct
161 Correct 870 ms 124008 KB Output is correct
162 Correct 835 ms 126100 KB Output is correct
163 Correct 852 ms 126312 KB Output is correct