답안 #682727

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
682727 2023-01-16T20:56:23 Z SirCovidThe19th 송신탑 (IOI22_towers) C++17
100 / 100
1257 ms 76724 KB
#include <bits/stdc++.h>
using namespace std; 

const int mx = 1e5 + 5;

struct pstNode{
    int sum, mn, mx;
};
struct segNode{
    int mn, mx, dif1, dif2, locMn;
};

pstNode comb(pstNode a, pstNode b){
    return {a.sum + b.sum, min(a.mn, b.mn), max(a.mx, b.mx)};
};
segNode comb(segNode a, segNode b){
    return {
        min(a.mn, b.mn), 
        max(a.mx, b.mx), 
        max({a.dif1, b.dif1, b.mx - a.mn}), 
        max({a.dif2, b.dif2, a.mx - b.mn}), 
        (a.mn < b.mn ? a.locMn : b.locMn)
    };
}

struct persistentSegTree{
    pstNode seg[mx * 31]; int idx = 1, lc[mx * 31] = {}, rc[mx * 31] = {};

    persistentSegTree(){ 
        fill(seg, seg + mx * 31, pstNode({0, int(1e9), 0})); 
    }
    void dup(int &i){
        lc[idx] = lc[i];
        rc[idx] = rc[i];
        seg[idx] = seg[i];
        i = idx; idx++;
    }
    void upd(int p, int &i, int l = 0, int r = mx){
        dup(i);
        if (l == r){ seg[i] = {1, l, l}; return; }

        int mid = (l + r) / 2;
        if (p <= mid) upd(p, lc[i], l, mid);
        else upd(p, rc[i], mid + 1, r);

        seg[i] = comb(seg[lc[i]], seg[rc[i]]);
    }
    pstNode qry(int ql, int qr, int i, int l = 0, int r = mx){
        if (qr < l or ql > r or !i) return {0, int(1e9), 0};
        if (l >= ql and r <= qr) return seg[i];
        int mid = (l + r) / 2;
        return comb(qry(ql, qr, lc[i], l, mid), qry(ql, qr, rc[i], mid + 1, r));
    }
};
struct segTree{
    segNode seg[mx * 2 + 5];

    void upd(int i, int val){
        seg[i + mx] = {val, val, 0, 0, i};
        for (i = (i + mx) / 2; i > 0; i /= 2)
            seg[i] = comb(seg[i * 2], seg[i * 2 + 1]);
    }
    segNode qry(int l, int r){ 
        segNode retL = segNode({int(1e9), 0, 0, 0, 0});
        segNode retR = segNode({int(1e9), 0, 0, 0, 0});

        for (l += mx, r += mx; l <= r; r /= 2, l /= 2){
            if (l % 2 == 1) retL = comb(retL, seg[l++]);
            if (r % 2 == 0) retR = comb(seg[r--], retR);
        }
        return comb(retL, retR);
    }
};
struct sparseTable{
    int rmq[mx][17];

    void build(vector<int> A){
        for (int j = 0; j < 17; j++)
            for (int i = 0; i + (1 << j) - 1 < A.size(); i++)
                rmq[i][j] = !j ? A[i] : max(rmq[i][j - 1], rmq[i + (1 << (j - 1))][j - 1]);
    }
    int qry(int l, int r){
        int lg = 31 - __builtin_clz(r - l + 1);
        return max(rmq[l][lg], rmq[r - (1 << lg) + 1][lg]);
    }
};

vector<int> H; map<int, int> root; segTree st; persistentSegTree pst; sparseTable fastMax;

