답안 #578106

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
578106 2022-06-16T05:05:22 Z balbit Uplifting Excursion (BOI22_vault) C++14
100 / 100
2791 ms 3276 KB
#include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define pii pair<ll, ll>
#define f first
#define s second

#define SZ(x) (int)((x).size())
#define ALL(x) (x).begin(), (x).end()
#define pb push_back

#define FOR(i,a,b) for (int i = a; i<b; ++i)
#define RREP(i,n)  for (int i = n-1; i>=0;--i)
#define REP(i,n)  FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)

#define MX(a,b) a = max(a,b)
#define MN(a,b) a = min(a,b)
#ifdef BALBIT
#define bug(...) cerr<<"#"<<__LINE__<<": "<<#__VA_ARGS__<<"- ", _do(__VA_ARGS__)
template<typename T> void _do( T && x) {cerr<<x<<endl;}
template<typename T,typename ...S> void _do( T && x, S && ...y) {cerr<<x<<", "; _do(y...);}
#else
#define bug(...)
#define endl '\n'
#endif // BALBIT

ll amt[606];
ll taken[606];

const ll inf = 0x3f3f3f3f3f3f3f3f;

const int rng = 300 * 300 * 2;
ll bst[rng*2+4];

vector<ll> bd(ll x) {
    //  maybe i can min x ith rng or smth
    vector<ll> re;
    ll scale = 1;
    while(x) {
        if (x & 1)  {
            re.pb(scale); x-=1;
        }else{
            re.pb(scale); re.pb(scale); x-=2;
        }
        x/=2; scale *= 2;
    }
    return re;
}

void ASS(bool x) {
    if (!x) while(1);
}

