Submission #674046

# Submission time Handle Problem Language Result Execution time Memory
674046 2022-12-22T17:33:33 Z doowey Fish 2 (JOI22_fish2) C++14
100 / 100
2224 ms 46620 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, int> pii;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = (int)1e5 + 10;

ll S[N];

struct segm{
    ll sum;
    int id;
    int cnt;
};

bool compL(segm p1, segm p2){
    return p1.id < p2.id;
}

bool compR(segm p1, segm p2){
    return p1.id > p2.id;
}

struct Node{
    vector<segm> pref;
    vector<segm> suff;
    int lef;
    int rig;
};

Node T[N * 4 + 512];

Node unite(Node A, Node B){
    Node res;
    res.pref = A.pref;
    res.suff = B.suff;
    res.lef = A.lef;
    res.rig = B.rig;
    res.pref.pop_back();
    res.suff.pop_back();
    int ii, jj;
    ll sum;
    int idx;

    for(int i = 0 ; i < A.suff.size(); i ++ ){
        ii = i;
        jj = 0;
        sum = 0;
        while(1){
            sum = A.suff[ii].sum;
            if(jj) sum += B.pref[jj - 1].sum;
            if(ii + 1 < A.suff.size()){
                if(sum >= S[A.suff[ii].id - 1]){
                    ii ++ ;
                    continue;
                }
            }
            if(jj < B.pref.size()){
                if(jj == 0) idx = A.rig + 1;
                else idx = B.pref[jj - 1].id + 1;
                if(sum >= S[idx]){
                    jj ++ ;
                    continue;
                }
            }
            break;
        }
        if(ii + 1 == A.suff.size()){
            if(jj == 0) idx = A.rig;
            else idx = B.pref[jj - 1].id;
            res.pref.push_back({sum, idx, A.suff[i].cnt});
        }
        if(jj == B.pref.size()){
            res.suff.push_back({sum, A.suff[ii].id, A.suff[i].cnt});
        }
    }
    for(int i = 0 ; i < B.pref.size(); i ++ ){
        ii = 0;
        jj = i;
        sum = 0;
        while(1){
            sum = B.pref[jj].sum;
            if(ii) sum += A.suff[ii - 1].sum;
            if(jj + 1 < B.pref.size()){
                if(sum >= S[B.pref[jj].id + 1]){
                    jj ++ ;
                    continue;
                }
            }
            if(ii < A.suff.size()){
                if(ii == 0) idx = B.lef - 1;
                else idx = A.suff[ii - 1].id - 1;
                if(sum >= S[idx]){
                    ii ++ ;
                    continue;
                }
            }
            break;
        }
        if(ii == A.suff.size()){
            res.pref.push_back({sum, B.pref[jj].id, B.pref[i].cnt});
        }
        if(jj + 1 == B.pref.size()) {
            if(ii == 0) idx = B.lef;
            else idx = A.suff[ii - 1].id;
            res.suff.push_back({sum, idx, B.pref[i].cnt});
        }
    }
    sort(res.pref.begin(), res.pref.end(), compL);
    sort(res.suff.begin(), res.suff.end(), compR);
    vector<segm> lap;
    vector<segm> rap;
    for(auto it : res.pref){
        if(lap.empty() || lap.back().id != it.id){
            lap.push_back(it);
        }
        else{
            lap.back().cnt += it.cnt;
        }
    }
    for(auto it : res.suff){
        if(rap.empty() || rap.back().id != it.id){
            rap.push_back(it);
        }
        else{
            rap.back().cnt += it.cnt;
        }
    }
    res.pref = lap;
    res.suff = rap;
    return res;
}

Node outp;
bool vv;

void get(int node, int cl, int cr, int tl, int tr){
    if(node == 1) vv = false;
    if(cr < tl || cl > tr) return;
    if(cl >= tl && cr <= tr){
        if(!vv){
            outp=T[node];
            vv=true;
        }
        else{
            outp=unite(outp,T[node]);
        }
        return;
    }
    int mid = (cl + cr) / 2;
    get(node * 2, cl, mid, tl, tr);
    get(node * 2 + 1, mid + 1, cr, tl, tr);
}

