답안 #815263

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
815263 2023-08-08T13:36:22 Z bachhoangxuan Security Guard (JOI23_guard) C++17
100 / 100
1912 ms 154868 KB
// Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_supports("avx2"));
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
// Atcoder
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma")
#include<bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_real_distribution<> pp(0.0,1.0);
#define int long long
#define ld long double
#define pii pair<int,int>
#define piii pair<int,pii>
#define fi first
#define se second
const int inf=1e18;
const int mod=998244353;
const int mod2=1e9+7;
const int maxn=200005;
const int bl=650;
const int maxs=650;
const int maxm=200005;
const int maxq=500005;
const int maxl=20;
const int maxa=1000005;
int power(int a,int n){
    int res=1;
    while(n){
        if(n&1) res=res*a%mod;
        a=a*a%mod;n>>=1;
    }
    return res;
}
struct ed{
    int u,v,w;
    ed(int _u=-1,int _v=-1,int _w=-1):u(_u),v(_v),w(_w){}
    bool operator <(const ed &o)const{
        if(w!=o.w) return w<o.w;
        else if(u!=o.u) return u<o.u;
        else return v<o.v;
    }
};
void solve(){
    int n,m,q,mx=0,mn=inf,sum=0;cin >> n >> m >> q;
    vector<int> s(n+1),par(n+1,0),r(n+1,1);
    vector<ed> e;
    vector<set<ed>> ss(n+1);
    set<ed> st;
    map<pii,int> mp;
    for(int i=1;i<=n;i++) cin >> s[i],sum+=s[i],mx=max(mx,s[i]),mn=min(mn,s[i]),par[i]=i;
    for(int i=1;i<=m;i++){
        int u,v;cin >> u >> v;
        e.push_back({u,v,s[u]+s[v]});
        mp[{u,v}]=mp[{v,u}]=s[u]+s[v];
    }
    function<int(int)> findpar = [&](int u){
        if(u!=par[u]) return par[u]=findpar(par[u]);
        return u;
    };
    function<void(int,int)> add = [&](int u,int val){
        if(ss[u].empty()) return;
        auto x = *ss[u].begin();
        //cout << x.u << ' ' << x.v << ' ' << x.w-s[u] << ' ' << val << '\n';
        if(val==-1) st.erase(ed(x.u,x.v,x.w-s[u]));
        else st.insert(ed(x.u,x.v,x.w-s[u]));
    };
    function<bool(int,int,int)> unions = [&](int u,int v,int t){
        int pu=findpar(u),pv=findpar(v);
        if(pu==pv) return false;
        if(r[pu]<r[pv]) swap(pu,pv),swap(u,v);
        par[pv]=pu;r[pu]+=r[pv];
        if(t){
            int w=mp[{u,v}];
            add(pu,-1);add(pv,-1);
            ss[pu].erase(ed(u,v,w));
            ss[pv].erase(ed(v,u,w));
            s[pu]=min(s[pu],s[pv]);
            for(auto x:ss[pv]) ss[pu].insert(x);
            add(pu,1);
        }
        return true;
    };
    sort(e.begin(),e.end());
    for(auto x:e){
        if(unions(x.u,x.v,0)){
            ss[x.u].insert(ed(x.u,x.v,x.w));
            ss[x.v].insert(ed(x.v,x.u,x.w));
        }
    }
    for(int i=1;i<=n;i++) par[i]=i,r[i]=1;
    int cur=sum;
    for(int i=1;i<=n;i++) add(i,1);
    vector<int> ans(n,0);
    for(int i=n-1;i>=1;i--){
        ans[i]=cur+(i-1)*mn-sum+mx;
        ed x=*st.begin();cur+=x.w;
        //cout << x.u << ' ' << x.v << ' ' << x.w << '\n';
        unions(x.u,x.v,1);
    }
    ans[0]=cur-mn-sum+mx;
    for(int i=0;i<=q;i++) cout << (i<n?ans[i]:ans[n-1]) << '\n';
}
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int test=1;//cin >> test;
    while(test--) solve();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 280 ms 85432 KB Output is correct
