Submission #311153

# Submission time Handle Problem Language Result Execution time Memory
311153 2020-10-09T14:15:43 Z nikatamliani Interval Collection (CCO20_day2problem2) C++14
25 / 25
4764 ms 245252 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5, oo = 1e8, LEFT = 0, RIGHT = 1;
multiset < int > ms[2][N], L, R;
struct node{
    int maxL, minR, best;
    node() {
        maxL = -oo;
        minR = oo;
        best = 2 * oo;
    }
}tree[N * 4];
void merge(node &x, node &L, node &R) {
    x.maxL = max(L.maxL, R.maxL);
    x.minR = min(L.minR, R.minR);
    x.best = min({L.best, R.best, R.minR - L.maxL});
}
void update(int l, int r, int x, int val, int p, int TYPE) {
    if(l > x || r < x) return;
    if(l == r) {
        if(TYPE == LEFT) {
            tree[p].maxL = val;
        } else {
            tree[p].minR = val;
        }
        tree[p].best = tree[p].minR - tree[p].maxL;
    } else {
        int m = l + r >> 1;
        update(l, m, x, val, p << 1, TYPE);
        update(m + 1, r, x, val, p << 1 | 1, TYPE);
        merge(tree[p], tree[p << 1], tree[p << 1 | 1]);
    }
}
int main() {
    int q;
    cin >> q;
    multiset < pair < int, int > > m;
    for(int i = 1; i <= q; ++i) {
        int l, r;
        char t;
        cin >> t >> l >> r;
        if(t == 'R') {
            ms[0][l].erase(ms[0][l].find(r));
            ms[1][r].erase(ms[1][r].find(l));
            L.erase(L.find(l));
            R.erase(R.find(r));
            int lf = -oo, rg = oo;
            if(!ms[0][l].empty()) rg = *ms[0][l].begin();
            if(!ms[1][r].empty()) lf = *ms[1][r].rbegin();
            update(1, N - 1, l, rg, 1, RIGHT);
            update(1, N - 1, r, lf, 1, LEFT);
        } else {
            ms[0][l].insert(r);
            ms[1][r].insert(l);
            L.insert(l);
            R.insert(r);
            int lf, rg;
            if(!ms[0][l].empty()) rg = *ms[0][l].begin();
            if(!ms[1][r].empty()) lf = *ms[1][r].rbegin();
            update(1, N - 1, l, rg, 1, RIGHT);
            update(1, N - 1, r, lf, 1, LEFT);
        }
        int maxL = *L.rbegin(), minR = *R.begin();
        if(minR <= maxL) {
            cout << tree[1].best << '\n';
        } else {
            int ansL = -1, ansR = 1e9;
            ansR = *ms[0][maxL].begin();
            ansL = *ms[1][minR].rbegin();
            cout << ansR - ansL << '\n';
        }
    }
}

Compilation message

Main.cpp: In function 'void update(int, int, int, int, int, int)':
Main.cpp:28:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   28 |         int m = l + r >> 1;
      |                 ~~^~~
Main.cpp: In function 'int main()':
Main.cpp:60:19: warning: 'rg' may be used uninitialized in this function [-Wmaybe-uninitialized]
   60 |             update(1, N - 1, l, rg, 1, RIGHT);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:61:19: warning: 'lf' may be used uninitialized in this function [-Wmaybe-uninitialized]
   61 |             update(1, N - 1, r, lf, 1, LEFT);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 94 ms 141304 KB Output is correct