void build(int node, int cl, int cr){
    if(cl == cr){
        T[node].pref = {{S[cl], cl, 1}};
        T[node].suff = {{S[cl], cl, 1}};
        T[node].lef = cl;
        T[node].rig = cr;
        return;
    }
    int mid = (cl + cr) / 2;
    build(node * 2, cl, mid);
    build(node * 2 + 1, mid + 1, cr);
    T[node] = unite(T[node * 2], T[node * 2 + 1]);
}

void upd(int node, int cl, int cr, int target){
    if(cl == cr){
        T[node].pref = {{S[cl], cl, 1}};
        T[node].suff = {{S[cl], cl, 1}};
        T[node].lef = cl;
        T[node].rig = cr;
        return;
    }
    int mid = (cl + cr) / 2;
    if(mid >= target) upd(node * 2, cl, mid, target);
    else upd(node * 2 + 1, mid + 1, cr, target);
    T[node] = unite(T[node * 2], T[node * 2 + 1]);
}

int main(){
    fastIO;
    //freopen("in.txt", "r", stdin);
    int n;
    cin >> n;
    for(int i = 1; i <= n; i ++ ){
        cin >> S[i];
    }
    build(1, 1, n);
    int q;
    cin >> q;
    int typ;
    int li, ri;
    for(int iq = 1; iq <= q; iq ++ ){
        cin >> typ;
        if(typ == 1){
            cin >> li >> ri;
            S[li]=ri;
            upd(1, 1, n, li);
        }
        else{
            cin >> li >> ri;
            get(1, 1, n, li, ri);
            cout << outp.suff.back().cnt << "\n";
        }
    }
    return 0;
}

Compilation message