3 Correct 281 ms 85540 KB Output is correct
4 Correct 335 ms 85868 KB Output is correct
5 Correct 346 ms 85632 KB Output is correct
6 Correct 353 ms 85564 KB Output is correct
7 Correct 335 ms 85692 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 280 ms 85432 KB Output is correct
3 Correct 281 ms 85540 KB Output is correct
4 Correct 335 ms 85868 KB Output is correct
5 Correct 346 ms 85632 KB Output is correct
6 Correct 353 ms 85564 KB Output is correct
7 Correct 335 ms 85692 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 828 ms 86764 KB Output is correct
11 Correct 306 ms 87104 KB Output is correct
12 Correct 365 ms 87032 KB Output is correct
13 Correct 317 ms 86720 KB Output is correct
14 Correct 901 ms 87140 KB Output is correct
15 Correct 911 ms 86736 KB Output is correct
16 Correct 905 ms 86696 KB Output is correct
17 Correct 876 ms 86712 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 280 ms 85432 KB Output is correct
3 Correct 281 ms 85540 KB Output is correct
4 Correct 335 ms 85868 KB Output is correct
5 Correct 346 ms 85632 KB Output is correct
6 Correct 353 ms 85564 KB Output is correct
7 Correct 335 ms 85692 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 828 ms 86764 KB Output is correct
11 Correct 306 ms 87104 KB Output is correct
12 Correct 365 ms 87032 KB Output is correct
13 Correct 317 ms 86720 KB Output is correct
14 Correct 901 ms 87140 KB Output is correct
15 Correct 911 ms 86736 KB Output is correct
16 Correct 905 ms 86696 KB Output is correct
17 Correct 876 ms 86712 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1242 ms 86728 KB Output is correct
20 Correct 1192 ms 86528 KB Output is correct
21 Correct 1220 ms 87524 KB Output is correct
22 Correct 1191 ms 86340 KB Output is correct
23 Correct 801 ms 86756 KB Output is correct
24 Correct 797 ms 87116 KB Output is correct
25 Correct 775 ms 86688 KB Output is correct
26 Correct 784 ms 86700 KB Output is correct
27 Correct 778 ms 86904 KB Output is correct
28 Correct 1111 ms 86812 KB Output is correct
29 Correct 1032 ms 86896 KB Output is correct
30 Correct 839 ms 87444 KB Output is correct
31 Correct 787 ms 87608 KB Output is correct
32 Correct 1044 ms 91004 KB Output is correct
33 Correct 1010 ms 86296 KB Output is correct
34 Correct 1169 ms 123924 KB Output is correct
35 Correct 1150 ms 148808 KB Output is correct
36 Correct 1008 ms 145652 KB Output is correct
37 Correct 928 ms 139252 KB Output is correct
38 Correct 851 ms 86724 KB Output is correct
39 Correct 699 ms 86500 KB Output is correct
40 Correct 748 ms 89104 KB Output is correct
41 Correct 804 ms 85940 KB Output is correct
42 Correct 833 ms 86860 KB Output is correct
43 Correct 1046 ms 87332 KB Output is correct
44 Correct 1304 ms 86936 KB Output is correct
45 Correct 1110 ms 86888 KB Output is correct
46 Correct 1168 ms 87052 KB Output is correct
47 Correct 1160 ms 86664 KB Output is correct
48 Correct 1204 ms 86684 KB Output is correct
49 Correct 821 ms 86744 KB Output is correct
50 Correct 968 ms 86528 KB Output is correct
51 Correct 965 ms 87252 KB Output is correct
52 Correct 926 ms 85500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 280 ms 85432 KB Output is correct
3 Correct 281 ms 85540 KB Output is correct
4 Correct 335 ms 85868 KB Output is correct
5 Correct 346 ms 85632 KB Output is correct
6 Correct 353 ms 85564 KB Output is correct
7 Correct 335 ms 85692 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 828 ms 86764 KB Output is correct
11 Correct 306 ms 87104 KB Output is correct
12 Correct 365 ms 87032 KB Output is correct
13 Correct 317 ms 86720 KB Output is correct
14 Correct 901 ms 87140 KB Output is correct
15 Correct 911 ms 86736 KB Output is correct
16 Correct 905 ms 86696 KB Output is correct
17 Correct 876 ms 86712 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1242 ms 86728 KB Output is correct
20 Correct 1192 ms 86528 KB Output is correct
21 Correct 1220 ms 87524 KB Output is correct
22 Correct 1191 ms 86340 KB Output is correct
23 Correct 801 ms 86756 KB Output is correct
24 Correct 797 ms 87116 KB Output is correct
25 Correct 775 ms 86688 KB Output is correct
26 Correct 784 ms 86700 KB Output is correct
27 Correct 778 ms 86904 KB Output is correct
28 Correct 1111 ms 86812 KB Output is correct
29 Correct 1032 ms 86896 KB Output is correct
30 Correct 839 ms 87444 KB Output is correct
31 Correct 787 ms 87608 KB Output is correct
32 Correct 1044 ms 91004 KB Output is correct
33 Correct 1010 ms 86296 KB Output is correct
34 Correct 1169 ms 123924 KB Output is correct
35 Correct 1150 ms 148808 KB Output is correct
36 Correct 1008 ms 145652 KB Output is correct
37 Correct 928 ms 139252 KB Output is correct
38 Correct 851 ms 86724 KB Output is correct
39 Correct 699 ms 86500 KB Output is correct
40 Correct 748 ms 89104 KB Output is correct
41 Correct 804 ms 85940 KB Output is correct
42 Correct 833 ms 86860 KB Output is correct
43 Correct 1046 ms 87332 KB Output is correct
44 Correct 1304 ms 86936 KB Output is correct
45 Correct 1110 ms 86888 KB Output is correct
46 Correct 1168 ms 87052 KB Output is correct
47 Correct 1160 ms 86664 KB Output is correct
48 Correct 1204 ms 86684 KB Output is correct
49 Correct 821 ms 86744 KB Output is correct
50 Correct 968 ms 86528 KB Output is correct
51 Correct 965 ms 87252 KB Output is correct
52 Correct 926 ms 85500 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 1120 ms 88360 KB Output is correct
55 Correct 1196 ms 88008 KB Output is correct
56 Correct 1456 ms 96608 KB Output is correct
57 Correct 1912 ms 118800 KB Output is correct
58 Correct 1387 ms 117596 KB Output is correct
59 Correct 1259 ms 118100 KB Output is correct
60 Correct 966 ms 102176 KB Output is correct
61 Correct 1193 ms 119208 KB Output is correct
62 Correct 1233 ms 119640 KB Output is correct
63 Correct 1145 ms 89616 KB Output is correct
64 Correct 1197 ms 102240 KB Output is correct
65 Correct 1239 ms 119068 KB Output is correct
66 Correct 1294 ms 118828 KB Output is correct
67 Correct 1635 ms 118340 KB Output is correct
68 Correct 1051 ms 85144 KB Output is correct
69 Correct 1624 ms 145540 KB Output is correct
70 Correct 1279 ms 153508 KB Output is correct
71 Correct 1026 ms 145540 KB Output is correct
72 Correct 956 ms 139928 KB Output is correct
73 Correct 881 ms 87572 KB Output is correct
74 Correct 720 ms 90572 KB Output is correct
75 Correct 817 ms 90012 KB Output is correct
76 Correct 788 ms 86984 KB Output is correct
77 Correct 900 ms 86572 KB Output is correct
78 Correct 1119 ms 89412 KB Output is correct
79 Correct 1737 ms 116028 KB Output is correct
80 Correct 1244 ms 93104 KB Output is correct
81 Correct 1617 ms 110764 KB Output is correct
82 Correct 1648 ms 118156 KB Output is correct
83 Correct 1680 ms 118112 KB Output is correct
84 Correct 1317 ms 115580 KB Output is correct
85 Correct 961 ms 84968 KB Output is correct
86 Correct 932 ms 87000 KB Output is correct
87 Correct 905 ms 85976 KB Output is correct
88 Correct 1529 ms 117856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 13 ms 2456 KB Output is correct
9 Correct 12 ms 2516 KB Output is correct
10 Correct 12 ms 2332 KB Output is correct
11 Correct 13 ms 2500 KB Output is correct
12 Correct 12 ms 2504 KB Output is correct
13 Correct 12 ms 2452 KB Output is correct
14 Correct 12 ms 2516 KB Output is correct
15 Correct 12 ms 2516 KB Output is correct
16 Correct 12 ms 2544 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 13 ms 2456 KB Output is correct
9 Correct 12 ms 2516 KB Output is correct
10 Correct 12 ms 2332 KB Output is correct
11 Correct 13 ms 2500 KB Output is correct
12 Correct 12 ms 2504 KB Output is correct
13 Correct 12 ms 2452 KB Output is correct
14 Correct 12 ms 2516 KB Output is correct
15 Correct 12 ms 2516 KB Output is correct
16 Correct 12 ms 2544 KB Output is correct
17 Correct 36 ms 7308 KB Output is correct
18 Correct 36 ms 7468 KB Output is correct
19 Correct 97 ms 16576 KB Output is correct
20 Correct 284 ms 30576 KB Output is correct
21 Correct 418 ms 37708 KB Output is correct
22 Correct 252 ms 30668 KB Output is correct
23 Correct 828 ms 65656 KB Output is correct
24 Correct 433 ms 40856 KB Output is correct
25 Correct 25 ms 3796 KB Output is correct
26 Correct 180 ms 23772 KB Output is correct
27 Correct 38 ms 7940 KB Output is correct
28 Correct 17 ms 3796 KB Output is correct
29 Correct 17 ms 3800 KB Output is correct
30 Correct 17 ms 3848 KB Output is correct
31 Correct 15 ms 2600 KB Output is correct
32 Correct 15 ms 2592 KB Output is correct
33 Correct 20 ms 4308 KB Output is correct
34 Correct 22 ms 4776 KB Output is correct
35 Correct 138 ms 19056 KB Output is correct
36 Correct 825 ms 66272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 280 ms 85432 KB Output is correct
3 Correct 281 ms 85540 KB Output is correct
4 Correct 335 ms 85868 KB Output is correct
5 Correct 346 ms 85632 KB Output is correct
6 Correct 353 ms 85564 KB Output is correct
7 Correct 335 ms 85692 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 828 ms 86764 KB Output is correct
11 Correct 306 ms 87104 KB Output is correct
12 Correct 365 ms 87032 KB Output is correct
13 Correct 317 ms 86720 KB Output is correct
14 Correct 901 ms 87140 KB Output is correct
15 Correct 911 ms 86736 KB Output is correct
16 Correct 905 ms 86696 KB Output is correct
17 Correct 876 ms 86712 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1242 ms 86728 KB Output is correct
20 Correct 1192 ms 86528 KB Output is correct
21 Correct 1220 ms 87524 KB Output is correct
22 Correct 1191 ms 86340 KB Output is correct
23 Correct 801 ms 86756 KB Output is correct
24 Correct 797 ms 87116 KB Output is correct
25 Correct 775 ms 86688 KB Output is correct
26 Correct 784 ms 86700 KB Output is correct
27 Correct 778 ms 86904 KB Output is correct
28 Correct 1111 ms 86812 KB Output is correct
29 Correct 1032 ms 86896 KB Output is correct
30 Correct 839 ms 87444 KB Output is correct
31 Correct 787 ms 87608 KB Output is correct
32 Correct 1044 ms 91004 KB Output is correct
33 Correct 1010 ms 86296 KB Output is correct
34 Correct 1169 ms 123924 KB Output is correct
35 Correct 1150 ms 148808 KB Output is correct
36 Correct 1008 ms 145652 KB Output is correct
37 Correct 928 ms 139252 KB Output is correct
38 Correct 851 ms 86724 KB Output is correct
39 Correct 699 ms 86500 KB Output is correct
40 Correct 748 ms 89104 KB Output is correct
41 Correct 804 ms 85940 KB Output is correct
42 Correct 833 ms 86860 KB Output is correct
43 Correct 1046 ms 87332 KB Output is correct
44 Correct 1304 ms 86936 KB Output is correct
45 Correct 1110 ms 86888 KB Output is correct
46 Correct 1168 ms 87052 KB Output is correct
47 Correct 1160 ms 86664 KB Output is correct
48 Correct 1204 ms 86684 KB Output is correct
49 Correct 821 ms 86744 KB Output is correct
50 Correct 968 ms 86528 KB Output is correct
51 Correct 965 ms 87252 KB Output is correct
52 Correct 926 ms 85500 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 1120 ms 88360 KB Output is correct
55 Correct 1196 ms 88008 KB Output is correct
56 Correct 1456 ms 96608 KB Output is correct
57 Correct 1912 ms 118800 KB Output is correct
58 Correct 1387 ms 117596 KB Output is correct
59 Correct 1259 ms 118100 KB Output is correct
60 Correct 966 ms 102176 KB Output is correct
61 Correct 1193 ms 119208 KB Output is correct
62 Correct 1233 ms 119640 KB Output is correct
63 Correct 1145 ms 89616 KB Output is correct
64 Correct 1197 ms 102240 KB Output is correct
65 Correct 1239 ms 119068 KB Output is correct
66 Correct 1294 ms 118828 KB Output is correct
67 Correct 1635 ms 118340 KB Output is correct
68 Correct 1051 ms 85144 KB Output is correct
69 Correct 1624 ms 145540 KB Output is correct
70 Correct 1279 ms 153508 KB Output is correct
71 Correct 1026 ms 145540 KB Output is correct
72 Correct 956 ms 139928 KB Output is correct
73 Correct 881 ms 87572 KB Output is correct
74 Correct 720 ms 90572 KB Output is correct
75 Correct 817 ms 90012 KB Output is correct
76 Correct 788 ms 86984 KB Output is correct
77 Correct 900 ms 86572 KB Output is correct
78 Correct 1119 ms 89412 KB Output is correct
79 Correct 1737 ms 116028 KB Output is correct
80 Correct 1244 ms 93104 KB Output is correct
81 Correct 1617 ms 110764 KB Output is correct
82 Correct 1648 ms 118156 KB Output is correct
83 Correct 1680 ms 118112 KB Output is correct
84 Correct 1317 ms 115580 KB Output is correct
85 Correct 961 ms 84968 KB Output is correct
86 Correct 932 ms 87000 KB Output is correct
87 Correct 905 ms 85976 KB Output is correct
88 Correct 1529 ms 117856 KB Output is correct
89 Correct 0 ms 212 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 212 KB Output is correct
93 Correct 1 ms 212 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 1 ms 212 KB Output is correct
96 Correct 13 ms 2456 KB Output is correct
97 Correct 12 ms 2516 KB Output is correct
98 Correct 12 ms 2332 KB Output is correct
99 Correct 13 ms 2500 KB Output is correct
100 Correct 12 ms 2504 KB Output is correct
101 Correct 12 ms 2452 KB Output is correct
102 Correct 12 ms 2516 KB Output is correct
103 Correct 12 ms 2516 KB Output is correct
104 Correct 12 ms 2544 KB Output is correct
105 Correct 36 ms 7308 KB Output is correct
106 Correct 36 ms 7468 KB Output is correct
107 Correct 97 ms 16576 KB Output is correct
108 Correct 284 ms 30576 KB Output is correct
109 Correct 418 ms 37708 KB Output is correct
110 Correct 252 ms 30668 KB Output is correct
111 Correct 828 ms 65656 KB Output is correct
112 Correct 433 ms 40856 KB Output is correct
113 Correct 25 ms 3796 KB Output is correct
114 Correct 180 ms 23772 KB Output is correct
115 Correct 38 ms 7940 KB Output is correct
116 Correct 17 ms 3796 KB Output is correct
117 Correct 17 ms 3800 KB Output is correct
118 Correct 17 ms 3848 KB Output is correct
119 Correct 15 ms 2600 KB Output is correct
120 Correct 15 ms 2592 KB Output is correct
121 Correct 20 ms 4308 KB Output is correct
122 Correct 22 ms 4776 KB Output is correct
123 Correct 138 ms 19056 KB Output is correct
124 Correct 825 ms 66272 KB Output is correct
125 Correct 1104 ms 92572 KB Output is correct
126 Correct 1097 ms 91852 KB Output is correct
127 Correct 1286 ms 99048 KB Output is correct
128 Correct 1613 ms 120368 KB Output is correct
129 Correct 1167 ms 110108 KB Output is correct
130 Correct 1272 ms 118276 KB Output is correct
131 Correct 1245 ms 118948 KB Output is correct
132 Correct 1233 ms 119236 KB Output is correct
133 Correct 1382 ms 117860 KB Output is correct
134 Correct 1151 ms 94296 KB Output is correct
135 Correct 1115 ms 97804 KB Output is correct
136 Correct 1351 ms 121308 KB Output is correct
137 Correct 1318 ms 122300 KB Output is correct
138 Correct 1552 ms 124432 KB Output is correct
139 Correct 1010 ms 87256 KB Output is correct
140 Correct 1427 ms 143920 KB Output is correct
141 Correct 1123 ms 154868 KB Output is correct
142 Correct 893 ms 147788 KB Output is correct
143 Correct 887 ms 141740 KB Output is correct
144 Correct 895 ms 90356 KB Output is correct
145 Correct 695 ms 96044 KB Output is correct
146 Correct 760 ms 89700 KB Output is correct
147 Correct 819 ms 88924 KB Output is correct
148 Correct 763 ms 88132 KB Output is correct
149 Correct 989 ms 89372 KB Output is correct
150 Correct 1548 ms 121392 KB Output is correct
151 Correct 1103 ms 97864 KB Output is correct
152 Correct 1496 ms 120168 KB Output is correct
153 Correct 1533 ms 119520 KB Output is correct
154 Correct 1551 ms 122788 KB Output is correct
155 Correct 1264 ms 122768 KB Output is correct
156 Correct 913 ms 89656 KB Output is correct
157 Correct 860 ms 91188 KB Output is correct
158 Correct 875 ms 87284 KB Output is correct
159 Correct 1460 ms 122720 KB Output is correct