int max_towers(int l, int r, int d){
    auto it = root.lower_bound(d);
    pstNode ret = pst.qry(l, r, it->second);

    if (ret.sum == 0){
        ret.mn = ret.mx = st.qry(l, r).locMn;
        ret.sum = 1;
    }
    
    int lo = l, hi = ret.mn;
    while (lo < hi){
        int mid = (lo + hi + 1) / 2;
        (fastMax.qry(mid, ret.mn) >= H[ret.mn] + d ? lo = mid : hi = mid - 1); 
    }
    ret.sum += (H[lo] >= H[ret.mn] + d and st.qry(l, lo).dif1 >= d);

    lo = ret.mx, hi = r;
    while (lo < hi){
        int mid = (lo + hi) / 2;
        (fastMax.qry(ret.mx, mid) >= H[ret.mx] + d ? hi = mid : lo = mid + 1);
    }
    ret.sum += (H[hi] >= H[ret.mx] + d and st.qry(hi, r).dif2 >= d);
    return ret.sum;
}
void init(int n, vector<int> h_){
    H = h_;
    fastMax.build(H);

    int L[n], R[n]; 
    for (int i = 0; i < n; i++) L[i] = R[i] = -1;
    
    stack<int> stk;
    for (int i = 0; i < n; i++){
        st.upd(i, H[i]);
        while (stk.size() and H[stk.top()] >= H[i]){
            R[stk.top()] = i;
            stk.pop();
        }
        if (stk.size()) L[i] = stk.top();
        stk.push(i);
    }

    vector<pair<int, int>> V;
    for (int i = 0; i < n; i++){
        int dlim = 1e9;
        if (L[i] != -1) dlim = min(dlim, fastMax.qry(L[i], i) - H[i]);
        if (R[i] != -1) dlim = min(dlim, fastMax.qry(i, R[i]) - H[i]);
        V.push_back({dlim, i});
    }
    sort(V.begin(), V.end(), greater<pair<int, int>>());

    int curRoot = 1;
    for (auto [dlim, i] : V){
        pst.upd(i, curRoot);
        root[dlim] = curRoot;
    }
}

Compilation message

towers.cpp: In member function 'void sparseTable::build(std::vector<int>)':
towers.cpp:79:46: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   79 |             for (int i = 0; i + (1 << j) - 1 < A.size(); i++)
      |                             ~~~~~~~~~~~~~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 510 ms 69204 KB Output is correct
