답안 #1098049

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1098049 2024-10-09T01:20:56 Z azberjibiou 송신탑 (IOI22_towers) C++17
100 / 100
2344 ms 59776 KB
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define pb push_back
#define lb lower_bound
#define gibon ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
typedef long long ll;
using namespace std;
const int mxN=500005;
const int mxM=2200005;
const int mxK=61;
const int MOD=1e9+7;
const ll INF=1e18;
struct segtree{
    pii seg[4*mxN];
    pii mrg(pii a, pii b){
        return pii(min(a.fi, b.fi), max(a.se, b.se));
    }
    void init(int idx, int s, int e, vector <int> &v){
        if(s==e){
            seg[idx]=pii(v[s], v[s]);
            return;
        }
        int mid=(s+e)/2;
        init(2*idx, s, mid, v);
        init(2*idx+1, mid+1, e, v);
        seg[idx]=mrg(seg[2*idx], seg[2*idx+1]);
    }
    pii solv(int idx, int s1, int e1, int s2, int e2){
        if(s2>e1 || s1>e2) return pii(MOD, -MOD);
        if(s2<=s1 && e1<=e2) return seg[idx];
        int mid=(s1+e1)/2;
        return mrg(solv(2*idx, s1, mid, s2, e2), solv(2*idx+1, mid+1, e1, s2, e2));
    }
};
struct node{
    int val;
    int l, r;
    node() : val(), l(), r() {}
    node(int val, int l, int r) : val(val), l(l), r(r) {}
};
struct pst{
    vector <node> tree;
    int root[100010]={};
    int sz=1, L, R;
    void init_s(int a, int b){
        tree.resize(2300000);
        root[0]=sz++;
        L=a, R=b;
        init_t(root[0], L, R);
    }
    void init_t(int idx, int s, int e){
        if(s==e) return;
        int mid=(s+e)/2;
        tree[idx].l=sz++;
        init_t(sz-1, s, mid);
        tree[idx].r=sz++;
        init_t(sz-1, mid+1, e);
    }
    void upd_s(int now, int pos){
        root[now]=sz++;
        upd_t(root[now], root[now-1], L, R, pos);
    }
    void upd_t(int idx1, int idx2, int s, int e, int pos){
        tree[idx1].val=tree[idx2].val;
        tree[idx1].val++;
        if(s==e) return;
        int mid=(s+e)/2;
        if(pos<=mid) tree[idx1].l=sz++;
        else tree[idx1].r=sz++;
        if(pos<=mid) upd_t(sz-1, tree[idx2].l, s, mid, pos), tree[idx1].r=tree[idx2].r;
        else upd_t(sz-1, tree[idx2].r, mid+1, e, pos), tree[idx1].l=tree[idx2].l;
    }
    int solv_s(int rt, int s, int e){
        return solv_t(root[rt], L, R, s, e);
    }
    int solv_t(int idx, int s1, int e1, int s2, int e2){
        if(s2>e1 || s1>e2) return 0;
        if(s2<=s1 && e1<=e2) return tree[idx].val;
        int mid=(s1+e1)/2;
        return solv_t(tree[idx].l, s1, mid, s2, e2)+solv_t(tree[idx].r, mid+1, e1, s2, e2);
    }
};
int N, Q;
int A[mxN];
int qry[mxN][3];
int F[mxN];
vector <pii> Dp, Dm;
/*
void input(){
    cin >> N >> Q;
    A[0]=-1e9-10, A[1]=1e9+10;
    for(int i=2;i<=N+1;i++) cin >> A[i];
    A[N+2]=1e9+10, A[N+3]=-1e9-10;
    for(int i=1;i<=Q;i++){
        int l, r, d;
        cin >> l >> r >> d;
        qry[i][0]=l;
        qry[i][1]=r;
        qry[i][2]=d;
    }
}
*/
segtree T1;
void make_F(){
    vector <int> v(N+4);
    for(int i=0;i<=N+3;i++) v[i]=A[i];
    T1.init(1, 0, N+3, v);
    stack <int> stk;
    stk.push(1);
    for(int i=2;i<=N+1;i++){
        while(A[stk.top()]<A[i]) stk.pop();
        if(A[i]<A[i-1] || A[i]<A[i+1]) continue;
        int mini=(stk.top()==i-1 ? MOD : T1.solv(1, 0, N+3, stk.top()+1, i-1).fi);
        F[i]=A[i]-mini;
        stk.push(i);
    }
    while(stk.size()) stk.pop();

    stk.push(N+2);
    for(int i=N+1;i>=2;i--){
        while(A[stk.top()]<A[i]) stk.pop();
        if(A[i]<A[i-1] || A[i]<A[i+1]) continue;
        int mini=(stk.top()==i+1 ? MOD : T1.solv(1, 0, N+3, i+1, stk.top()-1).fi);
        F[i]=min(F[i], A[i]-mini);
        stk.push(i);
    }
    while(stk.size()) stk.pop();

    stk.push(0);
    for(int i=2;i<=N+1;i++){
        while(A[stk.top()]>A[i]) stk.pop();
        if(A[i]>A[i-1] || A[i]>A[i+1]) continue;
        int maxi=(stk.top()==i-1 ? -MOD : T1.solv(1, 0, N+3, stk.top()+1, i-1).se);
        F[i]=maxi-A[i];
        stk.push(i);
    }

    stk.push(N+3);
    for(int i=N+1;i>=2;i--){
        while(A[stk.top()]>A[i]) stk.pop();
        if(A[i]>A[i-1] || A[i]>A[i+1]) continue;
        int maxi=(stk.top()==i+1 ? -MOD : T1.solv(1, 0, N+3, i+1, stk.top()-1).se);
        F[i]=min(F[i], maxi-A[i]);
        F[i]*=-1;
        stk.push(i);
    }
    //for(int i=1;i<=N;i++) printf("F[%d]=%d\n", i, F[i+1]);
    for(int i=2;i<=N+1;i++) if(F[i]>0) Dp.emplace_back(F[i], i);
    for(int i=2;i<=N+1;i++) if(F[i]<0) Dm.emplace_back(-F[i], i);
    sort(all(Dp), [](pii a, pii b){return a>b;});
    sort(all(Dm), [](pii a, pii b){return a>b;});
    /*
    for(auto [x, y] : Dp) printf("(%d %d) ", x, y);
    printf("\n");
    for(auto [x, y] : Dm) printf("(%d %d) ", x, y);
    printf("\n");
    */
}
pst T2, T3;
void make_tree(){
    T2.init_s(2, N+1);
    for(int i=0;i<Dp.size();i++){
        T2.upd_s(i+1, Dp[i].se);
    }
    T3.init_s(2, N+1);
    for(int i=0;i<Dm.size();i++){
        T3.upd_s(i+1, Dm[i].se);
    }
}
void init(int n, vector <int> v){
    N=n;
    A[0]=-1e9-10, A[1]=1e9+10;
    for(int i=2;i<=N+1;i++) A[i]=v[i-2];
    A[N+2]=1e9+10, A[N+3]=-1e9-10;
    make_F();
    make_tree();
}
int max_towers(int l, int r, int d){
    l+=2, r+=2;
    int lp=N+3, lm=N+3, rp=0, rm=0, mcnt=0, pcnt=0;

    int mxidx, mnidx;
    mxidx=lower_bound(all(Dp), pii(d, 0), [](pii a, pii b){return a>b;})-Dp.begin();
    mnidx=lower_bound(all(Dm), pii(d, 0), [](pii a, pii b){return a>b;})-Dm.begin();
    pcnt=T2.solv_s(mxidx, l, r);
    mcnt=T3.solv_s(mnidx, l, r);
    if(pcnt!=0){
        int s=l, e=r+1;
        while(s!=e){
            int mid=(s+e)/2;
            if(T2.solv_s(mxidx, mid, r)==0) e=mid;
            else s=mid+1;
        }
        rp=s-1;
        s=l, e=r;
        while(s!=e){
            int mid=(s+e)/2;
            if(T2.solv_s(mxidx, l, mid)==0) s=mid+1;
            else e=mid;
        }
        lp=s;
    }
    if(mcnt!=0){
        int s=l, e=r+1;
        while(s!=e){
            int mid=(s+e)/2;
            if(T3.solv_s(mnidx, mid, r)==0) e=mid;
            else s=mid+1;
        }
        rm=s-1;
        s=l, e=r;
        while(s!=e){
            int mid=(s+e)/2;
            if(T3.solv_s(mnidx, l, mid)==0) s=mid+1;
            else e=mid;
        }
        lm=s;
    }
    /*
    for(int i=l;i<=r;i++){
        if(F[i]>=d) pcnt++, rp=max(rp, i), lp=min(lp, i);
        if(F[i]<=-d) mcnt++, rm=max(rm, i), lm=min(lm, i);
    }
    */
    if(rp!=0 && rp>=rm){
        bool ok=false;
        if(rp!=r && T1.solv(1, 0, N+3, rp+1, r).fi<=A[rp]-d) ok=true;
        if(ok) mcnt++;
    }
    if(lp!=N+3 && lp<=lm){
        bool ok=false;
        if(lp!=l && T1.solv(1, 0, N+3, l, lp-1).fi<=A[lp]-d) ok=true;
        if(ok) mcnt++;
    }
    return (mcnt<=1 ? 1 : mcnt);
}
/*
int main()
{
    gibon
    input();
    make_F();
    make_tree();
    for(int i=1;i<=Q;i++){
        printf("%d\n", max_towers(qry[i][0], qry[i][1], qry[i][2]));
    }
} 
*/