fish2.cpp: In function 'Node unite(Node, Node)':
fish2.cpp:52:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |     for(int i = 0 ; i < A.suff.size(); i ++ ){
      |                     ~~^~~~~~~~~~~~~~~
fish2.cpp:59:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |             if(ii + 1 < A.suff.size()){
      |                ~~~~~~~^~~~~~~~~~~~~~~
fish2.cpp:65:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   65 |             if(jj < B.pref.size()){
      |                ~~~^~~~~~~~~~~~~~~
fish2.cpp:75:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   75 |         if(ii + 1 == A.suff.size()){
      |            ~~~~~~~^~~~~~~~~~~~~~~~
fish2.cpp:80:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |         if(jj == B.pref.size()){
      |            ~~~^~~~~~~~~~~~~~~~
fish2.cpp:84:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   84 |     for(int i = 0 ; i < B.pref.size(); i ++ ){
      |                     ~~^~~~~~~~~~~~~~~
fish2.cpp:91:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   91 |             if(jj + 1 < B.pref.size()){
      |                ~~~~~~~^~~~~~~~~~~~~~~
fish2.cpp:97:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   97 |             if(ii < A.suff.size()){
      |                ~~~^~~~~~~~~~~~~~~
fish2.cpp:107:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |         if(ii == A.suff.size()){
      |            ~~~^~~~~~~~~~~~~~~~
fish2.cpp:110:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<segm>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  110 |         if(jj + 1 == B.pref.size()) {
      |            ~~~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 11 ms 22236 KB Output is correct
2 Correct 13 ms 22200 KB Output is correct
3 Correct 11 ms 22356 KB Output is correct
4 Correct 12 ms 22228 KB Output is correct
5 Correct 16 ms 22404 KB Output is correct
6 Correct 14 ms 22400 KB Output is correct
7 Correct 17 ms 22320 KB Output is correct
8 Correct 14 ms 22324 KB Output is correct
9 Correct 18 ms 22352 KB Output is correct
10 Correct 14 ms 22356 KB Output is correct
11 Correct 16 ms 22284 KB Output is correct
12 Correct 14 ms 22492 KB Output is correct
13 Correct 14 ms 22276 KB Output is correct
14 Correct 19 ms 22436 KB Output is correct
15 Correct 15 ms 22336 KB Output is correct
16 Correct 16 ms 22336 KB Output is correct
17 Correct 14 ms 22356 KB Output is correct
18 Correct 14 ms 22356 KB Output is correct
19 Correct 15 ms 22356 KB Output is correct
20 Correct 15 ms 22364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 22216 KB Output is correct
2 Correct 104 ms 43720 KB Output is correct
3 Correct 98 ms 42224 KB Output is correct
4 Correct 102 ms 43724 KB Output is correct
5 Correct 98 ms 42292 KB Output is correct
6 Correct 97 ms 41092 KB Output is correct
7 Correct 98 ms 40792 KB Output is correct
8 Correct 97 ms 41024 KB Output is correct
9 Correct 95 ms 40552 KB Output is correct
10 Correct 124 ms 44688 KB Output is correct
11 Correct 100 ms 41992 KB Output is correct
12 Correct 92 ms 40300 KB Output is correct
13 Correct 91 ms 40320 KB Output is correct
14 Correct 95 ms 40324 KB Output is correct
15 Correct 97 ms 40936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 22236 KB Output is correct
2 Correct 13 ms 22200 KB Output is correct
3 Correct 11 ms 22356 KB Output is correct
4 Correct 12 ms 22228 KB Output is correct
5 Correct 16 ms 22404 KB Output is correct
6 Correct 14 ms 22400 KB Output is correct
7 Correct 17 ms 22320 KB Output is correct
8 Correct 14 ms 22324 KB Output is correct
9 Correct 18 ms 22352 KB Output is correct
10 Correct 14 ms 22356 KB Output is correct
11 Correct 16 ms 22284 KB Output is correct
12 Correct 14 ms 22492 KB Output is correct
13 Correct 14 ms 22276 KB Output is correct
14 Correct 19 ms 22436 KB Output is correct
15 Correct 15 ms 22336 KB Output is correct
16 Correct 16 ms 22336 KB Output is correct
17 Correct 14 ms 22356 KB Output is correct
18 Correct 14 ms 22356 KB Output is correct
19 Correct 15 ms 22356 KB Output is correct
20 Correct 15 ms 22364 KB Output is correct
21 Correct 11 ms 22216 KB Output is correct
22 Correct 104 ms 43720 KB Output is correct
23 Correct 98 ms 42224 KB Output is correct
24 Correct 102 ms 43724 KB Output is correct
25 Correct 98 ms 42292 KB Output is correct
26 Correct 97 ms 41092 KB Output is correct
27 Correct 98 ms 40792 KB Output is correct
28 Correct 97 ms 41024 KB Output is correct
29 Correct 95 ms 40552 KB Output is correct
30 Correct 124 ms 44688 KB Output is correct
31 Correct 100 ms 41992 KB Output is correct
32 Correct 92 ms 40300 KB Output is correct
33 Correct 91 ms 40320 KB Output is correct
34 Correct 95 ms 40324 KB Output is correct
35 Correct 97 ms 40936 KB Output is correct
36 Correct 114 ms 43768 KB Output is correct
37 Correct 117 ms 42480 KB Output is correct
38 Correct 116 ms 42296 KB Output is correct
39 Correct 113 ms 43732 KB Output is correct
40 Correct 115 ms 42320 KB Output is correct
41 Correct 106 ms 41144 KB Output is correct
42 Correct 105 ms 41112 KB Output is correct
43 Correct 109 ms 40680 KB Output is correct
44 Correct 106 ms 40680 KB Output is correct
45 Correct 127 ms 44696 KB Output is correct
46 Correct 124 ms 44888 KB Output is correct
47 Correct 120 ms 42092 KB Output is correct
48 Correct 121 ms 40500 KB Output is correct
49 Correct 101 ms 40404 KB Output is correct
50 Correct 104 ms 40416 KB Output is correct
51 Correct 126 ms 40908 KB Output is correct
52 Correct 103 ms 40460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 22216 KB Output is correct
2 Correct 104 ms 43720 KB Output is correct
3 Correct 98 ms 42224 KB Output is correct
4 Correct 102 ms 43724 KB Output is correct
5 Correct 98 ms 42292 KB Output is correct
6 Correct 97 ms 41092 KB Output is correct
7 Correct 98 ms 40792 KB Output is correct
8 Correct 97 ms 41024 KB Output is correct
9 Correct 95 ms 40552 KB Output is correct
10 Correct 124 ms 44688 KB Output is correct
11 Correct 100 ms 41992 KB Output is correct
12 Correct 92 ms 40300 KB Output is correct
13 Correct 91 ms 40320 KB Output is correct
14 Correct 95 ms 40324 KB Output is correct
15 Correct 97 ms 40936 KB Output is correct
16 Correct 12 ms 22228 KB Output is correct
17 Correct 1681 ms 43996 KB Output is correct
18 Correct 1362 ms 45552 KB Output is correct
19 Correct 1615 ms 44136 KB Output is correct
20 Correct 1657 ms 44020 KB Output is correct
21 Correct 1650 ms 43920 KB Output is correct
22 Correct 1346 ms 45588 KB Output is correct
23 Correct 1605 ms 43944 KB Output is correct
24 Correct 1689 ms 43952 KB Output is correct
25 Correct 1643 ms 44072 KB Output is correct
26 Correct 1674 ms 43840 KB Output is correct
27 Correct 985 ms 43104 KB Output is correct
28 Correct 971 ms 43000 KB Output is correct
29 Correct 952 ms 43072 KB Output is correct
30 Correct 1366 ms 42144 KB Output is correct
31 Correct 1310 ms 42272 KB Output is correct
32 Correct 1868 ms 43664 KB Output is correct
33 Correct 1994 ms 46620 KB Output is correct
34 Correct 1867 ms 43832 KB Output is correct
35 Correct 1816 ms 43428 KB Output is correct
36 Correct 2033 ms 46596 KB Output is correct
37 Correct 986 ms 42004 KB Output is correct
38 Correct 915 ms 42060 KB Output is correct
39 Correct 1016 ms 42564 KB Output is correct
40 Correct 1165 ms 42880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 22216 KB Output is correct
2 Correct 104 ms 43720 KB Output is correct
3 Correct 98 ms 42224 KB Output is correct
4 Correct 102 ms 43724 KB Output is correct
5 Correct 98 ms 42292 KB Output is correct
6 Correct 97 ms 41092 KB Output is correct
7 Correct 98 ms 40792 KB Output is correct
8 Correct 97 ms 41024 KB Output is correct
9 Correct 95 ms 40552 KB Output is correct
10 Correct 124 ms 44688 KB Output is correct
11 Correct 100 ms 41992 KB Output is correct
12 Correct 92 ms 40300 KB Output is correct
13 Correct 91 ms 40320 KB Output is correct
14 Correct 95 ms 40324 KB Output is correct
15 Correct 97 ms 40936 KB Output is correct
16 Correct 11 ms 22228 KB Output is correct
17 Correct 2091 ms 46560 KB Output is correct
18 Correct 1236 ms 44116 KB Output is correct
19 Correct 1352 ms 43964 KB Output is correct
20 Correct 934 ms 44084 KB Output is correct
21 Correct 1640 ms 45988 KB Output is correct
22 Correct 1295 ms 44112 KB Output is correct
23 Correct 1734 ms 43740 KB Output is correct
24 Correct 1213 ms 44136 KB Output is correct
25 Correct 1561 ms 43780 KB Output is correct
26 Correct 796 ms 42864 KB Output is correct
27 Correct 1094 ms 42816 KB Output is correct
28 Correct 880 ms 42796 KB Output is correct
29 Correct 900 ms 42956 KB Output is correct
30 Correct 1110 ms 43016 KB Output is correct
31 Correct 1105 ms 43208 KB Output is correct
32 Correct 1261 ms 43940 KB Output is correct
33 Correct 1502 ms 43592 KB Output is correct
34 Correct 1171 ms 46308 KB Output is correct
35 Correct 1919 ms 46228 KB Output is correct
36 Correct 1074 ms 43660 KB Output is correct
37 Correct 1026 ms 42700 KB Output is correct
38 Correct 638 ms 42576 KB Output is correct
39 Correct 819 ms 43088 KB Output is correct
40 Correct 360 ms 42792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 22236 KB Output is correct
2 Correct 13 ms 22200 KB Output is correct
3 Correct 11 ms 22356 KB Output is correct
4 Correct 12 ms 22228 KB Output is correct
5 Correct 16 ms 22404 KB Output is correct
6 Correct 14 ms 22400 KB Output is correct
7 Correct 17 ms 22320 KB Output is correct
8 Correct 14 ms 22324 KB Output is correct
9 Correct 18 ms 22352 KB Output is correct
10 Correct 14 ms 22356 KB Output is correct
11 Correct 16 ms 22284 KB Output is correct
12 Correct 14 ms 22492 KB Output is correct
13 Correct 14 ms 22276 KB Output is correct
14 Correct 19 ms 22436 KB Output is correct
15 Correct 15 ms 22336 KB Output is correct
16 Correct 16 ms 22336 KB Output is correct
17 Correct 14 ms 22356 KB Output is correct
18 Correct 14 ms 22356 KB Output is correct
19 Correct 15 ms 22356 KB Output is correct
20 Correct 15 ms 22364 KB Output is correct
21 Correct 11 ms 22216 KB Output is correct
22 Correct 104 ms 43720 KB Output is correct
23 Correct 98 ms 42224 KB Output is correct
24 Correct 102 ms 43724 KB Output is correct
25 Correct 98 ms 42292 KB Output is correct
26 Correct 97 ms 41092 KB Output is correct
27 Correct 98 ms 40792 KB Output is correct
28 Correct 97 ms 41024 KB Output is correct
29 Correct 95 ms 40552 KB Output is correct
30 Correct 124 ms 44688 KB Output is correct
31 Correct 100 ms 41992 KB Output is correct
32 Correct 92 ms 40300 KB Output is correct
33 Correct 91 ms 40320 KB Output is correct
34 Correct 95 ms 40324 KB Output is correct
35 Correct 97 ms 40936 KB Output is correct
36 Correct 114 ms 43768 KB Output is correct
37 Correct 117 ms 42480 KB Output is correct
38 Correct 116 ms 42296 KB Output is correct
39 Correct 113 ms 43732 KB Output is correct
40 Correct 115 ms 42320 KB Output is correct
41 Correct 106 ms 41144 KB Output is correct
42 Correct 105 ms 41112 KB Output is correct
43 Correct 109 ms 40680 KB Output is correct
44 Correct 106 ms 40680 KB Output is correct
45 Correct 127 ms 44696 KB Output is correct
46 Correct 124 ms 44888 KB Output is correct
47 Correct 120 ms 42092 KB Output is correct
48 Correct 121 ms 40500 KB Output is correct
49 Correct 101 ms 40404 KB Output is correct
50 Correct 104 ms 40416 KB Output is correct
51 Correct 126 ms 40908 KB Output is correct
52 Correct 103 ms 40460 KB Output is correct
53 Correct 12 ms 22228 KB Output is correct
54 Correct 1681 ms 43996 KB Output is correct
55 Correct 1362 ms 45552 KB Output is correct
56 Correct 1615 ms 44136 KB Output is correct
57 Correct 1657 ms 44020 KB Output is correct
58 Correct 1650 ms 43920 KB Output is correct
59 Correct 1346 ms 45588 KB Output is correct
60 Correct 1605 ms 43944 KB Output is correct
61 Correct 1689 ms 43952 KB Output is correct
62 Correct 1643 ms 44072 KB Output is correct
63 Correct 1674 ms 43840 KB Output is correct
64 Correct 985 ms 43104 KB Output is correct
65 Correct 971 ms 43000 KB Output is correct
66 Correct 952 ms 43072 KB Output is correct
67 Correct 1366 ms 42144 KB Output is correct
68 Correct 1310 ms 42272 KB Output is correct
69 Correct 1868 ms 43664 KB Output is correct
70 Correct 1994 ms 46620 KB Output is correct
71 Correct 1867 ms 43832 KB Output is correct
72 Correct 1816 ms 43428 KB Output is correct
73 Correct 2033 ms 46596 KB Output is correct
74 Correct 986 ms 42004 KB Output is correct
75 Correct 915 ms 42060 KB Output is correct
76 Correct 1016 ms 42564 KB Output is correct
77 Correct 1165 ms 42880 KB Output is correct
78 Correct 11 ms 22228 KB Output is correct
79 Correct 2091 ms 46560 KB Output is correct
80 Correct 1236 ms 44116 KB Output is correct
81 Correct 1352 ms 43964 KB Output is correct
82 Correct 934 ms 44084 KB Output is correct
83 Correct 1640 ms 45988 KB Output is correct
84 Correct 1295 ms 44112 KB Output is correct
85 Correct 1734 ms 43740 KB Output is correct
86 Correct 1213 ms 44136 KB Output is correct
87 Correct 1561 ms 43780 KB Output is correct
88 Correct 796 ms 42864 KB Output is correct
89 Correct 1094 ms 42816 KB Output is correct
90 Correct 880 ms 42796 KB Output is correct
91 Correct 900 ms 42956 KB Output is correct
92 Correct 1110 ms 43016 KB Output is correct
93 Correct 1105 ms 43208 KB Output is correct
94 Correct 1261 ms 43940 KB Output is correct
95 Correct 1502 ms 43592 KB Output is correct
96 Correct 1171 ms 46308 KB Output is correct
97 Correct 1919 ms 46228 KB Output is correct
98 Correct 1074 ms 43660 KB Output is correct
99 Correct 1026 ms 42700 KB Output is correct
100 Correct 638 ms 42576 KB Output is correct
101 Correct 819 ms 43088 KB Output is correct
102 Correct 360 ms 42792 KB Output is correct
103 Correct 2074 ms 43784 KB Output is correct
104 Correct 1387 ms 45540 KB Output is correct
105 Correct 1916 ms 44272 KB Output is correct
106 Correct 1409 ms 44156 KB Output is correct
107 Correct 2169 ms 44136 KB Output is correct
108 Correct 1426 ms 45636 KB Output is correct
109 Correct 1780 ms 44016 KB Output is correct
110 Correct 1356 ms 44280 KB Output is correct
111 Correct 1862 ms 44156 KB Output is correct
112 Correct 1416 ms 43868 KB Output is correct
113 Correct 1145 ms 42972 KB Output is correct
114 Correct 974 ms 42940 KB Output is correct
115 Correct 1332 ms 43152 KB Output is correct
116 Correct 1293 ms 42756 KB Output is correct
117 Correct 1002 ms 43196 KB Output is correct
118 Correct 1246 ms 42796 KB Output is correct
119 Correct 1204 ms 42952 KB Output is correct
120 Correct 1325 ms 43012 KB Output is correct
121 Correct 1237 ms 42928 KB Output is correct
122 Correct 1375 ms 43812 KB Output is correct
123 Correct 2224 ms 43728 KB Output is correct
124 Correct 1350 ms 43476 KB Output is correct
125 Correct 1779 ms 43184 KB Output is correct
126 Correct 1430 ms 43400 KB Output is correct
127 Correct 1346 ms 42756 KB Output is correct
128 Correct 1100 ms 42660 KB Output is correct
129 Correct 1246 ms 43288 KB Output is correct
130 Correct 1192 ms 42840 KB Output is correct