2 Correct 907 ms 75068 KB Output is correct
3 Correct 1071 ms 75072 KB Output is correct
4 Correct 933 ms 75328 KB Output is correct
5 Correct 1058 ms 75072 KB Output is correct
6 Correct 1026 ms 75068 KB Output is correct
7 Correct 1082 ms 74920 KB Output is correct
8 Correct 25 ms 61008 KB Output is correct
9 Correct 26 ms 61188 KB Output is correct
10 Correct 26 ms 61264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 60984 KB Output is correct
2 Correct 26 ms 61252 KB Output is correct
3 Correct 30 ms 61224 KB Output is correct
4 Correct 27 ms 61288 KB Output is correct
5 Correct 27 ms 61208 KB Output is correct
6 Correct 26 ms 61256 KB Output is correct
7 Correct 34 ms 61256 KB Output is correct
8 Correct 29 ms 61228 KB Output is correct
9 Correct 27 ms 61264 KB Output is correct
10 Correct 26 ms 61248 KB Output is correct
11 Correct 27 ms 61264 KB Output is correct
12 Correct 25 ms 60900 KB Output is correct
13 Correct 27 ms 61248 KB Output is correct
14 Correct 26 ms 61184 KB Output is correct
15 Correct 27 ms 61260 KB Output is correct
16 Correct 25 ms 61224 KB Output is correct
17 Correct 27 ms 61188 KB Output is correct
18 Correct 26 ms 61184 KB Output is correct
19 Correct 26 ms 61216 KB Output is correct
20 Correct 26 ms 61304 KB Output is correct
21 Correct 27 ms 61244 KB Output is correct
22 Correct 28 ms 61248 KB Output is correct
23 Correct 32 ms 61384 KB Output is correct
24 Correct 28 ms 61244 KB Output is correct
25 Correct 26 ms 61076 KB Output is correct
26 Correct 26 ms 61216 KB Output is correct
27 Correct 26 ms 61276 KB Output is correct
28 Correct 27 ms 61256 KB Output is correct
29 Correct 26 ms 61264 KB Output is correct
30 Correct 30 ms 61324 KB Output is correct
31 Correct 26 ms 61192 KB Output is correct
32 Correct 26 ms 61264 KB Output is correct
33 Correct 26 ms 61216 KB Output is correct
34 Correct 26 ms 61240 KB Output is correct
35 Correct 26 ms 61256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 60984 KB Output is correct
2 Correct 26 ms 61252 KB Output is correct
3 Correct 30 ms 61224 KB Output is correct
4 Correct 27 ms 61288 KB Output is correct
5 Correct 27 ms 61208 KB Output is correct
6 Correct 26 ms 61256 KB Output is correct
7 Correct 34 ms 61256 KB Output is correct
8 Correct 29 ms 61228 KB Output is correct
9 Correct 27 ms 61264 KB Output is correct
10 Correct 26 ms 61248 KB Output is correct
11 Correct 27 ms 61264 KB Output is correct
12 Correct 25 ms 60900 KB Output is correct
13 Correct 27 ms 61248 KB Output is correct
14 Correct 26 ms 61184 KB Output is correct
15 Correct 27 ms 61260 KB Output is correct
16 Correct 25 ms 61224 KB Output is correct
17 Correct 27 ms 61188 KB Output is correct
18 Correct 26 ms 61184 KB Output is correct
19 Correct 26 ms 61216 KB Output is correct
20 Correct 26 ms 61304 KB Output is correct
21 Correct 27 ms 61244 KB Output is correct
22 Correct 28 ms 61248 KB Output is correct
23 Correct 32 ms 61384 KB Output is correct
24 Correct 28 ms 61244 KB Output is correct
25 Correct 26 ms 61076 KB Output is correct
26 Correct 26 ms 61216 KB Output is correct
27 Correct 26 ms 61276 KB Output is correct
28 Correct 27 ms 61256 KB Output is correct
29 Correct 26 ms 61264 KB Output is correct
30 Correct 30 ms 61324 KB Output is correct
31 Correct 26 ms 61192 KB Output is correct
32 Correct 26 ms 61264 KB Output is correct
33 Correct 26 ms 61216 KB Output is correct
34 Correct 26 ms 61240 KB Output is correct
35 Correct 26 ms 61256 KB Output is correct
36 Correct 86 ms 70696 KB Output is correct
37 Correct 129 ms 75832 KB Output is correct
38 Correct 119 ms 75708 KB Output is correct
39 Correct 122 ms 76576 KB Output is correct
40 Correct 124 ms 76540 KB Output is correct
41 Correct 122 ms 76724 KB Output is correct
42 Correct 143 ms 76516 KB Output is correct
43 Correct 101 ms 75368 KB Output is correct
44 Correct 92 ms 74940 KB Output is correct
45 Correct 100 ms 75236 KB Output is correct
46 Correct 100 ms 74916 KB Output is correct
47 Correct 144 ms 75712 KB Output is correct
48 Correct 124 ms 76500 KB Output is correct
49 Correct 140 ms 76596 KB Output is correct
50 Correct 97 ms 74984 KB Output is correct
51 Correct 95 ms 75324 KB Output is correct
52 Correct 124 ms 75836 KB Output is correct
53 Correct 124 ms 76512 KB Output is correct
54 Correct 136 ms 76500 KB Output is correct
55 Correct 94 ms 74936 KB Output is correct
56 Correct 94 ms 75180 KB Output is correct
57 Correct 113 ms 75308 KB Output is correct
58 Correct 123 ms 75912 KB Output is correct
59 Correct 117 ms 75764 KB Output is correct
60 Correct 123 ms 76604 KB Output is correct
61 Correct 126 ms 76496 KB Output is correct
62 Correct 131 ms 76592 KB Output is correct
63 Correct 124 ms 76564 KB Output is correct
64 Correct 95 ms 75340 KB Output is correct
65 Correct 94 ms 74940 KB Output is correct
66 Correct 97 ms 75172 KB Output is correct
67 Correct 94 ms 75008 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 919 ms 75652 KB Output is correct
2 Correct 1022 ms 75704 KB Output is correct
3 Correct 1055 ms 75804 KB Output is correct
4 Correct 951 ms 76600 KB Output is correct
5 Correct 1077 ms 76604 KB Output is correct
6 Correct 1177 ms 76604 KB Output is correct
7 Correct 1141 ms 76580 KB Output is correct
8 Correct 1230 ms 75392 KB Output is correct
9 Correct 1171 ms 74948 KB Output is correct
10 Correct 1050 ms 75232 KB Output is correct
11 Correct 1052 ms 74920 KB Output is correct
12 Correct 1053 ms 75176 KB Output is correct
13 Correct 998 ms 74952 KB Output is correct
14 Correct 27 ms 60888 KB Output is correct
15 Correct 29 ms 61272 KB Output is correct
16 Correct 28 ms 61260 KB Output is correct
17 Correct 116 ms 75804 KB Output is correct
18 Correct 130 ms 76568 KB Output is correct
19 Correct 134 ms 76588 KB Output is correct
20 Correct 93 ms 75000 KB Output is correct
21 Correct 115 ms 75376 KB Output is correct
22 Correct 149 ms 75720 KB Output is correct
23 Correct 140 ms 76604 KB Output is correct
24 Correct 133 ms 76524 KB Output is correct
25 Correct 102 ms 74928 KB Output is correct
26 Correct 116 ms 75152 KB Output is correct
27 Correct 28 ms 61264 KB Output is correct
28 Correct 29 ms 61212 KB Output is correct
29 Correct 27 ms 61228 KB Output is correct
30 Correct 26 ms 61228 KB Output is correct
31 Correct 26 ms 61304 KB Output is correct
32 Correct 27 ms 61228 KB Output is correct
33 Correct 27 ms 61260 KB Output is correct
34 Correct 26 ms 61256 KB Output is correct
35 Correct 28 ms 61264 KB Output is correct
36 Correct 25 ms 61232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 371 ms 64452 KB Output is correct
2 Correct 1119 ms 75772 KB Output is correct
3 Correct 1093 ms 75732 KB Output is correct
4 Correct 1088 ms 76576 KB Output is correct
5 Correct 1140 ms 76592 KB Output is correct
6 Correct 966 ms 76604 KB Output is correct
7 Correct 892 ms 76576 KB Output is correct
8 Correct 1111 ms 75364 KB Output is correct
9 Correct 913 ms 75040 KB Output is correct
10 Correct 861 ms 75140 KB Output is correct
11 Correct 935 ms 74924 KB Output is correct
12 Correct 123 ms 75836 KB Output is correct
13 Correct 137 ms 76552 KB Output is correct
14 Correct 135 ms 76580 KB Output is correct
15 Correct 95 ms 74952 KB Output is correct
16 Correct 105 ms 75152 KB Output is correct
17 Correct 125 ms 75304 KB Output is correct
18 Correct 129 ms 75836 KB Output is correct
19 Correct 121 ms 75744 KB Output is correct
20 Correct 128 ms 76544 KB Output is correct
21 Correct 161 ms 76516 KB Output is correct
22 Correct 135 ms 76580 KB Output is correct
23 Correct 141 ms 76580 KB Output is correct
24 Correct 96 ms 75324 KB Output is correct
25 Correct 104 ms 74944 KB Output is correct
26 Correct 98 ms 75180 KB Output is correct
27 Correct 99 ms 74996 KB Output is correct
28 Correct 28 ms 61348 KB Output is correct
29 Correct 29 ms 61264 KB Output is correct
30 Correct 32 ms 61288 KB Output is correct
31 Correct 27 ms 61264 KB Output is correct
32 Correct 28 ms 61264 KB Output is correct
33 Correct 28 ms 61044 KB Output is correct
34 Correct 33 ms 61220 KB Output is correct
35 Correct 35 ms 61232 KB Output is correct
36 Correct 30 ms 61208 KB Output is correct
37 Correct 28 ms 61268 KB Output is correct
38 Correct 27 ms 61252 KB Output is correct
39 Correct 27 ms 61256 KB Output is correct
40 Correct 28 ms 61228 KB Output is correct
41 Correct 28 ms 61264 KB Output is correct
42 Correct 28 ms 61264 KB Output is correct
43 Correct 28 ms 61264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 60984 KB Output is correct
2 Correct 26 ms 61252 KB Output is correct
3 Correct 30 ms 61224 KB Output is correct
4 Correct 27 ms 61288 KB Output is correct
5 Correct 27 ms 61208 KB Output is correct
6 Correct 26 ms 61256 KB Output is correct
7 Correct 34 ms 61256 KB Output is correct
8 Correct 29 ms 61228 KB Output is correct
9 Correct 27 ms 61264 KB Output is correct
10 Correct 26 ms 61248 KB Output is correct
11 Correct 27 ms 61264 KB Output is correct
12 Correct 25 ms 60900 KB Output is correct
13 Correct 27 ms 61248 KB Output is correct
14 Correct 26 ms 61184 KB Output is correct
15 Correct 27 ms 61260 KB Output is correct
16 Correct 25 ms 61224 KB Output is correct
17 Correct 27 ms 61188 KB Output is correct
18 Correct 26 ms 61184 KB Output is correct
19 Correct 26 ms 61216 KB Output is correct
20 Correct 26 ms 61304 KB Output is correct
21 Correct 27 ms 61244 KB Output is correct
22 Correct 28 ms 61248 KB Output is correct
23 Correct 32 ms 61384 KB Output is correct
24 Correct 28 ms 61244 KB Output is correct
25 Correct 26 ms 61076 KB Output is correct
26 Correct 26 ms 61216 KB Output is correct
27 Correct 26 ms 61276 KB Output is correct
28 Correct 27 ms 61256 KB Output is correct
29 Correct 26 ms 61264 KB Output is correct
30 Correct 30 ms 61324 KB Output is correct
31 Correct 26 ms 61192 KB Output is correct
32 Correct 26 ms 61264 KB Output is correct
33 Correct 26 ms 61216 KB Output is correct
34 Correct 26 ms 61240 KB Output is correct
35 Correct 26 ms 61256 KB Output is correct
36 Correct 86 ms 70696 KB Output is correct
37 Correct 129 ms 75832 KB Output is correct
38 Correct 119 ms 75708 KB Output is correct
39 Correct 122 ms 76576 KB Output is correct
40 Correct 124 ms 76540 KB Output is correct
41 Correct 122 ms 76724 KB Output is correct
42 Correct 143 ms 76516 KB Output is correct
43 Correct 101 ms 75368 KB Output is correct
44 Correct 92 ms 74940 KB Output is correct
45 Correct 100 ms 75236 KB Output is correct
46 Correct 100 ms 74916 KB Output is correct
47 Correct 144 ms 75712 KB Output is correct
48 Correct 124 ms 76500 KB Output is correct
49 Correct 140 ms 76596 KB Output is correct
50 Correct 97 ms 74984 KB Output is correct
51 Correct 95 ms 75324 KB Output is correct
52 Correct 124 ms 75836 KB Output is correct
53 Correct 124 ms 76512 KB Output is correct
54 Correct 136 ms 76500 KB Output is correct
55 Correct 94 ms 74936 KB Output is correct
56 Correct 94 ms 75180 KB Output is correct
57 Correct 113 ms 75308 KB Output is correct
58 Correct 123 ms 75912 KB Output is correct
59 Correct 117 ms 75764 KB Output is correct
60 Correct 123 ms 76604 KB Output is correct
61 Correct 126 ms 76496 KB Output is correct
62 Correct 131 ms 76592 KB Output is correct
63 Correct 124 ms 76564 KB Output is correct
64 Correct 95 ms 75340 KB Output is correct
65 Correct 94 ms 74940 KB Output is correct
66 Correct 97 ms 75172 KB Output is correct
67 Correct 94 ms 75008 KB Output is correct
68 Correct 919 ms 75652 KB Output is correct
69 Correct 1022 ms 75704 KB Output is correct
70 Correct 1055 ms 75804 KB Output is correct
71 Correct 951 ms 76600 KB Output is correct
72 Correct 1077 ms 76604 KB Output is correct
73 Correct 1177 ms 76604 KB Output is correct
74 Correct 1141 ms 76580 KB Output is correct
75 Correct 1230 ms 75392 KB Output is correct
76 Correct 1171 ms 74948 KB Output is correct
77 Correct 1050 ms 75232 KB Output is correct
78 Correct 1052 ms 74920 KB Output is correct
79 Correct 1053 ms 75176 KB Output is correct
80 Correct 998 ms 74952 KB Output is correct
81 Correct 27 ms 60888 KB Output is correct
82 Correct 29 ms 61272 KB Output is correct
83 Correct 28 ms 61260 KB Output is correct
84 Correct 116 ms 75804 KB Output is correct
85 Correct 130 ms 76568 KB Output is correct
86 Correct 134 ms 76588 KB Output is correct
87 Correct 93 ms 75000 KB Output is correct
88 Correct 115 ms 75376 KB Output is correct
89 Correct 149 ms 75720 KB Output is correct
90 Correct 140 ms 76604 KB Output is correct
91 Correct 133 ms 76524 KB Output is correct
92 Correct 102 ms 74928 KB Output is correct
93 Correct 116 ms 75152 KB Output is correct
94 Correct 28 ms 61264 KB Output is correct
95 Correct 29 ms 61212 KB Output is correct
96 Correct 27 ms 61228 KB Output is correct
97 Correct 26 ms 61228 KB Output is correct
98 Correct 26 ms 61304 KB Output is correct
99 Correct 27 ms 61228 KB Output is correct
100 Correct 27 ms 61260 KB Output is correct
101 Correct 26 ms 61256 KB Output is correct
102 Correct 28 ms 61264 KB Output is correct
103 Correct 25 ms 61232 KB Output is correct
104 Correct 1004 ms 74188 KB Output is correct
105 Correct 1060 ms 75796 KB Output is correct
106 Correct 1195 ms 75836 KB Output is correct
107 Correct 1047 ms 76608 KB Output is correct
108 Correct 839 ms 76584 KB Output is correct
109 Correct 1080 ms 76600 KB Output is correct
110 Correct 1092 ms 76588 KB Output is correct
111 Correct 1081 ms 75348 KB Output is correct
112 Correct 984 ms 74948 KB Output is correct
113 Correct 997 ms 75068 KB Output is correct
114 Correct 965 ms 75012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 510 ms 69204 KB Output is correct
2 Correct 907 ms 75068 KB Output is correct
3 Correct 1071 ms 75072 KB Output is correct
4 Correct 933 ms 75328 KB Output is correct
5 Correct 1058 ms 75072 KB Output is correct
6 Correct 1026 ms 75068 KB Output is correct
7 Correct 1082 ms 74920 KB Output is correct
8 Correct 25 ms 61008 KB Output is correct
9 Correct 26 ms 61188 KB Output is correct
10 Correct 26 ms 61264 KB Output is correct
11 Correct 26 ms 60984 KB Output is correct
12 Correct 26 ms 61252 KB Output is correct
13 Correct 30 ms 61224 KB Output is correct
14 Correct 27 ms 61288 KB Output is correct
15 Correct 27 ms 61208 KB Output is correct
16 Correct 26 ms 61256 KB Output is correct
17 Correct 34 ms 61256 KB Output is correct
18 Correct 29 ms 61228 KB Output is correct
19 Correct 27 ms 61264 KB Output is correct
20 Correct 26 ms 61248 KB Output is correct
21 Correct 27 ms 61264 KB Output is correct
22 Correct 25 ms 60900 KB Output is correct
23 Correct 27 ms 61248 KB Output is correct
24 Correct 26 ms 61184 KB Output is correct
25 Correct 27 ms 61260 KB Output is correct
26 Correct 25 ms 61224 KB Output is correct
27 Correct 27 ms 61188 KB Output is correct
28 Correct 26 ms 61184 KB Output is correct
29 Correct 26 ms 61216 KB Output is correct
30 Correct 26 ms 61304 KB Output is correct
31 Correct 27 ms 61244 KB Output is correct
32 Correct 28 ms 61248 KB Output is correct
33 Correct 32 ms 61384 KB Output is correct
34 Correct 28 ms 61244 KB Output is correct
35 Correct 26 ms 61076 KB Output is correct
36 Correct 26 ms 61216 KB Output is correct
37 Correct 26 ms 61276 KB Output is correct
38 Correct 27 ms 61256 KB Output is correct
39 Correct 26 ms 61264 KB Output is correct
40 Correct 30 ms 61324 KB Output is correct
41 Correct 26 ms 61192 KB Output is correct
42 Correct 26 ms 61264 KB Output is correct
43 Correct 26 ms 61216 KB Output is correct
44 Correct 26 ms 61240 KB Output is correct
45 Correct 26 ms 61256 KB Output is correct
46 Correct 86 ms 70696 KB Output is correct
47 Correct 129 ms 75832 KB Output is correct
48 Correct 119 ms 75708 KB Output is correct
49 Correct 122 ms 76576 KB Output is correct
50 Correct 124 ms 76540 KB Output is correct
51 Correct 122 ms 76724 KB Output is correct
52 Correct 143 ms 76516 KB Output is correct
53 Correct 101 ms 75368 KB Output is correct
54 Correct 92 ms 74940 KB Output is correct
55 Correct 100 ms 75236 KB Output is correct
56 Correct 100 ms 74916 KB Output is correct
57 Correct 144 ms 75712 KB Output is correct
58 Correct 124 ms 76500 KB Output is correct
59 Correct 140 ms 76596 KB Output is correct
60 Correct 97 ms 74984 KB Output is correct
61 Correct 95 ms 75324 KB Output is correct
62 Correct 124 ms 75836 KB Output is correct
63 Correct 124 ms 76512 KB Output is correct
64 Correct 136 ms 76500 KB Output is correct
65 Correct 94 ms 74936 KB Output is correct
66 Correct 94 ms 75180 KB Output is correct
67 Correct 113 ms 75308 KB Output is correct
68 Correct 123 ms 75912 KB Output is correct
69 Correct 117 ms 75764 KB Output is correct
70 Correct 123 ms 76604 KB Output is correct
71 Correct 126 ms 76496 KB Output is correct
72 Correct 131 ms 76592 KB Output is correct
73 Correct 124 ms 76564 KB Output is correct
74 Correct 95 ms 75340 KB Output is correct
75 Correct 94 ms 74940 KB Output is correct
76 Correct 97 ms 75172 KB Output is correct
77 Correct 94 ms 75008 KB Output is correct
78 Correct 919 ms 75652 KB Output is correct
79 Correct 1022 ms 75704 KB Output is correct
80 Correct 1055 ms 75804 KB Output is correct
81 Correct 951 ms 76600 KB Output is correct
82 Correct 1077 ms 76604 KB Output is correct
83 Correct 1177 ms 76604 KB Output is correct
84 Correct 1141 ms 76580 KB Output is correct
85 Correct 1230 ms 75392 KB Output is correct
86 Correct 1171 ms 74948 KB Output is correct
87 Correct 1050 ms 75232 KB Output is correct
88 Correct 1052 ms 74920 KB Output is correct
89 Correct 1053 ms 75176 KB Output is correct
90 Correct 998 ms 74952 KB Output is correct
91 Correct 27 ms 60888 KB Output is correct
92 Correct 29 ms 61272 KB Output is correct
93 Correct 28 ms 61260 KB Output is correct
94 Correct 116 ms 75804 KB Output is correct
95 Correct 130 ms 76568 KB Output is correct
96 Correct 134 ms 76588 KB Output is correct
97 Correct 93 ms 75000 KB Output is correct
98 Correct 115 ms 75376 KB Output is correct
99 Correct 149 ms 75720 KB Output is correct
100 Correct 140 ms 76604 KB Output is correct
101 Correct 133 ms 76524 KB Output is correct
102 Correct 102 ms 74928 KB Output is correct
103 Correct 116 ms 75152 KB Output is correct
104 Correct 28 ms 61264 KB Output is correct
105 Correct 29 ms 61212 KB Output is correct
106 Correct 27 ms 61228 KB Output is correct
107 Correct 26 ms 61228 KB Output is correct
108 Correct 26 ms 61304 KB Output is correct
109 Correct 27 ms 61228 KB Output is correct
110 Correct 27 ms 61260 KB Output is correct
111 Correct 26 ms 61256 KB Output is correct
112 Correct 28 ms 61264 KB Output is correct
113 Correct 25 ms 61232 KB Output is correct
114 Correct 371 ms 64452 KB Output is correct
115 Correct 1119 ms 75772 KB Output is correct
116 Correct 1093 ms 75732 KB Output is correct
117 Correct 1088 ms 76576 KB Output is correct
118 Correct 1140 ms 76592 KB Output is correct
119 Correct 966 ms 76604 KB Output is correct
120 Correct 892 ms 76576 KB Output is correct
121 Correct 1111 ms 75364 KB Output is correct
122 Correct 913 ms 75040 KB Output is correct
123 Correct 861 ms 75140 KB Output is correct
124 Correct 935 ms 74924 KB Output is correct
125 Correct 123 ms 75836 KB Output is correct
126 Correct 137 ms 76552 KB Output is correct
127 Correct 135 ms 76580 KB Output is correct
128 Correct 95 ms 74952 KB Output is correct
129 Correct 105 ms 75152 KB Output is correct
130 Correct 125 ms 75304 KB Output is correct
131 Correct 129 ms 75836 KB Output is correct
132 Correct 121 ms 75744 KB Output is correct
133 Correct 128 ms 76544 KB Output is correct
134 Correct 161 ms 76516 KB Output is correct
135 Correct 135 ms 76580 KB Output is correct
136 Correct 141 ms 76580 KB Output is correct
137 Correct 96 ms 75324 KB Output is correct
138 Correct 104 ms 74944 KB Output is correct
139 Correct 98 ms 75180 KB Output is correct
140 Correct 99 ms 74996 KB Output is correct
141 Correct 28 ms 61348 KB Output is correct
142 Correct 29 ms 61264 KB Output is correct
143 Correct 32 ms 61288 KB Output is correct
144 Correct 27 ms 61264 KB Output is correct
145 Correct 28 ms 61264 KB Output is correct
146 Correct 28 ms 61044 KB Output is correct
147 Correct 33 ms 61220 KB Output is correct
148 Correct 35 ms 61232 KB Output is correct
149 Correct 30 ms 61208 KB Output is correct
150 Correct 28 ms 61268 KB Output is correct
151 Correct 27 ms 61252 KB Output is correct
152 Correct 27 ms 61256 KB Output is correct
153 Correct 28 ms 61228 KB Output is correct
154 Correct 28 ms 61264 KB Output is correct
155 Correct 28 ms 61264 KB Output is correct
156 Correct 28 ms 61264 KB Output is correct
157 Correct 1004 ms 74188 KB Output is correct
158 Correct 1060 ms 75796 KB Output is correct
159 Correct 1195 ms 75836 KB Output is correct
160 Correct 1047 ms 76608 KB Output is correct
161 Correct 839 ms 76584 KB Output is correct
162 Correct 1080 ms 76600 KB Output is correct
163 Correct 1092 ms 76588 KB Output is correct
164 Correct 1081 ms 75348 KB Output is correct
165 Correct 984 ms 74948 KB Output is correct
166 Correct 997 ms 75068 KB Output is correct
167 Correct 965 ms 75012 KB Output is correct
168 Correct 26 ms 60972 KB Output is correct
169 Correct 751 ms 66096 KB Output is correct
170 Correct 1257 ms 75836 KB Output is correct
171 Correct 1140 ms 75760 KB Output is correct
172 Correct 1250 ms 76504 KB Output is correct
173 Correct 1110 ms 76588 KB Output is correct
174 Correct 1255 ms 76532 KB Output is correct
175 Correct 1233 ms 76532 KB Output is correct
176 Correct 963 ms 75456 KB Output is correct
177 Correct 1028 ms 74976 KB Output is correct
178 Correct 1002 ms 75048 KB Output is correct
179 Correct 939 ms 74944 KB Output is correct