Submission #268391

# Submission time Handle Problem Language Result Execution time Memory
268391 2020-08-16T11:29:46 Z imeimi2000 Interval Collection (CCO20_day2problem2) C++17
25 / 25
1469 ms 198260 KB
#include <bits/stdc++.h>

using namespace std;

const int inf = 1e8, n = 1e6;
template <int X>
struct PQ {
    priority_queue<int> pq1, pq2;
    void push(int x) {
        pq1.push(x * X);
    }
    void pop(int x) {
        pq2.push(x * X);
        while (!pq2.empty() && pq1.top() == pq2.top()) {
            pq1.pop();
            pq2.pop();
        }
    }
    int top() {
        if (pq1.empty()) return -inf * X;
        return pq1.top() * X;
    }
};

const int sz = 1 << 20;
PQ<1> L[sz], Ls;
PQ<-1> R[sz], Rs;

struct node {
    int l, r, m;
    void init(int i) {
        l = L[i].top();
        r = R[i].top();
        m = r - l;
    }
    node operator+(const node &p) const {
        node ret;
        ret.l = max(l, p.l);
        ret.r = min(r, p.r);
        ret.m = min({ m, p.m, p.r - l });
        return ret;
    }
} seg[sz << 1];

void update(int i) {
    seg[i + sz].init(i);
    i += sz;
    while (i >>= 1) seg[i] = seg[i + i] + seg[i + i + 1];
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int q;
    cin >> q;
    for (int i = 0; i < sz; ++i) seg[i + sz].init(i);
    for (int i = sz; i--; ) seg[i] = seg[i + i] + seg[i + i + 1];
    while (q--) {
        char C[10];
        int l, r;
        cin >> C >> l >> r;
        if (C[0] == 'A') {
            Ls.push(l);
            Rs.push(r);
            L[r].push(l);
            R[l].push(r);
        }
        else {
            Ls.pop(l);
            Rs.pop(r);
            L[r].pop(l);
            R[l].pop(r);
        }
        update(l), update(r);
        if (Ls.top() < Rs.top()) {
            printf("%d\n", R[Ls.top()].top() - L[Rs.top()].top());
            continue;
        }
        printf("%d\n", seg[1].m);
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 106 ms 156280 KB Output is correct
2 Correct 109 ms 156292 KB Output is correct
3 Correct 115 ms 156416 KB Output is correct
4 Correct 110 ms 156280 KB Output is correct
5 Correct 109 ms 156280 KB Output is correct
6 Correct 116 ms 156280 KB Output is correct
7 Correct 113 ms 156380 KB Output is correct
8 Correct 116 ms 156280 KB Output is correct
9 Correct 112 ms 156280 KB Output is correct
10 Correct 129 ms 156280 KB Output is correct
11 Correct 113 ms 156280 KB Output is correct
12 Correct 126 ms 156408 KB Output is correct
13 Correct 129 ms 156352 KB Output is correct
14 Correct 152 ms 156284 KB Output is correct
15 Correct 160 ms 156280 KB Output is correct
16 Correct 138 ms 156408 KB Output is correct
17 Correct 115 ms 156280 KB Output is correct
18 Correct 225 ms 156280 KB Output is correct
19 Correct 114 ms 156280 KB Output is correct
20 Correct 114 ms 156280 KB Output is correct
21 Correct 126 ms 156408 KB Output is correct
22 Correct 117 ms 156376 KB Output is correct
23 Correct 119 ms 156284 KB Output is correct
24 Correct 117 ms 156440 KB Output is correct
25 Correct 134 ms 156280 KB Output is correct
26 Correct 134 ms 156388 KB Output is correct
27 Correct 134 ms 156280 KB Output is correct
28 Correct 123 ms 156280 KB Output is correct
29 Correct 117 ms 156284 KB Output is correct
30 Correct 120 ms 156280 KB Output is correct
31 Correct 114 ms 156280 KB Output is correct
32 Correct 133 ms 156280 KB Output is correct
33 Correct 115 ms 156280 KB Output is correct
34 Correct 111 ms 156312 KB Output is correct
35 Correct 116 ms 156280 KB Output is correct
36 Correct 108 ms 156280 KB Output is correct
37 Correct 116 ms 156284 KB Output is correct
38 Correct 163 ms 156384 KB Output is correct
39 Correct 131 ms 156392 KB Output is correct
40 Correct 120 ms 156280 KB Output is correct
41 Correct 113 ms 156280 KB Output is correct
42 Correct 111 ms 156280 KB Output is correct
43 Correct 109 ms 156280 KB Output is correct
44 Correct 156 ms 156412 KB Output is correct
45 Correct 136 ms 156536 KB Output is correct
46 Correct 117 ms 156364 KB Output is correct
47 Correct 119 ms 156256 KB Output is correct
48 Correct 118 ms 156344 KB Output is correct
49 Correct 118 ms 156280 KB Output is correct
50 Correct 127 ms 156280 KB Output is correct
51 Correct 129 ms 156328 KB Output is correct
52 Correct 116 ms 156280 KB Output is correct
53 Correct 127 ms 156280 KB Output is correct
54 Correct 113 ms 156280 KB Output is correct
55 Correct 109 ms 156280 KB Output is correct
56 Correct 115 ms 156280 KB Output is correct
57 Correct 122 ms 156296 KB Output is correct
58 Correct 123 ms 156280 KB Output is correct
59 Correct 119 ms 156384 KB Output is correct
60 Correct 137 ms 156408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 106 ms 156280 KB Output is correct
2 Correct 109 ms 156292 KB Output is correct
3 Correct 115 ms 156416 KB Output is correct
4 Correct 110 ms 156280 KB Output is correct
5 Correct 109 ms 156280 KB Output is correct
6 Correct 116 ms 156280 KB Output is correct
7 Correct 113 ms 156380 KB Output is correct
8 Correct 116 ms 156280 KB Output is correct
9 Correct 112 ms 156280 KB Output is correct
10 Correct 129 ms 156280 KB Output is correct
11 Correct 113 ms 156280 KB Output is correct
12 Correct 126 ms 156408 KB Output is correct
13 Correct 129 ms 156352 KB Output is correct
14 Correct 152 ms 156284 KB Output is correct
15 Correct 160 ms 156280 KB Output is correct
16 Correct 138 ms 156408 KB Output is correct
17 Correct 115 ms 156280 KB Output is correct
18 Correct 225 ms 156280 KB Output is correct
19 Correct 114 ms 156280 KB Output is correct
20 Correct 114 ms 156280 KB Output is correct
21 Correct 126 ms 156408 KB Output is correct
22 Correct 117 ms 156376 KB Output is correct
23 Correct 119 ms 156284 KB Output is correct
24 Correct 117 ms 156440 KB Output is correct
25 Correct 134 ms 156280 KB Output is correct
26 Correct 134 ms 156388 KB Output is correct
27 Correct 134 ms 156280 KB Output is correct
28 Correct 123 ms 156280 KB Output is correct
29 Correct 117 ms 156284 KB Output is correct
30 Correct 120 ms 156280 KB Output is correct
31 Correct 114 ms 156280 KB Output is correct
32 Correct 133 ms 156280 KB Output is correct
33 Correct 115 ms 156280 KB Output is correct
34 Correct 111 ms 156312 KB Output is correct
35 Correct 116 ms 156280 KB Output is correct
36 Correct 108 ms 156280 KB Output is correct
37 Correct 116 ms 156284 KB Output is correct
38 Correct 163 ms 156384 KB Output is correct
39 Correct 131 ms 156392 KB Output is correct
40 Correct 120 ms 156280 KB Output is correct
41 Correct 113 ms 156280 KB Output is correct
42 Correct 111 ms 156280 KB Output is correct
43 Correct 109 ms 156280 KB Output is correct
44 Correct 156 ms 156412 KB Output is correct
45 Correct 136 ms 156536 KB Output is correct
46 Correct 117 ms 156364 KB Output is correct
47 Correct 119 ms 156256 KB Output is correct
48 Correct 118 ms 156344 KB Output is correct
49 Correct 118 ms 156280 KB Output is correct
50 Correct 127 ms 156280 KB Output is correct
51 Correct 129 ms 156328 KB Output is correct
52 Correct 116 ms 156280 KB Output is correct
53 Correct 127 ms 156280 KB Output is correct
54 Correct 113 ms 156280 KB Output is correct
55 Correct 109 ms 156280 KB Output is correct
56 Correct 115 ms 156280 KB Output is correct
57 Correct 122 ms 156296 KB Output is correct
58 Correct 123 ms 156280 KB Output is correct
59 Correct 119 ms 156384 KB Output is correct
60 Correct 137 ms 156408 KB Output is correct
61 Correct 112 ms 156280 KB Output is correct
62 Correct 154 ms 156280 KB Output is correct
63 Correct 126 ms 156280 KB Output is correct
64 Correct 152 ms 157388 KB Output is correct
65 Correct 137 ms 157416 KB Output is correct
66 Correct 174 ms 157532 KB Output is correct
67 Correct 141 ms 157348 KB Output is correct
68 Correct 143 ms 157432 KB Output is correct
69 Correct 132 ms 157432 KB Output is correct
70 Correct 195 ms 157432 KB Output is correct
71 Correct 164 ms 157340 KB Output is correct
72 Correct 139 ms 157432 KB Output is correct
73 Correct 175 ms 157432 KB Output is correct
74 Correct 162 ms 157432 KB Output is correct
75 Correct 163 ms 157432 KB Output is correct
76 Correct 162 ms 157432 KB Output is correct
77 Correct 140 ms 157520 KB Output is correct
78 Correct 159 ms 157432 KB Output is correct
79 Correct 169 ms 157432 KB Output is correct
80 Correct 137 ms 157332 KB Output is correct
81 Correct 136 ms 157560 KB Output is correct
82 Correct 128 ms 157432 KB Output is correct
83 Correct 146 ms 157308 KB Output is correct
84 Correct 131 ms 157432 KB Output is correct
85 Correct 149 ms 157416 KB Output is correct
86 Correct 131 ms 157432 KB Output is correct
87 Correct 173 ms 157432 KB Output is correct
88 Correct 137 ms 157432 KB Output is correct
89 Correct 130 ms 157304 KB Output is correct
90 Correct 141 ms 157420 KB Output is correct
91 Correct 146 ms 157364 KB Output is correct
92 Correct 139 ms 157432 KB Output is correct
93 Correct 140 ms 157324 KB Output is correct
94 Correct 151 ms 157408 KB Output is correct
95 Correct 133 ms 157304 KB Output is correct
96 Correct 127 ms 157304 KB Output is correct
97 Correct 128 ms 157308 KB Output is correct
98 Correct 126 ms 157304 KB Output is correct
99 Correct 128 ms 157280 KB Output is correct
100 Correct 132 ms 157432 KB Output is correct
101 Correct 171 ms 157304 KB Output is correct
102 Correct 152 ms 157532 KB Output is correct
103 Correct 156 ms 157432 KB Output is correct
104 Correct 135 ms 157304 KB Output is correct
105 Correct 135 ms 157304 KB Output is correct
106 Correct 137 ms 157400 KB Output is correct
107 Correct 136 ms 157304 KB Output is correct
108 Correct 136 ms 157432 KB Output is correct
109 Correct 149 ms 157304 KB Output is correct
110 Correct 173 ms 157304 KB Output is correct
111 Correct 135 ms 157292 KB Output is correct
112 Correct 149 ms 157304 KB Output is correct
113 Correct 157 ms 157304 KB Output is correct
114 Correct 151 ms 157176 KB Output is correct
115 Correct 153 ms 157176 KB Output is correct
116 Correct 160 ms 157304 KB Output is correct
117 Correct 133 ms 157460 KB Output is correct
118 Correct 127 ms 157200 KB Output is correct
119 Correct 126 ms 157176 KB Output is correct
120 Correct 125 ms 157432 KB Output is correct
121 Correct 128 ms 157304 KB Output is correct
122 Correct 132 ms 157432 KB Output is correct
123 Correct 161 ms 157432 KB Output is correct
124 Correct 121 ms 157048 KB Output is correct
125 Correct 124 ms 156792 KB Output is correct
126 Correct 147 ms 156792 KB Output is correct
127 Correct 124 ms 157072 KB Output is correct
128 Correct 123 ms 156792 KB Output is correct
129 Correct 125 ms 156704 KB Output is correct
130 Correct 136 ms 157120 KB Output is correct
131 Correct 120 ms 156792 KB Output is correct
132 Correct 120 ms 156664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 106 ms 156280 KB Output is correct
2 Correct 109 ms 156292 KB Output is correct
3 Correct 115 ms 156416 KB Output is correct
4 Correct 110 ms 156280 KB Output is correct
5 Correct 109 ms 156280 KB Output is correct
6 Correct 116 ms 156280 KB Output is correct
7 Correct 113 ms 156380 KB Output is correct
8 Correct 116 ms 156280 KB Output is correct
9 Correct 112 ms 156280 KB Output is correct
10 Correct 129 ms 156280 KB Output is correct
11 Correct 113 ms 156280 KB Output is correct
12 Correct 126 ms 156408 KB Output is correct
13 Correct 129 ms 156352 KB Output is correct
14 Correct 152 ms 156284 KB Output is correct
15 Correct 160 ms 156280 KB Output is correct
16 Correct 138 ms 156408 KB Output is correct
17 Correct 115 ms 156280 KB Output is correct
18 Correct 225 ms 156280 KB Output is correct
19 Correct 114 ms 156280 KB Output is correct
20 Correct 114 ms 156280 KB Output is correct
21 Correct 126 ms 156408 KB Output is correct
22 Correct 117 ms 156376 KB Output is correct
23 Correct 119 ms 156284 KB Output is correct
24 Correct 117 ms 156440 KB Output is correct
25 Correct 134 ms 156280 KB Output is correct
26 Correct 134 ms 156388 KB Output is correct
27 Correct 134 ms 156280 KB Output is correct
28 Correct 123 ms 156280 KB Output is correct
29 Correct 117 ms 156284 KB Output is correct
30 Correct 120 ms 156280 KB Output is correct
31 Correct 114 ms 156280 KB Output is correct
32 Correct 133 ms 156280 KB Output is correct
33 Correct 115 ms 156280 KB Output is correct
34 Correct 111 ms 156312 KB Output is correct
35 Correct 116 ms 156280 KB Output is correct
36 Correct 108 ms 156280 KB Output is correct
37 Correct 116 ms 156284 KB Output is correct
38 Correct 163 ms 156384 KB Output is correct
39 Correct 131 ms 156392 KB Output is correct
40 Correct 120 ms 156280 KB Output is correct
41 Correct 113 ms 156280 KB Output is correct
42 Correct 111 ms 156280 KB Output is correct
43 Correct 109 ms 156280 KB Output is correct
44 Correct 156 ms 156412 KB Output is correct
45 Correct 136 ms 156536 KB Output is correct
46 Correct 117 ms 156364 KB Output is correct
47 Correct 119 ms 156256 KB Output is correct
48 Correct 118 ms 156344 KB Output is correct
49 Correct 118 ms 156280 KB Output is correct
50 Correct 127 ms 156280 KB Output is correct
51 Correct 129 ms 156328 KB Output is correct
52 Correct 116 ms 156280 KB Output is correct
53 Correct 127 ms 156280 KB Output is correct
54 Correct 113 ms 156280 KB Output is correct
55 Correct 109 ms 156280 KB Output is correct
56 Correct 115 ms 156280 KB Output is correct
57 Correct 122 ms 156296 KB Output is correct
58 Correct 123 ms 156280 KB Output is correct
59 Correct 119 ms 156384 KB Output is correct
60 Correct 137 ms 156408 KB Output is correct
61 Correct 112 ms 156280 KB Output is correct
62 Correct 154 ms 156280 KB Output is correct
63 Correct 126 ms 156280 KB Output is correct
64 Correct 152 ms 157388 KB Output is correct
65 Correct 137 ms 157416 KB Output is correct
66 Correct 174 ms 157532 KB Output is correct
67 Correct 141 ms 157348 KB Output is correct
68 Correct 143 ms 157432 KB Output is correct
69 Correct 132 ms 157432 KB Output is correct
70 Correct 195 ms 157432 KB Output is correct
71 Correct 164 ms 157340 KB Output is correct
72 Correct 139 ms 157432 KB Output is correct
73 Correct 175 ms 157432 KB Output is correct
74 Correct 162 ms 157432 KB Output is correct
75 Correct 163 ms 157432 KB Output is correct
76 Correct 162 ms 157432 KB Output is correct
77 Correct 140 ms 157520 KB Output is correct
78 Correct 159 ms 157432 KB Output is correct
79 Correct 169 ms 157432 KB Output is correct
80 Correct 137 ms 157332 KB Output is correct
81 Correct 136 ms 157560 KB Output is correct
82 Correct 128 ms 157432 KB Output is correct
83 Correct 146 ms 157308 KB Output is correct
84 Correct 131 ms 157432 KB Output is correct
85 Correct 149 ms 157416 KB Output is correct
86 Correct 131 ms 157432 KB Output is correct
87 Correct 173 ms 157432 KB Output is correct
88 Correct 137 ms 157432 KB Output is correct
89 Correct 130 ms 157304 KB Output is correct
90 Correct 141 ms 157420 KB Output is correct
91 Correct 146 ms 157364 KB Output is correct
92 Correct 139 ms 157432 KB Output is correct
93 Correct 140 ms 157324 KB Output is correct
94 Correct 151 ms 157408 KB Output is correct
95 Correct 133 ms 157304 KB Output is correct
96 Correct 127 ms 157304 KB Output is correct
97 Correct 128 ms 157308 KB Output is correct
98 Correct 126 ms 157304 KB Output is correct
99 Correct 128 ms 157280 KB Output is correct
100 Correct 132 ms 157432 KB Output is correct
101 Correct 171 ms 157304 KB Output is correct
102 Correct 152 ms 157532 KB Output is correct
103 Correct 156 ms 157432 KB Output is correct
104 Correct 135 ms 157304 KB Output is correct
105 Correct 135 ms 157304 KB Output is correct
106 Correct 137 ms 157400 KB Output is correct
107 Correct 136 ms 157304 KB Output is correct
108 Correct 136 ms 157432 KB Output is correct
109 Correct 149 ms 157304 KB Output is correct
110 Correct 173 ms 157304 KB Output is correct
111 Correct 135 ms 157292 KB Output is correct
112 Correct 149 ms 157304 KB Output is correct
113 Correct 157 ms 157304 KB Output is correct
114 Correct 151 ms 157176 KB Output is correct
115 Correct 153 ms 157176 KB Output is correct
116 Correct 160 ms 157304 KB Output is correct
117 Correct 133 ms 157460 KB Output is correct
118 Correct 127 ms 157200 KB Output is correct
119 Correct 126 ms 157176 KB Output is correct
120 Correct 125 ms 157432 KB Output is correct
121 Correct 128 ms 157304 KB Output is correct
122 Correct 132 ms 157432 KB Output is correct
123 Correct 161 ms 157432 KB Output is correct
124 Correct 121 ms 157048 KB Output is correct
125 Correct 124 ms 156792 KB Output is correct
126 Correct 147 ms 156792 KB Output is correct
127 Correct 124 ms 157072 KB Output is correct
128 Correct 123 ms 156792 KB Output is correct
129 Correct 125 ms 156704 KB Output is correct
130 Correct 136 ms 157120 KB Output is correct
131 Correct 120 ms 156792 KB Output is correct
132 Correct 120 ms 156664 KB Output is correct
133 Correct 209 ms 160784 KB Output is correct
134 Correct 298 ms 160760 KB Output is correct
135 Correct 205 ms 160888 KB Output is correct
136 Correct 199 ms 160504 KB Output is correct
137 Correct 258 ms 160756 KB Output is correct
138 Correct 251 ms 160824 KB Output is correct
139 Correct 226 ms 160792 KB Output is correct
140 Correct 232 ms 160888 KB Output is correct
141 Correct 238 ms 160752 KB Output is correct
142 Correct 239 ms 160732 KB Output is correct
143 Correct 217 ms 160752 KB Output is correct
144 Correct 204 ms 160752 KB Output is correct
145 Correct 204 ms 160628 KB Output is correct
146 Correct 202 ms 160628 KB Output is correct
147 Correct 203 ms 160624 KB Output is correct
148 Correct 211 ms 160856 KB Output is correct
149 Correct 213 ms 160608 KB Output is correct
150 Correct 206 ms 160632 KB Output is correct
151 Correct 201 ms 160760 KB Output is correct
152 Correct 210 ms 160504 KB Output is correct
153 Correct 216 ms 160644 KB Output is correct
154 Correct 195 ms 160632 KB Output is correct
155 Correct 190 ms 160760 KB Output is correct
156 Correct 192 ms 160632 KB Output is correct
157 Correct 251 ms 160624 KB Output is correct
158 Correct 221 ms 160752 KB Output is correct
159 Correct 207 ms 160624 KB Output is correct
160 Correct 199 ms 160628 KB Output is correct
161 Correct 208 ms 160548 KB Output is correct
162 Correct 250 ms 160652 KB Output is correct
163 Correct 206 ms 160624 KB Output is correct
164 Correct 230 ms 160672 KB Output is correct
165 Correct 183 ms 160504 KB Output is correct
166 Correct 192 ms 160632 KB Output is correct
167 Correct 186 ms 160632 KB Output is correct
168 Correct 220 ms 160520 KB Output is correct
169 Correct 205 ms 160836 KB Output is correct
170 Correct 200 ms 160632 KB Output is correct
171 Correct 242 ms 160504 KB Output is correct
172 Correct 189 ms 160504 KB Output is correct
173 Correct 202 ms 160880 KB Output is correct
174 Correct 222 ms 160632 KB Output is correct
175 Correct 227 ms 160632 KB Output is correct
176 Correct 211 ms 160480 KB Output is correct
177 Correct 203 ms 160760 KB Output is correct
178 Correct 205 ms 160632 KB Output is correct
179 Correct 202 ms 160504 KB Output is correct
180 Correct 194 ms 160636 KB Output is correct
181 Correct 196 ms 160816 KB Output is correct
182 Correct 184 ms 160716 KB Output is correct
183 Correct 160 ms 159992 KB Output is correct
184 Correct 176 ms 160248 KB Output is correct
185 Correct 167 ms 160940 KB Output is correct
186 Correct 192 ms 160756 KB Output is correct
187 Correct 162 ms 159992 KB Output is correct
188 Correct 179 ms 159992 KB Output is correct
189 Correct 171 ms 160756 KB Output is correct
190 Correct 183 ms 160756 KB Output is correct
191 Correct 156 ms 160752 KB Output is correct
192 Correct 164 ms 160624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 281 ms 173924 KB Output is correct
2 Correct 309 ms 173912 KB Output is correct
3 Correct 431 ms 191436 KB Output is correct
4 Correct 454 ms 191316 KB Output is correct
5 Correct 512 ms 198260 KB Output is correct
6 Correct 568 ms 197584 KB Output is correct
7 Correct 743 ms 175224 KB Output is correct
8 Correct 506 ms 168520 KB Output is correct
9 Correct 500 ms 168264 KB Output is correct
10 Correct 756 ms 176524 KB Output is correct
11 Correct 520 ms 168556 KB Output is correct
12 Correct 500 ms 168140 KB Output is correct
13 Correct 746 ms 176844 KB Output is correct
14 Correct 556 ms 168524 KB Output is correct
15 Correct 523 ms 168268 KB Output is correct
16 Correct 752 ms 181700 KB Output is correct
17 Correct 789 ms 181708 KB Output is correct
18 Correct 736 ms 182100 KB Output is correct
19 Correct 810 ms 181976 KB Output is correct
20 Correct 764 ms 182044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 106 ms 156280 KB Output is correct
2 Correct 109 ms 156292 KB Output is correct
3 Correct 115 ms 156416 KB Output is correct
4 Correct 110 ms 156280 KB Output is correct
5 Correct 109 ms 156280 KB Output is correct
6 Correct 116 ms 156280 KB Output is correct
7 Correct 113 ms 156380 KB Output is correct
8 Correct 116 ms 156280 KB Output is correct
9 Correct 112 ms 156280 KB Output is correct
10 Correct 129 ms 156280 KB Output is correct
11 Correct 113 ms 156280 KB Output is correct
12 Correct 126 ms 156408 KB Output is correct
13 Correct 129 ms 156352 KB Output is correct
14 Correct 152 ms 156284 KB Output is correct
15 Correct 160 ms 156280 KB Output is correct
16 Correct 138 ms 156408 KB Output is correct
17 Correct 115 ms 156280 KB Output is correct
18 Correct 225 ms 156280 KB Output is correct
19 Correct 114 ms 156280 KB Output is correct
20 Correct 114 ms 156280 KB Output is correct
21 Correct 126 ms 156408 KB Output is correct
22 Correct 117 ms 156376 KB Output is correct
23 Correct 119 ms 156284 KB Output is correct
24 Correct 117 ms 156440 KB Output is correct
25 Correct 134 ms 156280 KB Output is correct
26 Correct 134 ms 156388 KB Output is correct
27 Correct 134 ms 156280 KB Output is correct
28 Correct 123 ms 156280 KB Output is correct
29 Correct 117 ms 156284 KB Output is correct
30 Correct 120 ms 156280 KB Output is correct
31 Correct 114 ms 156280 KB Output is correct
32 Correct 133 ms 156280 KB Output is correct
33 Correct 115 ms 156280 KB Output is correct
34 Correct 111 ms 156312 KB Output is correct
35 Correct 116 ms 156280 KB Output is correct
36 Correct 108 ms 156280 KB Output is correct
37 Correct 116 ms 156284 KB Output is correct
38 Correct 163 ms 156384 KB Output is correct
39 Correct 131 ms 156392 KB Output is correct
40 Correct 120 ms 156280 KB Output is correct
41 Correct 113 ms 156280 KB Output is correct
42 Correct 111 ms 156280 KB Output is correct
43 Correct 109 ms 156280 KB Output is correct
44 Correct 156 ms 156412 KB Output is correct
45 Correct 136 ms 156536 KB Output is correct
46 Correct 117 ms 156364 KB Output is correct
47 Correct 119 ms 156256 KB Output is correct
48 Correct 118 ms 156344 KB Output is correct
49 Correct 118 ms 156280 KB Output is correct
50 Correct 127 ms 156280 KB Output is correct
51 Correct 129 ms 156328 KB Output is correct
52 Correct 116 ms 156280 KB Output is correct
53 Correct 127 ms 156280 KB Output is correct
54 Correct 113 ms 156280 KB Output is correct
55 Correct 109 ms 156280 KB Output is correct
56 Correct 115 ms 156280 KB Output is correct
57 Correct 122 ms 156296 KB Output is correct
58 Correct 123 ms 156280 KB Output is correct
59 Correct 119 ms 156384 KB Output is correct
60 Correct 137 ms 156408 KB Output is correct
61 Correct 112 ms 156280 KB Output is correct
62 Correct 154 ms 156280 KB Output is correct
63 Correct 126 ms 156280 KB Output is correct
64 Correct 152 ms 157388 KB Output is correct
65 Correct 137 ms 157416 KB Output is correct
66 Correct 174 ms 157532 KB Output is correct
67 Correct 141 ms 157348 KB Output is correct
68 Correct 143 ms 157432 KB Output is correct
69 Correct 132 ms 157432 KB Output is correct
70 Correct 195 ms 157432 KB Output is correct
71 Correct 164 ms 157340 KB Output is correct
72 Correct 139 ms 157432 KB Output is correct
73 Correct 175 ms 157432 KB Output is correct
74 Correct 162 ms 157432 KB Output is correct
75 Correct 163 ms 157432 KB Output is correct
76 Correct 162 ms 157432 KB Output is correct
77 Correct 140 ms 157520 KB Output is correct
78 Correct 159 ms 157432 KB Output is correct
79 Correct 169 ms 157432 KB Output is correct
80 Correct 137 ms 157332 KB Output is correct
81 Correct 136 ms 157560 KB Output is correct
82 Correct 128 ms 157432 KB Output is correct
83 Correct 146 ms 157308 KB Output is correct
84 Correct 131 ms 157432 KB Output is correct
85 Correct 149 ms 157416 KB Output is correct
86 Correct 131 ms 157432 KB Output is correct
87 Correct 173 ms 157432 KB Output is correct
88 Correct 137 ms 157432 KB Output is correct
89 Correct 130 ms 157304 KB Output is correct
90 Correct 141 ms 157420 KB Output is correct
91 Correct 146 ms 157364 KB Output is correct
92 Correct 139 ms 157432 KB Output is correct
93 Correct 140 ms 157324 KB Output is correct
94 Correct 151 ms 157408 KB Output is correct
95 Correct 133 ms 157304 KB Output is correct
96 Correct 127 ms 157304 KB Output is correct
97 Correct 128 ms 157308 KB Output is correct
98 Correct 126 ms 157304 KB Output is correct
99 Correct 128 ms 157280 KB Output is correct
100 Correct 132 ms 157432 KB Output is correct
101 Correct 171 ms 157304 KB Output is correct
102 Correct 152 ms 157532 KB Output is correct
103 Correct 156 ms 157432 KB Output is correct
104 Correct 135 ms 157304 KB Output is correct
105 Correct 135 ms 157304 KB Output is correct
106 Correct 137 ms 157400 KB Output is correct
107 Correct 136 ms 157304 KB Output is correct
108 Correct 136 ms 157432 KB Output is correct
109 Correct 149 ms 157304 KB Output is correct
110 Correct 173 ms 157304 KB Output is correct
111 Correct 135 ms 157292 KB Output is correct
112 Correct 149 ms 157304 KB Output is correct
113 Correct 157 ms 157304 KB Output is correct
114 Correct 151 ms 157176 KB Output is correct
115 Correct 153 ms 157176 KB Output is correct
116 Correct 160 ms 157304 KB Output is correct
117 Correct 133 ms 157460 KB Output is correct
118 Correct 127 ms 157200 KB Output is correct
119 Correct 126 ms 157176 KB Output is correct
120 Correct 125 ms 157432 KB Output is correct
121 Correct 128 ms 157304 KB Output is correct
122 Correct 132 ms 157432 KB Output is correct
123 Correct 161 ms 157432 KB Output is correct
124 Correct 121 ms 157048 KB Output is correct
125 Correct 124 ms 156792 KB Output is correct
126 Correct 147 ms 156792 KB Output is correct
127 Correct 124 ms 157072 KB Output is correct
128 Correct 123 ms 156792 KB Output is correct
129 Correct 125 ms 156704 KB Output is correct
130 Correct 136 ms 157120 KB Output is correct
131 Correct 120 ms 156792 KB Output is correct
132 Correct 120 ms 156664 KB Output is correct
133 Correct 209 ms 160784 KB Output is correct
134 Correct 298 ms 160760 KB Output is correct
135 Correct 205 ms 160888 KB Output is correct
136 Correct 199 ms 160504 KB Output is correct
137 Correct 258 ms 160756 KB Output is correct
138 Correct 251 ms 160824 KB Output is correct
139 Correct 226 ms 160792 KB Output is correct
140 Correct 232 ms 160888 KB Output is correct
141 Correct 238 ms 160752 KB Output is correct
142 Correct 239 ms 160732 KB Output is correct
143 Correct 217 ms 160752 KB Output is correct
144 Correct 204 ms 160752 KB Output is correct
145 Correct 204 ms 160628 KB Output is correct
146 Correct 202 ms 160628 KB Output is correct
147 Correct 203 ms 160624 KB Output is correct
148 Correct 211 ms 160856 KB Output is correct
149 Correct 213 ms 160608 KB Output is correct
150 Correct 206 ms 160632 KB Output is correct
151 Correct 201 ms 160760 KB Output is correct
152 Correct 210 ms 160504 KB Output is correct
153 Correct 216 ms 160644 KB Output is correct
154 Correct 195 ms 160632 KB Output is correct
155 Correct 190 ms 160760 KB Output is correct
156 Correct 192 ms 160632 KB Output is correct
157 Correct 251 ms 160624 KB Output is correct
158 Correct 221 ms 160752 KB Output is correct
159 Correct 207 ms 160624 KB Output is correct
160 Correct 199 ms 160628 KB Output is correct
161 Correct 208 ms 160548 KB Output is correct
162 Correct 250 ms 160652 KB Output is correct
163 Correct 206 ms 160624 KB Output is correct
164 Correct 230 ms 160672 KB Output is correct
165 Correct 183 ms 160504 KB Output is correct
166 Correct 192 ms 160632 KB Output is correct
167 Correct 186 ms 160632 KB Output is correct
168 Correct 220 ms 160520 KB Output is correct
169 Correct 205 ms 160836 KB Output is correct
170 Correct 200 ms 160632 KB Output is correct
171 Correct 242 ms 160504 KB Output is correct
172 Correct 189 ms 160504 KB Output is correct
173 Correct 202 ms 160880 KB Output is correct
174 Correct 222 ms 160632 KB Output is correct
175 Correct 227 ms 160632 KB Output is correct
176 Correct 211 ms 160480 KB Output is correct
177 Correct 203 ms 160760 KB Output is correct
178 Correct 205 ms 160632 KB Output is correct
179 Correct 202 ms 160504 KB Output is correct
180 Correct 194 ms 160636 KB Output is correct
181 Correct 196 ms 160816 KB Output is correct
182 Correct 184 ms 160716 KB Output is correct
183 Correct 160 ms 159992 KB Output is correct
184 Correct 176 ms 160248 KB Output is correct
185 Correct 167 ms 160940 KB Output is correct
186 Correct 192 ms 160756 KB Output is correct
187 Correct 162 ms 159992 KB Output is correct
188 Correct 179 ms 159992 KB Output is correct
189 Correct 171 ms 160756 KB Output is correct
190 Correct 183 ms 160756 KB Output is correct
191 Correct 156 ms 160752 KB Output is correct
192 Correct 164 ms 160624 KB Output is correct
193 Correct 281 ms 173924 KB Output is correct
194 Correct 309 ms 173912 KB Output is correct
195 Correct 431 ms 191436 KB Output is correct
196 Correct 454 ms 191316 KB Output is correct
197 Correct 512 ms 198260 KB Output is correct
198 Correct 568 ms 197584 KB Output is correct
199 Correct 743 ms 175224 KB Output is correct
200 Correct 506 ms 168520 KB Output is correct
201 Correct 500 ms 168264 KB Output is correct
202 Correct 756 ms 176524 KB Output is correct
203 Correct 520 ms 168556 KB Output is correct
204 Correct 500 ms 168140 KB Output is correct
205 Correct 746 ms 176844 KB Output is correct
206 Correct 556 ms 168524 KB Output is correct
207 Correct 523 ms 168268 KB Output is correct
208 Correct 752 ms 181700 KB Output is correct
209 Correct 789 ms 181708 KB Output is correct
210 Correct 736 ms 182100 KB Output is correct
211 Correct 810 ms 181976 KB Output is correct
212 Correct 764 ms 182044 KB Output is correct
213 Correct 1369 ms 191364 KB Output is correct
214 Correct 1181 ms 192412 KB Output is correct
215 Correct 1248 ms 192752 KB Output is correct
216 Correct 1109 ms 192864 KB Output is correct
217 Correct 1423 ms 190456 KB Output is correct
218 Correct 1431 ms 191612 KB Output is correct
219 Correct 1372 ms 191696 KB Output is correct
220 Correct 1136 ms 192064 KB Output is correct
221 Correct 1252 ms 188576 KB Output is correct
222 Correct 1409 ms 189408 KB Output is correct
223 Correct 1427 ms 189460 KB Output is correct
224 Correct 1264 ms 189352 KB Output is correct
225 Correct 1244 ms 188500 KB Output is correct
226 Correct 1207 ms 188636 KB Output is correct
227 Correct 1161 ms 186836 KB Output is correct
228 Correct 1434 ms 186612 KB Output is correct
229 Correct 1244 ms 188564 KB Output is correct
230 Correct 1146 ms 188016 KB Output is correct
231 Correct 1187 ms 188604 KB Output is correct
232 Correct 1072 ms 188180 KB Output is correct
233 Correct 1244 ms 187352 KB Output is correct
234 Correct 1129 ms 188120 KB Output is correct
235 Correct 1137 ms 188360 KB Output is correct
236 Correct 1094 ms 188232 KB Output is correct
237 Correct 1163 ms 186068 KB Output is correct
238 Correct 1175 ms 186740 KB Output is correct
239 Correct 1114 ms 187152 KB Output is correct
240 Correct 1155 ms 186732 KB Output is correct
241 Correct 1186 ms 184352 KB Output is correct
242 Correct 1372 ms 183764 KB Output is correct
243 Correct 1098 ms 183768 KB Output is correct
244 Correct 1170 ms 183676 KB Output is correct
245 Correct 960 ms 186288 KB Output is correct
246 Correct 946 ms 186136 KB Output is correct
247 Correct 946 ms 186104 KB Output is correct
248 Correct 926 ms 186196 KB Output is correct
249 Correct 1059 ms 186852 KB Output is correct
250 Correct 1155 ms 188176 KB Output is correct
251 Correct 1136 ms 189192 KB Output is correct
252 Correct 1016 ms 186232 KB Output is correct
253 Correct 1469 ms 188092 KB Output is correct
254 Correct 1192 ms 187052 KB Output is correct
255 Correct 1286 ms 185580 KB Output is correct
256 Correct 1064 ms 185580 KB Output is correct
257 Correct 1377 ms 188120 KB Output is correct
258 Correct 1241 ms 187056 KB Output is correct
259 Correct 1267 ms 185536 KB Output is correct
260 Correct 1041 ms 185592 KB Output is correct
261 Correct 882 ms 191564 KB Output is correct
262 Correct 1113 ms 191664 KB Output is correct
263 Correct 561 ms 179284 KB Output is correct
264 Correct 934 ms 179620 KB Output is correct
265 Correct 728 ms 191696 KB Output is correct
266 Correct 1010 ms 191648 KB Output is correct
267 Correct 553 ms 179360 KB Output is correct
268 Correct 983 ms 179280 KB Output is correct
269 Correct 538 ms 193152 KB Output is correct
270 Correct 563 ms 193104 KB Output is correct
271 Correct 828 ms 170696 KB Output is correct
272 Correct 732 ms 163620 KB Output is correct
273 Correct 718 ms 172488 KB Output is correct
274 Correct 538 ms 163360 KB Output is correct
275 Correct 522 ms 164244 KB Output is correct