답안 #319492

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
319492 2020-11-05T12:01:22 Z VEGAnn 벽 칠하기 (APIO20_paint) C++14
100 / 100
1198 ms 32740 KB
#include "paint.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ft first
using namespace std;
using namespace __gnu_pbds;
const int M = 50100;
const int N = 100100;
const int K = 100100;
const int oo = 2e9;
gp_hash_table<int, bool> inside[K];
int f[N], cnt[M], st[4 * N];

void build(int v, int l, int r){
    if (l == r){
        st[v] = f[l];
        return;
    }

    int md = (l + r) >> 1;

    build(v + v, l, md);
    build(v + v + 1, md + 1, r);

    st[v] = min(st[v + v], st[v + v + 1]);
}

int get(int v, int tl, int tr, int l, int r){
    if (l > r) return oo;

    if (tl == l && tr == r) return st[v];

    int md = (tl + tr) >> 1;

    return min(get(v + v, tl, md, l, min(r, md)),
               get(v + v + 1, md + 1, tr, max(md + 1, l), r));
}

void update(int v, int l, int r, int ps){
    if (l == r){
        st[v] = f[l];
        return;
    }

    int md = (l + r) >> 1;

    if (ps <= md)
        update(v + v, l, md, ps);
    else update(v + v + 1, md + 1, r, ps);

    st[v] = min(st[v + v], st[v + v + 1]);
}