2 Correct 94 ms 141176 KB Output is correct
3 Correct 94 ms 141176 KB Output is correct
4 Correct 98 ms 141304 KB Output is correct
5 Correct 100 ms 141304 KB Output is correct
6 Correct 93 ms 141388 KB Output is correct
7 Correct 92 ms 141176 KB Output is correct
8 Correct 95 ms 141176 KB Output is correct
9 Correct 95 ms 141304 KB Output is correct
10 Correct 104 ms 141304 KB Output is correct
11 Correct 94 ms 141244 KB Output is correct
12 Correct 92 ms 141304 KB Output is correct
13 Correct 96 ms 141308 KB Output is correct
14 Correct 95 ms 141304 KB Output is correct
15 Correct 112 ms 141304 KB Output is correct
16 Correct 97 ms 141308 KB Output is correct
17 Correct 93 ms 141304 KB Output is correct
18 Correct 94 ms 141176 KB Output is correct
19 Correct 93 ms 141176 KB Output is correct
20 Correct 94 ms 141176 KB Output is correct
21 Correct 93 ms 141304 KB Output is correct
22 Correct 95 ms 141304 KB Output is correct
23 Correct 92 ms 141208 KB Output is correct
24 Correct 95 ms 141176 KB Output is correct
25 Correct 93 ms 141304 KB Output is correct
26 Correct 94 ms 141328 KB Output is correct
27 Correct 94 ms 141304 KB Output is correct
28 Correct 94 ms 141304 KB Output is correct
29 Correct 96 ms 141304 KB Output is correct
30 Correct 100 ms 141304 KB Output is correct
31 Correct 96 ms 141264 KB Output is correct
32 Correct 101 ms 141304 KB Output is correct
33 Correct 94 ms 141176 KB Output is correct
34 Correct 94 ms 141176 KB Output is correct
35 Correct 105 ms 141176 KB Output is correct
36 Correct 100 ms 141176 KB Output is correct
37 Correct 95 ms 141176 KB Output is correct
38 Correct 95 ms 141336 KB Output is correct
39 Correct 96 ms 141176 KB Output is correct
40 Correct 94 ms 141176 KB Output is correct
41 Correct 94 ms 141304 KB Output is correct
42 Correct 92 ms 141176 KB Output is correct
43 Correct 92 ms 141176 KB Output is correct
44 Correct 93 ms 141176 KB Output is correct
45 Correct 92 ms 141304 KB Output is correct
46 Correct 93 ms 141176 KB Output is correct
47 Correct 92 ms 141176 KB Output is correct
48 Correct 94 ms 141176 KB Output is correct
49 Correct 91 ms 141304 KB Output is correct
50 Correct 92 ms 141304 KB Output is correct
51 Correct 90 ms 141300 KB Output is correct
52 Correct 93 ms 141304 KB Output is correct
53 Correct 93 ms 141304 KB Output is correct
54 Correct 94 ms 141304 KB Output is correct
55 Correct 92 ms 141304 KB Output is correct
56 Correct 92 ms 141304 KB Output is correct
57 Correct 94 ms 141304 KB Output is correct
58 Correct 92 ms 141304 KB Output is correct
59 Correct 94 ms 141332 KB Output is correct
60 Correct 91 ms 141316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 94 ms 141304 KB Output is correct
2 Correct 94 ms 141176 KB Output is correct
3 Correct 94 ms 141176 KB Output is correct
4 Correct 98 ms 141304 KB Output is correct
5 Correct 100 ms 141304 KB Output is correct
6 Correct 93 ms 141388 KB Output is correct
7 Correct 92 ms 141176 KB Output is correct
8 Correct 95 ms 141176 KB Output is correct
9 Correct 95 ms 141304 KB Output is correct
10 Correct 104 ms 141304 KB Output is correct
11 Correct 94 ms 141244 KB Output is correct
12 Correct 92 ms 141304 KB Output is correct
13 Correct 96 ms 141308 KB Output is correct
14 Correct 95 ms 141304 KB Output is correct
15 Correct 112 ms 141304 KB Output is correct
16 Correct 97 ms 141308 KB Output is correct
17 Correct 93 ms 141304 KB Output is correct
18 Correct 94 ms 141176 KB Output is correct
19 Correct 93 ms 141176 KB Output is correct
20 Correct 94 ms 141176 KB Output is correct
21 Correct 93 ms 141304 KB Output is correct
22 Correct 95 ms 141304 KB Output is correct
23 Correct 92 ms 141208 KB Output is correct
24 Correct 95 ms 141176 KB Output is correct
25 Correct 93 ms 141304 KB Output is correct
26 Correct 94 ms 141328 KB Output is correct
27 Correct 94 ms 141304 KB Output is correct
28 Correct 94 ms 141304 KB Output is correct
29 Correct 96 ms 141304 KB Output is correct
30 Correct 100 ms 141304 KB Output is correct
31 Correct 96 ms 141264 KB Output is correct
32 Correct 101 ms 141304 KB Output is correct
33 Correct 94 ms 141176 KB Output is correct
34 Correct 94 ms 141176 KB Output is correct
35 Correct 105 ms 141176 KB Output is correct
36 Correct 100 ms 141176 KB Output is correct
37 Correct 95 ms 141176 KB Output is correct
38 Correct 95 ms 141336 KB Output is correct
39 Correct 96 ms 141176 KB Output is correct
40 Correct 94 ms 141176 KB Output is correct
41 Correct 94 ms 141304 KB Output is correct
42 Correct 92 ms 141176 KB Output is correct
43 Correct 92 ms 141176 KB Output is correct
44 Correct 93 ms 141176 KB Output is correct
45 Correct 92 ms 141304 KB Output is correct
46 Correct 93 ms 141176 KB Output is correct
47 Correct 92 ms 141176 KB Output is correct
48 Correct 94 ms 141176 KB Output is correct
49 Correct 91 ms 141304 KB Output is correct
50 Correct 92 ms 141304 KB Output is correct
51 Correct 90 ms 141300 KB Output is correct
52 Correct 93 ms 141304 KB Output is correct
53 Correct 93 ms 141304 KB Output is correct
54 Correct 94 ms 141304 KB Output is correct
55 Correct 92 ms 141304 KB Output is correct
56 Correct 92 ms 141304 KB Output is correct
57 Correct 94 ms 141304 KB Output is correct
58 Correct 92 ms 141304 KB Output is correct
59 Correct 94 ms 141332 KB Output is correct
60 Correct 91 ms 141316 KB Output is correct
61 Correct 91 ms 141176 KB Output is correct
62 Correct 91 ms 141176 KB Output is correct
63 Correct 90 ms 141176 KB Output is correct
64 Correct 169 ms 142616 KB Output is correct
65 Correct 160 ms 141688 KB Output is correct
66 Correct 157 ms 141492 KB Output is correct
67 Correct 154 ms 141432 KB Output is correct
68 Correct 170 ms 142584 KB Output is correct
69 Correct 160 ms 141712 KB Output is correct
70 Correct 158 ms 141688 KB Output is correct
71 Correct 154 ms 141560 KB Output is correct
72 Correct 179 ms 143224 KB Output is correct
73 Correct 180 ms 142840 KB Output is correct
74 Correct 171 ms 142840 KB Output is correct
75 Correct 174 ms 142840 KB Output is correct
76 Correct 175 ms 143736 KB Output is correct
77 Correct 217 ms 143736 KB Output is correct
78 Correct 175 ms 143736 KB Output is correct
79 Correct 173 ms 143736 KB Output is correct
80 Correct 169 ms 142584 KB Output is correct
81 Correct 160 ms 141688 KB Output is correct
82 Correct 156 ms 141432 KB Output is correct
83 Correct 149 ms 141560 KB Output is correct
84 Correct 180 ms 142584 KB Output is correct
85 Correct 169 ms 141692 KB Output is correct
86 Correct 159 ms 141536 KB Output is correct
87 Correct 161 ms 141560 KB Output is correct
88 Correct 182 ms 143348 KB Output is correct
89 Correct 169 ms 142840 KB Output is correct
90 Correct 169 ms 142840 KB Output is correct
91 Correct 169 ms 142840 KB Output is correct
92 Correct 172 ms 143736 KB Output is correct
93 Correct 174 ms 143736 KB Output is correct
94 Correct 173 ms 143736 KB Output is correct
95 Correct 171 ms 143760 KB Output is correct
96 Correct 155 ms 141432 KB Output is correct
97 Correct 152 ms 141764 KB Output is correct
98 Correct 151 ms 141460 KB Output is correct
99 Correct 153 ms 141560 KB Output is correct
100 Correct 159 ms 141560 KB Output is correct
101 Correct 156 ms 141432 KB Output is correct
102 Correct 153 ms 141432 KB Output is correct
103 Correct 154 ms 141436 KB Output is correct
104 Correct 169 ms 142712 KB Output is correct
105 Correct 159 ms 141688 KB Output is correct
106 Correct 156 ms 141540 KB Output is correct
107 Correct 154 ms 141432 KB Output is correct
108 Correct 166 ms 142712 KB Output is correct
109 Correct 162 ms 141816 KB Output is correct
110 Correct 153 ms 141432 KB Output is correct
111 Correct 151 ms 141560 KB Output is correct
112 Correct 151 ms 142584 KB Output is correct
113 Correct 156 ms 142584 KB Output is correct
114 Correct 151 ms 142584 KB Output is correct
115 Correct 157 ms 142584 KB Output is correct
116 Correct 152 ms 142712 KB Output is correct
117 Correct 156 ms 142712 KB Output is correct
118 Correct 151 ms 142556 KB Output is correct
119 Correct 155 ms 142644 KB Output is correct
120 Correct 151 ms 142540 KB Output is correct
121 Correct 161 ms 142572 KB Output is correct
122 Correct 157 ms 143652 KB Output is correct
123 Correct 158 ms 143608 KB Output is correct
124 Correct 147 ms 141688 KB Output is correct
125 Correct 143 ms 141560 KB Output is correct
126 Correct 145 ms 141432 KB Output is correct
127 Correct 149 ms 141944 KB Output is correct
128 Correct 143 ms 141560 KB Output is correct
129 Correct 144 ms 141484 KB Output is correct
130 Correct 154 ms 141944 KB Output is correct
131 Correct 145 ms 141560 KB Output is correct
132 Correct 141 ms 141432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 94 ms 141304 KB Output is correct
2 Correct 94 ms 141176 KB Output is correct
3 Correct 94 ms 141176 KB Output is correct
4 Correct 98 ms 141304 KB Output is correct
5 Correct 100 ms 141304 KB Output is correct
6 Correct 93 ms 141388 KB Output is correct
7 Correct 92 ms 141176 KB Output is correct
8 Correct 95 ms 141176 KB Output is correct
9 Correct 95 ms 141304 KB Output is correct
10 Correct 104 ms 141304 KB Output is correct
11 Correct 94 ms 141244 KB Output is correct
12 Correct 92 ms 141304 KB Output is correct
13 Correct 96 ms 141308 KB Output is correct
14 Correct 95 ms 141304 KB Output is correct
15 Correct 112 ms 141304 KB Output is correct
16 Correct 97 ms 141308 KB Output is correct
17 Correct 93 ms 141304 KB Output is correct
18 Correct 94 ms 141176 KB Output is correct
19 Correct 93 ms 141176 KB Output is correct
20 Correct 94 ms 141176 KB Output is correct
21 Correct 93 ms 141304 KB Output is correct
22 Correct 95 ms 141304 KB Output is correct
23 Correct 92 ms 141208 KB Output is correct
24 Correct 95 ms 141176 KB Output is correct
25 Correct 93 ms 141304 KB Output is correct
26 Correct 94 ms 141328 KB Output is correct
27 Correct 94 ms 141304 KB Output is correct
28 Correct 94 ms 141304 KB Output is correct
29 Correct 96 ms 141304 KB Output is correct
30 Correct 100 ms 141304 KB Output is correct
31 Correct 96 ms 141264 KB Output is correct
32 Correct 101 ms 141304 KB Output is correct
33 Correct 94 ms 141176 KB Output is correct
34 Correct 94 ms 141176 KB Output is correct
35 Correct 105 ms 141176 KB Output is correct
36 Correct 100 ms 141176 KB Output is correct
37 Correct 95 ms 141176 KB Output is correct
38 Correct 95 ms 141336 KB Output is correct
39 Correct 96 ms 141176 KB Output is correct
40 Correct 94 ms 141176 KB Output is correct
41 Correct 94 ms 141304 KB Output is correct
42 Correct 92 ms 141176 KB Output is correct
43 Correct 92 ms 141176 KB Output is correct
44 Correct 93 ms 141176 KB Output is correct
45 Correct 92 ms 141304 KB Output is correct
46 Correct 93 ms 141176 KB Output is correct
47 Correct 92 ms 141176 KB Output is correct
48 Correct 94 ms 141176 KB Output is correct
49 Correct 91 ms 141304 KB Output is correct
50 Correct 92 ms 141304 KB Output is correct
51 Correct 90 ms 141300 KB Output is correct
52 Correct 93 ms 141304 KB Output is correct
53 Correct 93 ms 141304 KB Output is correct
54 Correct 94 ms 141304 KB Output is correct
55 Correct 92 ms 141304 KB Output is correct
56 Correct 92 ms 141304 KB Output is correct
57 Correct 94 ms 141304 KB Output is correct
58 Correct 92 ms 141304 KB Output is correct
59 Correct 94 ms 141332 KB Output is correct
60 Correct 91 ms 141316 KB Output is correct
61 Correct 91 ms 141176 KB Output is correct
62 Correct 91 ms 141176 KB Output is correct
63 Correct 90 ms 141176 KB Output is correct
64 Correct 169 ms 142616 KB Output is correct
65 Correct 160 ms 141688 KB Output is correct
66 Correct 157 ms 141492 KB Output is correct
67 Correct 154 ms 141432 KB Output is correct
68 Correct 170 ms 142584 KB Output is correct
69 Correct 160 ms 141712 KB Output is correct
70 Correct 158 ms 141688 KB Output is correct
71 Correct 154 ms 141560 KB Output is correct
72 Correct 179 ms 143224 KB Output is correct
73 Correct 180 ms 142840 KB Output is correct
74 Correct 171 ms 142840 KB Output is correct
75 Correct 174 ms 142840 KB Output is correct
76 Correct 175 ms 143736 KB Output is correct
77 Correct 217 ms 143736 KB Output is correct
78 Correct 175 ms 143736 KB Output is correct
79 Correct 173 ms 143736 KB Output is correct
80 Correct 169 ms 142584 KB Output is correct
81 Correct 160 ms 141688 KB Output is correct
82 Correct 156 ms 141432 KB Output is correct
83 Correct 149 ms 141560 KB Output is correct
84 Correct 180 ms 142584 KB Output is correct
85 Correct 169 ms 141692 KB Output is correct
86 Correct 159 ms 141536 KB Output is correct
87 Correct 161 ms 141560 KB Output is correct
88 Correct 182 ms 143348 KB Output is correct
89 Correct 169 ms 142840 KB Output is correct
90 Correct 169 ms 142840 KB Output is correct
91 Correct 169 ms 142840 KB Output is correct
92 Correct 172 ms 143736 KB Output is correct
93 Correct 174 ms 143736 KB Output is correct
94 Correct 173 ms 143736 KB Output is correct
95 Correct 171 ms 143760 KB Output is correct
96 Correct 155 ms 141432 KB Output is correct
97 Correct 152 ms 141764 KB Output is correct
98 Correct 151 ms 141460 KB Output is correct
99 Correct 153 ms 141560 KB Output is correct
100 Correct 159 ms 141560 KB Output is correct
101 Correct 156 ms 141432 KB Output is correct
102 Correct 153 ms 141432 KB Output is correct
103 Correct 154 ms 141436 KB Output is correct
104 Correct 169 ms 142712 KB Output is correct
105 Correct 159 ms 141688 KB Output is correct
106 Correct 156 ms 141540 KB Output is correct
107 Correct 154 ms 141432 KB Output is correct
108 Correct 166 ms 142712 KB Output is correct
109 Correct 162 ms 141816 KB Output is correct
110 Correct 153 ms 141432 KB Output is correct
111 Correct 151 ms 141560 KB Output is correct
112 Correct 151 ms 142584 KB Output is correct
113 Correct 156 ms 142584 KB Output is correct
114 Correct 151 ms 142584 KB Output is correct
115 Correct 157 ms 142584 KB Output is correct
116 Correct 152 ms 142712 KB Output is correct
117 Correct 156 ms 142712 KB Output is correct
118 Correct 151 ms 142556 KB Output is correct
119 Correct 155 ms 142644 KB Output is correct
120 Correct 151 ms 142540 KB Output is correct
121 Correct 161 ms 142572 KB Output is correct
122 Correct 157 ms 143652 KB Output is correct
123 Correct 158 ms 143608 KB Output is correct
124 Correct 147 ms 141688 KB Output is correct
125 Correct 143 ms 141560 KB Output is correct
126 Correct 145 ms 141432 KB Output is correct
127 Correct 149 ms 141944 KB Output is correct
128 Correct 143 ms 141560 KB Output is correct
129 Correct 144 ms 141484 KB Output is correct
130 Correct 154 ms 141944 KB Output is correct
131 Correct 145 ms 141560 KB Output is correct
132 Correct 141 ms 141432 KB Output is correct
133 Correct 453 ms 147112 KB Output is correct
134 Correct 400 ms 143224 KB Output is correct
135 Correct 381 ms 142564 KB Output is correct
136 Correct 349 ms 142456 KB Output is correct
137 Correct 452 ms 147064 KB Output is correct
138 Correct 404 ms 143224 KB Output is correct
139 Correct 380 ms 142456 KB Output is correct
140 Correct 372 ms 142444 KB Output is correct
141 Correct 477 ms 149752 KB Output is correct
142 Correct 455 ms 148344 KB Output is correct
143 Correct 443 ms 147832 KB Output is correct
144 Correct 448 ms 148088 KB Output is correct
145 Correct 483 ms 151580 KB Output is correct
146 Correct 487 ms 151672 KB Output is correct
147 Correct 477 ms 151800 KB Output is correct
148 Correct 486 ms 151800 KB Output is correct
149 Correct 457 ms 146936 KB Output is correct
150 Correct 406 ms 143224 KB Output is correct
151 Correct 382 ms 142456 KB Output is correct
152 Correct 353 ms 142460 KB Output is correct
153 Correct 460 ms 146936 KB Output is correct
154 Correct 409 ms 143148 KB Output is correct
155 Correct 398 ms 142456 KB Output is correct
156 Correct 373 ms 142456 KB Output is correct
157 Correct 472 ms 149988 KB Output is correct
158 Correct 450 ms 148220 KB Output is correct
159 Correct 447 ms 147832 KB Output is correct
160 Correct 443 ms 147832 KB Output is correct
161 Correct 478 ms 151536 KB Output is correct
162 Correct 472 ms 151544 KB Output is correct
163 Correct 478 ms 151672 KB Output is correct
164 Correct 478 ms 151800 KB Output is correct
165 Correct 354 ms 142328 KB Output is correct
166 Correct 351 ms 142328 KB Output is correct
167 Correct 347 ms 142328 KB Output is correct
168 Correct 354 ms 142332 KB Output is correct
169 Correct 368 ms 142456 KB Output is correct
170 Correct 361 ms 142328 KB Output is correct
171 Correct 360 ms 142328 KB Output is correct
172 Correct 351 ms 142404 KB Output is correct
173 Correct 434 ms 146936 KB Output is correct
174 Correct 400 ms 143224 KB Output is correct
175 Correct 371 ms 142456 KB Output is correct
176 Correct 349 ms 142328 KB Output is correct
177 Correct 431 ms 146936 KB Output is correct
178 Correct 397 ms 143224 KB Output is correct
179 Correct 383 ms 142456 KB Output is correct
180 Correct 356 ms 142328 KB Output is correct
181 Correct 367 ms 147144 KB Output is correct
182 Correct 389 ms 147068 KB Output is correct
183 Correct 356 ms 147068 KB Output is correct
184 Correct 380 ms 146936 KB Output is correct
185 Correct 368 ms 147064 KB Output is correct
186 Correct 393 ms 147192 KB Output is correct
187 Correct 356 ms 147128 KB Output is correct
188 Correct 381 ms 146940 KB Output is correct
189 Correct 365 ms 146940 KB Output is correct
190 Correct 392 ms 146936 KB Output is correct
191 Correct 368 ms 151648 KB Output is correct
192 Correct 371 ms 151416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1193 ms 182024 KB Output is correct
2 Correct 1215 ms 182516 KB Output is correct
3 Correct 2306 ms 223424 KB Output is correct
4 Correct 2372 ms 223472 KB Output is correct
5 Correct 2876 ms 244092 KB Output is correct
6 Correct 2901 ms 243832 KB Output is correct
7 Correct 2903 ms 151904 KB Output is correct
8 Correct 2523 ms 149112 KB Output is correct
9 Correct 2518 ms 148716 KB Output is correct
10 Correct 3054 ms 155328 KB Output is correct
11 Correct 2535 ms 149112 KB Output is correct
12 Correct 2488 ms 148580 KB Output is correct
13 Correct 3061 ms 156664 KB Output is correct
14 Correct 2528 ms 149136 KB Output is correct
15 Correct 2486 ms 148728 KB Output is correct
16 Correct 2514 ms 149880 KB Output is correct
17 Correct 2476 ms 149908 KB Output is correct
18 Correct 2481 ms 149752 KB Output is correct
19 Correct 2461 ms 149756 KB Output is correct
20 Correct 2462 ms 149752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 94 ms 141304 KB Output is correct
2 Correct 94 ms 141176 KB Output is correct
3 Correct 94 ms 141176 KB Output is correct
4 Correct 98 ms 141304 KB Output is correct
5 Correct 100 ms 141304 KB Output is correct
6 Correct 93 ms 141388 KB Output is correct
7 Correct 92 ms 141176 KB Output is correct
8 Correct 95 ms 141176 KB Output is correct
9 Correct 95 ms 141304 KB Output is correct
10 Correct 104 ms 141304 KB Output is correct
11 Correct 94 ms 141244 KB Output is correct
12 Correct 92 ms 141304 KB Output is correct
13 Correct 96 ms 141308 KB Output is correct
14 Correct 95 ms 141304 KB Output is correct
15 Correct 112 ms 141304 KB Output is correct
16 Correct 97 ms 141308 KB Output is correct
17 Correct 93 ms 141304 KB Output is correct
18 Correct 94 ms 141176 KB Output is correct
19 Correct 93 ms 141176 KB Output is correct
20 Correct 94 ms 141176 KB Output is correct
21 Correct 93 ms 141304 KB Output is correct
22 Correct 95 ms 141304 KB Output is correct
23 Correct 92 ms 141208 KB Output is correct
24 Correct 95 ms 141176 KB Output is correct
25 Correct 93 ms 141304 KB Output is correct
26 Correct 94 ms 141328 KB Output is correct
27 Correct 94 ms 141304 KB Output is correct
28 Correct 94 ms 141304 KB Output is correct
29 Correct 96 ms 141304 KB Output is correct
30 Correct 100 ms 141304 KB Output is correct
31 Correct 96 ms 141264 KB Output is correct
32 Correct 101 ms 141304 KB Output is correct
33 Correct 94 ms 141176 KB Output is correct
34 Correct 94 ms 141176 KB Output is correct
35 Correct 105 ms 141176 KB Output is correct
36 Correct 100 ms 141176 KB Output is correct
37 Correct 95 ms 141176 KB Output is correct
38 Correct 95 ms 141336 KB Output is correct
39 Correct 96 ms 141176 KB Output is correct
40 Correct 94 ms 141176 KB Output is correct
41 Correct 94 ms 141304 KB Output is correct
42 Correct 92 ms 141176 KB Output is correct
43 Correct 92 ms 141176 KB Output is correct
44 Correct 93 ms 141176 KB Output is correct
45 Correct 92 ms 141304 KB Output is correct
46 Correct 93 ms 141176 KB Output is correct
47 Correct 92 ms 141176 KB Output is correct
48 Correct 94 ms 141176 KB Output is correct
49 Correct 91 ms 141304 KB Output is correct
50 Correct 92 ms 141304 KB Output is correct
51 Correct 90 ms 141300 KB Output is correct
52 Correct 93 ms 141304 KB Output is correct
53 Correct 93 ms 141304 KB Output is correct
54 Correct 94 ms 141304 KB Output is correct
55 Correct 92 ms 141304 KB Output is correct
56 Correct 92 ms 141304 KB Output is correct
57 Correct 94 ms 141304 KB Output is correct
58 Correct 92 ms 141304 KB Output is correct
59 Correct 94 ms 141332 KB Output is correct
60 Correct 91 ms 141316 KB Output is correct
61 Correct 91 ms 141176 KB Output is correct
62 Correct 91 ms 141176 KB Output is correct
63 Correct 90 ms 141176 KB Output is correct
64 Correct 169 ms 142616 KB Output is correct
65 Correct 160 ms 141688 KB Output is correct
66 Correct 157 ms 141492 KB Output is correct
67 Correct 154 ms 141432 KB Output is correct
68 Correct 170 ms 142584 KB Output is correct
69 Correct 160 ms 141712 KB Output is correct
70 Correct 158 ms 141688 KB Output is correct
71 Correct 154 ms 141560 KB Output is correct
72 Correct 179 ms 143224 KB Output is correct
73 Correct 180 ms 142840 KB Output is correct
74 Correct 171 ms 142840 KB Output is correct
75 Correct 174 ms 142840 KB Output is correct
76 Correct 175 ms 143736 KB Output is correct
77 Correct 217 ms 143736 KB Output is correct
78 Correct 175 ms 143736 KB Output is correct
79 Correct 173 ms 143736 KB Output is correct
80 Correct 169 ms 142584 KB Output is correct
81 Correct 160 ms 141688 KB Output is correct
82 Correct 156 ms 141432 KB Output is correct
83 Correct 149 ms 141560 KB Output is correct
84 Correct 180 ms 142584 KB Output is correct
85 Correct 169 ms 141692 KB Output is correct
86 Correct 159 ms 141536 KB Output is correct
87 Correct 161 ms 141560 KB Output is correct
88 Correct 182 ms 143348 KB Output is correct
89 Correct 169 ms 142840 KB Output is correct
90 Correct 169 ms 142840 KB Output is correct
91 Correct 169 ms 142840 KB Output is correct
92 Correct 172 ms 143736 KB Output is correct
93 Correct 174 ms 143736 KB Output is correct
94 Correct 173 ms 143736 KB Output is correct
95 Correct 171 ms 143760 KB Output is correct
96 Correct 155 ms 141432 KB Output is correct
97 Correct 152 ms 141764 KB Output is correct
98 Correct 151 ms 141460 KB Output is correct
99 Correct 153 ms 141560 KB Output is correct
100 Correct 159 ms 141560 KB Output is correct
101 Correct 156 ms 141432 KB Output is correct
102 Correct 153 ms 141432 KB Output is correct
103 Correct 154 ms 141436 KB Output is correct
104 Correct 169 ms 142712 KB Output is correct
105 Correct 159 ms 141688 KB Output is correct
106 Correct 156 ms 141540 KB Output is correct
107 Correct 154 ms 141432 KB Output is correct
108 Correct 166 ms 142712 KB Output is correct
109 Correct 162 ms 141816 KB Output is correct
110 Correct 153 ms 141432 KB Output is correct
111 Correct 151 ms 141560 KB Output is correct
112 Correct 151 ms 142584 KB Output is correct
113 Correct 156 ms 142584 KB Output is correct
114 Correct 151 ms 142584 KB Output is correct
115 Correct 157 ms 142584 KB Output is correct
116 Correct 152 ms 142712 KB Output is correct
117 Correct 156 ms 142712 KB Output is correct
118 Correct 151 ms 142556 KB Output is correct
119 Correct 155 ms 142644 KB Output is correct
120 Correct 151 ms 142540 KB Output is correct
121 Correct 161 ms 142572 KB Output is correct
122 Correct 157 ms 143652 KB Output is correct
123 Correct 158 ms 143608 KB Output is correct
124 Correct 147 ms 141688 KB Output is correct
125 Correct 143 ms 141560 KB Output is correct
126 Correct 145 ms 141432 KB Output is correct
127 Correct 149 ms 141944 KB Output is correct
128 Correct 143 ms 141560 KB Output is correct
129 Correct 144 ms 141484 KB Output is correct
130 Correct 154 ms 141944 KB Output is correct
131 Correct 145 ms 141560 KB Output is correct
132 Correct 141 ms 141432 KB Output is correct
133 Correct 453 ms 147112 KB Output is correct
134 Correct 400 ms 143224 KB Output is correct
135 Correct 381 ms 142564 KB Output is correct
136 Correct 349 ms 142456 KB Output is correct
137 Correct 452 ms 147064 KB Output is correct
138 Correct 404 ms 143224 KB Output is correct
139 Correct 380 ms 142456 KB Output is correct
140 Correct 372 ms 142444 KB Output is correct
141 Correct 477 ms 149752 KB Output is correct
142 Correct 455 ms 148344 KB Output is correct
143 Correct 443 ms 147832 KB Output is correct
144 Correct 448 ms 148088 KB Output is correct
145 Correct 483 ms 151580 KB Output is correct
146 Correct 487 ms 151672 KB Output is correct
147 Correct 477 ms 151800 KB Output is correct
148 Correct 486 ms 151800 KB Output is correct
149 Correct 457 ms 146936 KB Output is correct
150 Correct 406 ms 143224 KB Output is correct
151 Correct 382 ms 142456 KB Output is correct
152 Correct 353 ms 142460 KB Output is correct
153 Correct 460 ms 146936 KB Output is correct
154 Correct 409 ms 143148 KB Output is correct
155 Correct 398 ms 142456 KB Output is correct
156 Correct 373 ms 142456 KB Output is correct
157 Correct 472 ms 149988 KB Output is correct
158 Correct 450 ms 148220 KB Output is correct
159 Correct 447 ms 147832 KB Output is correct
160 Correct 443 ms 147832 KB Output is correct
161 Correct 478 ms 151536 KB Output is correct
162 Correct 472 ms 151544 KB Output is correct
163 Correct 478 ms 151672 KB Output is correct
164 Correct 478 ms 151800 KB Output is correct
165 Correct 354 ms 142328 KB Output is correct
166 Correct 351 ms 142328 KB Output is correct
167 Correct 347 ms 142328 KB Output is correct
168 Correct 354 ms 142332 KB Output is correct
169 Correct 368 ms 142456 KB Output is correct
170 Correct 361 ms 142328 KB Output is correct
171 Correct 360 ms 142328 KB Output is correct
172 Correct 351 ms 142404 KB Output is correct
173 Correct 434 ms 146936 KB Output is correct
174 Correct 400 ms 143224 KB Output is correct
175 Correct 371 ms 142456 KB Output is correct
176 Correct 349 ms 142328 KB Output is correct
177 Correct 431 ms 146936 KB Output is correct
178 Correct 397 ms 143224 KB Output is correct
179 Correct 383 ms 142456 KB Output is correct
180 Correct 356 ms 142328 KB Output is correct
181 Correct 367 ms 147144 KB Output is correct
182 Correct 389 ms 147068 KB Output is correct
183 Correct 356 ms 147068 KB Output is correct
184 Correct 380 ms 146936 KB Output is correct
185 Correct 368 ms 147064 KB Output is correct
186 Correct 393 ms 147192 KB Output is correct
187 Correct 356 ms 147128 KB Output is correct
188 Correct 381 ms 146940 KB Output is correct
189 Correct 365 ms 146940 KB Output is correct
190 Correct 392 ms 146936 KB Output is correct
191 Correct 368 ms 151648 KB Output is correct
192 Correct 371 ms 151416 KB Output is correct
193 Correct 1193 ms 182024 KB Output is correct
194 Correct 1215 ms 182516 KB Output is correct
195 Correct 2306 ms 223424 KB Output is correct
196 Correct 2372 ms 223472 KB Output is correct
197 Correct 2876 ms 244092 KB Output is correct
198 Correct 2901 ms 243832 KB Output is correct
199 Correct 2903 ms 151904 KB Output is correct
200 Correct 2523 ms 149112 KB Output is correct
201 Correct 2518 ms 148716 KB Output is correct
202 Correct 3054 ms 155328 KB Output is correct
203 Correct 2535 ms 149112 KB Output is correct
204 Correct 2488 ms 148580 KB Output is correct
205 Correct 3061 ms 156664 KB Output is correct
206 Correct 2528 ms 149136 KB Output is correct
207 Correct 2486 ms 148728 KB Output is correct
208 Correct 2514 ms 149880 KB Output is correct
209 Correct 2476 ms 149908 KB Output is correct
210 Correct 2481 ms 149752 KB Output is correct
211 Correct 2461 ms 149756 KB Output is correct
212 Correct 2462 ms 149752 KB Output is correct
213 Correct 4445 ms 197876 KB Output is correct
214 Correct 4000 ms 160644 KB Output is correct
215 Correct 3271 ms 152696 KB Output is correct
216 Correct 2779 ms 152312 KB Output is correct
217 Correct 4456 ms 198236 KB Output is correct
218 Correct 3971 ms 160912 KB Output is correct
219 Correct 3277 ms 152952 KB Output is correct
220 Correct 2866 ms 152056 KB Output is correct
221 Correct 4602 ms 226244 KB Output is correct
222 Correct 4511 ms 211224 KB Output is correct
223 Correct 4497 ms 207956 KB Output is correct
224 Correct 4446 ms 207472 KB Output is correct
225 Correct 4678 ms 245032 KB Output is correct
226 Correct 4702 ms 245096 KB Output is correct
227 Correct 4684 ms 245252 KB Output is correct
228 Correct 4651 ms 244984 KB Output is correct
229 Correct 4440 ms 197888 KB Output is correct
230 Correct 4000 ms 160480 KB Output is correct
231 Correct 3277 ms 152828 KB Output is correct
232 Correct 2742 ms 151928 KB Output is correct
233 Correct 4454 ms 198100 KB Output is correct
234 Correct 3967 ms 160604 KB Output is correct
235 Correct 3293 ms 152960 KB Output is correct
236 Correct 2881 ms 152020 KB Output is correct
237 Correct 4542 ms 225912 KB Output is correct
238 Correct 4487 ms 210940 KB Output is correct
239 Correct 4556 ms 207928 KB Output is correct
240 Correct 4525 ms 207096 KB Output is correct
241 Correct 4764 ms 244728 KB Output is correct
242 Correct 4723 ms 244572 KB Output is correct
243 Correct 4746 ms 244604 KB Output is correct
244 Correct 4712 ms 244344 KB Output is correct
245 Correct 2724 ms 152312 KB Output is correct
246 Correct 2660 ms 152312 KB Output is correct
247 Correct 2687 ms 152312 KB Output is correct
248 Correct 2646 ms 152312 KB Output is correct
249 Correct 2928 ms 152184 KB Output is correct
250 Correct 2928 ms 152056 KB Output is correct
251 Correct 2945 ms 152056 KB Output is correct
252 Correct 2783 ms 152312 KB Output is correct
253 Correct 4398 ms 197880 KB Output is correct
254 Correct 3828 ms 160784 KB Output is correct
255 Correct 3235 ms 152912 KB Output is correct
256 Correct 2844 ms 152312 KB Output is correct
257 Correct 4254 ms 197636 KB Output is correct
258 Correct 3844 ms 160232 KB Output is correct
259 Correct 3243 ms 152716 KB Output is correct
260 Correct 2768 ms 151456 KB Output is correct
261 Correct 3175 ms 198908 KB Output is correct
262 Correct 3748 ms 198904 KB Output is correct
263 Correct 2619 ms 198264 KB Output is correct
264 Correct 3204 ms 198176 KB Output is correct
265 Correct 3204 ms 199288 KB Output is correct
266 Correct 3688 ms 199288 KB Output is correct
267 Correct 2586 ms 198188 KB Output is correct
268 Correct 3119 ms 198284 KB Output is correct
269 Correct 2848 ms 243576 KB Output is correct
270 Correct 2910 ms 243664 KB Output is correct
271 Correct 2923 ms 152672 KB Output is correct
272 Correct 2528 ms 149400 KB Output is correct
273 Correct 3047 ms 156692 KB Output is correct
274 Correct 2542 ms 149116 KB Output is correct
275 Correct 2549 ms 197496 KB Output is correct