답안 #578109

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
578109 2022-06-16T05:07:28 Z balbit Uplifting Excursion (BOI22_vault) C++14
100 / 100
1357 ms 1748 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 ;
ll bst[rng*2+4];

vector<ll> bd(ll x) {
    //  maybe i can min x ith rng or smth
    MN(x, rng*2);
    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 2 ms 1620 KB Output is correct
2 Correct 2 ms 1620 KB Output is correct
3 Correct 2 ms 1620 KB Output is correct
4 Correct 7 ms 1620 KB Output is correct
5 Correct 1 ms 1620 KB Output is correct
6 Correct 109 ms 1620 KB Output is correct
7 Correct 48 ms 1712 KB Output is correct
8 Correct 111 ms 1620 KB Output is correct
9 Correct 149 ms 1712 KB Output is correct
10 Correct 4 ms 1620 KB Output is correct
11 Correct 5 ms 1744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 2 ms 1620 KB Output is correct
3 Correct 2 ms 1620 KB Output is correct
4 Correct 7 ms 1620 KB Output is correct
5 Correct 1 ms 1620 KB Output is correct
6 Correct 109 ms 1620 KB Output is correct
7 Correct 48 ms 1712 KB Output is correct
8 Correct 111 ms 1620 KB Output is correct
9 Correct 149 ms 1712 KB Output is correct
10 Correct 4 ms 1620 KB Output is correct
11 Correct 5 ms 1744 KB Output is correct
12 Correct 3 ms 1620 KB Output is correct
13 Correct 2 ms 1620 KB Output is correct
14 Correct 2 ms 1620 KB Output is correct
15 Correct 6 ms 1728 KB Output is correct
16 Correct 1 ms 1620 KB Output is correct
17 Correct 121 ms 1620 KB Output is correct
18 Correct 49 ms 1712 KB Output is correct
19 Correct 110 ms 1716 KB Output is correct
20 Correct 141 ms 1712 KB Output is correct
21 Correct 4 ms 1620 KB Output is correct
22 Correct 5 ms 1620 KB Output is correct
23 Correct 1 ms 1620 KB Output is correct
24 Correct 272 ms 1716 KB Output is correct
25 Correct 109 ms 1620 KB Output is correct
26 Correct 320 ms 1716 KB Output is correct
27 Correct 322 ms 1712 KB Output is correct
28 Correct 4 ms 1732 KB Output is correct
29 Correct 6 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1620 KB Output is correct
2 Correct 72 ms 1620 KB Output is correct
3 Correct 22 ms 1740 KB Output is correct
4 Correct 73 ms 1620 KB Output is correct
5 Correct 68 ms 1620 KB Output is correct
6 Correct 47 ms 1620 KB Output is correct
7 Correct 8 ms 1620 KB Output is correct
8 Correct 6 ms 1620 KB Output is correct
9 Correct 29 ms 1620 KB Output is correct
10 Correct 47 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1620 KB Output is correct
2 Correct 72 ms 1620 KB Output is correct
3 Correct 22 ms 1740 KB Output is correct
4 Correct 73 ms 1620 KB Output is correct
5 Correct 68 ms 1620 KB Output is correct
6 Correct 47 ms 1620 KB Output is correct
7 Correct 8 ms 1620 KB Output is correct
8 Correct 6 ms 1620 KB Output is correct
9 Correct 29 ms 1620 KB Output is correct
10 Correct 47 ms 1620 KB Output is correct
11 Correct 3 ms 1620 KB Output is correct
12 Correct 2 ms 1620 KB Output is correct
13 Correct 2 ms 1620 KB Output is correct
14 Correct 10 ms 1620 KB Output is correct
15 Correct 72 ms 1720 KB Output is correct
16 Correct 23 ms 1736 KB Output is correct
17 Correct 78 ms 1712 KB Output is correct
18 Correct 68 ms 1620 KB Output is correct
19 Correct 50 ms 1724 KB Output is correct
20 Correct 8 ms 1620 KB Output is correct
21 Correct 6 ms 1620 KB Output is correct
22 Correct 31 ms 1620 KB Output is correct
23 Correct 48 ms 1720 KB Output is correct
24 Correct 140 ms 1716 KB Output is correct
25 Correct 43 ms 1712 KB Output is correct
26 Correct 132 ms 1720 KB Output is correct
27 Correct 101 ms 1620 KB Output is correct
28 Correct 132 ms 1720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1620 KB Output is correct
2 Correct 72 ms 1620 KB Output is correct
3 Correct 22 ms 1740 KB Output is correct
4 Correct 73 ms 1620 KB Output is correct
5 Correct 68 ms 1620 KB Output is correct
6 Correct 47 ms 1620 KB Output is correct
7 Correct 8 ms 1620 KB Output is correct
8 Correct 6 ms 1620 KB Output is correct
9 Correct 29 ms 1620 KB Output is correct
10 Correct 47 ms 1620 KB Output is correct
11 Correct 7 ms 1620 KB Output is correct
12 Correct 72 ms 1716 KB Output is correct
13 Correct 23 ms 1728 KB Output is correct
14 Correct 81 ms 1716 KB Output is correct
15 Correct 69 ms 1620 KB Output is correct
16 Correct 62 ms 1712 KB Output is correct
17 Correct 9 ms 1620 KB Output is correct
18 Correct 6 ms 1736 KB Output is correct
19 Correct 31 ms 1712 KB Output is correct
20 Correct 64 ms 1716 KB Output is correct
21 Correct 6 ms 1620 KB Output is correct
22 Correct 5 ms 1620 KB Output is correct
23 Correct 91 ms 1620 KB Output is correct
24 Correct 49 ms 1620 KB Output is correct
25 Correct 110 ms 1716 KB Output is correct
26 Correct 123 ms 1712 KB Output is correct
27 Correct 109 ms 1712 KB Output is correct
28 Correct 93 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 2 ms 1620 KB Output is correct
3 Correct 2 ms 1620 KB Output is correct
4 Correct 7 ms 1620 KB Output is correct
5 Correct 1 ms 1620 KB Output is correct
6 Correct 109 ms 1620 KB Output is correct
7 Correct 48 ms 1712 KB Output is correct
8 Correct 111 ms 1620 KB Output is correct
9 Correct 149 ms 1712 KB Output is correct
10 Correct 4 ms 1620 KB Output is correct
11 Correct 5 ms 1744 KB Output is correct
12 Correct 7 ms 1620 KB Output is correct
13 Correct 72 ms 1620 KB Output is correct
14 Correct 22 ms 1740 KB Output is correct
15 Correct 73 ms 1620 KB Output is correct
16 Correct 68 ms 1620 KB Output is correct
17 Correct 47 ms 1620 KB Output is correct
18 Correct 8 ms 1620 KB Output is correct
19 Correct 6 ms 1620 KB Output is correct
20 Correct 29 ms 1620 KB Output is correct
21 Correct 47 ms 1620 KB Output is correct
22 Correct 3 ms 1620 KB Output is correct
23 Correct 2 ms 1620 KB Output is correct
24 Correct 2 ms 1620 KB Output is correct
25 Correct 10 ms 1620 KB Output is correct
26 Correct 72 ms 1720 KB Output is correct
27 Correct 23 ms 1736 KB Output is correct
28 Correct 78 ms 1712 KB Output is correct
29 Correct 68 ms 1620 KB Output is correct
30 Correct 50 ms 1724 KB Output is correct
31 Correct 8 ms 1620 KB Output is correct
32 Correct 6 ms 1620 KB Output is correct
33 Correct 31 ms 1620 KB Output is correct
34 Correct 48 ms 1720 KB Output is correct
35 Correct 140 ms 1716 KB Output is correct
36 Correct 43 ms 1712 KB Output is correct
37 Correct 132 ms 1720 KB Output is correct
38 Correct 101 ms 1620 KB Output is correct
39 Correct 132 ms 1720 KB Output is correct
40 Correct 7 ms 1620 KB Output is correct
41 Correct 72 ms 1716 KB Output is correct
42 Correct 23 ms 1728 KB Output is correct
43 Correct 81 ms 1716 KB Output is correct
44 Correct 69 ms 1620 KB Output is correct
45 Correct 62 ms 1712 KB Output is correct
46 Correct 9 ms 1620 KB Output is correct
47 Correct 6 ms 1736 KB Output is correct
48 Correct 31 ms 1712 KB Output is correct
49 Correct 64 ms 1716 KB Output is correct
50 Correct 6 ms 1620 KB Output is correct
51 Correct 5 ms 1620 KB Output is correct
52 Correct 91 ms 1620 KB Output is correct
53 Correct 49 ms 1620 KB Output is correct
54 Correct 110 ms 1716 KB Output is correct
55 Correct 123 ms 1712 KB Output is correct
56 Correct 109 ms 1712 KB Output is correct
57 Correct 93 ms 1620 KB Output is correct
58 Correct 3 ms 1620 KB Output is correct
59 Correct 2 ms 1620 KB Output is correct
60 Correct 2 ms 1620 KB Output is correct
61 Correct 8 ms 1748 KB Output is correct
62 Correct 1 ms 1620 KB Output is correct
63 Correct 114 ms 1716 KB Output is correct
64 Correct 49 ms 1728 KB Output is correct
65 Correct 106 ms 1716 KB Output is correct
66 Correct 136 ms 1716 KB Output is correct
67 Correct 3 ms 1620 KB Output is correct
68 Correct 5 ms 1620 KB Output is correct
69 Correct 68 ms 1716 KB Output is correct
70 Correct 22 ms 1620 KB Output is correct
71 Correct 68 ms 1620 KB Output is correct
72 Correct 65 ms 1620 KB Output is correct
73 Correct 46 ms 1620 KB Output is correct
74 Correct 7 ms 1620 KB Output is correct
75 Correct 6 ms 1620 KB Output is correct
76 Correct 29 ms 1736 KB Output is correct
77 Correct 48 ms 1712 KB Output is correct
78 Correct 127 ms 1620 KB Output is correct
79 Correct 41 ms 1620 KB Output is correct
80 Correct 127 ms 1716 KB Output is correct
81 Correct 97 ms 1712 KB Output is correct
82 Correct 124 ms 1716 KB Output is correct
83 Correct 88 ms 1720 KB Output is correct
84 Correct 49 ms 1620 KB Output is correct
85 Correct 86 ms 1620 KB Output is correct
86 Correct 112 ms 1716 KB Output is correct
87 Correct 100 ms 1712 KB Output is correct
88 Correct 91 ms 1620 KB Output is correct
89 Correct 174 ms 1716 KB Output is correct
90 Correct 207 ms 1716 KB Output is correct
91 Correct 173 ms 1620 KB Output is correct
92 Correct 197 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1620 KB Output is correct
2 Correct 72 ms 1620 KB Output is correct
3 Correct 22 ms 1740 KB Output is correct
4 Correct 73 ms 1620 KB Output is correct
5 Correct 68 ms 1620 KB Output is correct
6 Correct 47 ms 1620 KB Output is correct
7 Correct 8 ms 1620 KB Output is correct
8 Correct 6 ms 1620 KB Output is correct
9 Correct 29 ms 1620 KB Output is correct
10 Correct 47 ms 1620 KB Output is correct
11 Correct 7 ms 1620 KB Output is correct
12 Correct 72 ms 1716 KB Output is correct
13 Correct 23 ms 1728 KB Output is correct
14 Correct 81 ms 1716 KB Output is correct
15 Correct 69 ms 1620 KB Output is correct
16 Correct 62 ms 1712 KB Output is correct
17 Correct 9 ms 1620 KB Output is correct
18 Correct 6 ms 1736 KB Output is correct
19 Correct 31 ms 1712 KB Output is correct
20 Correct 64 ms 1716 KB Output is correct
21 Correct 6 ms 1620 KB Output is correct
22 Correct 5 ms 1620 KB Output is correct
23 Correct 91 ms 1620 KB Output is correct
24 Correct 49 ms 1620 KB Output is correct
25 Correct 110 ms 1716 KB Output is correct
26 Correct 123 ms 1712 KB Output is correct
27 Correct 109 ms 1712 KB Output is correct
28 Correct 93 ms 1620 KB Output is correct
29 Correct 6 ms 1620 KB Output is correct
30 Correct 66 ms 1620 KB Output is correct
31 Correct 26 ms 1620 KB Output is correct
32 Correct 76 ms 1620 KB Output is correct
33 Correct 62 ms 1620 KB Output is correct
34 Correct 45 ms 1620 KB Output is correct
35 Correct 7 ms 1736 KB Output is correct
36 Correct 6 ms 1736 KB Output is correct
37 Correct 29 ms 1720 KB Output is correct
38 Correct 49 ms 1728 KB Output is correct
39 Correct 4 ms 1620 KB Output is correct
40 Correct 4 ms 1620 KB Output is correct
41 Correct 92 ms 1716 KB Output is correct
42 Correct 47 ms 1620 KB Output is correct
43 Correct 86 ms 1716 KB Output is correct
44 Correct 110 ms 1620 KB Output is correct
45 Correct 93 ms 1724 KB Output is correct
46 Correct 91 ms 1712 KB Output is correct
47 Correct 4 ms 1620 KB Output is correct
48 Correct 5 ms 1620 KB Output is correct
49 Correct 187 ms 1720 KB Output is correct
50 Correct 77 ms 1720 KB Output is correct
51 Correct 210 ms 1620 KB Output is correct
52 Correct 209 ms 1620 KB Output is correct
53 Correct 192 ms 1712 KB Output is correct
54 Correct 165 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 2 ms 1620 KB Output is correct
3 Correct 2 ms 1620 KB Output is correct
4 Correct 7 ms 1620 KB Output is correct
5 Correct 1 ms 1620 KB Output is correct
6 Correct 109 ms 1620 KB Output is correct
7 Correct 48 ms 1712 KB Output is correct
8 Correct 111 ms 1620 KB Output is correct
9 Correct 149 ms 1712 KB Output is correct
10 Correct 4 ms 1620 KB Output is correct
11 Correct 5 ms 1744 KB Output is correct
12 Correct 3 ms 1620 KB Output is correct
13 Correct 2 ms 1620 KB Output is correct
14 Correct 2 ms 1620 KB Output is correct
15 Correct 6 ms 1728 KB Output is correct
16 Correct 1 ms 1620 KB Output is correct
17 Correct 121 ms 1620 KB Output is correct
18 Correct 49 ms 1712 KB Output is correct
19 Correct 110 ms 1716 KB Output is correct
20 Correct 141 ms 1712 KB Output is correct
21 Correct 4 ms 1620 KB Output is correct
22 Correct 5 ms 1620 KB Output is correct
23 Correct 1 ms 1620 KB Output is correct
24 Correct 272 ms 1716 KB Output is correct
25 Correct 109 ms 1620 KB Output is correct
26 Correct 320 ms 1716 KB Output is correct
27 Correct 322 ms 1712 KB Output is correct
28 Correct 4 ms 1732 KB Output is correct
29 Correct 6 ms 1620 KB Output is correct
30 Correct 7 ms 1620 KB Output is correct
31 Correct 72 ms 1620 KB Output is correct
32 Correct 22 ms 1740 KB Output is correct
33 Correct 73 ms 1620 KB Output is correct
34 Correct 68 ms 1620 KB Output is correct
35 Correct 47 ms 1620 KB Output is correct
36 Correct 8 ms 1620 KB Output is correct
37 Correct 6 ms 1620 KB Output is correct
38 Correct 29 ms 1620 KB Output is correct
39 Correct 47 ms 1620 KB Output is correct
40 Correct 3 ms 1620 KB Output is correct
41 Correct 2 ms 1620 KB Output is correct
42 Correct 2 ms 1620 KB Output is correct
43 Correct 10 ms 1620 KB Output is correct
44 Correct 72 ms 1720 KB Output is correct
45 Correct 23 ms 1736 KB Output is correct
46 Correct 78 ms 1712 KB Output is correct
47 Correct 68 ms 1620 KB Output is correct
48 Correct 50 ms 1724 KB Output is correct
49 Correct 8 ms 1620 KB Output is correct
50 Correct 6 ms 1620 KB Output is correct
51 Correct 31 ms 1620 KB Output is correct
52 Correct 48 ms 1720 KB Output is correct
53 Correct 140 ms 1716 KB Output is correct
54 Correct 43 ms 1712 KB Output is correct
55 Correct 132 ms 1720 KB Output is correct
56 Correct 101 ms 1620 KB Output is correct
57 Correct 132 ms 1720 KB Output is correct
58 Correct 7 ms 1620 KB Output is correct
59 Correct 72 ms 1716 KB Output is correct
60 Correct 23 ms 1728 KB Output is correct
61 Correct 81 ms 1716 KB Output is correct
62 Correct 69 ms 1620 KB Output is correct
63 Correct 62 ms 1712 KB Output is correct
64 Correct 9 ms 1620 KB Output is correct
65 Correct 6 ms 1736 KB Output is correct
66 Correct 31 ms 1712 KB Output is correct
67 Correct 64 ms 1716 KB Output is correct
68 Correct 6 ms 1620 KB Output is correct
69 Correct 5 ms 1620 KB Output is correct
70 Correct 91 ms 1620 KB Output is correct
71 Correct 49 ms 1620 KB Output is correct
72 Correct 110 ms 1716 KB Output is correct
73 Correct 123 ms 1712 KB Output is correct
74 Correct 109 ms 1712 KB Output is correct
75 Correct 93 ms 1620 KB Output is correct
76 Correct 3 ms 1620 KB Output is correct
77 Correct 2 ms 1620 KB Output is correct
78 Correct 2 ms 1620 KB Output is correct
79 Correct 8 ms 1748 KB Output is correct
80 Correct 1 ms 1620 KB Output is correct
81 Correct 114 ms 1716 KB Output is correct
82 Correct 49 ms 1728 KB Output is correct
83 Correct 106 ms 1716 KB Output is correct
84 Correct 136 ms 1716 KB Output is correct
85 Correct 3 ms 1620 KB Output is correct
86 Correct 5 ms 1620 KB Output is correct
87 Correct 68 ms 1716 KB Output is correct
88 Correct 22 ms 1620 KB Output is correct
89 Correct 68 ms 1620 KB Output is correct
90 Correct 65 ms 1620 KB Output is correct
91 Correct 46 ms 1620 KB Output is correct
92 Correct 7 ms 1620 KB Output is correct
93 Correct 6 ms 1620 KB Output is correct
94 Correct 29 ms 1736 KB Output is correct
95 Correct 48 ms 1712 KB Output is correct
96 Correct 127 ms 1620 KB Output is correct
97 Correct 41 ms 1620 KB Output is correct
98 Correct 127 ms 1716 KB Output is correct
99 Correct 97 ms 1712 KB Output is correct
100 Correct 124 ms 1716 KB Output is correct
101 Correct 88 ms 1720 KB Output is correct
102 Correct 49 ms 1620 KB Output is correct
103 Correct 86 ms 1620 KB Output is correct
104 Correct 112 ms 1716 KB Output is correct
105 Correct 100 ms 1712 KB Output is correct
106 Correct 91 ms 1620 KB Output is correct
107 Correct 174 ms 1716 KB Output is correct
108 Correct 207 ms 1716 KB Output is correct
109 Correct 173 ms 1620 KB Output is correct
110 Correct 197 ms 1620 KB Output is correct
111 Correct 6 ms 1620 KB Output is correct
112 Correct 66 ms 1620 KB Output is correct
113 Correct 26 ms 1620 KB Output is correct
114 Correct 76 ms 1620 KB Output is correct
115 Correct 62 ms 1620 KB Output is correct
116 Correct 45 ms 1620 KB Output is correct
117 Correct 7 ms 1736 KB Output is correct
118 Correct 6 ms 1736 KB Output is correct
119 Correct 29 ms 1720 KB Output is correct
120 Correct 49 ms 1728 KB Output is correct
121 Correct 4 ms 1620 KB Output is correct
122 Correct 4 ms 1620 KB Output is correct
123 Correct 92 ms 1716 KB Output is correct
124 Correct 47 ms 1620 KB Output is correct
125 Correct 86 ms 1716 KB Output is correct
126 Correct 110 ms 1620 KB Output is correct
127 Correct 93 ms 1724 KB Output is correct
128 Correct 91 ms 1712 KB Output is correct
129 Correct 4 ms 1620 KB Output is correct
130 Correct 5 ms 1620 KB Output is correct
131 Correct 187 ms 1720 KB Output is correct
132 Correct 77 ms 1720 KB Output is correct
133 Correct 210 ms 1620 KB Output is correct
134 Correct 209 ms 1620 KB Output is correct
135 Correct 192 ms 1712 KB Output is correct
136 Correct 165 ms 1620 KB Output is correct
137 Correct 2 ms 1620 KB Output is correct
138 Correct 2 ms 1620 KB Output is correct
139 Correct 2 ms 1620 KB Output is correct
140 Correct 7 ms 1732 KB Output is correct
141 Correct 1 ms 1620 KB Output is correct
142 Correct 110 ms 1716 KB Output is correct
143 Correct 51 ms 1740 KB Output is correct
144 Correct 108 ms 1620 KB Output is correct
145 Correct 142 ms 1620 KB Output is correct
146 Correct 4 ms 1620 KB Output is correct
147 Correct 5 ms 1620 KB Output is correct
148 Correct 1 ms 1620 KB Output is correct
149 Correct 276 ms 1740 KB Output is correct
150 Correct 99 ms 1620 KB Output is correct
151 Correct 300 ms 1720 KB Output is correct
152 Correct 292 ms 1716 KB Output is correct
153 Correct 4 ms 1620 KB Output is correct
154 Correct 5 ms 1620 KB Output is correct
155 Correct 66 ms 1620 KB Output is correct
156 Correct 22 ms 1620 KB Output is correct
157 Correct 71 ms 1716 KB Output is correct
158 Correct 62 ms 1716 KB Output is correct
159 Correct 46 ms 1620 KB Output is correct
160 Correct 8 ms 1744 KB Output is correct
161 Correct 6 ms 1620 KB Output is correct
162 Correct 32 ms 1732 KB Output is correct
163 Correct 44 ms 1620 KB Output is correct
164 Correct 88 ms 1716 KB Output is correct
165 Correct 49 ms 1728 KB Output is correct
166 Correct 89 ms 1716 KB Output is correct
167 Correct 109 ms 1716 KB Output is correct
168 Correct 102 ms 1712 KB Output is correct
169 Correct 91 ms 1620 KB Output is correct
170 Correct 126 ms 1712 KB Output is correct
171 Correct 46 ms 1740 KB Output is correct
172 Correct 128 ms 1716 KB Output is correct
173 Correct 98 ms 1716 KB Output is correct
174 Correct 131 ms 1720 KB Output is correct
175 Correct 165 ms 1716 KB Output is correct
176 Correct 215 ms 1716 KB Output is correct
177 Correct 185 ms 1620 KB Output is correct
178 Correct 199 ms 1620 KB Output is correct
179 Correct 185 ms 1620 KB Output is correct
180 Correct 81 ms 1620 KB Output is correct
181 Correct 207 ms 1712 KB Output is correct
182 Correct 204 ms 1620 KB Output is correct
183 Correct 192 ms 1620 KB Output is correct
184 Correct 159 ms 1716 KB Output is correct
185 Correct 377 ms 1712 KB Output is correct
186 Correct 417 ms 1720 KB Output is correct
187 Correct 382 ms 1620 KB Output is correct
188 Correct 369 ms 1728 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1620 KB Output is correct
2 Correct 72 ms 1620 KB Output is correct
3 Correct 22 ms 1740 KB Output is correct
4 Correct 73 ms 1620 KB Output is correct
5 Correct 68 ms 1620 KB Output is correct
6 Correct 47 ms 1620 KB Output is correct
7 Correct 8 ms 1620 KB Output is correct
8 Correct 6 ms 1620 KB Output is correct
9 Correct 29 ms 1620 KB Output is correct
10 Correct 47 ms 1620 KB Output is correct
11 Correct 7 ms 1620 KB Output is correct
12 Correct 72 ms 1716 KB Output is correct
13 Correct 23 ms 1728 KB Output is correct
14 Correct 81 ms 1716 KB Output is correct
15 Correct 69 ms 1620 KB Output is correct
16 Correct 62 ms 1712 KB Output is correct
17 Correct 9 ms 1620 KB Output is correct
18 Correct 6 ms 1736 KB Output is correct
19 Correct 31 ms 1712 KB Output is correct
20 Correct 64 ms 1716 KB Output is correct
21 Correct 6 ms 1620 KB Output is correct
22 Correct 5 ms 1620 KB Output is correct
23 Correct 91 ms 1620 KB Output is correct
24 Correct 49 ms 1620 KB Output is correct
25 Correct 110 ms 1716 KB Output is correct
26 Correct 123 ms 1712 KB Output is correct
27 Correct 109 ms 1712 KB Output is correct
28 Correct 93 ms 1620 KB Output is correct
29 Correct 6 ms 1620 KB Output is correct
30 Correct 66 ms 1620 KB Output is correct
31 Correct 26 ms 1620 KB Output is correct
32 Correct 76 ms 1620 KB Output is correct
33 Correct 62 ms 1620 KB Output is correct
34 Correct 45 ms 1620 KB Output is correct
35 Correct 7 ms 1736 KB Output is correct
36 Correct 6 ms 1736 KB Output is correct
37 Correct 29 ms 1720 KB Output is correct
38 Correct 49 ms 1728 KB Output is correct
39 Correct 4 ms 1620 KB Output is correct
40 Correct 4 ms 1620 KB Output is correct
41 Correct 92 ms 1716 KB Output is correct
42 Correct 47 ms 1620 KB Output is correct
43 Correct 86 ms 1716 KB Output is correct
44 Correct 110 ms 1620 KB Output is correct
45 Correct 93 ms 1724 KB Output is correct
46 Correct 91 ms 1712 KB Output is correct
47 Correct 4 ms 1620 KB Output is correct
48 Correct 5 ms 1620 KB Output is correct
49 Correct 187 ms 1720 KB Output is correct
50 Correct 77 ms 1720 KB Output is correct
51 Correct 210 ms 1620 KB Output is correct
52 Correct 209 ms 1620 KB Output is correct
53 Correct 192 ms 1712 KB Output is correct
54 Correct 165 ms 1620 KB Output is correct
55 Correct 6 ms 1620 KB Output is correct
56 Correct 69 ms 1716 KB Output is correct
57 Correct 23 ms 1732 KB Output is correct
58 Correct 73 ms 1716 KB Output is correct
59 Correct 62 ms 1620 KB Output is correct
60 Correct 45 ms 1620 KB Output is correct
61 Correct 7 ms 1620 KB Output is correct
62 Correct 6 ms 1620 KB Output is correct
63 Correct 29 ms 1620 KB Output is correct
64 Correct 48 ms 1724 KB Output is correct
65 Correct 4 ms 1620 KB Output is correct
66 Correct 4 ms 1620 KB Output is correct
67 Correct 90 ms 1716 KB Output is correct
68 Correct 49 ms 1620 KB Output is correct
69 Correct 88 ms 1724 KB Output is correct
70 Correct 111 ms 1620 KB Output is correct
71 Correct 95 ms 1712 KB Output is correct
72 Correct 92 ms 1620 KB Output is correct
73 Correct 5 ms 1620 KB Output is correct
74 Correct 5 ms 1620 KB Output is correct
75 Correct 182 ms 1620 KB Output is correct
76 Correct 80 ms 1716 KB Output is correct
77 Correct 201 ms 1620 KB Output is correct
78 Correct 204 ms 1620 KB Output is correct
79 Correct 189 ms 1720 KB Output is correct
80 Correct 157 ms 1712 KB Output is correct
81 Correct 601 ms 1740 KB Output is correct
82 Correct 264 ms 1740 KB Output is correct
83 Correct 580 ms 1740 KB Output is correct
84 Correct 636 ms 1720 KB Output is correct
85 Correct 5 ms 1620 KB Output is correct
86 Correct 6 ms 1620 KB Output is correct
87 Correct 522 ms 1732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 2 ms 1620 KB Output is correct
3 Correct 2 ms 1620 KB Output is correct
4 Correct 7 ms 1620 KB Output is correct
5 Correct 1 ms 1620 KB Output is correct
6 Correct 109 ms 1620 KB Output is correct
7 Correct 48 ms 1712 KB Output is correct
8 Correct 111 ms 1620 KB Output is correct
9 Correct 149 ms 1712 KB Output is correct
10 Correct 4 ms 1620 KB Output is correct
11 Correct 5 ms 1744 KB Output is correct
12 Correct 3 ms 1620 KB Output is correct
13 Correct 2 ms 1620 KB Output is correct
14 Correct 2 ms 1620 KB Output is correct
15 Correct 6 ms 1728 KB Output is correct
16 Correct 1 ms 1620 KB Output is correct
17 Correct 121 ms 1620 KB Output is correct
18 Correct 49 ms 1712 KB Output is correct
19 Correct 110 ms 1716 KB Output is correct
20 Correct 141 ms 1712 KB Output is correct
21 Correct 4 ms 1620 KB Output is correct
22 Correct 5 ms 1620 KB Output is correct
23 Correct 1 ms 1620 KB Output is correct
24 Correct 272 ms 1716 KB Output is correct
25 Correct 109 ms 1620 KB Output is correct
26 Correct 320 ms 1716 KB Output is correct
27 Correct 322 ms 1712 KB Output is correct
28 Correct 4 ms 1732 KB Output is correct
29 Correct 6 ms 1620 KB Output is correct
30 Correct 7 ms 1620 KB Output is correct
31 Correct 72 ms 1620 KB Output is correct
32 Correct 22 ms 1740 KB Output is correct
33 Correct 73 ms 1620 KB Output is correct
34 Correct 68 ms 1620 KB Output is correct
35 Correct 47 ms 1620 KB Output is correct
36 Correct 8 ms 1620 KB Output is correct
37 Correct 6 ms 1620 KB Output is correct
38 Correct 29 ms 1620 KB Output is correct
39 Correct 47 ms 1620 KB Output is correct
40 Correct 3 ms 1620 KB Output is correct
41 Correct 2 ms 1620 KB Output is correct
42 Correct 2 ms 1620 KB Output is correct
43 Correct 10 ms 1620 KB Output is correct
44 Correct 72 ms 1720 KB Output is correct
45 Correct 23 ms 1736 KB Output is correct
46 Correct 78 ms 1712 KB Output is correct
47 Correct 68 ms 1620 KB Output is correct
48 Correct 50 ms 1724 KB Output is correct
49 Correct 8 ms 1620 KB Output is correct
50 Correct 6 ms 1620 KB Output is correct
51 Correct 31 ms 1620 KB Output is correct
52 Correct 48 ms 1720 KB Output is correct
53 Correct 140 ms 1716 KB Output is correct
54 Correct 43 ms 1712 KB Output is correct
55 Correct 132 ms 1720 KB Output is correct
56 Correct 101 ms 1620 KB Output is correct
57 Correct 132 ms 1720 KB Output is correct
58 Correct 7 ms 1620 KB Output is correct
59 Correct 72 ms 1716 KB Output is correct
60 Correct 23 ms 1728 KB Output is correct
61 Correct 81 ms 1716 KB Output is correct
62 Correct 69 ms 1620 KB Output is correct
63 Correct 62 ms 1712 KB Output is correct
64 Correct 9 ms 1620 KB Output is correct
65 Correct 6 ms 1736 KB Output is correct
66 Correct 31 ms 1712 KB Output is correct
67 Correct 64 ms 1716 KB Output is correct
68 Correct 6 ms 1620 KB Output is correct
69 Correct 5 ms 1620 KB Output is correct
70 Correct 91 ms 1620 KB Output is correct
71 Correct 49 ms 1620 KB Output is correct
72 Correct 110 ms 1716 KB Output is correct
73 Correct 123 ms 1712 KB Output is correct
74 Correct 109 ms 1712 KB Output is correct
75 Correct 93 ms 1620 KB Output is correct
76 Correct 3 ms 1620 KB Output is correct
77 Correct 2 ms 1620 KB Output is correct
78 Correct 2 ms 1620 KB Output is correct
79 Correct 8 ms 1748 KB Output is correct
80 Correct 1 ms 1620 KB Output is correct
81 Correct 114 ms 1716 KB Output is correct
82 Correct 49 ms 1728 KB Output is correct
83 Correct 106 ms 1716 KB Output is correct
84 Correct 136 ms 1716 KB Output is correct
85 Correct 3 ms 1620 KB Output is correct
86 Correct 5 ms 1620 KB Output is correct
87 Correct 68 ms 1716 KB Output is correct
88 Correct 22 ms 1620 KB Output is correct
89 Correct 68 ms 1620 KB Output is correct
90 Correct 65 ms 1620 KB Output is correct
91 Correct 46 ms 1620 KB Output is correct
92 Correct 7 ms 1620 KB Output is correct
93 Correct 6 ms 1620 KB Output is correct
94 Correct 29 ms 1736 KB Output is correct
95 Correct 48 ms 1712 KB Output is correct
96 Correct 127 ms 1620 KB Output is correct
97 Correct 41 ms 1620 KB Output is correct
98 Correct 127 ms 1716 KB Output is correct
99 Correct 97 ms 1712 KB Output is correct
100 Correct 124 ms 1716 KB Output is correct
101 Correct 88 ms 1720 KB Output is correct
102 Correct 49 ms 1620 KB Output is correct
103 Correct 86 ms 1620 KB Output is correct
104 Correct 112 ms 1716 KB Output is correct
105 Correct 100 ms 1712 KB Output is correct
106 Correct 91 ms 1620 KB Output is correct
107 Correct 174 ms 1716 KB Output is correct
108 Correct 207 ms 1716 KB Output is correct
109 Correct 173 ms 1620 KB Output is correct
110 Correct 197 ms 1620 KB Output is correct
111 Correct 6 ms 1620 KB Output is correct
112 Correct 66 ms 1620 KB Output is correct
113 Correct 26 ms 1620 KB Output is correct
114 Correct 76 ms 1620 KB Output is correct
115 Correct 62 ms 1620 KB Output is correct
116 Correct 45 ms 1620 KB Output is correct
117 Correct 7 ms 1736 KB Output is correct
118 Correct 6 ms 1736 KB Output is correct
119 Correct 29 ms 1720 KB Output is correct
120 Correct 49 ms 1728 KB Output is correct
121 Correct 4 ms 1620 KB Output is correct
122 Correct 4 ms 1620 KB Output is correct
123 Correct 92 ms 1716 KB Output is correct
124 Correct 47 ms 1620 KB Output is correct
125 Correct 86 ms 1716 KB Output is correct
126 Correct 110 ms 1620 KB Output is correct
127 Correct 93 ms 1724 KB Output is correct
128 Correct 91 ms 1712 KB Output is correct
129 Correct 4 ms 1620 KB Output is correct
130 Correct 5 ms 1620 KB Output is correct
131 Correct 187 ms 1720 KB Output is correct
132 Correct 77 ms 1720 KB Output is correct
133 Correct 210 ms 1620 KB Output is correct
134 Correct 209 ms 1620 KB Output is correct
135 Correct 192 ms 1712 KB Output is correct
136 Correct 165 ms 1620 KB Output is correct
137 Correct 2 ms 1620 KB Output is correct
138 Correct 2 ms 1620 KB Output is correct
139 Correct 2 ms 1620 KB Output is correct
140 Correct 7 ms 1732 KB Output is correct
141 Correct 1 ms 1620 KB Output is correct
142 Correct 110 ms 1716 KB Output is correct
143 Correct 51 ms 1740 KB Output is correct
144 Correct 108 ms 1620 KB Output is correct
145 Correct 142 ms 1620 KB Output is correct
146 Correct 4 ms 1620 KB Output is correct
147 Correct 5 ms 1620 KB Output is correct
148 Correct 1 ms 1620 KB Output is correct
149 Correct 276 ms 1740 KB Output is correct
150 Correct 99 ms 1620 KB Output is correct
151 Correct 300 ms 1720 KB Output is correct
152 Correct 292 ms 1716 KB Output is correct
153 Correct 4 ms 1620 KB Output is correct
154 Correct 5 ms 1620 KB Output is correct
155 Correct 66 ms 1620 KB Output is correct
156 Correct 22 ms 1620 KB Output is correct
157 Correct 71 ms 1716 KB Output is correct
158 Correct 62 ms 1716 KB Output is correct
159 Correct 46 ms 1620 KB Output is correct
160 Correct 8 ms 1744 KB Output is correct
161 Correct 6 ms 1620 KB Output is correct
162 Correct 32 ms 1732 KB Output is correct
163 Correct 44 ms 1620 KB Output is correct
164 Correct 88 ms 1716 KB Output is correct
165 Correct 49 ms 1728 KB Output is correct
166 Correct 89 ms 1716 KB Output is correct
167 Correct 109 ms 1716 KB Output is correct
168 Correct 102 ms 1712 KB Output is correct
169 Correct 91 ms 1620 KB Output is correct
170 Correct 126 ms 1712 KB Output is correct
171 Correct 46 ms 1740 KB Output is correct
172 Correct 128 ms 1716 KB Output is correct
173 Correct 98 ms 1716 KB Output is correct
174 Correct 131 ms 1720 KB Output is correct
175 Correct 165 ms 1716 KB Output is correct
176 Correct 215 ms 1716 KB Output is correct
177 Correct 185 ms 1620 KB Output is correct
178 Correct 199 ms 1620 KB Output is correct
179 Correct 185 ms 1620 KB Output is correct
180 Correct 81 ms 1620 KB Output is correct
181 Correct 207 ms 1712 KB Output is correct
182 Correct 204 ms 1620 KB Output is correct
183 Correct 192 ms 1620 KB Output is correct
184 Correct 159 ms 1716 KB Output is correct
185 Correct 377 ms 1712 KB Output is correct
186 Correct 417 ms 1720 KB Output is correct
187 Correct 382 ms 1620 KB Output is correct
188 Correct 369 ms 1728 KB Output is correct
189 Correct 6 ms 1620 KB Output is correct
190 Correct 69 ms 1716 KB Output is correct
191 Correct 23 ms 1732 KB Output is correct
192 Correct 73 ms 1716 KB Output is correct
193 Correct 62 ms 1620 KB Output is correct
194 Correct 45 ms 1620 KB Output is correct
195 Correct 7 ms 1620 KB Output is correct
196 Correct 6 ms 1620 KB Output is correct
197 Correct 29 ms 1620 KB Output is correct
198 Correct 48 ms 1724 KB Output is correct
199 Correct 4 ms 1620 KB Output is correct
200 Correct 4 ms 1620 KB Output is correct
201 Correct 90 ms 1716 KB Output is correct
202 Correct 49 ms 1620 KB Output is correct
203 Correct 88 ms 1724 KB Output is correct
204 Correct 111 ms 1620 KB Output is correct
205 Correct 95 ms 1712 KB Output is correct
206 Correct 92 ms 1620 KB Output is correct
207 Correct 5 ms 1620 KB Output is correct
208 Correct 5 ms 1620 KB Output is correct
209 Correct 182 ms 1620 KB Output is correct
210 Correct 80 ms 1716 KB Output is correct
211 Correct 201 ms 1620 KB Output is correct
212 Correct 204 ms 1620 KB Output is correct
213 Correct 189 ms 1720 KB Output is correct
214 Correct 157 ms 1712 KB Output is correct
215 Correct 601 ms 1740 KB Output is correct
216 Correct 264 ms 1740 KB Output is correct
217 Correct 580 ms 1740 KB Output is correct
218 Correct 636 ms 1720 KB Output is correct
219 Correct 5 ms 1620 KB Output is correct
220 Correct 6 ms 1620 KB Output is correct
221 Correct 522 ms 1732 KB Output is correct
222 Correct 6 ms 1620 KB Output is correct
223 Correct 67 ms 1620 KB Output is correct
224 Correct 22 ms 1740 KB Output is correct
225 Correct 70 ms 1716 KB Output is correct
226 Correct 65 ms 1712 KB Output is correct
227 Correct 45 ms 1620 KB Output is correct
228 Correct 8 ms 1732 KB Output is correct
229 Correct 6 ms 1620 KB Output is correct
230 Correct 30 ms 1620 KB Output is correct
231 Correct 45 ms 1688 KB Output is correct
232 Correct 4 ms 1620 KB Output is correct
233 Correct 5 ms 1736 KB Output is correct
234 Correct 88 ms 1620 KB Output is correct
235 Correct 47 ms 1720 KB Output is correct
236 Correct 88 ms 1620 KB Output is correct
237 Correct 113 ms 1740 KB Output is correct
238 Correct 95 ms 1712 KB Output is correct
239 Correct 92 ms 1716 KB Output is correct
240 Correct 5 ms 1620 KB Output is correct
241 Correct 5 ms 1736 KB Output is correct
242 Correct 193 ms 1716 KB Output is correct
243 Correct 82 ms 1720 KB Output is correct
244 Correct 205 ms 1712 KB Output is correct
245 Correct 205 ms 1712 KB Output is correct
246 Correct 191 ms 1620 KB Output is correct
247 Correct 161 ms 1620 KB Output is correct
248 Correct 3 ms 1620 KB Output is correct
249 Correct 2 ms 1620 KB Output is correct
250 Correct 2 ms 1620 KB Output is correct
251 Correct 1 ms 1620 KB Output is correct
252 Correct 114 ms 1720 KB Output is correct
253 Correct 49 ms 1716 KB Output is correct
254 Correct 107 ms 1716 KB Output is correct
255 Correct 136 ms 1712 KB Output is correct
256 Correct 1 ms 1620 KB Output is correct
257 Correct 257 ms 1716 KB Output is correct
258 Correct 101 ms 1620 KB Output is correct
259 Correct 302 ms 1720 KB Output is correct
260 Correct 303 ms 1620 KB Output is correct
261 Correct 130 ms 1716 KB Output is correct
262 Correct 42 ms 1712 KB Output is correct
263 Correct 125 ms 1716 KB Output is correct
264 Correct 98 ms 1724 KB Output is correct
265 Correct 126 ms 1620 KB Output is correct
266 Correct 172 ms 1716 KB Output is correct
267 Correct 218 ms 1716 KB Output is correct
268 Correct 176 ms 1620 KB Output is correct
269 Correct 217 ms 1620 KB Output is correct
270 Correct 390 ms 1716 KB Output is correct
271 Correct 421 ms 1728 KB Output is correct
272 Correct 382 ms 1724 KB Output is correct
273 Correct 373 ms 1620 KB Output is correct
274 Correct 599 ms 1720 KB Output is correct
275 Correct 259 ms 1740 KB Output is correct
276 Correct 570 ms 1732 KB Output is correct
277 Correct 640 ms 1720 KB Output is correct
278 Correct 5 ms 1620 KB Output is correct
279 Correct 6 ms 1620 KB Output is correct
280 Correct 525 ms 1720 KB Output is correct
281 Correct 1202 ms 1720 KB Output is correct
282 Correct 1357 ms 1720 KB Output is correct
283 Correct 1184 ms 1740 KB Output is correct