답안 #622347

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
622347 2022-08-04T07:43:58 Z rrrr10000 Uplifting Excursion (BOI22_vault) C++14
80 / 100
5000 ms 24300 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<bool> vb;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++)
#define all(a) a.begin(),a.end()
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pb emplace_back
#define dupli(a) {sort(all(a));a.erase(unique(all(a)),a.end());}
template<class T> void out(T a){cout<<a<<endl;}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
const ll inf=1001001001001001001;

int main(){
    ll n,K;cin>>n>>K;
    ll tot=0,sum=0;
    vi a(n),b(n);
    rep(i,n)cin>>a[i];
    cin>>tot;
    rep(i,n)cin>>b[i];
    reverse(all(a));
    rep(i,n)sum-=a[i]*(i+1);
    rep(i,n)sum+=b[i]*(i+1);
    rep(i,n)tot+=a[i];
    rep(i,n)tot+=b[i];
    sum-=K;
    if(sum<0){
        sum*=-1;swap(a,b);
    }
    ll mx=910000,mx2=450000;
    auto sol=[&](vi v){
        vi dp(mx+1,inf);dp[0]=0;
        REP(i,1,v.size()+1){
            vi ndp=dp;
            rep(j,i){
                deque<ll> deq;
                for(ll k=j;k<=mx;k+=i){
                    if(dp[k]!=inf){
                        while(deq.size()&&dp[deq.back()]-deq.back()/i>=dp[k]-k/i)deq.pop_back();
                        deq.pb(k);
                    }
                    while(deq.size()&&deq.front()<k-i*v[i-1])deq.pop_front();
                    if(deq.size())chmin(ndp[k],dp[deq.front()]+(k-deq.front())/i);
                }
            }
            dp=ndp;
        }
        return dp;
    };
    for(int i=n;i>0;i--)if(sum>mx2){
        ll mi=min(b[i-1]-i,(sum-mx2)/i+1);
        chmax(mi,0ll);
        sum-=mi*i;
        b[i-1]-=mi;
        tot-=mi;
    }
    if(sum>mx){
        out("impossible");
        return 0;
    }
    vi dpa=sol(a);
    vi dpb=sol(b);
    ll ans=inf;
    rep(i,dpa.size())if(i+sum<dpb.size())chmin(ans,dpa[i]+dpb[i+sum]);
    if(ans==inf)out("impossible");
    else out(tot-ans);
}

Compilation message

vault.cpp: In function 'int main()':
vault.cpp:74:30: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |     rep(i,dpa.size())if(i+sum<dpb.size())chmin(ans,dpa[i]+dpb[i+sum]);
      |                         ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 21592 KB Output is correct