int minimumInstructions(int n, int m, int k, std::vector<int> C,
                         std::vector<int> A, std::vector<std::vector<int>> B) {

    for (int i = 0; i < m; i++)
    for (int j = 0; j < A[i]; j++)
        inside[B[i][j]][i] = 1;

    int ptr = 0;

    for (int i = n - 1; i > n - m; i--){
        for (auto cr : inside[C[i]]){
            int loc = (ptr + cr.ft);

            if (loc >= m)
                loc -= m;

            cnt[loc]++;
        }

        ptr++;

        if (ptr == m) ptr = 0;
    }

    f[n] = 0;

    fill(f, f + n, oo);

    build(1, 0, n);

    for (int i = n - m; i >= 0; i--){
        int mn = get(1, 0, n, i + 1, i + m);

        if (mn == oo) break;

        if (i + m < n){
            for (auto cr : inside[C[i + m]]){
                int loc = (ptr + cr.ft);

                if (loc >= m)
                    loc -= m;

                cnt[loc]--;
            }
        }

        bool ok = 0;

        for (auto cr : inside[C[i]]){
            int loc = (ptr + cr.ft);

            if (loc >= m)
                loc -= m;

            cnt[loc]++;

            if (cnt[loc] == m) ok = 1;
        }

        if (ok) {
            f[i] = mn + 1;
            update(1, 0, n, i);
        }

        ptr++;

        if (ptr == m) ptr = 0;
    }

    return (f[0] == oo ? -1 : f[0]);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 21496 KB Output is correct
2 Correct 25 ms 21484 KB Output is correct
3 Correct 24 ms 21484 KB Output is correct
4 Correct 27 ms 21476 KB Output is correct
5 Correct 25 ms 21484 KB Output is correct
6 Correct 24 ms 21484 KB Output is correct
7 Correct 24 ms 21484 KB Output is correct
8 Correct 24 ms 21484 KB Output is correct
9 Correct 24 ms 21484 KB Output is correct
10 Correct 23 ms 21484 KB Output is correct
11 Correct 24 ms 21484 KB Output is correct
12 Correct 24 ms 21612 KB Output is correct
13 Correct 24 ms 21484 KB Output is correct
14 Correct 24 ms 21484 KB Output is correct
15 Correct 24 ms 21484 KB Output is correct
16 Correct 24 ms 21484 KB Output is correct
17 Correct 24 ms 21612 KB Output is correct
18 Correct 24 ms 21484 KB Output is correct
19 Correct 25 ms 21484 KB Output is correct
20 Correct 24 ms 21612 KB Output is correct
21 Correct 24 ms 21484 KB Output is correct
22 Correct 60 ms 22372 KB Output is correct
23 Correct 63 ms 22244 KB Output is correct
24 Correct 60 ms 22372 KB Output is correct
25 Correct 33 ms 21996 KB Output is correct
26 Correct 32 ms 21996 KB Output is correct
27 Correct 26 ms 22124 KB Output is correct
28 Correct 26 ms 21996 KB Output is correct
29 Correct 26 ms 21996 KB Output is correct
30 Correct 27 ms 22120 KB Output is correct
31 Correct 50 ms 22244 KB Output is correct
32 Correct 50 ms 22252 KB Output is correct
33 Correct 49 ms 22252 KB Output is correct
34 Correct 51 ms 22244 KB Output is correct
35 Correct 49 ms 22244 KB Output is correct
36 Correct 49 ms 22244 KB Output is correct
37 Correct 65 ms 23044 KB Output is correct
38 Correct 65 ms 23012 KB Output is correct
39 Correct 65 ms 22884 KB Output is correct
40 Correct 69 ms 23524 KB Output is correct
41 Correct 49 ms 22872 KB Output is correct
42 Correct 35 ms 23652 KB Output is correct
43 Correct 31 ms 22764 KB Output is correct
44 Correct 31 ms 22756 KB Output is correct
45 Correct 36 ms 23660 KB Output is correct
46 Correct 131 ms 29284 KB Output is correct
47 Correct 92 ms 26212 KB Output is correct
48 Correct 85 ms 28772 KB Output is correct
49 Correct 84 ms 28420 KB Output is correct
50 Correct 83 ms 28516 KB Output is correct
51 Correct 69 ms 26692 KB Output is correct
52 Correct 69 ms 23916 KB Output is correct
53 Correct 69 ms 24036 KB Output is correct
54 Correct 35 ms 23908 KB Output is correct
55 Correct 35 ms 24036 KB Output is correct
56 Correct 36 ms 23912 KB Output is correct
57 Correct 39 ms 23916 KB Output is correct
58 Correct 156 ms 30820 KB Output is correct
59 Correct 158 ms 30820 KB Output is correct
60 Correct 158 ms 30820 KB Output is correct
61 Correct 154 ms 30820 KB Output is correct
62 Correct 153 ms 30820 KB Output is correct
63 Correct 163 ms 30948 KB Output is correct
64 Correct 97 ms 30180 KB Output is correct
65 Correct 100 ms 30180 KB Output is correct
66 Correct 102 ms 30180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 21484 KB Output is correct
2 Correct 24 ms 21612 KB Output is correct
3 Correct 24 ms 21496 KB Output is correct
4 Correct 25 ms 21484 KB Output is correct
5 Correct 24 ms 21484 KB Output is correct
6 Correct 27 ms 21476 KB Output is correct
7 Correct 25 ms 21484 KB Output is correct
8 Correct 24 ms 21484 KB Output is correct
9 Correct 24 ms 21484 KB Output is correct
10 Correct 24 ms 21484 KB Output is correct
11 Correct 24 ms 21484 KB Output is correct
12 Correct 23 ms 21484 KB Output is correct
13 Correct 24 ms 21484 KB Output is correct
14 Correct 24 ms 21612 KB Output is correct
15 Correct 24 ms 21484 KB Output is correct
16 Correct 24 ms 21484 KB Output is correct
17 Correct 24 ms 21484 KB Output is correct
18 Correct 24 ms 21484 KB Output is correct
19 Correct 24 ms 21612 KB Output is correct
20 Correct 24 ms 21484 KB Output is correct
21 Correct 25 ms 21484 KB Output is correct
22 Correct 24 ms 21612 KB Output is correct
23 Correct 24 ms 21484 KB Output is correct
24 Correct 24 ms 21484 KB Output is correct
25 Correct 24 ms 21484 KB Output is correct
26 Correct 24 ms 21612 KB Output is correct
27 Correct 24 ms 21484 KB Output is correct
28 Correct 25 ms 21516 KB Output is correct
29 Correct 24 ms 21484 KB Output is correct
30 Correct 24 ms 21484 KB Output is correct
31 Correct 24 ms 21516 KB Output is correct
32 Correct 24 ms 21612 KB Output is correct
33 Correct 24 ms 21476 KB Output is correct
34 Correct 24 ms 21484 KB Output is correct
35 Correct 24 ms 21612 KB Output is correct
36 Correct 24 ms 21484 KB Output is correct
37 Correct 26 ms 21476 KB Output is correct
38 Correct 24 ms 21484 KB Output is correct
39 Correct 24 ms 21484 KB Output is correct
40 Correct 24 ms 21484 KB Output is correct
41 Correct 24 ms 21484 KB Output is correct
42 Correct 24 ms 21484 KB Output is correct
43 Correct 27 ms 21484 KB Output is correct
44 Correct 24 ms 21612 KB Output is correct
45 Correct 24 ms 21484 KB Output is correct
46 Correct 24 ms 21484 KB Output is correct
47 Correct 24 ms 21484 KB Output is correct
48 Correct 23 ms 21612 KB Output is correct
49 Correct 24 ms 21612 KB Output is correct
50 Correct 24 ms 21484 KB Output is correct
51 Correct 25 ms 21484 KB Output is correct
52 Correct 24 ms 21484 KB Output is correct
53 Correct 24 ms 21484 KB Output is correct
54 Correct 24 ms 21484 KB Output is correct
55 Correct 24 ms 21484 KB Output is correct
56 Correct 24 ms 21612 KB Output is correct
57 Correct 24 ms 21608 KB Output is correct
58 Correct 28 ms 21740 KB Output is correct
59 Correct 24 ms 21484 KB Output is correct
60 Correct 24 ms 21484 KB Output is correct
61 Correct 25 ms 21484 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 21484 KB Output is correct
2 Correct 24 ms 21612 KB Output is correct
3 Correct 24 ms 21496 KB Output is correct
4 Correct 25 ms 21484 KB Output is correct
5 Correct 24 ms 21484 KB Output is correct
6 Correct 27 ms 21476 KB Output is correct
7 Correct 25 ms 21484 KB Output is correct
8 Correct 24 ms 21484 KB Output is correct
9 Correct 24 ms 21484 KB Output is correct
10 Correct 24 ms 21484 KB Output is correct
11 Correct 24 ms 21484 KB Output is correct
12 Correct 23 ms 21484 KB Output is correct
13 Correct 24 ms 21484 KB Output is correct
14 Correct 24 ms 21612 KB Output is correct
15 Correct 24 ms 21484 KB Output is correct
16 Correct 24 ms 21484 KB Output is correct
17 Correct 24 ms 21484 KB Output is correct
18 Correct 24 ms 21484 KB Output is correct
19 Correct 24 ms 21612 KB Output is correct
20 Correct 24 ms 21484 KB Output is correct
21 Correct 25 ms 21484 KB Output is correct
22 Correct 24 ms 21612 KB Output is correct
23 Correct 24 ms 21484 KB Output is correct
24 Correct 60 ms 22372 KB Output is correct
25 Correct 63 ms 22244 KB Output is correct
26 Correct 60 ms 22372 KB Output is correct
27 Correct 24 ms 21484 KB Output is correct
28 Correct 24 ms 21484 KB Output is correct
29 Correct 24 ms 21612 KB Output is correct
30 Correct 24 ms 21484 KB Output is correct
31 Correct 25 ms 21516 KB Output is correct
32 Correct 24 ms 21484 KB Output is correct
33 Correct 24 ms 21484 KB Output is correct
34 Correct 24 ms 21516 KB Output is correct
35 Correct 24 ms 21612 KB Output is correct
36 Correct 24 ms 21476 KB Output is correct
37 Correct 24 ms 21484 KB Output is correct
38 Correct 24 ms 21612 KB Output is correct
39 Correct 24 ms 21484 KB Output is correct
40 Correct 26 ms 21476 KB Output is correct
41 Correct 24 ms 21484 KB Output is correct
42 Correct 24 ms 21484 KB Output is correct
43 Correct 24 ms 21484 KB Output is correct
44 Correct 24 ms 21484 KB Output is correct
45 Correct 24 ms 21484 KB Output is correct
46 Correct 27 ms 21484 KB Output is correct
47 Correct 24 ms 21612 KB Output is correct
48 Correct 24 ms 21484 KB Output is correct
49 Correct 24 ms 21484 KB Output is correct
50 Correct 24 ms 21484 KB Output is correct
51 Correct 23 ms 21612 KB Output is correct
52 Correct 24 ms 21612 KB Output is correct
53 Correct 24 ms 21484 KB Output is correct
54 Correct 25 ms 21484 KB Output is correct
55 Correct 24 ms 21484 KB Output is correct
56 Correct 24 ms 21484 KB Output is correct
57 Correct 24 ms 21484 KB Output is correct
58 Correct 24 ms 21484 KB Output is correct
59 Correct 24 ms 21612 KB Output is correct
60 Correct 24 ms 21608 KB Output is correct
61 Correct 28 ms 21740 KB Output is correct
62 Correct 24 ms 21484 KB Output is correct
63 Correct 24 ms 21484 KB Output is correct
64 Correct 25 ms 21484 KB Output is correct
65 Correct 26 ms 21612 KB Output is correct
66 Correct 24 ms 21484 KB Output is correct
67 Correct 26 ms 21484 KB Output is correct
68 Correct 29 ms 21484 KB Output is correct
69 Correct 26 ms 21612 KB Output is correct
70 Correct 27 ms 21996 KB Output is correct
71 Correct 28 ms 21996 KB Output is correct
72 Correct 27 ms 21948 KB Output is correct
73 Correct 28 ms 21988 KB Output is correct
74 Correct 28 ms 22244 KB Output is correct
75 Correct 28 ms 21868 KB Output is correct
76 Correct 63 ms 23780 KB Output is correct
77 Correct 48 ms 22500 KB Output is correct
78 Correct 73 ms 23776 KB Output is correct
79 Correct 26 ms 21612 KB Output is correct
80 Correct 27 ms 21484 KB Output is correct
81 Correct 27 ms 21484 KB Output is correct
82 Correct 26 ms 21612 KB Output is correct
83 Correct 27 ms 21612 KB Output is correct
84 Correct 28 ms 22116 KB Output is correct
85 Correct 29 ms 21996 KB Output is correct
86 Correct 29 ms 21996 KB Output is correct
87 Correct 29 ms 21996 KB Output is correct
88 Correct 29 ms 22124 KB Output is correct
89 Correct 28 ms 21996 KB Output is correct
90 Correct 93 ms 24068 KB Output is correct
91 Correct 84 ms 24292 KB Output is correct
92 Correct 81 ms 24164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 21484 KB Output is correct
2 Correct 24 ms 21612 KB Output is correct
3 Correct 24 ms 21496 KB Output is correct
4 Correct 25 ms 21484 KB Output is correct
5 Correct 24 ms 21484 KB Output is correct
6 Correct 27 ms 21476 KB Output is correct
7 Correct 25 ms 21484 KB Output is correct
8 Correct 24 ms 21484 KB Output is correct
9 Correct 24 ms 21484 KB Output is correct
10 Correct 24 ms 21484 KB Output is correct
11 Correct 24 ms 21484 KB Output is correct
12 Correct 23 ms 21484 KB Output is correct
13 Correct 24 ms 21484 KB Output is correct
14 Correct 24 ms 21612 KB Output is correct
15 Correct 24 ms 21484 KB Output is correct
16 Correct 24 ms 21484 KB Output is correct
17 Correct 24 ms 21484 KB Output is correct
18 Correct 24 ms 21484 KB Output is correct
19 Correct 24 ms 21612 KB Output is correct
20 Correct 24 ms 21484 KB Output is correct
21 Correct 25 ms 21484 KB Output is correct
22 Correct 24 ms 21612 KB Output is correct
23 Correct 24 ms 21484 KB Output is correct
24 Correct 60 ms 22372 KB Output is correct
25 Correct 63 ms 22244 KB Output is correct
26 Correct 60 ms 22372 KB Output is correct
27 Correct 33 ms 21996 KB Output is correct
28 Correct 32 ms 21996 KB Output is correct
29 Correct 26 ms 22124 KB Output is correct
30 Correct 26 ms 21996 KB Output is correct
31 Correct 26 ms 21996 KB Output is correct
32 Correct 27 ms 22120 KB Output is correct
33 Correct 50 ms 22244 KB Output is correct
34 Correct 50 ms 22252 KB Output is correct
35 Correct 49 ms 22252 KB Output is correct
36 Correct 51 ms 22244 KB Output is correct
37 Correct 49 ms 22244 KB Output is correct
38 Correct 49 ms 22244 KB Output is correct
39 Correct 65 ms 23044 KB Output is correct
40 Correct 65 ms 23012 KB Output is correct
41 Correct 65 ms 22884 KB Output is correct
42 Correct 24 ms 21484 KB Output is correct
43 Correct 24 ms 21484 KB Output is correct
44 Correct 24 ms 21612 KB Output is correct
45 Correct 24 ms 21484 KB Output is correct
46 Correct 25 ms 21516 KB Output is correct
47 Correct 24 ms 21484 KB Output is correct
48 Correct 24 ms 21484 KB Output is correct
49 Correct 24 ms 21516 KB Output is correct
50 Correct 24 ms 21612 KB Output is correct
51 Correct 24 ms 21476 KB Output is correct
52 Correct 24 ms 21484 KB Output is correct
53 Correct 24 ms 21612 KB Output is correct
54 Correct 24 ms 21484 KB Output is correct
55 Correct 26 ms 21476 KB Output is correct
56 Correct 24 ms 21484 KB Output is correct
57 Correct 24 ms 21484 KB Output is correct
58 Correct 24 ms 21484 KB Output is correct
59 Correct 24 ms 21484 KB Output is correct
60 Correct 24 ms 21484 KB Output is correct
61 Correct 27 ms 21484 KB Output is correct
62 Correct 24 ms 21612 KB Output is correct
63 Correct 24 ms 21484 KB Output is correct
64 Correct 24 ms 21484 KB Output is correct
65 Correct 24 ms 21484 KB Output is correct
66 Correct 23 ms 21612 KB Output is correct
67 Correct 24 ms 21612 KB Output is correct
68 Correct 24 ms 21484 KB Output is correct
69 Correct 25 ms 21484 KB Output is correct
70 Correct 24 ms 21484 KB Output is correct
71 Correct 24 ms 21484 KB Output is correct
72 Correct 24 ms 21484 KB Output is correct
73 Correct 24 ms 21484 KB Output is correct
74 Correct 24 ms 21612 KB Output is correct
75 Correct 24 ms 21608 KB Output is correct
76 Correct 28 ms 21740 KB Output is correct
77 Correct 24 ms 21484 KB Output is correct
78 Correct 24 ms 21484 KB Output is correct
79 Correct 25 ms 21484 KB Output is correct
80 Correct 26 ms 21612 KB Output is correct
81 Correct 24 ms 21484 KB Output is correct
82 Correct 26 ms 21484 KB Output is correct
83 Correct 29 ms 21484 KB Output is correct
84 Correct 26 ms 21612 KB Output is correct
85 Correct 27 ms 21996 KB Output is correct
86 Correct 28 ms 21996 KB Output is correct
87 Correct 27 ms 21948 KB Output is correct
88 Correct 28 ms 21988 KB Output is correct
89 Correct 28 ms 22244 KB Output is correct
90 Correct 28 ms 21868 KB Output is correct
91 Correct 63 ms 23780 KB Output is correct
92 Correct 48 ms 22500 KB Output is correct
93 Correct 73 ms 23776 KB Output is correct
94 Correct 26 ms 21612 KB Output is correct
95 Correct 27 ms 21484 KB Output is correct
96 Correct 27 ms 21484 KB Output is correct
97 Correct 26 ms 21612 KB Output is correct
98 Correct 27 ms 21612 KB Output is correct
99 Correct 28 ms 22116 KB Output is correct
100 Correct 29 ms 21996 KB Output is correct
101 Correct 29 ms 21996 KB Output is correct
102 Correct 29 ms 21996 KB Output is correct
103 Correct 29 ms 22124 KB Output is correct
104 Correct 28 ms 21996 KB Output is correct
105 Correct 93 ms 24068 KB Output is correct
106 Correct 84 ms 24292 KB Output is correct
107 Correct 81 ms 24164 KB Output is correct
108 Correct 33 ms 21996 KB Output is correct
109 Correct 193 ms 21868 KB Output is correct
110 Correct 30 ms 21936 KB Output is correct
111 Correct 28 ms 21868 KB Output is correct
112 Correct 30 ms 21988 KB Output is correct
113 Correct 29 ms 21868 KB Output is correct
114 Correct 72 ms 24292 KB Output is correct
115 Correct 56 ms 24036 KB Output is correct
116 Correct 74 ms 25700 KB Output is correct
117 Correct 67 ms 24164 KB Output is correct
118 Correct 60 ms 24548 KB Output is correct
119 Correct 54 ms 22272 KB Output is correct
120 Correct 58 ms 23400 KB Output is correct
121 Correct 35 ms 21996 KB Output is correct
122 Correct 67 ms 24292 KB Output is correct
123 Correct 35 ms 21868 KB Output is correct
124 Correct 69 ms 24164 KB Output is correct
125 Correct 44 ms 22244 KB Output is correct
126 Correct 40 ms 22124 KB Output is correct
127 Correct 47 ms 22244 KB Output is correct
128 Correct 39 ms 21988 KB Output is correct
129 Correct 39 ms 21996 KB Output is correct
130 Correct 41 ms 21996 KB Output is correct
131 Correct 255 ms 22124 KB Output is correct
132 Correct 31 ms 22116 KB Output is correct
133 Correct 31 ms 22124 KB Output is correct
134 Correct 31 ms 22124 KB Output is correct
135 Correct 31 ms 22124 KB Output is correct
136 Correct 84 ms 26344 KB Output is correct
137 Correct 84 ms 26216 KB Output is correct
138 Correct 94 ms 26212 KB Output is correct
139 Correct 85 ms 26212 KB Output is correct
140 Correct 82 ms 26212 KB Output is correct
141 Correct 86 ms 26340 KB Output is correct
142 Correct 89 ms 24932 KB Output is correct
143 Correct 46 ms 22380 KB Output is correct
144 Correct 86 ms 25064 KB Output is correct
145 Correct 45 ms 22380 KB Output is correct
146 Correct 85 ms 24804 KB Output is correct
147 Correct 45 ms 22372 KB Output is correct
148 Correct 50 ms 22372 KB Output is correct
149 Correct 50 ms 22244 KB Output is correct
150 Correct 48 ms 22244 KB Output is correct
151 Correct 48 ms 22252 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 21484 KB Output is correct
2 Correct 24 ms 21612 KB Output is correct
3 Correct 24 ms 21496 KB Output is correct
4 Correct 25 ms 21484 KB Output is correct
5 Correct 24 ms 21484 KB Output is correct
6 Correct 27 ms 21476 KB Output is correct
7 Correct 25 ms 21484 KB Output is correct
8 Correct 24 ms 21484 KB Output is correct
9 Correct 24 ms 21484 KB Output is correct
10 Correct 24 ms 21484 KB Output is correct
11 Correct 24 ms 21484 KB Output is correct
12 Correct 23 ms 21484 KB Output is correct
13 Correct 24 ms 21484 KB Output is correct
14 Correct 24 ms 21612 KB Output is correct
15 Correct 24 ms 21484 KB Output is correct
16 Correct 24 ms 21484 KB Output is correct
17 Correct 24 ms 21484 KB Output is correct
18 Correct 24 ms 21484 KB Output is correct
19 Correct 24 ms 21612 KB Output is correct
20 Correct 24 ms 21484 KB Output is correct
21 Correct 25 ms 21484 KB Output is correct
22 Correct 24 ms 21612 KB Output is correct
23 Correct 24 ms 21484 KB Output is correct
24 Correct 60 ms 22372 KB Output is correct
25 Correct 63 ms 22244 KB Output is correct
26 Correct 60 ms 22372 KB Output is correct
27 Correct 33 ms 21996 KB Output is correct
28 Correct 32 ms 21996 KB Output is correct
29 Correct 26 ms 22124 KB Output is correct
30 Correct 26 ms 21996 KB Output is correct
31 Correct 26 ms 21996 KB Output is correct
32 Correct 27 ms 22120 KB Output is correct
33 Correct 50 ms 22244 KB Output is correct
34 Correct 50 ms 22252 KB Output is correct
35 Correct 49 ms 22252 KB Output is correct
36 Correct 51 ms 22244 KB Output is correct
37 Correct 49 ms 22244 KB Output is correct
38 Correct 49 ms 22244 KB Output is correct
39 Correct 65 ms 23044 KB Output is correct
40 Correct 65 ms 23012 KB Output is correct
41 Correct 65 ms 22884 KB Output is correct
42 Correct 69 ms 23524 KB Output is correct
43 Correct 49 ms 22872 KB Output is correct
44 Correct 35 ms 23652 KB Output is correct
45 Correct 31 ms 22764 KB Output is correct
46 Correct 31 ms 22756 KB Output is correct
47 Correct 36 ms 23660 KB Output is correct
48 Correct 131 ms 29284 KB Output is correct
49 Correct 92 ms 26212 KB Output is correct
50 Correct 85 ms 28772 KB Output is correct
51 Correct 84 ms 28420 KB Output is correct
52 Correct 83 ms 28516 KB Output is correct
53 Correct 69 ms 26692 KB Output is correct
54 Correct 69 ms 23916 KB Output is correct
55 Correct 69 ms 24036 KB Output is correct
56 Correct 35 ms 23908 KB Output is correct
57 Correct 35 ms 24036 KB Output is correct
58 Correct 36 ms 23912 KB Output is correct
59 Correct 39 ms 23916 KB Output is correct
60 Correct 156 ms 30820 KB Output is correct
61 Correct 158 ms 30820 KB Output is correct
62 Correct 158 ms 30820 KB Output is correct
63 Correct 154 ms 30820 KB Output is correct
64 Correct 153 ms 30820 KB Output is correct
65 Correct 163 ms 30948 KB Output is correct
66 Correct 97 ms 30180 KB Output is correct
67 Correct 100 ms 30180 KB Output is correct
68 Correct 102 ms 30180 KB Output is correct
69 Correct 24 ms 21484 KB Output is correct
70 Correct 24 ms 21484 KB Output is correct
71 Correct 24 ms 21612 KB Output is correct
72 Correct 24 ms 21484 KB Output is correct
73 Correct 25 ms 21516 KB Output is correct
74 Correct 24 ms 21484 KB Output is correct
75 Correct 24 ms 21484 KB Output is correct
76 Correct 24 ms 21516 KB Output is correct
77 Correct 24 ms 21612 KB Output is correct
78 Correct 24 ms 21476 KB Output is correct
79 Correct 24 ms 21484 KB Output is correct
80 Correct 24 ms 21612 KB Output is correct
81 Correct 24 ms 21484 KB Output is correct
82 Correct 26 ms 21476 KB Output is correct
83 Correct 24 ms 21484 KB Output is correct
84 Correct 24 ms 21484 KB Output is correct
85 Correct 24 ms 21484 KB Output is correct
86 Correct 24 ms 21484 KB Output is correct
87 Correct 24 ms 21484 KB Output is correct
88 Correct 27 ms 21484 KB Output is correct
89 Correct 24 ms 21612 KB Output is correct
90 Correct 24 ms 21484 KB Output is correct
91 Correct 24 ms 21484 KB Output is correct
92 Correct 24 ms 21484 KB Output is correct
93 Correct 23 ms 21612 KB Output is correct
94 Correct 24 ms 21612 KB Output is correct
95 Correct 24 ms 21484 KB Output is correct
96 Correct 25 ms 21484 KB Output is correct
97 Correct 24 ms 21484 KB Output is correct
98 Correct 24 ms 21484 KB Output is correct
99 Correct 24 ms 21484 KB Output is correct
100 Correct 24 ms 21484 KB Output is correct
101 Correct 24 ms 21612 KB Output is correct
102 Correct 24 ms 21608 KB Output is correct
103 Correct 28 ms 21740 KB Output is correct
104 Correct 24 ms 21484 KB Output is correct
105 Correct 24 ms 21484 KB Output is correct
106 Correct 25 ms 21484 KB Output is correct
107 Correct 26 ms 21612 KB Output is correct
108 Correct 24 ms 21484 KB Output is correct
109 Correct 26 ms 21484 KB Output is correct
110 Correct 29 ms 21484 KB Output is correct
111 Correct 26 ms 21612 KB Output is correct
112 Correct 27 ms 21996 KB Output is correct
113 Correct 28 ms 21996 KB Output is correct
114 Correct 27 ms 21948 KB Output is correct
115 Correct 28 ms 21988 KB Output is correct
116 Correct 28 ms 22244 KB Output is correct
117 Correct 28 ms 21868 KB Output is correct
118 Correct 63 ms 23780 KB Output is correct
119 Correct 48 ms 22500 KB Output is correct
120 Correct 73 ms 23776 KB Output is correct
121 Correct 26 ms 21612 KB Output is correct
122 Correct 27 ms 21484 KB Output is correct
123 Correct 27 ms 21484 KB Output is correct
124 Correct 26 ms 21612 KB Output is correct
125 Correct 27 ms 21612 KB Output is correct
126 Correct 28 ms 22116 KB Output is correct
127 Correct 29 ms 21996 KB Output is correct
128 Correct 29 ms 21996 KB Output is correct
129 Correct 29 ms 21996 KB Output is correct
130 Correct 29 ms 22124 KB Output is correct
131 Correct 28 ms 21996 KB Output is correct
132 Correct 93 ms 24068 KB Output is correct
133 Correct 84 ms 24292 KB Output is correct
134 Correct 81 ms 24164 KB Output is correct
135 Correct 33 ms 21996 KB Output is correct
136 Correct 193 ms 21868 KB Output is correct
137 Correct 30 ms 21936 KB Output is correct
138 Correct 28 ms 21868 KB Output is correct
139 Correct 30 ms 21988 KB Output is correct
140 Correct 29 ms 21868 KB Output is correct
141 Correct 72 ms 24292 KB Output is correct
142 Correct 56 ms 24036 KB Output is correct
143 Correct 74 ms 25700 KB Output is correct
144 Correct 67 ms 24164 KB Output is correct
145 Correct 60 ms 24548 KB Output is correct
146 Correct 54 ms 22272 KB Output is correct
147 Correct 58 ms 23400 KB Output is correct
148 Correct 35 ms 21996 KB Output is correct
149 Correct 67 ms 24292 KB Output is correct
150 Correct 35 ms 21868 KB Output is correct
151 Correct 69 ms 24164 KB Output is correct
152 Correct 44 ms 22244 KB Output is correct
153 Correct 40 ms 22124 KB Output is correct
154 Correct 47 ms 22244 KB Output is correct
155 Correct 39 ms 21988 KB Output is correct
156 Correct 39 ms 21996 KB Output is correct
157 Correct 41 ms 21996 KB Output is correct
158 Correct 255 ms 22124 KB Output is correct
159 Correct 31 ms 22116 KB Output is correct
160 Correct 31 ms 22124 KB Output is correct
161 Correct 31 ms 22124 KB Output is correct
162 Correct 31 ms 22124 KB Output is correct
163 Correct 84 ms 26344 KB Output is correct
164 Correct 84 ms 26216 KB Output is correct
165 Correct 94 ms 26212 KB Output is correct
166 Correct 85 ms 26212 KB Output is correct
167 Correct 82 ms 26212 KB Output is correct
168 Correct 86 ms 26340 KB Output is correct
169 Correct 89 ms 24932 KB Output is correct
170 Correct 46 ms 22380 KB Output is correct
171 Correct 86 ms 25064 KB Output is correct
172 Correct 45 ms 22380 KB Output is correct
173 Correct 85 ms 24804 KB Output is correct
174 Correct 45 ms 22372 KB Output is correct
175 Correct 50 ms 22372 KB Output is correct
176 Correct 50 ms 22244 KB Output is correct
177 Correct 48 ms 22244 KB Output is correct
178 Correct 48 ms 22252 KB Output is correct
179 Correct 53 ms 22892 KB Output is correct
180 Correct 460 ms 22884 KB Output is correct
181 Correct 37 ms 23652 KB Output is correct
182 Correct 40 ms 24032 KB Output is correct
183 Correct 36 ms 23148 KB Output is correct
184 Correct 35 ms 23016 KB Output is correct
185 Correct 107 ms 24932 KB Output is correct
186 Correct 108 ms 25956 KB Output is correct
187 Correct 126 ms 25316 KB Output is correct
188 Correct 74 ms 26472 KB Output is correct
189 Correct 152 ms 25956 KB Output is correct
190 Correct 85 ms 28756 KB Output is correct
191 Correct 132 ms 26976 KB Output is correct
192 Correct 65 ms 25572 KB Output is correct
193 Correct 107 ms 24932 KB Output is correct
194 Correct 73 ms 23908 KB Output is correct
195 Correct 1198 ms 24164 KB Output is correct
196 Correct 41 ms 24044 KB Output is correct
197 Correct 41 ms 24044 KB Output is correct
198 Correct 42 ms 24164 KB Output is correct
199 Correct 53 ms 24164 KB Output is correct
200 Correct 178 ms 31456 KB Output is correct
201 Correct 177 ms 31588 KB Output is correct
202 Correct 178 ms 31460 KB Output is correct
203 Correct 177 ms 31460 KB Output is correct
204 Correct 179 ms 31460 KB Output is correct
205 Correct 177 ms 31588 KB Output is correct
206 Correct 117 ms 32484 KB Output is correct
207 Correct 153 ms 31332 KB Output is correct
208 Correct 119 ms 32612 KB Output is correct
209 Correct 154 ms 31456 KB Output is correct
210 Correct 121 ms 32740 KB Output is correct
211 Correct 154 ms 31460 KB Output is correct
212 Correct 163 ms 31408 KB Output is correct
213 Correct 170 ms 28260 KB Output is correct
214 Correct 171 ms 27620 KB Output is correct
215 Correct 171 ms 27620 KB Output is correct