signed main(){
    ios::sync_with_stdio(0), cin.tie(0);

    bug(1,2);

//    vector<int> hi = bd(23);
//    for (int x : hi) cout<<x<<' ';
//    return 0;

    REP(i, rng*2+4) {
        bst[i] = -inf;
    }

    int m; ll L;
    cin>>m>>L;

    ll tot = 0;
    ll things= 0;

    FOR(i,-m,m+1) {
        cin>>amt[i+m];
        tot += i * (amt[i+m]);
        things += amt[i+m];
    }
    bug(tot, L);
    if (tot < L) {
        // flip  everything
        FOR(i,0,m+1) {
            swap(amt[i+m], amt[-i+m]);
        }
        tot = -tot; L = -L;
    }

    FOR(i,-m,m+1) {
        taken[i+m] = amt[i+m];
    }

    bug(tot,L);

    for (int i = m; i>=1; --i) {
        if (tot > L + rng) {
            int need = (tot - (L+rng)-1) / i + 1; // ceiling
            need = min(need, taken[i+m]);
            taken[i+m] -= need; tot -= i * need; things -= need;
        }
        if (tot <= L+rng && tot >= L-rng) {
//            MX(bst[tot-L+rng], things);
            bug(tot, things);
            while (taken[i+m] && (tot-i >= L-rng)) {
                --taken[i+m]; tot -= i; --things;
                bug(tot, things);
//                MX(bst[tot-L+rng], things);
            }
        }
    }

    bug(tot, L, things);


    if (tot > L) {
        // sad
        cout<<"impossible"<<endl; return 0;
    }

    MX(bst[tot-L+rng], things);
//    FOR(j,-2*m,2*m+1) {
//        bug(j, bst[j+rng]);
//    }

    FOR(i,1,m+1) {
        if (amt[i+m] - taken[i+m]) {
            // try adding stuff back
            for (ll d : bd(amt[i+m] - taken[i+m])) {
                if (i < 0) {

                    ASS(0);
                }else{
                    RREP(j, rng*2+1 - d*i) {
                        if (j + d*i < 0) ASS(0);
                        if (j + d*i > rng*2) ASS(0);
                        MX(bst[j+d*i], bst[j]+d);
                    }
                }
            }
        }
        #ifdef BALBIT
//        bug(i, taken[i+m], amt[i+m]);
//        FOR(j,-2*m,2*m+1) {
//            bug(j, bst[j+rng]);
//        }
        #endif
    }

    FOR(i,-m,m+1) {
        if (i == 0) continue;
        if (taken[i+m]) {
            // try removing stuff
            for (ll d : bd(taken[i+m])) {
                if (i < 0) {
                    RREP(j,  rng*2+1+d*i) {
                        if (j - d*i < 0) ASS(0);
                        if (j - d*i > rng*2) ASS(0);
                        MX(bst[j-d*i], bst[j]-d);
                    }
                }else{
                    FOR(j, d*i, rng*2+1) {
                        if (j - d*i < 0) ASS(0);
                        if (j - d*i > rng*2) ASS(0);
                        MX(bst[j-d*i], bst[j]-d);
                    }
                }
            }
        }
        #ifdef BALBIT
//        bug(i, taken[i+m], amt[i+m]);
//        FOR(j,-m,m+1) {
//            bug(j, bst[j+rng]);
//        }
        #endif
    }
    if (bst[rng] <= 0) cout<<"impossible"<<endl;
    else cout<<bst[rng]<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 3028 KB Output is correct
2 Correct 3 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 13 ms 3148 KB Output is correct
5 Correct 2 ms 3028 KB Output is correct
6 Correct 219 ms 3076 KB Output is correct
7 Correct 110 ms 3124 KB Output is correct
8 Correct 217 ms 3140 KB Output is correct
9 Correct 282 ms 3124 KB Output is correct
10 Correct 8 ms 3156 KB Output is correct
11 Correct 9 ms 3144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 3028 KB Output is correct
2 Correct 3 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 13 ms 3148 KB Output is correct
5 Correct 2 ms 3028 KB Output is correct
6 Correct 219 ms 3076 KB Output is correct
7 Correct 110 ms 3124 KB Output is correct
8 Correct 217 ms 3140 KB Output is correct
9 Correct 282 ms 3124 KB Output is correct
10 Correct 8 ms 3156 KB Output is correct
11 Correct 9 ms 3144 KB Output is correct
12 Correct 7 ms 3028 KB Output is correct
13 Correct 3 ms 3144 KB Output is correct
14 Correct 3 ms 3028 KB Output is correct
15 Correct 13 ms 3148 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 232 ms 3128 KB Output is correct
18 Correct 103 ms 3028 KB Output is correct
19 Correct 225 ms 3124 KB Output is correct
20 Correct 275 ms 3156 KB Output is correct
21 Correct 7 ms 3028 KB Output is correct
22 Correct 10 ms 3148 KB Output is correct
23 Correct 2 ms 3028 KB Output is correct
24 Correct 539 ms 3132 KB Output is correct
25 Correct 200 ms 3028 KB Output is correct
26 Correct 613 ms 3124 KB Output is correct
27 Correct 592 ms 3028 KB Output is correct
28 Correct 9 ms 3028 KB Output is correct
29 Correct 10 ms 3144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 3148 KB Output is correct
2 Correct 140 ms 3028 KB Output is correct
3 Correct 51 ms 3148 KB Output is correct
4 Correct 141 ms 3124 KB Output is correct
5 Correct 136 ms 3132 KB Output is correct
6 Correct 94 ms 3028 KB Output is correct
7 Correct 15 ms 3144 KB Output is correct
8 Correct 13 ms 3028 KB Output is correct
9 Correct 62 ms 3028 KB Output is correct
10 Correct 96 ms 3124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 3148 KB Output is correct
2 Correct 140 ms 3028 KB Output is correct
3 Correct 51 ms 3148 KB Output is correct
4 Correct 141 ms 3124 KB Output is correct
5 Correct 136 ms 3132 KB Output is correct
6 Correct 94 ms 3028 KB Output is correct
7 Correct 15 ms 3144 KB Output is correct
8 Correct 13 ms 3028 KB Output is correct
9 Correct 62 ms 3028 KB Output is correct
10 Correct 96 ms 3124 KB Output is correct
11 Correct 5 ms 3024 KB Output is correct
12 Correct 3 ms 3028 KB Output is correct
13 Correct 3 ms 3028 KB Output is correct
14 Correct 12 ms 3144 KB Output is correct
15 Correct 157 ms 3132 KB Output is correct
16 Correct 48 ms 3140 KB Output is correct
17 Correct 138 ms 3028 KB Output is correct
18 Correct 135 ms 3028 KB Output is correct
19 Correct 93 ms 3028 KB Output is correct
20 Correct 14 ms 3144 KB Output is correct
21 Correct 12 ms 3028 KB Output is correct
22 Correct 62 ms 3028 KB Output is correct
23 Correct 94 ms 3028 KB Output is correct
24 Correct 279 ms 3124 KB Output is correct
25 Correct 88 ms 3028 KB Output is correct
26 Correct 260 ms 3124 KB Output is correct
27 Correct 189 ms 3028 KB Output is correct
28 Correct 266 ms 3128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 3148 KB Output is correct
2 Correct 140 ms 3028 KB Output is correct
3 Correct 51 ms 3148 KB Output is correct
4 Correct 141 ms 3124 KB Output is correct
5 Correct 136 ms 3132 KB Output is correct
6 Correct 94 ms 3028 KB Output is correct
7 Correct 15 ms 3144 KB Output is correct
8 Correct 13 ms 3028 KB Output is correct
9 Correct 62 ms 3028 KB Output is correct
10 Correct 96 ms 3124 KB Output is correct
11 Correct 12 ms 3028 KB Output is correct
12 Correct 148 ms 3144 KB Output is correct
13 Correct 55 ms 3152 KB Output is correct
14 Correct 139 ms 3124 KB Output is correct
15 Correct 135 ms 3136 KB Output is correct
16 Correct 90 ms 3128 KB Output is correct
17 Correct 14 ms 3148 KB Output is correct
18 Correct 13 ms 3028 KB Output is correct
19 Correct 64 ms 3144 KB Output is correct
20 Correct 96 ms 3028 KB Output is correct
21 Correct 7 ms 3028 KB Output is correct
22 Correct 9 ms 3028 KB Output is correct
23 Correct 186 ms 3140 KB Output is correct
24 Correct 98 ms 3128 KB Output is correct
25 Correct 185 ms 3028 KB Output is correct
26 Correct 239 ms 3124 KB Output is correct
27 Correct 194 ms 3124 KB Output is correct
28 Correct 192 ms 3128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 3028 KB Output is correct
2 Correct 3 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 13 ms 3148 KB Output is correct
5 Correct 2 ms 3028 KB Output is correct
6 Correct 219 ms 3076 KB Output is correct
7 Correct 110 ms 3124 KB Output is correct
8 Correct 217 ms 3140 KB Output is correct
9 Correct 282 ms 3124 KB Output is correct
10 Correct 8 ms 3156 KB Output is correct
11 Correct 9 ms 3144 KB Output is correct
12 Correct 13 ms 3148 KB Output is correct
13 Correct 140 ms 3028 KB Output is correct
14 Correct 51 ms 3148 KB Output is correct
15 Correct 141 ms 3124 KB Output is correct
16 Correct 136 ms 3132 KB Output is correct
17 Correct 94 ms 3028 KB Output is correct
18 Correct 15 ms 3144 KB Output is correct
19 Correct 13 ms 3028 KB Output is correct
20 Correct 62 ms 3028 KB Output is correct
21 Correct 96 ms 3124 KB Output is correct
22 Correct 5 ms 3024 KB Output is correct
23 Correct 3 ms 3028 KB Output is correct
24 Correct 3 ms 3028 KB Output is correct
25 Correct 12 ms 3144 KB Output is correct
26 Correct 157 ms 3132 KB Output is correct
27 Correct 48 ms 3140 KB Output is correct
28 Correct 138 ms 3028 KB Output is correct
29 Correct 135 ms 3028 KB Output is correct
30 Correct 93 ms 3028 KB Output is correct
31 Correct 14 ms 3144 KB Output is correct
32 Correct 12 ms 3028 KB Output is correct
33 Correct 62 ms 3028 KB Output is correct
34 Correct 94 ms 3028 KB Output is correct
35 Correct 279 ms 3124 KB Output is correct
36 Correct 88 ms 3028 KB Output is correct
37 Correct 260 ms 3124 KB Output is correct
38 Correct 189 ms 3028 KB Output is correct
39 Correct 266 ms 3128 KB Output is correct
40 Correct 12 ms 3028 KB Output is correct
41 Correct 148 ms 3144 KB Output is correct
42 Correct 55 ms 3152 KB Output is correct
43 Correct 139 ms 3124 KB Output is correct
44 Correct 135 ms 3136 KB Output is correct
45 Correct 90 ms 3128 KB Output is correct
46 Correct 14 ms 3148 KB Output is correct
47 Correct 13 ms 3028 KB Output is correct
48 Correct 64 ms 3144 KB Output is correct
49 Correct 96 ms 3028 KB Output is correct
50 Correct 7 ms 3028 KB Output is correct
51 Correct 9 ms 3028 KB Output is correct
52 Correct 186 ms 3140 KB Output is correct
53 Correct 98 ms 3128 KB Output is correct
54 Correct 185 ms 3028 KB Output is correct
55 Correct 239 ms 3124 KB Output is correct
56 Correct 194 ms 3124 KB Output is correct
57 Correct 192 ms 3128 KB Output is correct
58 Correct 4 ms 3028 KB Output is correct
59 Correct 4 ms 3028 KB Output is correct
60 Correct 3 ms 3028 KB Output is correct
61 Correct 13 ms 3148 KB Output is correct
62 Correct 2 ms 3028 KB Output is correct
63 Correct 228 ms 3124 KB Output is correct
64 Correct 107 ms 3124 KB Output is correct
65 Correct 214 ms 3028 KB Output is correct
66 Correct 274 ms 3144 KB Output is correct
67 Correct 7 ms 3028 KB Output is correct
68 Correct 9 ms 3028 KB Output is correct
69 Correct 140 ms 3124 KB Output is correct
70 Correct 48 ms 3028 KB Output is correct
71 Correct 136 ms 3140 KB Output is correct
72 Correct 139 ms 3124 KB Output is correct
73 Correct 91 ms 3128 KB Output is correct
74 Correct 15 ms 3028 KB Output is correct
75 Correct 13 ms 3028 KB Output is correct
76 Correct 59 ms 3128 KB Output is correct
77 Correct 96 ms 3068 KB Output is correct
78 Correct 281 ms 3124 KB Output is correct
79 Correct 91 ms 3028 KB Output is correct
80 Correct 266 ms 3028 KB Output is correct
81 Correct 191 ms 3132 KB Output is correct
82 Correct 260 ms 3028 KB Output is correct
83 Correct 188 ms 3128 KB Output is correct
84 Correct 102 ms 3132 KB Output is correct
85 Correct 185 ms 3132 KB Output is correct
86 Correct 233 ms 3128 KB Output is correct
87 Correct 222 ms 3124 KB Output is correct
88 Correct 193 ms 3124 KB Output is correct
89 Correct 349 ms 3272 KB Output is correct
90 Correct 435 ms 3124 KB Output is correct
91 Correct 376 ms 3148 KB Output is correct
92 Correct 416 ms 3128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 3148 KB Output is correct
2 Correct 140 ms 3028 KB Output is correct
3 Correct 51 ms 3148 KB Output is correct
4 Correct 141 ms 3124 KB Output is correct
5 Correct 136 ms 3132 KB Output is correct
6 Correct 94 ms 3028 KB Output is correct
7 Correct 15 ms 3144 KB Output is correct
8 Correct 13 ms 3028 KB Output is correct
9 Correct 62 ms 3028 KB Output is correct
10 Correct 96 ms 3124 KB Output is correct
11 Correct 12 ms 3028 KB Output is correct
12 Correct 148 ms 3144 KB Output is correct
13 Correct 55 ms 3152 KB Output is correct
14 Correct 139 ms 3124 KB Output is correct
15 Correct 135 ms 3136 KB Output is correct
16 Correct 90 ms 3128 KB Output is correct
17 Correct 14 ms 3148 KB Output is correct
18 Correct 13 ms 3028 KB Output is correct
19 Correct 64 ms 3144 KB Output is correct
20 Correct 96 ms 3028 KB Output is correct
21 Correct 7 ms 3028 KB Output is correct
22 Correct 9 ms 3028 KB Output is correct
23 Correct 186 ms 3140 KB Output is correct
24 Correct 98 ms 3128 KB Output is correct
25 Correct 185 ms 3028 KB Output is correct
26 Correct 239 ms 3124 KB Output is correct
27 Correct 194 ms 3124 KB Output is correct
28 Correct 192 ms 3128 KB Output is correct
29 Correct 13 ms 3028 KB Output is correct
30 Correct 138 ms 3028 KB Output is correct
31 Correct 48 ms 3128 KB Output is correct
32 Correct 142 ms 3128 KB Output is correct
33 Correct 136 ms 3028 KB Output is correct
34 Correct 93 ms 3028 KB Output is correct
35 Correct 14 ms 3028 KB Output is correct
36 Correct 12 ms 3144 KB Output is correct
37 Correct 65 ms 3028 KB Output is correct
38 Correct 95 ms 3128 KB Output is correct
39 Correct 7 ms 3148 KB Output is correct
40 Correct 9 ms 3152 KB Output is correct
41 Correct 182 ms 3028 KB Output is correct
42 Correct 99 ms 3028 KB Output is correct
43 Correct 187 ms 3148 KB Output is correct
44 Correct 234 ms 3128 KB Output is correct
45 Correct 205 ms 3128 KB Output is correct
46 Correct 197 ms 3124 KB Output is correct
47 Correct 8 ms 3028 KB Output is correct
48 Correct 11 ms 3152 KB Output is correct
49 Correct 379 ms 3028 KB Output is correct
50 Correct 171 ms 3124 KB Output is correct
51 Correct 423 ms 3124 KB Output is correct
52 Correct 467 ms 3128 KB Output is correct
53 Correct 402 ms 3136 KB Output is correct
54 Correct 327 ms 3028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 3028 KB Output is correct
2 Correct 3 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 13 ms 3148 KB Output is correct
5 Correct 2 ms 3028 KB Output is correct
6 Correct 219 ms 3076 KB Output is correct
7 Correct 110 ms 3124 KB Output is correct
8 Correct 217 ms 3140 KB Output is correct
9 Correct 282 ms 3124 KB Output is correct
10 Correct 8 ms 3156 KB Output is correct
11 Correct 9 ms 3144 KB Output is correct
12 Correct 7 ms 3028 KB Output is correct
13 Correct 3 ms 3144 KB Output is correct
14 Correct 3 ms 3028 KB Output is correct
15 Correct 13 ms 3148 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 232 ms 3128 KB Output is correct
18 Correct 103 ms 3028 KB Output is correct
19 Correct 225 ms 3124 KB Output is correct
20 Correct 275 ms 3156 KB Output is correct
21 Correct 7 ms 3028 KB Output is correct
22 Correct 10 ms 3148 KB Output is correct
23 Correct 2 ms 3028 KB Output is correct
24 Correct 539 ms 3132 KB Output is correct
25 Correct 200 ms 3028 KB Output is correct
26 Correct 613 ms 3124 KB Output is correct
27 Correct 592 ms 3028 KB Output is correct
28 Correct 9 ms 3028 KB Output is correct
29 Correct 10 ms 3144 KB Output is correct
30 Correct 13 ms 3148 KB Output is correct
31 Correct 140 ms 3028 KB Output is correct
32 Correct 51 ms 3148 KB Output is correct
33 Correct 141 ms 3124 KB Output is correct
34 Correct 136 ms 3132 KB Output is correct
35 Correct 94 ms 3028 KB Output is correct
36 Correct 15 ms 3144 KB Output is correct
37 Correct 13 ms 3028 KB Output is correct
38 Correct 62 ms 3028 KB Output is correct
39 Correct 96 ms 3124 KB Output is correct
40 Correct 5 ms 3024 KB Output is correct
41 Correct 3 ms 3028 KB Output is correct
42 Correct 3 ms 3028 KB Output is correct
43 Correct 12 ms 3144 KB Output is correct
44 Correct 157 ms 3132 KB Output is correct
45 Correct 48 ms 3140 KB Output is correct
46 Correct 138 ms 3028 KB Output is correct
47 Correct 135 ms 3028 KB Output is correct
48 Correct 93 ms 3028 KB Output is correct
49 Correct 14 ms 3144 KB Output is correct
50 Correct 12 ms 3028 KB Output is correct
51 Correct 62 ms 3028 KB Output is correct
52 Correct 94 ms 3028 KB Output is correct
53 Correct 279 ms 3124 KB Output is correct
54 Correct 88 ms 3028 KB Output is correct
55 Correct 260 ms 3124 KB Output is correct
56 Correct 189 ms 3028 KB Output is correct
57 Correct 266 ms 3128 KB Output is correct
58 Correct 12 ms 3028 KB Output is correct
59 Correct 148 ms 3144 KB Output is correct
60 Correct 55 ms 3152 KB Output is correct
61 Correct 139 ms 3124 KB Output is correct
62 Correct 135 ms 3136 KB Output is correct
63 Correct 90 ms 3128 KB Output is correct
64 Correct 14 ms 3148 KB Output is correct
65 Correct 13 ms 3028 KB Output is correct
66 Correct 64 ms 3144 KB Output is correct
67 Correct 96 ms 3028 KB Output is correct
68 Correct 7 ms 3028 KB Output is correct
69 Correct 9 ms 3028 KB Output is correct
70 Correct 186 ms 3140 KB Output is correct
71 Correct 98 ms 3128 KB Output is correct
72 Correct 185 ms 3028 KB Output is correct
73 Correct 239 ms 3124 KB Output is correct
74 Correct 194 ms 3124 KB Output is correct
75 Correct 192 ms 3128 KB Output is correct
76 Correct 4 ms 3028 KB Output is correct
77 Correct 4 ms 3028 KB Output is correct
78 Correct 3 ms 3028 KB Output is correct
79 Correct 13 ms 3148 KB Output is correct
80 Correct 2 ms 3028 KB Output is correct
81 Correct 228 ms 3124 KB Output is correct
82 Correct 107 ms 3124 KB Output is correct
83 Correct 214 ms 3028 KB Output is correct
84 Correct 274 ms 3144 KB Output is correct
85 Correct 7 ms 3028 KB Output is correct
86 Correct 9 ms 3028 KB Output is correct
87 Correct 140 ms 3124 KB Output is correct
88 Correct 48 ms 3028 KB Output is correct
89 Correct 136 ms 3140 KB Output is correct
90 Correct 139 ms 3124 KB Output is correct
91 Correct 91 ms 3128 KB Output is correct
92 Correct 15 ms 3028 KB Output is correct
93 Correct 13 ms 3028 KB Output is correct
94 Correct 59 ms 3128 KB Output is correct
95 Correct 96 ms 3068 KB Output is correct
96 Correct 281 ms 3124 KB Output is correct
97 Correct 91 ms 3028 KB Output is correct
98 Correct 266 ms 3028 KB Output is correct
99 Correct 191 ms 3132 KB Output is correct
100 Correct 260 ms 3028 KB Output is correct
101 Correct 188 ms 3128 KB Output is correct
102 Correct 102 ms 3132 KB Output is correct
103 Correct 185 ms 3132 KB Output is correct
104 Correct 233 ms 3128 KB Output is correct
105 Correct 222 ms 3124 KB Output is correct
106 Correct 193 ms 3124 KB Output is correct
107 Correct 349 ms 3272 KB Output is correct
108 Correct 435 ms 3124 KB Output is correct
109 Correct 376 ms 3148 KB Output is correct
110 Correct 416 ms 3128 KB Output is correct
111 Correct 13 ms 3028 KB Output is correct
112 Correct 138 ms 3028 KB Output is correct
113 Correct 48 ms 3128 KB Output is correct
114 Correct 142 ms 3128 KB Output is correct
115 Correct 136 ms 3028 KB Output is correct
116 Correct 93 ms 3028 KB Output is correct
117 Correct 14 ms 3028 KB Output is correct
118 Correct 12 ms 3144 KB Output is correct
119 Correct 65 ms 3028 KB Output is correct
120 Correct 95 ms 3128 KB Output is correct
121 Correct 7 ms 3148 KB Output is correct
122 Correct 9 ms 3152 KB Output is correct
123 Correct 182 ms 3028 KB Output is correct
124 Correct 99 ms 3028 KB Output is correct
125 Correct 187 ms 3148 KB Output is correct
126 Correct 234 ms 3128 KB Output is correct
127 Correct 205 ms 3128 KB Output is correct
128 Correct 197 ms 3124 KB Output is correct
129 Correct 8 ms 3028 KB Output is correct
130 Correct 11 ms 3152 KB Output is correct
131 Correct 379 ms 3028 KB Output is correct
132 Correct 171 ms 3124 KB Output is correct
133 Correct 423 ms 3124 KB Output is correct
134 Correct 467 ms 3128 KB Output is correct
135 Correct 402 ms 3136 KB Output is correct
136 Correct 327 ms 3028 KB Output is correct
137 Correct 5 ms 3028 KB Output is correct
138 Correct 3 ms 3156 KB Output is correct
139 Correct 3 ms 3028 KB Output is correct
140 Correct 14 ms 3148 KB Output is correct
141 Correct 2 ms 3028 KB Output is correct
142 Correct 237 ms 3136 KB Output is correct
143 Correct 106 ms 3188 KB Output is correct
144 Correct 236 ms 3128 KB Output is correct
145 Correct 293 ms 3148 KB Output is correct
146 Correct 7 ms 3152 KB Output is correct
147 Correct 15 ms 3148 KB Output is correct
148 Correct 2 ms 3028 KB Output is correct
149 Correct 554 ms 3136 KB Output is correct
150 Correct 212 ms 3128 KB Output is correct
151 Correct 619 ms 3124 KB Output is correct
152 Correct 598 ms 3028 KB Output is correct
153 Correct 8 ms 3148 KB Output is correct
154 Correct 11 ms 3028 KB Output is correct
155 Correct 140 ms 3124 KB Output is correct
156 Correct 49 ms 3136 KB Output is correct
157 Correct 136 ms 3132 KB Output is correct
158 Correct 142 ms 3124 KB Output is correct
159 Correct 90 ms 3128 KB Output is correct
160 Correct 14 ms 3028 KB Output is correct
161 Correct 12 ms 3028 KB Output is correct
162 Correct 60 ms 3128 KB Output is correct
163 Correct 102 ms 3124 KB Output is correct
164 Correct 187 ms 3028 KB Output is correct
165 Correct 98 ms 3128 KB Output is correct
166 Correct 183 ms 3124 KB Output is correct
167 Correct 238 ms 3028 KB Output is correct
168 Correct 194 ms 3028 KB Output is correct
169 Correct 194 ms 3128 KB Output is correct
170 Correct 278 ms 3128 KB Output is correct
171 Correct 99 ms 3124 KB Output is correct
172 Correct 259 ms 3128 KB Output is correct
173 Correct 194 ms 3132 KB Output is correct
174 Correct 260 ms 3128 KB Output is correct
175 Correct 342 ms 3028 KB Output is correct
176 Correct 433 ms 3128 KB Output is correct
177 Correct 360 ms 3152 KB Output is correct
178 Correct 424 ms 3028 KB Output is correct
179 Correct 393 ms 3132 KB Output is correct
180 Correct 172 ms 3128 KB Output is correct
181 Correct 416 ms 3128 KB Output is correct
182 Correct 451 ms 3128 KB Output is correct
183 Correct 390 ms 3128 KB Output is correct
184 Correct 329 ms 3148 KB Output is correct
185 Correct 819 ms 3132 KB Output is correct
186 Correct 871 ms 3124 KB Output is correct
187 Correct 840 ms 3128 KB Output is correct
188 Correct 782 ms 3132 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 3148 KB Output is correct
2 Correct 140 ms 3028 KB Output is correct
3 Correct 51 ms 3148 KB Output is correct
4 Correct 141 ms 3124 KB Output is correct
5 Correct 136 ms 3132 KB Output is correct
6 Correct 94 ms 3028 KB Output is correct
7 Correct 15 ms 3144 KB Output is correct
8 Correct 13 ms 3028 KB Output is correct
9 Correct 62 ms 3028 KB Output is correct
10 Correct 96 ms 3124 KB Output is correct
11 Correct 12 ms 3028 KB Output is correct
12 Correct 148 ms 3144 KB Output is correct
13 Correct 55 ms 3152 KB Output is correct
14 Correct 139 ms 3124 KB Output is correct
15 Correct 135 ms 3136 KB Output is correct
16 Correct 90 ms 3128 KB Output is correct
17 Correct 14 ms 3148 KB Output is correct
18 Correct 13 ms 3028 KB Output is correct
19 Correct 64 ms 3144 KB Output is correct
20 Correct 96 ms 3028 KB Output is correct
21 Correct 7 ms 3028 KB Output is correct
22 Correct 9 ms 3028 KB Output is correct
23 Correct 186 ms 3140 KB Output is correct
24 Correct 98 ms 3128 KB Output is correct
25 Correct 185 ms 3028 KB Output is correct
26 Correct 239 ms 3124 KB Output is correct
27 Correct 194 ms 3124 KB Output is correct
28 Correct 192 ms 3128 KB Output is correct
29 Correct 13 ms 3028 KB Output is correct
30 Correct 138 ms 3028 KB Output is correct
31 Correct 48 ms 3128 KB Output is correct
32 Correct 142 ms 3128 KB Output is correct
33 Correct 136 ms 3028 KB Output is correct
34 Correct 93 ms 3028 KB Output is correct
35 Correct 14 ms 3028 KB Output is correct
36 Correct 12 ms 3144 KB Output is correct
37 Correct 65 ms 3028 KB Output is correct
38 Correct 95 ms 3128 KB Output is correct
39 Correct 7 ms 3148 KB Output is correct
40 Correct 9 ms 3152 KB Output is correct
41 Correct 182 ms 3028 KB Output is correct
42 Correct 99 ms 3028 KB Output is correct
43 Correct 187 ms 3148 KB Output is correct
44 Correct 234 ms 3128 KB Output is correct
45 Correct 205 ms 3128 KB Output is correct
46 Correct 197 ms 3124 KB Output is correct
47 Correct 8 ms 3028 KB Output is correct
48 Correct 11 ms 3152 KB Output is correct
49 Correct 379 ms 3028 KB Output is correct
50 Correct 171 ms 3124 KB Output is correct
51 Correct 423 ms 3124 KB Output is correct
52 Correct 467 ms 3128 KB Output is correct
53 Correct 402 ms 3136 KB Output is correct
54 Correct 327 ms 3028 KB Output is correct
55 Correct 20 ms 3028 KB Output is correct
56 Correct 159 ms 3128 KB Output is correct
57 Correct 51 ms 3144 KB Output is correct
58 Correct 143 ms 3124 KB Output is correct
59 Correct 145 ms 3028 KB Output is correct
60 Correct 94 ms 3028 KB Output is correct
61 Correct 14 ms 3028 KB Output is correct
62 Correct 14 ms 3152 KB Output is correct
63 Correct 63 ms 3028 KB Output is correct
64 Correct 104 ms 3128 KB Output is correct
65 Correct 9 ms 3028 KB Output is correct
66 Correct 10 ms 3148 KB Output is correct
67 Correct 206 ms 3128 KB Output is correct
68 Correct 109 ms 3124 KB Output is correct
69 Correct 204 ms 3128 KB Output is correct
70 Correct 244 ms 3124 KB Output is correct
71 Correct 205 ms 3028 KB Output is correct
72 Correct 205 ms 3128 KB Output is correct
73 Correct 9 ms 3028 KB Output is correct
74 Correct 12 ms 3144 KB Output is correct
75 Correct 436 ms 3028 KB Output is correct
76 Correct 191 ms 3128 KB Output is correct
77 Correct 457 ms 3124 KB Output is correct
78 Correct 450 ms 3128 KB Output is correct
79 Correct 391 ms 3124 KB Output is correct
80 Correct 327 ms 3128 KB Output is correct
81 Correct 1308 ms 3132 KB Output is correct
82 Correct 550 ms 3128 KB Output is correct
83 Correct 1240 ms 3260 KB Output is correct
84 Correct 1371 ms 3136 KB Output is correct
85 Correct 13 ms 3028 KB Output is correct
86 Correct 14 ms 3148 KB Output is correct
87 Correct 1117 ms 3128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 3028 KB Output is correct
2 Correct 3 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 13 ms 3148 KB Output is correct
5 Correct 2 ms 3028 KB Output is correct
6 Correct 219 ms 3076 KB Output is correct
7 Correct 110 ms 3124 KB Output is correct
8 Correct 217 ms 3140 KB Output is correct
9 Correct 282 ms 3124 KB Output is correct
10 Correct 8 ms 3156 KB Output is correct
11 Correct 9 ms 3144 KB Output is correct
12 Correct 7 ms 3028 KB Output is correct
13 Correct 3 ms 3144 KB Output is correct
14 Correct 3 ms 3028 KB Output is correct
15 Correct 13 ms 3148 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 232 ms 3128 KB Output is correct
18 Correct 103 ms 3028 KB Output is correct
19 Correct 225 ms 3124 KB Output is correct
20 Correct 275 ms 3156 KB Output is correct
21 Correct 7 ms 3028 KB Output is correct
22 Correct 10 ms 3148 KB Output is correct
23 Correct 2 ms 3028 KB Output is correct
24 Correct 539 ms 3132 KB Output is correct
25 Correct 200 ms 3028 KB Output is correct
26 Correct 613 ms 3124 KB Output is correct
27 Correct 592 ms 3028 KB Output is correct
28 Correct 9 ms 3028 KB Output is correct
29 Correct 10 ms 3144 KB Output is correct
30 Correct 13 ms 3148 KB Output is correct
31 Correct 140 ms 3028 KB Output is correct
32 Correct 51 ms 3148 KB Output is correct
33 Correct 141 ms 3124 KB Output is correct
34 Correct 136 ms 3132 KB Output is correct
35 Correct 94 ms 3028 KB Output is correct
36 Correct 15 ms 3144 KB Output is correct
37 Correct 13 ms 3028 KB Output is correct
38 Correct 62 ms 3028 KB Output is correct
39 Correct 96 ms 3124 KB Output is correct
40 Correct 5 ms 3024 KB Output is correct
41 Correct 3 ms 3028 KB Output is correct
42 Correct 3 ms 3028 KB Output is correct
43 Correct 12 ms 3144 KB Output is correct
44 Correct 157 ms 3132 KB Output is correct
45 Correct 48 ms 3140 KB Output is correct
46 Correct 138 ms 3028 KB Output is correct
47 Correct 135 ms 3028 KB Output is correct
48 Correct 93 ms 3028 KB Output is correct
49 Correct 14 ms 3144 KB Output is correct
50 Correct 12 ms 3028 KB Output is correct
51 Correct 62 ms 3028 KB Output is correct
52 Correct 94 ms 3028 KB Output is correct
53 Correct 279 ms 3124 KB Output is correct
54 Correct 88 ms 3028 KB Output is correct
55 Correct 260 ms 3124 KB Output is correct
56 Correct 189 ms 3028 KB Output is correct
57 Correct 266 ms 3128 KB Output is correct
58 Correct 12 ms 3028 KB Output is correct
59 Correct 148 ms 3144 KB Output is correct
60 Correct 55 ms 3152 KB Output is correct
61 Correct 139 ms 3124 KB Output is correct
62 Correct 135 ms 3136 KB Output is correct
63 Correct 90 ms 3128 KB Output is correct
64 Correct 14 ms 3148 KB Output is correct
65 Correct 13 ms 3028 KB Output is correct
66 Correct 64 ms 3144 KB Output is correct
67 Correct 96 ms 3028 KB Output is correct
68 Correct 7 ms 3028 KB Output is correct
69 Correct 9 ms 3028 KB Output is correct
70 Correct 186 ms 3140 KB Output is correct
71 Correct 98 ms 3128 KB Output is correct
72 Correct 185 ms 3028 KB Output is correct
73 Correct 239 ms 3124 KB Output is correct
74 Correct 194 ms 3124 KB Output is correct
75 Correct 192 ms 3128 KB Output is correct
76 Correct 4 ms 3028 KB Output is correct
77 Correct 4 ms 3028 KB Output is correct
78 Correct 3 ms 3028 KB Output is correct
79 Correct 13 ms 3148 KB Output is correct
80 Correct 2 ms 3028 KB Output is correct
81 Correct 228 ms 3124 KB Output is correct
82 Correct 107 ms 3124 KB Output is correct
83 Correct 214 ms 3028 KB Output is correct
84 Correct 274 ms 3144 KB Output is correct
85 Correct 7 ms 3028 KB Output is correct
86 Correct 9 ms 3028 KB Output is correct
87 Correct 140 ms 3124 KB Output is correct
88 Correct 48 ms 3028 KB Output is correct
89 Correct 136 ms 3140 KB Output is correct
90 Correct 139 ms 3124 KB Output is correct
91 Correct 91 ms 3128 KB Output is correct
92 Correct 15 ms 3028 KB Output is correct
93 Correct 13 ms 3028 KB Output is correct
94 Correct 59 ms 3128 KB Output is correct
95 Correct 96 ms 3068 KB Output is correct
96 Correct 281 ms 3124 KB Output is correct
97 Correct 91 ms 3028 KB Output is correct
98 Correct 266 ms 3028 KB Output is correct
99 Correct 191 ms 3132 KB Output is correct
100 Correct 260 ms 3028 KB Output is correct
101 Correct 188 ms 3128 KB Output is correct
102 Correct 102 ms 3132 KB Output is correct
103 Correct 185 ms 3132 KB Output is correct
104 Correct 233 ms 3128 KB Output is correct
105 Correct 222 ms 3124 KB Output is correct
106 Correct 193 ms 3124 KB Output is correct
107 Correct 349 ms 3272 KB Output is correct
108 Correct 435 ms 3124 KB Output is correct
109 Correct 376 ms 3148 KB Output is correct
110 Correct 416 ms 3128 KB Output is correct
111 Correct 13 ms 3028 KB Output is correct
112 Correct 138 ms 3028 KB Output is correct
113 Correct 48 ms 3128 KB Output is correct
114 Correct 142 ms 3128 KB Output is correct
115 Correct 136 ms 3028 KB Output is correct
116 Correct 93 ms 3028 KB Output is correct
117 Correct 14 ms 3028 KB Output is correct
118 Correct 12 ms 3144 KB Output is correct
119 Correct 65 ms 3028 KB Output is correct
120 Correct 95 ms 3128 KB Output is correct
121 Correct 7 ms 3148 KB Output is correct
122 Correct 9 ms 3152 KB Output is correct
123 Correct 182 ms 3028 KB Output is correct
124 Correct 99 ms 3028 KB Output is correct
125 Correct 187 ms 3148 KB Output is correct
126 Correct 234 ms 3128 KB Output is correct
127 Correct 205 ms 3128 KB Output is correct
128 Correct 197 ms 3124 KB Output is correct
129 Correct 8 ms 3028 KB Output is correct
130 Correct 11 ms 3152 KB Output is correct
131 Correct 379 ms 3028 KB Output is correct
132 Correct 171 ms 3124 KB Output is correct
133 Correct 423 ms 3124 KB Output is correct
134 Correct 467 ms 3128 KB Output is correct
135 Correct 402 ms 3136 KB Output is correct
136 Correct 327 ms 3028 KB Output is correct
137 Correct 5 ms 3028 KB Output is correct
138 Correct 3 ms 3156 KB Output is correct
139 Correct 3 ms 3028 KB Output is correct
140 Correct 14 ms 3148 KB Output is correct
141 Correct 2 ms 3028 KB Output is correct
142 Correct 237 ms 3136 KB Output is correct
143 Correct 106 ms 3188 KB Output is correct
144 Correct 236 ms 3128 KB Output is correct
145 Correct 293 ms 3148 KB Output is correct
146 Correct 7 ms 3152 KB Output is correct
147 Correct 15 ms 3148 KB Output is correct
148 Correct 2 ms 3028 KB Output is correct
149 Correct 554 ms 3136 KB Output is correct
150 Correct 212 ms 3128 KB Output is correct
151 Correct 619 ms 3124 KB Output is correct
152 Correct 598 ms 3028 KB Output is correct
153 Correct 8 ms 3148 KB Output is correct
154 Correct 11 ms 3028 KB Output is correct
155 Correct 140 ms 3124 KB Output is correct
156 Correct 49 ms 3136 KB Output is correct
157 Correct 136 ms 3132 KB Output is correct
158 Correct 142 ms 3124 KB Output is correct
159 Correct 90 ms 3128 KB Output is correct
160 Correct 14 ms 3028 KB Output is correct
161 Correct 12 ms 3028 KB Output is correct
162 Correct 60 ms 3128 KB Output is correct
163 Correct 102 ms 3124 KB Output is correct
164 Correct 187 ms 3028 KB Output is correct
165 Correct 98 ms 3128 KB Output is correct
166 Correct 183 ms 3124 KB Output is correct
167 Correct 238 ms 3028 KB Output is correct
168 Correct 194 ms 3028 KB Output is correct
169 Correct 194 ms 3128 KB Output is correct
170 Correct 278 ms 3128 KB Output is correct
171 Correct 99 ms 3124 KB Output is correct
172 Correct 259 ms 3128 KB Output is correct
173 Correct 194 ms 3132 KB Output is correct
174 Correct 260 ms 3128 KB Output is correct
175 Correct 342 ms 3028 KB Output is correct
176 Correct 433 ms 3128 KB Output is correct
177 Correct 360 ms 3152 KB Output is correct
178 Correct 424 ms 3028 KB Output is correct
179 Correct 393 ms 3132 KB Output is correct
180 Correct 172 ms 3128 KB Output is correct
181 Correct 416 ms 3128 KB Output is correct
182 Correct 451 ms 3128 KB Output is correct
183 Correct 390 ms 3128 KB Output is correct
184 Correct 329 ms 3148 KB Output is correct
185 Correct 819 ms 3132 KB Output is correct
186 Correct 871 ms 3124 KB Output is correct
187 Correct 840 ms 3128 KB Output is correct
188 Correct 782 ms 3132 KB Output is correct
189 Correct 20 ms 3028 KB Output is correct
190 Correct 159 ms 3128 KB Output is correct
191 Correct 51 ms 3144 KB Output is correct
192 Correct 143 ms 3124 KB Output is correct
193 Correct 145 ms 3028 KB Output is correct
194 Correct 94 ms 3028 KB Output is correct
195 Correct 14 ms 3028 KB Output is correct
196 Correct 14 ms 3152 KB Output is correct
197 Correct 63 ms 3028 KB Output is correct
198 Correct 104 ms 3128 KB Output is correct
199 Correct 9 ms 3028 KB Output is correct
200 Correct 10 ms 3148 KB Output is correct
201 Correct 206 ms 3128 KB Output is correct
202 Correct 109 ms 3124 KB Output is correct
203 Correct 204 ms 3128 KB Output is correct
204 Correct 244 ms 3124 KB Output is correct
205 Correct 205 ms 3028 KB Output is correct
206 Correct 205 ms 3128 KB Output is correct
207 Correct 9 ms 3028 KB Output is correct
208 Correct 12 ms 3144 KB Output is correct
209 Correct 436 ms 3028 KB Output is correct
210 Correct 191 ms 3128 KB Output is correct
211 Correct 457 ms 3124 KB Output is correct
212 Correct 450 ms 3128 KB Output is correct
213 Correct 391 ms 3124 KB Output is correct
214 Correct 327 ms 3128 KB Output is correct
215 Correct 1308 ms 3132 KB Output is correct
216 Correct 550 ms 3128 KB Output is correct
217 Correct 1240 ms 3260 KB Output is correct
218 Correct 1371 ms 3136 KB Output is correct
219 Correct 13 ms 3028 KB Output is correct
220 Correct 14 ms 3148 KB Output is correct
221 Correct 1117 ms 3128 KB Output is correct
222 Correct 12 ms 3028 KB Output is correct
223 Correct 139 ms 3132 KB Output is correct
224 Correct 49 ms 3148 KB Output is correct
225 Correct 145 ms 3128 KB Output is correct
226 Correct 134 ms 3028 KB Output is correct
227 Correct 90 ms 3128 KB Output is correct
228 Correct 14 ms 3028 KB Output is correct
229 Correct 12 ms 3148 KB Output is correct
230 Correct 63 ms 3028 KB Output is correct
231 Correct 93 ms 3028 KB Output is correct
232 Correct 7 ms 3144 KB Output is correct
233 Correct 9 ms 3028 KB Output is correct
234 Correct 189 ms 3148 KB Output is correct
235 Correct 99 ms 3132 KB Output is correct
236 Correct 186 ms 3132 KB Output is correct
237 Correct 230 ms 3128 KB Output is correct
238 Correct 196 ms 3128 KB Output is correct
239 Correct 194 ms 3128 KB Output is correct
240 Correct 8 ms 3028 KB Output is correct
241 Correct 10 ms 3028 KB Output is correct
242 Correct 377 ms 3128 KB Output is correct
243 Correct 166 ms 3140 KB Output is correct
244 Correct 416 ms 3028 KB Output is correct
245 Correct 438 ms 3028 KB Output is correct
246 Correct 406 ms 3124 KB Output is correct
247 Correct 330 ms 3028 KB Output is correct
248 Correct 5 ms 3028 KB Output is correct
249 Correct 5 ms 3028 KB Output is correct
250 Correct 4 ms 3028 KB Output is correct
251 Correct 1 ms 3028 KB Output is correct
252 Correct 215 ms 3124 KB Output is correct
253 Correct 100 ms 3128 KB Output is correct
254 Correct 212 ms 3128 KB Output is correct
255 Correct 285 ms 3140 KB Output is correct
256 Correct 2 ms 3028 KB Output is correct
257 Correct 518 ms 3128 KB Output is correct
258 Correct 194 ms 3124 KB Output is correct
259 Correct 585 ms 3124 KB Output is correct
260 Correct 589 ms 3128 KB Output is correct
261 Correct 279 ms 3028 KB Output is correct
262 Correct 88 ms 3132 KB Output is correct
263 Correct 262 ms 3128 KB Output is correct
264 Correct 188 ms 3148 KB Output is correct
265 Correct 265 ms 3028 KB Output is correct
266 Correct 342 ms 3140 KB Output is correct
267 Correct 438 ms 3128 KB Output is correct
268 Correct 370 ms 3132 KB Output is correct
269 Correct 423 ms 3124 KB Output is correct
270 Correct 800 ms 3252 KB Output is correct
271 Correct 855 ms 3140 KB Output is correct
272 Correct 775 ms 3132 KB Output is correct
273 Correct 773 ms 3132 KB Output is correct
274 Correct 1295 ms 3132 KB Output is correct
275 Correct 561 ms 3124 KB Output is correct
276 Correct 1260 ms 3276 KB Output is correct
277 Correct 1377 ms 3140 KB Output is correct
278 Correct 12 ms 3028 KB Output is correct
279 Correct 14 ms 3028 KB Output is correct
280 Correct 1138 ms 3144 KB Output is correct
281 Correct 2507 ms 3260 KB Output is correct
282 Correct 2791 ms 3132 KB Output is correct
283 Correct 2557 ms 3136 KB Output is correct