2 Correct 51 ms 21604 KB Output is correct
3 Correct 24 ms 21660 KB Output is correct
4 Correct 111 ms 21668 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 752 ms 21660 KB Output is correct
7 Correct 783 ms 21660 KB Output is correct
8 Correct 768 ms 21664 KB Output is correct
9 Correct 732 ms 21580 KB Output is correct
10 Correct 788 ms 21664 KB Output is correct
11 Correct 749 ms 21664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 21592 KB Output is correct
2 Correct 51 ms 21604 KB Output is correct
3 Correct 24 ms 21660 KB Output is correct
4 Correct 111 ms 21668 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 752 ms 21660 KB Output is correct
7 Correct 783 ms 21660 KB Output is correct
8 Correct 768 ms 21664 KB Output is correct
9 Correct 732 ms 21580 KB Output is correct
10 Correct 788 ms 21664 KB Output is correct
11 Correct 749 ms 21664 KB Output is correct
12 Correct 28 ms 21636 KB Output is correct
13 Correct 39 ms 21644 KB Output is correct
14 Correct 21 ms 21624 KB Output is correct
15 Correct 115 ms 21576 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 719 ms 21656 KB Output is correct
18 Correct 747 ms 21716 KB Output is correct
19 Correct 785 ms 21664 KB Output is correct
20 Correct 840 ms 21660 KB Output is correct
21 Correct 771 ms 21700 KB Output is correct
22 Correct 792 ms 21664 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1803 ms 21664 KB Output is correct
25 Correct 1661 ms 21668 KB Output is correct
26 Correct 2245 ms 21672 KB Output is correct
27 Correct 2136 ms 21668 KB Output is correct
28 Correct 1655 ms 21656 KB Output is correct
29 Correct 1418 ms 21656 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 176 ms 21660 KB Output is correct
2 Correct 1088 ms 22224 KB Output is correct
3 Correct 712 ms 21832 KB Output is correct
4 Correct 1058 ms 23544 KB Output is correct
5 Correct 1077 ms 22240 KB Output is correct
6 Correct 860 ms 22904 KB Output is correct
7 Correct 367 ms 21664 KB Output is correct
8 Correct 394 ms 21660 KB Output is correct
9 Correct 818 ms 22700 KB Output is correct
10 Correct 753 ms 21928 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 176 ms 21660 KB Output is correct
2 Correct 1088 ms 22224 KB Output is correct
3 Correct 712 ms 21832 KB Output is correct
4 Correct 1058 ms 23544 KB Output is correct
5 Correct 1077 ms 22240 KB Output is correct
6 Correct 860 ms 22904 KB Output is correct
7 Correct 367 ms 21664 KB Output is correct
8 Correct 394 ms 21660 KB Output is correct
9 Correct 818 ms 22700 KB Output is correct
10 Correct 753 ms 21928 KB Output is correct
11 Correct 31 ms 21644 KB Output is correct
12 Correct 36 ms 21612 KB Output is correct
13 Correct 24 ms 21684 KB Output is correct
14 Correct 106 ms 21580 KB Output is correct
15 Correct 918 ms 22360 KB Output is correct
16 Correct 614 ms 21732 KB Output is correct
17 Correct 872 ms 23640 KB Output is correct
18 Correct 827 ms 22240 KB Output is correct
19 Correct 829 ms 22896 KB Output is correct
20 Correct 385 ms 21624 KB Output is correct
21 Correct 384 ms 21580 KB Output is correct
22 Correct 797 ms 22644 KB Output is correct
23 Correct 799 ms 21960 KB Output is correct
24 Correct 1496 ms 22288 KB Output is correct
25 Correct 890 ms 21624 KB Output is correct
26 Correct 1251 ms 22044 KB Output is correct
27 Correct 1305 ms 22268 KB Output is correct
28 Correct 1334 ms 23024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 176 ms 21660 KB Output is correct
2 Correct 1088 ms 22224 KB Output is correct
3 Correct 712 ms 21832 KB Output is correct
4 Correct 1058 ms 23544 KB Output is correct
5 Correct 1077 ms 22240 KB Output is correct
6 Correct 860 ms 22904 KB Output is correct
7 Correct 367 ms 21664 KB Output is correct
8 Correct 394 ms 21660 KB Output is correct
9 Correct 818 ms 22700 KB Output is correct
10 Correct 753 ms 21928 KB Output is correct
11 Correct 98 ms 21664 KB Output is correct
12 Correct 893 ms 22348 KB Output is correct
13 Correct 648 ms 21752 KB Output is correct
14 Correct 872 ms 23540 KB Output is correct
15 Correct 861 ms 22288 KB Output is correct
16 Correct 787 ms 22892 KB Output is correct
17 Correct 377 ms 21660 KB Output is correct
18 Correct 374 ms 21668 KB Output is correct
19 Correct 803 ms 22736 KB Output is correct
20 Correct 799 ms 21848 KB Output is correct
21 Correct 643 ms 21660 KB Output is correct
22 Correct 645 ms 21628 KB Output is correct
23 Correct 1531 ms 22088 KB Output is correct
24 Correct 1223 ms 22032 KB Output is correct
25 Correct 1570 ms 22908 KB Output is correct
26 Correct 1485 ms 22740 KB Output is correct
27 Correct 1351 ms 22596 KB Output is correct
28 Correct 1498 ms 22088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 21592 KB Output is correct
2 Correct 51 ms 21604 KB Output is correct
3 Correct 24 ms 21660 KB Output is correct
4 Correct 111 ms 21668 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 752 ms 21660 KB Output is correct
7 Correct 783 ms 21660 KB Output is correct
8 Correct 768 ms 21664 KB Output is correct
9 Correct 732 ms 21580 KB Output is correct
10 Correct 788 ms 21664 KB Output is correct
11 Correct 749 ms 21664 KB Output is correct
12 Correct 176 ms 21660 KB Output is correct
13 Correct 1088 ms 22224 KB Output is correct
14 Correct 712 ms 21832 KB Output is correct
15 Correct 1058 ms 23544 KB Output is correct
16 Correct 1077 ms 22240 KB Output is correct
17 Correct 860 ms 22904 KB Output is correct
18 Correct 367 ms 21664 KB Output is correct
19 Correct 394 ms 21660 KB Output is correct
20 Correct 818 ms 22700 KB Output is correct
21 Correct 753 ms 21928 KB Output is correct
22 Correct 31 ms 21644 KB Output is correct
23 Correct 36 ms 21612 KB Output is correct
24 Correct 24 ms 21684 KB Output is correct
25 Correct 106 ms 21580 KB Output is correct
26 Correct 918 ms 22360 KB Output is correct
27 Correct 614 ms 21732 KB Output is correct
28 Correct 872 ms 23640 KB Output is correct
29 Correct 827 ms 22240 KB Output is correct
30 Correct 829 ms 22896 KB Output is correct
31 Correct 385 ms 21624 KB Output is correct
32 Correct 384 ms 21580 KB Output is correct
33 Correct 797 ms 22644 KB Output is correct
34 Correct 799 ms 21960 KB Output is correct
35 Correct 1496 ms 22288 KB Output is correct
36 Correct 890 ms 21624 KB Output is correct
37 Correct 1251 ms 22044 KB Output is correct
38 Correct 1305 ms 22268 KB Output is correct
39 Correct 1334 ms 23024 KB Output is correct
40 Correct 98 ms 21664 KB Output is correct
41 Correct 893 ms 22348 KB Output is correct
42 Correct 648 ms 21752 KB Output is correct
43 Correct 872 ms 23540 KB Output is correct
44 Correct 861 ms 22288 KB Output is correct
45 Correct 787 ms 22892 KB Output is correct
46 Correct 377 ms 21660 KB Output is correct
47 Correct 374 ms 21668 KB Output is correct
48 Correct 803 ms 22736 KB Output is correct
49 Correct 799 ms 21848 KB Output is correct
50 Correct 643 ms 21660 KB Output is correct
51 Correct 645 ms 21628 KB Output is correct
52 Correct 1531 ms 22088 KB Output is correct
53 Correct 1223 ms 22032 KB Output is correct
54 Correct 1570 ms 22908 KB Output is correct
55 Correct 1485 ms 22740 KB Output is correct
56 Correct 1351 ms 22596 KB Output is correct
57 Correct 1498 ms 22088 KB Output is correct
58 Correct 27 ms 21644 KB Output is correct
59 Correct 36 ms 21696 KB Output is correct
60 Correct 20 ms 21644 KB Output is correct
61 Correct 111 ms 21596 KB Output is correct
62 Correct 0 ms 212 KB Output is correct
63 Correct 677 ms 21660 KB Output is correct
64 Correct 675 ms 21664 KB Output is correct
65 Correct 729 ms 21664 KB Output is correct
66 Correct 708 ms 21656 KB Output is correct
67 Correct 610 ms 21584 KB Output is correct
68 Correct 651 ms 21572 KB Output is correct
69 Correct 908 ms 22296 KB Output is correct
70 Correct 620 ms 21732 KB Output is correct
71 Correct 889 ms 23628 KB Output is correct
72 Correct 833 ms 22284 KB Output is correct
73 Correct 816 ms 22892 KB Output is correct
74 Correct 393 ms 21584 KB Output is correct
75 Correct 392 ms 21656 KB Output is correct
76 Correct 844 ms 22748 KB Output is correct
77 Correct 792 ms 21852 KB Output is correct
78 Correct 1426 ms 22284 KB Output is correct
79 Correct 838 ms 21768 KB Output is correct
80 Correct 1275 ms 22036 KB Output is correct
81 Correct 1414 ms 22244 KB Output is correct
82 Correct 1351 ms 23012 KB Output is correct
83 Correct 1521 ms 22216 KB Output is correct
84 Correct 1220 ms 21828 KB Output is correct
85 Correct 1526 ms 22996 KB Output is correct
86 Correct 1492 ms 22740 KB Output is correct
87 Correct 1317 ms 22568 KB Output is correct
88 Correct 1528 ms 22036 KB Output is correct
89 Correct 2401 ms 21984 KB Output is correct
90 Correct 2618 ms 22552 KB Output is correct
91 Correct 2386 ms 22844 KB Output is correct
92 Correct 2188 ms 22912 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 176 ms 21660 KB Output is correct
2 Correct 1088 ms 22224 KB Output is correct
3 Correct 712 ms 21832 KB Output is correct
4 Correct 1058 ms 23544 KB Output is correct
5 Correct 1077 ms 22240 KB Output is correct
6 Correct 860 ms 22904 KB Output is correct
7 Correct 367 ms 21664 KB Output is correct
8 Correct 394 ms 21660 KB Output is correct
9 Correct 818 ms 22700 KB Output is correct
10 Correct 753 ms 21928 KB Output is correct
11 Correct 98 ms 21664 KB Output is correct
12 Correct 893 ms 22348 KB Output is correct
13 Correct 648 ms 21752 KB Output is correct
14 Correct 872 ms 23540 KB Output is correct
15 Correct 861 ms 22288 KB Output is correct
16 Correct 787 ms 22892 KB Output is correct
17 Correct 377 ms 21660 KB Output is correct
18 Correct 374 ms 21668 KB Output is correct
19 Correct 803 ms 22736 KB Output is correct
20 Correct 799 ms 21848 KB Output is correct
21 Correct 643 ms 21660 KB Output is correct
22 Correct 645 ms 21628 KB Output is correct
23 Correct 1531 ms 22088 KB Output is correct
24 Correct 1223 ms 22032 KB Output is correct
25 Correct 1570 ms 22908 KB Output is correct
26 Correct 1485 ms 22740 KB Output is correct
27 Correct 1351 ms 22596 KB Output is correct
28 Correct 1498 ms 22088 KB Output is correct
29 Correct 99 ms 21596 KB Output is correct
30 Correct 894 ms 22348 KB Output is correct
31 Correct 619 ms 21792 KB Output is correct
32 Correct 916 ms 23540 KB Output is correct
33 Correct 885 ms 22344 KB Output is correct
34 Correct 774 ms 22896 KB Output is correct
35 Correct 387 ms 21708 KB Output is correct
36 Correct 381 ms 21708 KB Output is correct
37 Correct 796 ms 22740 KB Output is correct
38 Correct 759 ms 21968 KB Output is correct
39 Correct 652 ms 21656 KB Output is correct
40 Correct 731 ms 21660 KB Output is correct
41 Correct 1471 ms 22140 KB Output is correct
42 Correct 1212 ms 21836 KB Output is correct
43 Correct 1523 ms 22912 KB Output is correct
44 Correct 1555 ms 22732 KB Output is correct
45 Correct 1328 ms 22608 KB Output is correct
46 Correct 1469 ms 22044 KB Output is correct
47 Correct 1493 ms 21660 KB Output is correct
48 Correct 1314 ms 21656 KB Output is correct
49 Correct 3245 ms 23540 KB Output is correct
50 Correct 2483 ms 21784 KB Output is correct
51 Correct 3156 ms 24144 KB Output is correct
52 Correct 3225 ms 23116 KB Output is correct
53 Correct 2845 ms 22228 KB Output is correct
54 Correct 3290 ms 22856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 21592 KB Output is correct
2 Correct 51 ms 21604 KB Output is correct
3 Correct 24 ms 21660 KB Output is correct
4 Correct 111 ms 21668 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 752 ms 21660 KB Output is correct
7 Correct 783 ms 21660 KB Output is correct
8 Correct 768 ms 21664 KB Output is correct
9 Correct 732 ms 21580 KB Output is correct
10 Correct 788 ms 21664 KB Output is correct
11 Correct 749 ms 21664 KB Output is correct
12 Correct 28 ms 21636 KB Output is correct
13 Correct 39 ms 21644 KB Output is correct
14 Correct 21 ms 21624 KB Output is correct
15 Correct 115 ms 21576 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 719 ms 21656 KB Output is correct
18 Correct 747 ms 21716 KB Output is correct
19 Correct 785 ms 21664 KB Output is correct
20 Correct 840 ms 21660 KB Output is correct
21 Correct 771 ms 21700 KB Output is correct
22 Correct 792 ms 21664 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1803 ms 21664 KB Output is correct
25 Correct 1661 ms 21668 KB Output is correct
26 Correct 2245 ms 21672 KB Output is correct
27 Correct 2136 ms 21668 KB Output is correct
28 Correct 1655 ms 21656 KB Output is correct
29 Correct 1418 ms 21656 KB Output is correct
30 Correct 176 ms 21660 KB Output is correct
31 Correct 1088 ms 22224 KB Output is correct
32 Correct 712 ms 21832 KB Output is correct
33 Correct 1058 ms 23544 KB Output is correct
34 Correct 1077 ms 22240 KB Output is correct
35 Correct 860 ms 22904 KB Output is correct
36 Correct 367 ms 21664 KB Output is correct
37 Correct 394 ms 21660 KB Output is correct
38 Correct 818 ms 22700 KB Output is correct
39 Correct 753 ms 21928 KB Output is correct
40 Correct 31 ms 21644 KB Output is correct
41 Correct 36 ms 21612 KB Output is correct
42 Correct 24 ms 21684 KB Output is correct
43 Correct 106 ms 21580 KB Output is correct
44 Correct 918 ms 22360 KB Output is correct
45 Correct 614 ms 21732 KB Output is correct
46 Correct 872 ms 23640 KB Output is correct
47 Correct 827 ms 22240 KB Output is correct
48 Correct 829 ms 22896 KB Output is correct
49 Correct 385 ms 21624 KB Output is correct
50 Correct 384 ms 21580 KB Output is correct
51 Correct 797 ms 22644 KB Output is correct
52 Correct 799 ms 21960 KB Output is correct
53 Correct 1496 ms 22288 KB Output is correct
54 Correct 890 ms 21624 KB Output is correct
55 Correct 1251 ms 22044 KB Output is correct
56 Correct 1305 ms 22268 KB Output is correct
57 Correct 1334 ms 23024 KB Output is correct
58 Correct 98 ms 21664 KB Output is correct
59 Correct 893 ms 22348 KB Output is correct
60 Correct 648 ms 21752 KB Output is correct
61 Correct 872 ms 23540 KB Output is correct
62 Correct 861 ms 22288 KB Output is correct
63 Correct 787 ms 22892 KB Output is correct
64 Correct 377 ms 21660 KB Output is correct
65 Correct 374 ms 21668 KB Output is correct
66 Correct 803 ms 22736 KB Output is correct
67 Correct 799 ms 21848 KB Output is correct
68 Correct 643 ms 21660 KB Output is correct
69 Correct 645 ms 21628 KB Output is correct
70 Correct 1531 ms 22088 KB Output is correct
71 Correct 1223 ms 22032 KB Output is correct
72 Correct 1570 ms 22908 KB Output is correct
73 Correct 1485 ms 22740 KB Output is correct
74 Correct 1351 ms 22596 KB Output is correct
75 Correct 1498 ms 22088 KB Output is correct
76 Correct 27 ms 21644 KB Output is correct
77 Correct 36 ms 21696 KB Output is correct
78 Correct 20 ms 21644 KB Output is correct
79 Correct 111 ms 21596 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 677 ms 21660 KB Output is correct
82 Correct 675 ms 21664 KB Output is correct
83 Correct 729 ms 21664 KB Output is correct
84 Correct 708 ms 21656 KB Output is correct
85 Correct 610 ms 21584 KB Output is correct
86 Correct 651 ms 21572 KB Output is correct
87 Correct 908 ms 22296 KB Output is correct
88 Correct 620 ms 21732 KB Output is correct
89 Correct 889 ms 23628 KB Output is correct
90 Correct 833 ms 22284 KB Output is correct
91 Correct 816 ms 22892 KB Output is correct
92 Correct 393 ms 21584 KB Output is correct
93 Correct 392 ms 21656 KB Output is correct
94 Correct 844 ms 22748 KB Output is correct
95 Correct 792 ms 21852 KB Output is correct
96 Correct 1426 ms 22284 KB Output is correct
97 Correct 838 ms 21768 KB Output is correct
98 Correct 1275 ms 22036 KB Output is correct
99 Correct 1414 ms 22244 KB Output is correct
100 Correct 1351 ms 23012 KB Output is correct
101 Correct 1521 ms 22216 KB Output is correct
102 Correct 1220 ms 21828 KB Output is correct
103 Correct 1526 ms 22996 KB Output is correct
104 Correct 1492 ms 22740 KB Output is correct
105 Correct 1317 ms 22568 KB Output is correct
106 Correct 1528 ms 22036 KB Output is correct
107 Correct 2401 ms 21984 KB Output is correct
108 Correct 2618 ms 22552 KB Output is correct
109 Correct 2386 ms 22844 KB Output is correct
110 Correct 2188 ms 22912 KB Output is correct
111 Correct 99 ms 21596 KB Output is correct
112 Correct 894 ms 22348 KB Output is correct
113 Correct 619 ms 21792 KB Output is correct
114 Correct 916 ms 23540 KB Output is correct
115 Correct 885 ms 22344 KB Output is correct
116 Correct 774 ms 22896 KB Output is correct
117 Correct 387 ms 21708 KB Output is correct
118 Correct 381 ms 21708 KB Output is correct
119 Correct 796 ms 22740 KB Output is correct
120 Correct 759 ms 21968 KB Output is correct
121 Correct 652 ms 21656 KB Output is correct
122 Correct 731 ms 21660 KB Output is correct
123 Correct 1471 ms 22140 KB Output is correct
124 Correct 1212 ms 21836 KB Output is correct
125 Correct 1523 ms 22912 KB Output is correct
126 Correct 1555 ms 22732 KB Output is correct
127 Correct 1328 ms 22608 KB Output is correct
128 Correct 1469 ms 22044 KB Output is correct
129 Correct 1493 ms 21660 KB Output is correct
130 Correct 1314 ms 21656 KB Output is correct
131 Correct 3245 ms 23540 KB Output is correct
132 Correct 2483 ms 21784 KB Output is correct
133 Correct 3156 ms 24144 KB Output is correct
134 Correct 3225 ms 23116 KB Output is correct
135 Correct 2845 ms 22228 KB Output is correct
136 Correct 3290 ms 22856 KB Output is correct
137 Correct 28 ms 21640 KB Output is correct
138 Correct 39 ms 21656 KB Output is correct
139 Correct 21 ms 21656 KB Output is correct
140 Correct 117 ms 21576 KB Output is correct
141 Correct 0 ms 212 KB Output is correct
142 Correct 661 ms 21664 KB Output is correct
143 Correct 689 ms 21664 KB Output is correct
144 Correct 689 ms 21576 KB Output is correct
145 Correct 710 ms 21752 KB Output is correct
146 Correct 617 ms 21660 KB Output is correct
147 Correct 646 ms 21712 KB Output is correct
148 Correct 0 ms 212 KB Output is correct
149 Correct 1678 ms 21704 KB Output is correct
150 Correct 1492 ms 21676 KB Output is correct
151 Correct 1923 ms 21668 KB Output is correct
152 Correct 1935 ms 21712 KB Output is correct
153 Correct 1354 ms 21660 KB Output is correct
154 Correct 1394 ms 21664 KB Output is correct
155 Correct 889 ms 22292 KB Output is correct
156 Correct 614 ms 21732 KB Output is correct
157 Correct 871 ms 23540 KB Output is correct
158 Correct 849 ms 22244 KB Output is correct
159 Correct 786 ms 22892 KB Output is correct
160 Correct 375 ms 21584 KB Output is correct
161 Correct 386 ms 21708 KB Output is correct
162 Correct 841 ms 22740 KB Output is correct
163 Correct 754 ms 21844 KB Output is correct
164 Correct 1450 ms 22100 KB Output is correct
165 Correct 1267 ms 21964 KB Output is correct
166 Correct 1487 ms 22912 KB Output is correct
167 Correct 1503 ms 22740 KB Output is correct
168 Correct 1364 ms 22604 KB Output is correct
169 Correct 1465 ms 22140 KB Output is correct
170 Correct 1376 ms 22404 KB Output is correct
171 Correct 858 ms 21784 KB Output is correct
172 Correct 1259 ms 22088 KB Output is correct
173 Correct 1326 ms 22248 KB Output is correct
174 Correct 1291 ms 22900 KB Output is correct
175 Correct 2263 ms 21976 KB Output is correct
176 Correct 2423 ms 22688 KB Output is correct
177 Correct 2338 ms 22828 KB Output is correct
178 Correct 2186 ms 22916 KB Output is correct
179 Correct 3065 ms 23540 KB Output is correct
180 Correct 2543 ms 21756 KB Output is correct
181 Correct 3162 ms 24300 KB Output is correct
182 Correct 3132 ms 23164 KB Output is correct
183 Correct 2673 ms 22252 KB Output is correct
184 Correct 3007 ms 22916 KB Output is correct
185 Correct 4795 ms 22452 KB Output is correct
186 Correct 4921 ms 23616 KB Output is correct
187 Correct 4412 ms 23424 KB Output is correct
188 Correct 4247 ms 22812 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 176 ms 21660 KB Output is correct
2 Correct 1088 ms 22224 KB Output is correct
3 Correct 712 ms 21832 KB Output is correct
4 Correct 1058 ms 23544 KB Output is correct
5 Correct 1077 ms 22240 KB Output is correct
6 Correct 860 ms 22904 KB Output is correct
7 Correct 367 ms 21664 KB Output is correct
8 Correct 394 ms 21660 KB Output is correct
9 Correct 818 ms 22700 KB Output is correct
10 Correct 753 ms 21928 KB Output is correct
11 Correct 98 ms 21664 KB Output is correct
12 Correct 893 ms 22348 KB Output is correct
13 Correct 648 ms 21752 KB Output is correct
14 Correct 872 ms 23540 KB Output is correct
15 Correct 861 ms 22288 KB Output is correct
16 Correct 787 ms 22892 KB Output is correct
17 Correct 377 ms 21660 KB Output is correct
18 Correct 374 ms 21668 KB Output is correct
19 Correct 803 ms 22736 KB Output is correct
20 Correct 799 ms 21848 KB Output is correct
21 Correct 643 ms 21660 KB Output is correct
22 Correct 645 ms 21628 KB Output is correct
23 Correct 1531 ms 22088 KB Output is correct
24 Correct 1223 ms 22032 KB Output is correct
25 Correct 1570 ms 22908 KB Output is correct
26 Correct 1485 ms 22740 KB Output is correct
27 Correct 1351 ms 22596 KB Output is correct
28 Correct 1498 ms 22088 KB Output is correct
29 Correct 99 ms 21596 KB Output is correct
30 Correct 894 ms 22348 KB Output is correct
31 Correct 619 ms 21792 KB Output is correct
32 Correct 916 ms 23540 KB Output is correct
33 Correct 885 ms 22344 KB Output is correct
34 Correct 774 ms 22896 KB Output is correct
35 Correct 387 ms 21708 KB Output is correct
36 Correct 381 ms 21708 KB Output is correct
37 Correct 796 ms 22740 KB Output is correct
38 Correct 759 ms 21968 KB Output is correct
39 Correct 652 ms 21656 KB Output is correct
40 Correct 731 ms 21660 KB Output is correct
41 Correct 1471 ms 22140 KB Output is correct
42 Correct 1212 ms 21836 KB Output is correct
43 Correct 1523 ms 22912 KB Output is correct
44 Correct 1555 ms 22732 KB Output is correct
45 Correct 1328 ms 22608 KB Output is correct
46 Correct 1469 ms 22044 KB Output is correct
47 Correct 1493 ms 21660 KB Output is correct
48 Correct 1314 ms 21656 KB Output is correct
49 Correct 3245 ms 23540 KB Output is correct
50 Correct 2483 ms 21784 KB Output is correct
51 Correct 3156 ms 24144 KB Output is correct
52 Correct 3225 ms 23116 KB Output is correct
53 Correct 2845 ms 22228 KB Output is correct
54 Correct 3290 ms 22856 KB Output is correct
55 Correct 103 ms 21660 KB Output is correct
56 Correct 899 ms 22292 KB Output is correct
57 Correct 627 ms 21856 KB Output is correct
58 Correct 880 ms 23536 KB Output is correct
59 Correct 836 ms 22296 KB Output is correct
60 Correct 817 ms 22776 KB Output is correct
61 Correct 368 ms 21656 KB Output is correct
62 Correct 349 ms 21656 KB Output is correct
63 Correct 794 ms 22616 KB Output is correct
64 Correct 758 ms 21856 KB Output is correct
65 Correct 669 ms 21720 KB Output is correct
66 Correct 628 ms 21580 KB Output is correct
67 Correct 1444 ms 22100 KB Output is correct
68 Correct 1260 ms 21848 KB Output is correct
69 Correct 1505 ms 22856 KB Output is correct
70 Correct 1518 ms 22736 KB Output is correct
71 Correct 1335 ms 22560 KB Output is correct
72 Correct 1479 ms 22040 KB Output is correct
73 Correct 1325 ms 21660 KB Output is correct
74 Correct 1414 ms 21656 KB Output is correct
75 Correct 3120 ms 23632 KB Output is correct
76 Correct 2479 ms 21796 KB Output is correct
77 Correct 3131 ms 24268 KB Output is correct
78 Correct 3148 ms 23252 KB Output is correct
79 Correct 2784 ms 22232 KB Output is correct
80 Correct 3123 ms 22920 KB Output is correct
81 Execution timed out 5057 ms 22224 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 21592 KB Output is correct
2 Correct 51 ms 21604 KB Output is correct
3 Correct 24 ms 21660 KB Output is correct
4 Correct 111 ms 21668 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 752 ms 21660 KB Output is correct
7 Correct 783 ms 21660 KB Output is correct
8 Correct 768 ms 21664 KB Output is correct
9 Correct 732 ms 21580 KB Output is correct
10 Correct 788 ms 21664 KB Output is correct
11 Correct 749 ms 21664 KB Output is correct
12 Correct 28 ms 21636 KB Output is correct
13 Correct 39 ms 21644 KB Output is correct
14 Correct 21 ms 21624 KB Output is correct
15 Correct 115 ms 21576 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 719 ms 21656 KB Output is correct
18 Correct 747 ms 21716 KB Output is correct
19 Correct 785 ms 21664 KB Output is correct
20 Correct 840 ms 21660 KB Output is correct
21 Correct 771 ms 21700 KB Output is correct
22 Correct 792 ms 21664 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1803 ms 21664 KB Output is correct
25 Correct 1661 ms 21668 KB Output is correct
26 Correct 2245 ms 21672 KB Output is correct
27 Correct 2136 ms 21668 KB Output is correct
28 Correct 1655 ms 21656 KB Output is correct
29 Correct 1418 ms 21656 KB Output is correct
30 Correct 176 ms 21660 KB Output is correct
31 Correct 1088 ms 22224 KB Output is correct
32 Correct 712 ms 21832 KB Output is correct
33 Correct 1058 ms 23544 KB Output is correct
34 Correct 1077 ms 22240 KB Output is correct
35 Correct 860 ms 22904 KB Output is correct
36 Correct 367 ms 21664 KB Output is correct
37 Correct 394 ms 21660 KB Output is correct
38 Correct 818 ms 22700 KB Output is correct
39 Correct 753 ms 21928 KB Output is correct
40 Correct 31 ms 21644 KB Output is correct
41 Correct 36 ms 21612 KB Output is correct
42 Correct 24 ms 21684 KB Output is correct
43 Correct 106 ms 21580 KB Output is correct
44 Correct 918 ms 22360 KB Output is correct
45 Correct 614 ms 21732 KB Output is correct
46 Correct 872 ms 23640 KB Output is correct
47 Correct 827 ms 22240 KB Output is correct
48 Correct 829 ms 22896 KB Output is correct
49 Correct 385 ms 21624 KB Output is correct
50 Correct 384 ms 21580 KB Output is correct
51 Correct 797 ms 22644 KB Output is correct
52 Correct 799 ms 21960 KB Output is correct
53 Correct 1496 ms 22288 KB Output is correct
54 Correct 890 ms 21624 KB Output is correct
55 Correct 1251 ms 22044 KB Output is correct
56 Correct 1305 ms 22268 KB Output is correct
57 Correct 1334 ms 23024 KB Output is correct
58 Correct 98 ms 21664 KB Output is correct
59 Correct 893 ms 22348 KB Output is correct
60 Correct 648 ms 21752 KB Output is correct
61 Correct 872 ms 23540 KB Output is correct
62 Correct 861 ms 22288 KB Output is correct
63 Correct 787 ms 22892 KB Output is correct
64 Correct 377 ms 21660 KB Output is correct
65 Correct 374 ms 21668 KB Output is correct
66 Correct 803 ms 22736 KB Output is correct
67 Correct 799 ms 21848 KB Output is correct
68 Correct 643 ms 21660 KB Output is correct
69 Correct 645 ms 21628 KB Output is correct
70 Correct 1531 ms 22088 KB Output is correct
71 Correct 1223 ms 22032 KB Output is correct
72 Correct 1570 ms 22908 KB Output is correct
73 Correct 1485 ms 22740 KB Output is correct
74 Correct 1351 ms 22596 KB Output is correct
75 Correct 1498 ms 22088 KB Output is correct
76 Correct 27 ms 21644 KB Output is correct
77 Correct 36 ms 21696 KB Output is correct
78 Correct 20 ms 21644 KB Output is correct
79 Correct 111 ms 21596 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 677 ms 21660 KB Output is correct
82 Correct 675 ms 21664 KB Output is correct
83 Correct 729 ms 21664 KB Output is correct
84 Correct 708 ms 21656 KB Output is correct
85 Correct 610 ms 21584 KB Output is correct
86 Correct 651 ms 21572 KB Output is correct
87 Correct 908 ms 22296 KB Output is correct
88 Correct 620 ms 21732 KB Output is correct
89 Correct 889 ms 23628 KB Output is correct
90 Correct 833 ms 22284 KB Output is correct
91 Correct 816 ms 22892 KB Output is correct
92 Correct 393 ms 21584 KB Output is correct
93 Correct 392 ms 21656 KB Output is correct
94 Correct 844 ms 22748 KB Output is correct
95 Correct 792 ms 21852 KB Output is correct
96 Correct 1426 ms 22284 KB Output is correct
97 Correct 838 ms 21768 KB Output is correct
98 Correct 1275 ms 22036 KB Output is correct
99 Correct 1414 ms 22244 KB Output is correct
100 Correct 1351 ms 23012 KB Output is correct
101 Correct 1521 ms 22216 KB Output is correct
102 Correct 1220 ms 21828 KB Output is correct
103 Correct 1526 ms 22996 KB Output is correct
104 Correct 1492 ms 22740 KB Output is correct
105 Correct 1317 ms 22568 KB Output is correct
106 Correct 1528 ms 22036 KB Output is correct
107 Correct 2401 ms 21984 KB Output is correct
108 Correct 2618 ms 22552 KB Output is correct
109 Correct 2386 ms 22844 KB Output is correct
110 Correct 2188 ms 22912 KB Output is correct
111 Correct 99 ms 21596 KB Output is correct
112 Correct 894 ms 22348 KB Output is correct
113 Correct 619 ms 21792 KB Output is correct
114 Correct 916 ms 23540 KB Output is correct
115 Correct 885 ms 22344 KB Output is correct
116 Correct 774 ms 22896 KB Output is correct
117 Correct 387 ms 21708 KB Output is correct
118 Correct 381 ms 21708 KB Output is correct
119 Correct 796 ms 22740 KB Output is correct
120 Correct 759 ms 21968 KB Output is correct
121 Correct 652 ms 21656 KB Output is correct
122 Correct 731 ms 21660 KB Output is correct
123 Correct 1471 ms 22140 KB Output is correct
124 Correct 1212 ms 21836 KB Output is correct
125 Correct 1523 ms 22912 KB Output is correct
126 Correct 1555 ms 22732 KB Output is correct
127 Correct 1328 ms 22608 KB Output is correct
128 Correct 1469 ms 22044 KB Output is correct
129 Correct 1493 ms 21660 KB Output is correct
130 Correct 1314 ms 21656 KB Output is correct
131 Correct 3245 ms 23540 KB Output is correct
132 Correct 2483 ms 21784 KB Output is correct
133 Correct 3156 ms 24144 KB Output is correct
134 Correct 3225 ms 23116 KB Output is correct
135 Correct 2845 ms 22228 KB Output is correct
136 Correct 3290 ms 22856 KB Output is correct
137 Correct 28 ms 21640 KB Output is correct
138 Correct 39 ms 21656 KB Output is correct
139 Correct 21 ms 21656 KB Output is correct
140 Correct 117 ms 21576 KB Output is correct
141 Correct 0 ms 212 KB Output is correct
142 Correct 661 ms 21664 KB Output is correct
143 Correct 689 ms 21664 KB Output is correct
144 Correct 689 ms 21576 KB Output is correct
145 Correct 710 ms 21752 KB Output is correct
146 Correct 617 ms 21660 KB Output is correct
147 Correct 646 ms 21712 KB Output is correct
148 Correct 0 ms 212 KB Output is correct
149 Correct 1678 ms 21704 KB Output is correct
150 Correct 1492 ms 21676 KB Output is correct
151 Correct 1923 ms 21668 KB Output is correct
152 Correct 1935 ms 21712 KB Output is correct
153 Correct 1354 ms 21660 KB Output is correct
154 Correct 1394 ms 21664 KB Output is correct
155 Correct 889 ms 22292 KB Output is correct
156 Correct 614 ms 21732 KB Output is correct
157 Correct 871 ms 23540 KB Output is correct
158 Correct 849 ms 22244 KB Output is correct
159 Correct 786 ms 22892 KB Output is correct
160 Correct 375 ms 21584 KB Output is correct
161 Correct 386 ms 21708 KB Output is correct
162 Correct 841 ms 22740 KB Output is correct
163 Correct 754 ms 21844 KB Output is correct
164 Correct 1450 ms 22100 KB Output is correct
165 Correct 1267 ms 21964 KB Output is correct
166 Correct 1487 ms 22912 KB Output is correct
167 Correct 1503 ms 22740 KB Output is correct
168 Correct 1364 ms 22604 KB Output is correct
169 Correct 1465 ms 22140 KB Output is correct
170 Correct 1376 ms 22404 KB Output is correct
171 Correct 858 ms 21784 KB Output is correct
172 Correct 1259 ms 22088 KB Output is correct
173 Correct 1326 ms 22248 KB Output is correct
174 Correct 1291 ms 22900 KB Output is correct
175 Correct 2263 ms 21976 KB Output is correct
176 Correct 2423 ms 22688 KB Output is correct
177 Correct 2338 ms 22828 KB Output is correct
178 Correct 2186 ms 22916 KB Output is correct
179 Correct 3065 ms 23540 KB Output is correct
180 Correct 2543 ms 21756 KB Output is correct
181 Correct 3162 ms 24300 KB Output is correct
182 Correct 3132 ms 23164 KB Output is correct
183 Correct 2673 ms 22252 KB Output is correct
184 Correct 3007 ms 22916 KB Output is correct
185 Correct 4795 ms 22452 KB Output is correct
186 Correct 4921 ms 23616 KB Output is correct
187 Correct 4412 ms 23424 KB Output is correct
188 Correct 4247 ms 22812 KB Output is correct
189 Correct 103 ms 21660 KB Output is correct
190 Correct 899 ms 22292 KB Output is correct
191 Correct 627 ms 21856 KB Output is correct
192 Correct 880 ms 23536 KB Output is correct
193 Correct 836 ms 22296 KB Output is correct
194 Correct 817 ms 22776 KB Output is correct
195 Correct 368 ms 21656 KB Output is correct
196 Correct 349 ms 21656 KB Output is correct
197 Correct 794 ms 22616 KB Output is correct
198 Correct 758 ms 21856 KB Output is correct
199 Correct 669 ms 21720 KB Output is correct
200 Correct 628 ms 21580 KB Output is correct
201 Correct 1444 ms 22100 KB Output is correct
202 Correct 1260 ms 21848 KB Output is correct
203 Correct 1505 ms 22856 KB Output is correct
204 Correct 1518 ms 22736 KB Output is correct
205 Correct 1335 ms 22560 KB Output is correct
206 Correct 1479 ms 22040 KB Output is correct
207 Correct 1325 ms 21660 KB Output is correct
208 Correct 1414 ms 21656 KB Output is correct
209 Correct 3120 ms 23632 KB Output is correct
210 Correct 2479 ms 21796 KB Output is correct
211 Correct 3131 ms 24268 KB Output is correct
212 Correct 3148 ms 23252 KB Output is correct
213 Correct 2784 ms 22232 KB Output is correct
214 Correct 3123 ms 22920 KB Output is correct
215 Execution timed out 5057 ms 22224 KB Time limit exceeded
216 Halted 0 ms 0 KB -