Compilation message

towers.cpp: In function 'void make_tree()':
towers.cpp:166:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  166 |     for(int i=0;i<Dp.size();i++){
      |                 ~^~~~~~~~~~
towers.cpp:170:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  170 |     for(int i=0;i<Dm.size();i++){
      |                 ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 428 ms 56932 KB Output is correct
2 Correct 763 ms 58312 KB Output is correct
3 Correct 825 ms 58308 KB Output is correct
4 Correct 766 ms 58312 KB Output is correct
5 Correct 734 ms 58664 KB Output is correct
6 Correct 770 ms 58312 KB Output is correct
7 Correct 765 ms 58312 KB Output is correct
8 Correct 21 ms 55128 KB Output is correct
9 Correct 21 ms 55128 KB Output is correct
10 Correct 22 ms 55128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 55088 KB Output is correct
2 Correct 22 ms 55128 KB Output is correct
3 Correct 22 ms 55128 KB Output is correct
4 Correct 22 ms 55296 KB Output is correct
5 Correct 22 ms 55128 KB Output is correct
6 Correct 22 ms 55128 KB Output is correct
7 Correct 25 ms 55152 KB Output is correct
8 Correct 28 ms 55384 KB Output is correct
9 Correct 23 ms 55120 KB Output is correct
10 Correct 26 ms 55120 KB Output is correct
11 Correct 23 ms 55120 KB Output is correct
12 Correct 23 ms 55128 KB Output is correct
13 Correct 24 ms 55264 KB Output is correct
14 Correct 24 ms 55128 KB Output is correct
15 Correct 25 ms 55120 KB Output is correct
16 Correct 26 ms 55128 KB Output is correct
17 Correct 30 ms 55128 KB Output is correct
18 Correct 25 ms 55120 KB Output is correct
19 Correct 25 ms 55060 KB Output is correct
20 Correct 26 ms 55120 KB Output is correct
21 Correct 26 ms 55128 KB Output is correct
22 Correct 25 ms 55128 KB Output is correct
23 Correct 27 ms 55312 KB Output is correct
24 Correct 24 ms 55128 KB Output is correct
25 Correct 24 ms 55128 KB Output is correct
26 Correct 24 ms 55296 KB Output is correct
27 Correct 25 ms 55128 KB Output is correct
28 Correct 26 ms 55120 KB Output is correct
29 Correct 25 ms 55128 KB Output is correct
30 Correct 24 ms 55128 KB Output is correct
31 Correct 24 ms 55128 KB Output is correct
32 Correct 22 ms 55128 KB Output is correct
33 Correct 24 ms 55120 KB Output is correct
34 Correct 25 ms 55120 KB Output is correct
35 Correct 25 ms 55116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 55088 KB Output is correct
2 Correct 22 ms 55128 KB Output is correct
3 Correct 22 ms 55128 KB Output is correct
4 Correct 22 ms 55296 KB Output is correct
5 Correct 22 ms 55128 KB Output is correct
6 Correct 22 ms 55128 KB Output is correct
7 Correct 25 ms 55152 KB Output is correct
8 Correct 28 ms 55384 KB Output is correct
9 Correct 23 ms 55120 KB Output is correct
10 Correct 26 ms 55120 KB Output is correct
11 Correct 23 ms 55120 KB Output is correct
12 Correct 23 ms 55128 KB Output is correct
13 Correct 24 ms 55264 KB Output is correct
14 Correct 24 ms 55128 KB Output is correct
15 Correct 25 ms 55120 KB Output is correct
16 Correct 26 ms 55128 KB Output is correct
17 Correct 30 ms 55128 KB Output is correct
18 Correct 25 ms 55120 KB Output is correct
19 Correct 25 ms 55060 KB Output is correct
20 Correct 26 ms 55120 KB Output is correct
21 Correct 26 ms 55128 KB Output is correct
22 Correct 25 ms 55128 KB Output is correct
23 Correct 27 ms 55312 KB Output is correct
24 Correct 24 ms 55128 KB Output is correct
25 Correct 24 ms 55128 KB Output is correct
26 Correct 24 ms 55296 KB Output is correct
27 Correct 25 ms 55128 KB Output is correct
28 Correct 26 ms 55120 KB Output is correct
29 Correct 25 ms 55128 KB Output is correct
30 Correct 24 ms 55128 KB Output is correct
31 Correct 24 ms 55128 KB Output is correct
32 Correct 22 ms 55128 KB Output is correct
33 Correct 24 ms 55120 KB Output is correct
34 Correct 25 ms 55120 KB Output is correct
35 Correct 25 ms 55116 KB Output is correct
36 Correct 60 ms 57680 KB Output is correct
37 Correct 71 ms 59336 KB Output is correct
38 Correct 69 ms 59512 KB Output is correct
39 Correct 88 ms 59528 KB Output is correct
40 Correct 104 ms 59580 KB Output is correct
41 Correct 81 ms 59588 KB Output is correct
42 Correct 90 ms 59604 KB Output is correct
43 Correct 39 ms 58320 KB Output is correct
44 Correct 43 ms 58312 KB Output is correct
45 Correct 34 ms 58332 KB Output is correct
46 Correct 32 ms 58312 KB Output is correct
47 Correct 76 ms 59332 KB Output is correct
48 Correct 83 ms 59540 KB Output is correct
49 Correct 89 ms 59644 KB Output is correct
50 Correct 44 ms 58312 KB Output is correct
51 Correct 35 ms 58312 KB Output is correct
52 Correct 69 ms 59376 KB Output is correct
53 Correct 81 ms 59640 KB Output is correct
54 Correct 83 ms 59652 KB Output is correct
55 Correct 41 ms 58456 KB Output is correct
56 Correct 36 ms 58312 KB Output is correct
57 Correct 66 ms 59392 KB Output is correct
58 Correct 69 ms 59312 KB Output is correct
59 Correct 76 ms 59340 KB Output is correct
60 Correct 91 ms 59724 KB Output is correct
61 Correct 87 ms 59588 KB Output is correct
62 Correct 90 ms 59588 KB Output is correct
63 Correct 92 ms 59588 KB Output is correct
64 Correct 35 ms 58320 KB Output is correct
65 Correct 41 ms 58324 KB Output is correct
66 Correct 32 ms 58328 KB Output is correct
67 Correct 32 ms 58412 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1347 ms 59332 KB Output is correct
2 Correct 1868 ms 59280 KB Output is correct
3 Correct 1885 ms 59384 KB Output is correct
4 Correct 1913 ms 59588 KB Output is correct
5 Correct 1916 ms 59544 KB Output is correct
6 Correct 1809 ms 59740 KB Output is correct
7 Correct 1990 ms 59584 KB Output is correct
8 Correct 717 ms 58380 KB Output is correct
9 Correct 737 ms 58312 KB Output is correct
10 Correct 1366 ms 58244 KB Output is correct
11 Correct 1381 ms 58356 KB Output is correct
12 Correct 722 ms 58308 KB Output is correct
13 Correct 747 ms 58320 KB Output is correct
14 Correct 24 ms 55128 KB Output is correct
15 Correct 25 ms 55128 KB Output is correct
16 Correct 27 ms 55128 KB Output is correct
17 Correct 78 ms 59332 KB Output is correct
18 Correct 82 ms 59724 KB Output is correct
19 Correct 91 ms 59584 KB Output is correct
20 Correct 34 ms 58312 KB Output is correct
21 Correct 38 ms 58568 KB Output is correct
22 Correct 69 ms 59332 KB Output is correct
23 Correct 84 ms 59584 KB Output is correct
24 Correct 99 ms 59584 KB Output is correct
25 Correct 36 ms 58320 KB Output is correct
26 Correct 34 ms 58320 KB Output is correct
27 Correct 25 ms 55124 KB Output is correct
28 Correct 25 ms 55192 KB Output is correct
29 Correct 25 ms 55128 KB Output is correct
30 Correct 24 ms 55128 KB Output is correct
31 Correct 24 ms 55128 KB Output is correct
32 Correct 26 ms 55148 KB Output is correct
33 Correct 25 ms 55128 KB Output is correct
34 Correct 25 ms 55120 KB Output is correct
35 Correct 24 ms 55232 KB Output is correct
36 Correct 24 ms 55120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 315 ms 56412 KB Output is correct
2 Correct 1006 ms 59324 KB Output is correct
3 Correct 1043 ms 59324 KB Output is correct
4 Correct 1034 ms 59584 KB Output is correct
5 Correct 985 ms 59588 KB Output is correct
6 Correct 1072 ms 59584 KB Output is correct
7 Correct 1137 ms 59688 KB Output is correct
8 Correct 844 ms 58320 KB Output is correct
9 Correct 828 ms 58300 KB Output is correct
10 Correct 867 ms 58312 KB Output is correct
11 Correct 880 ms 58320 KB Output is correct
12 Correct 64 ms 59340 KB Output is correct
13 Correct 85 ms 59644 KB Output is correct
14 Correct 77 ms 59776 KB Output is correct
15 Correct 32 ms 58320 KB Output is correct
16 Correct 32 ms 58316 KB Output is correct
17 Correct 63 ms 59348 KB Output is correct
18 Correct 72 ms 59332 KB Output is correct
19 Correct 65 ms 59376 KB Output is correct
20 Correct 77 ms 59652 KB Output is correct
21 Correct 78 ms 59584 KB Output is correct
22 Correct 80 ms 59588 KB Output is correct
23 Correct 81 ms 59584 KB Output is correct
24 Correct 34 ms 58312 KB Output is correct
25 Correct 32 ms 58320 KB Output is correct
26 Correct 42 ms 58272 KB Output is correct
27 Correct 31 ms 58460 KB Output is correct
28 Correct 25 ms 55128 KB Output is correct
29 Correct 24 ms 55128 KB Output is correct
30 Correct 22 ms 55128 KB Output is correct
31 Correct 24 ms 55072 KB Output is correct
32 Correct 25 ms 55120 KB Output is correct
33 Correct 24 ms 55128 KB Output is correct
34 Correct 24 ms 55120 KB Output is correct
35 Correct 25 ms 55128 KB Output is correct
36 Correct 24 ms 55244 KB Output is correct
37 Correct 23 ms 55128 KB Output is correct
38 Correct 24 ms 55208 KB Output is correct
39 Correct 24 ms 55128 KB Output is correct
40 Correct 23 ms 55128 KB Output is correct
41 Correct 25 ms 55232 KB Output is correct
42 Correct 24 ms 55128 KB Output is correct
43 Correct 25 ms 55120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 55088 KB Output is correct
2 Correct 22 ms 55128 KB Output is correct
3 Correct 22 ms 55128 KB Output is correct
4 Correct 22 ms 55296 KB Output is correct
5 Correct 22 ms 55128 KB Output is correct
6 Correct 22 ms 55128 KB Output is correct
7 Correct 25 ms 55152 KB Output is correct
8 Correct 28 ms 55384 KB Output is correct
9 Correct 23 ms 55120 KB Output is correct
10 Correct 26 ms 55120 KB Output is correct
11 Correct 23 ms 55120 KB Output is correct
12 Correct 23 ms 55128 KB Output is correct
13 Correct 24 ms 55264 KB Output is correct
14 Correct 24 ms 55128 KB Output is correct
15 Correct 25 ms 55120 KB Output is correct
16 Correct 26 ms 55128 KB Output is correct
17 Correct 30 ms 55128 KB Output is correct
18 Correct 25 ms 55120 KB Output is correct
19 Correct 25 ms 55060 KB Output is correct
20 Correct 26 ms 55120 KB Output is correct
21 Correct 26 ms 55128 KB Output is correct
22 Correct 25 ms 55128 KB Output is correct
23 Correct 27 ms 55312 KB Output is correct
24 Correct 24 ms 55128 KB Output is correct
25 Correct 24 ms 55128 KB Output is correct
26 Correct 24 ms 55296 KB Output is correct
27 Correct 25 ms 55128 KB Output is correct
28 Correct 26 ms 55120 KB Output is correct
29 Correct 25 ms 55128 KB Output is correct
30 Correct 24 ms 55128 KB Output is correct
31 Correct 24 ms 55128 KB Output is correct
32 Correct 22 ms 55128 KB Output is correct
33 Correct 24 ms 55120 KB Output is correct
34 Correct 25 ms 55120 KB Output is correct
35 Correct 25 ms 55116 KB Output is correct
36 Correct 60 ms 57680 KB Output is correct
37 Correct 71 ms 59336 KB Output is correct
38 Correct 69 ms 59512 KB Output is correct
39 Correct 88 ms 59528 KB Output is correct
40 Correct 104 ms 59580 KB Output is correct
41 Correct 81 ms 59588 KB Output is correct
42 Correct 90 ms 59604 KB Output is correct
43 Correct 39 ms 58320 KB Output is correct
44 Correct 43 ms 58312 KB Output is correct
45 Correct 34 ms 58332 KB Output is correct
46 Correct 32 ms 58312 KB Output is correct
47 Correct 76 ms 59332 KB Output is correct
48 Correct 83 ms 59540 KB Output is correct
49 Correct 89 ms 59644 KB Output is correct
50 Correct 44 ms 58312 KB Output is correct
51 Correct 35 ms 58312 KB Output is correct
52 Correct 69 ms 59376 KB Output is correct
53 Correct 81 ms 59640 KB Output is correct
54 Correct 83 ms 59652 KB Output is correct
55 Correct 41 ms 58456 KB Output is correct
56 Correct 36 ms 58312 KB Output is correct
57 Correct 66 ms 59392 KB Output is correct
58 Correct 69 ms 59312 KB Output is correct
59 Correct 76 ms 59340 KB Output is correct
60 Correct 91 ms 59724 KB Output is correct
61 Correct 87 ms 59588 KB Output is correct
62 Correct 90 ms 59588 KB Output is correct
63 Correct 92 ms 59588 KB Output is correct
64 Correct 35 ms 58320 KB Output is correct
65 Correct 41 ms 58324 KB Output is correct
66 Correct 32 ms 58328 KB Output is correct
67 Correct 32 ms 58412 KB Output is correct
68 Correct 1347 ms 59332 KB Output is correct
69 Correct 1868 ms 59280 KB Output is correct
70 Correct 1885 ms 59384 KB Output is correct
71 Correct 1913 ms 59588 KB Output is correct
72 Correct 1916 ms 59544 KB Output is correct
73 Correct 1809 ms 59740 KB Output is correct
74 Correct 1990 ms 59584 KB Output is correct
75 Correct 717 ms 58380 KB Output is correct
76 Correct 737 ms 58312 KB Output is correct
77 Correct 1366 ms 58244 KB Output is correct
78 Correct 1381 ms 58356 KB Output is correct
79 Correct 722 ms 58308 KB Output is correct
80 Correct 747 ms 58320 KB Output is correct
81 Correct 24 ms 55128 KB Output is correct
82 Correct 25 ms 55128 KB Output is correct
83 Correct 27 ms 55128 KB Output is correct
84 Correct 78 ms 59332 KB Output is correct
85 Correct 82 ms 59724 KB Output is correct
86 Correct 91 ms 59584 KB Output is correct
87 Correct 34 ms 58312 KB Output is correct
88 Correct 38 ms 58568 KB Output is correct
89 Correct 69 ms 59332 KB Output is correct
90 Correct 84 ms 59584 KB Output is correct
91 Correct 99 ms 59584 KB Output is correct
92 Correct 36 ms 58320 KB Output is correct
93 Correct 34 ms 58320 KB Output is correct
94 Correct 25 ms 55124 KB Output is correct
95 Correct 25 ms 55192 KB Output is correct
96 Correct 25 ms 55128 KB Output is correct
97 Correct 24 ms 55128 KB Output is correct
98 Correct 24 ms 55128 KB Output is correct
99 Correct 26 ms 55148 KB Output is correct
100 Correct 25 ms 55128 KB Output is correct
101 Correct 25 ms 55120 KB Output is correct
102 Correct 24 ms 55232 KB Output is correct
103 Correct 24 ms 55120 KB Output is correct
104 Correct 1530 ms 59040 KB Output is correct
105 Correct 1747 ms 59328 KB Output is correct
106 Correct 1687 ms 59396 KB Output is correct
107 Correct 1774 ms 59532 KB Output is correct
108 Correct 1646 ms 59592 KB Output is correct
109 Correct 1829 ms 59588 KB Output is correct
110 Correct 1878 ms 59628 KB Output is correct
111 Correct 720 ms 58312 KB Output is correct
112 Correct 798 ms 58316 KB Output is correct
113 Correct 1032 ms 58320 KB Output is correct
114 Correct 1215 ms 58312 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 428 ms 56932 KB Output is correct
2 Correct 763 ms 58312 KB Output is correct
3 Correct 825 ms 58308 KB Output is correct
4 Correct 766 ms 58312 KB Output is correct
5 Correct 734 ms 58664 KB Output is correct
6 Correct 770 ms 58312 KB Output is correct
7 Correct 765 ms 58312 KB Output is correct
8 Correct 21 ms 55128 KB Output is correct
9 Correct 21 ms 55128 KB Output is correct
10 Correct 22 ms 55128 KB Output is correct
11 Correct 22 ms 55088 KB Output is correct
12 Correct 22 ms 55128 KB Output is correct
13 Correct 22 ms 55128 KB Output is correct
14 Correct 22 ms 55296 KB Output is correct
15 Correct 22 ms 55128 KB Output is correct
16 Correct 22 ms 55128 KB Output is correct
17 Correct 25 ms 55152 KB Output is correct
18 Correct 28 ms 55384 KB Output is correct
19 Correct 23 ms 55120 KB Output is correct
20 Correct 26 ms 55120 KB Output is correct
21 Correct 23 ms 55120 KB Output is correct
22 Correct 23 ms 55128 KB Output is correct
23 Correct 24 ms 55264 KB Output is correct
24 Correct 24 ms 55128 KB Output is correct
25 Correct 25 ms 55120 KB Output is correct
26 Correct 26 ms 55128 KB Output is correct
27 Correct 30 ms 55128 KB Output is correct
28 Correct 25 ms 55120 KB Output is correct
29 Correct 25 ms 55060 KB Output is correct
30 Correct 26 ms 55120 KB Output is correct
31 Correct 26 ms 55128 KB Output is correct
32 Correct 25 ms 55128 KB Output is correct
33 Correct 27 ms 55312 KB Output is correct
34 Correct 24 ms 55128 KB Output is correct
35 Correct 24 ms 55128 KB Output is correct
36 Correct 24 ms 55296 KB Output is correct
37 Correct 25 ms 55128 KB Output is correct
38 Correct 26 ms 55120 KB Output is correct
39 Correct 25 ms 55128 KB Output is correct
40 Correct 24 ms 55128 KB Output is correct
41 Correct 24 ms 55128 KB Output is correct
42 Correct 22 ms 55128 KB Output is correct
43 Correct 24 ms 55120 KB Output is correct
44 Correct 25 ms 55120 KB Output is correct
45 Correct 25 ms 55116 KB Output is correct
46 Correct 60 ms 57680 KB Output is correct
47 Correct 71 ms 59336 KB Output is correct
48 Correct 69 ms 59512 KB Output is correct
49 Correct 88 ms 59528 KB Output is correct
50 Correct 104 ms 59580 KB Output is correct
51 Correct 81 ms 59588 KB Output is correct
52 Correct 90 ms 59604 KB Output is correct
53 Correct 39 ms 58320 KB Output is correct
54 Correct 43 ms 58312 KB Output is correct
55 Correct 34 ms 58332 KB Output is correct
56 Correct 32 ms 58312 KB Output is correct
57 Correct 76 ms 59332 KB Output is correct
58 Correct 83 ms 59540 KB Output is correct
59 Correct 89 ms 59644 KB Output is correct
60 Correct 44 ms 58312 KB Output is correct
61 Correct 35 ms 58312 KB Output is correct
62 Correct 69 ms 59376 KB Output is correct
63 Correct 81 ms 59640 KB Output is correct
64 Correct 83 ms 59652 KB Output is correct
65 Correct 41 ms 58456 KB Output is correct
66 Correct 36 ms 58312 KB Output is correct
67 Correct 66 ms 59392 KB Output is correct
68 Correct 69 ms 59312 KB Output is correct
69 Correct 76 ms 59340 KB Output is correct
70 Correct 91 ms 59724 KB Output is correct
71 Correct 87 ms 59588 KB Output is correct
72 Correct 90 ms 59588 KB Output is correct
73 Correct 92 ms 59588 KB Output is correct
74 Correct 35 ms 58320 KB Output is correct
75 Correct 41 ms 58324 KB Output is correct
76 Correct 32 ms 58328 KB Output is correct
77 Correct 32 ms 58412 KB Output is correct
78 Correct 1347 ms 59332 KB Output is correct
79 Correct 1868 ms 59280 KB Output is correct
80 Correct 1885 ms 59384 KB Output is correct
81 Correct 1913 ms 59588 KB Output is correct
82 Correct 1916 ms 59544 KB Output is correct
83 Correct 1809 ms 59740 KB Output is correct
84 Correct 1990 ms 59584 KB Output is correct
85 Correct 717 ms 58380 KB Output is correct
86 Correct 737 ms 58312 KB Output is correct
87 Correct 1366 ms 58244 KB Output is correct
88 Correct 1381 ms 58356 KB Output is correct
89 Correct 722 ms 58308 KB Output is correct
90 Correct 747 ms 58320 KB Output is correct
91 Correct 24 ms 55128 KB Output is correct
92 Correct 25 ms 55128 KB Output is correct
93 Correct 27 ms 55128 KB Output is correct
94 Correct 78 ms 59332 KB Output is correct
95 Correct 82 ms 59724 KB Output is correct
96 Correct 91 ms 59584 KB Output is correct
97 Correct 34 ms 58312 KB Output is correct
98 Correct 38 ms 58568 KB Output is correct
99 Correct 69 ms 59332 KB Output is correct
100 Correct 84 ms 59584 KB Output is correct
101 Correct 99 ms 59584 KB Output is correct
102 Correct 36 ms 58320 KB Output is correct
103 Correct 34 ms 58320 KB Output is correct
104 Correct 25 ms 55124 KB Output is correct
105 Correct 25 ms 55192 KB Output is correct
106 Correct 25 ms 55128 KB Output is correct
107 Correct 24 ms 55128 KB Output is correct
108 Correct 24 ms 55128 KB Output is correct
109 Correct 26 ms 55148 KB Output is correct
110 Correct 25 ms 55128 KB Output is correct
111 Correct 25 ms 55120 KB Output is correct
112 Correct 24 ms 55232 KB Output is correct
113 Correct 24 ms 55120 KB Output is correct
114 Correct 315 ms 56412 KB Output is correct
115 Correct 1006 ms 59324 KB Output is correct
116 Correct 1043 ms 59324 KB Output is correct
117 Correct 1034 ms 59584 KB Output is correct
118 Correct 985 ms 59588 KB Output is correct
119 Correct 1072 ms 59584 KB Output is correct
120 Correct 1137 ms 59688 KB Output is correct
121 Correct 844 ms 58320 KB Output is correct
122 Correct 828 ms 58300 KB Output is correct
123 Correct 867 ms 58312 KB Output is correct
124 Correct 880 ms 58320 KB Output is correct
125 Correct 64 ms 59340 KB Output is correct
126 Correct 85 ms 59644 KB Output is correct
127 Correct 77 ms 59776 KB Output is correct
128 Correct 32 ms 58320 KB Output is correct
129 Correct 32 ms 58316 KB Output is correct
130 Correct 63 ms 59348 KB Output is correct
131 Correct 72 ms 59332 KB Output is correct
132 Correct 65 ms 59376 KB Output is correct
133 Correct 77 ms 59652 KB Output is correct
134 Correct 78 ms 59584 KB Output is correct
135 Correct 80 ms 59588 KB Output is correct
136 Correct 81 ms 59584 KB Output is correct
137 Correct 34 ms 58312 KB Output is correct
138 Correct 32 ms 58320 KB Output is correct
139 Correct 42 ms 58272 KB Output is correct
140 Correct 31 ms 58460 KB Output is correct
141 Correct 25 ms 55128 KB Output is correct
142 Correct 24 ms 55128 KB Output is correct
143 Correct 22 ms 55128 KB Output is correct
144 Correct 24 ms 55072 KB Output is correct
145 Correct 25 ms 55120 KB Output is correct
146 Correct 24 ms 55128 KB Output is correct
147 Correct 24 ms 55120 KB Output is correct
148 Correct 25 ms 55128 KB Output is correct
149 Correct 24 ms 55244 KB Output is correct
150 Correct 23 ms 55128 KB Output is correct
151 Correct 24 ms 55208 KB Output is correct
152 Correct 24 ms 55128 KB Output is correct
153 Correct 23 ms 55128 KB Output is correct
154 Correct 25 ms 55232 KB Output is correct
155 Correct 24 ms 55128 KB Output is correct
156 Correct 25 ms 55120 KB Output is correct
157 Correct 1530 ms 59040 KB Output is correct
158 Correct 1747 ms 59328 KB Output is correct
159 Correct 1687 ms 59396 KB Output is correct
160 Correct 1774 ms 59532 KB Output is correct
161 Correct 1646 ms 59592 KB Output is correct
162 Correct 1829 ms 59588 KB Output is correct
163 Correct 1878 ms 59628 KB Output is correct
164 Correct 720 ms 58312 KB Output is correct
165 Correct 798 ms 58316 KB Output is correct
166 Correct 1032 ms 58320 KB Output is correct
167 Correct 1215 ms 58312 KB Output is correct
168 Correct 21 ms 55128 KB Output is correct
169 Correct 1035 ms 57032 KB Output is correct
170 Correct 1970 ms 59496 KB Output is correct
171 Correct 1993 ms 59332 KB Output is correct
172 Correct 2344 ms 59592 KB Output is correct
173 Correct 2189 ms 59640 KB Output is correct
174 Correct 2199 ms 59664 KB Output is correct
175 Correct 2190 ms 59608 KB Output is correct
176 Correct 765 ms 58392 KB Output is correct
177 Correct 769 ms 58312 KB Output is correct
178 Correct 1204 ms 58320 KB Output is correct
179 Correct 1120 ms 58312 KB Output is correct