Submission #908994

# Submission time Handle Problem Language Result Execution time Memory
908994 2024-01-17T04:19:13 Z wii Painting Walls (APIO20_paint) C++17
63 / 100
458 ms 524288 KB
#include "paint.h"
#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define bit(i, mask) ((mask) >> (i) & 1)
#define reset(x, val) memset(x, val, sizeof(x))
#define foru(i,a,b) for(int i = (a); i <= (b); ++i)
#define ford(i,a,b) for(int i = (a); i >= (b); --i)

const int N = 1e5 + 5;

int n;
vector<int> f0[N], fn[N];
vector<int> adj[N];
int a[N], used[N], ok[N];

const int Inf = 0x3f3f3f3f;

struct SegmentTree {
    int f[N * 2];

    SegmentTree() {
        memset(f, 0x3f, sizeof f);
    }

    void upd(int u, int x) {
        ++u;
        for (f[u += n] = x; u > 1; u >>= 1)
            f[u >> 1] = min(f[u], f[u ^ 1]);
    }

    int get(int l, int r) {
        int ans = Inf;

        ++l; ++r;
        for (l += n, r += n + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) ans = min(ans, f[l++]);
            if (r & 1) ans = min(ans, f[--r]);
        }
        return ans;
    }
};

SegmentTree St;
int minimumInstructions(int N, int M, int K, std::vector<int> _C, std::vector<int> A, std::vector<std::vector<int>> B) {
    n = N + 1;

    foru(i, 0, M - 1) {
        foru(j, 0, A[i] - 1)
            adj[B[i][j]].push_back(i + 1);
    }

    foru(i, 1, N)
        a[i] = _C[i - 1];

    foru(i, 1, N) {
        for (int u: f0[i - 1]) used[u] = true;

        for (int u: adj[a[i]]) {
            if (u == 1) f0[i].push_back(u); else
                if (used[u - 1]) f0[i].push_back(u);
        }

        for (int u: f0[i - 1]) used[u] = false;
    }

    ford(i, N, 1) {
        for (int u: fn[i + 1]) used[u] = true;

        for (int u: adj[a[i]]) {
            if (u == M) fn[i].push_back(u); else
                if (used[u + 1]) fn[i].push_back(u);
        }

        for (int u: fn[i + 1]) used[u] = false;
    }

    foru(i, M, N) {
        for (int u: f0[i]) used[u] = true;

        ok[i] = (used[M] == true);
        for (int u: fn[i - M + 1]) {
            ok[i] |= (used[u - 1]);
        }

        for (int u: f0[i]) used[u] = false;
    }

    St.upd(0, 0);
    foru(i, M, N) if (ok[i]) {
        St.upd(i, St.get(i - M, i - 1) + 1);
    }

    int ans = St.get(N, N);
    if (ans == Inf) ans = -1;

    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 9304 KB Output is correct
2 Correct 3 ms 9308 KB Output is correct
3 Correct 2 ms 9308 KB Output is correct
4 Correct 2 ms 9308 KB Output is correct
5 Correct 3 ms 9308 KB Output is correct
6 Correct 4 ms 9304 KB Output is correct
7 Correct 3 ms 9308 KB Output is correct
8 Correct 3 ms 9304 KB Output is correct
9 Correct 3 ms 9308 KB Output is correct
10 Correct 3 ms 9460 KB Output is correct
11 Correct 3 ms 9440 KB Output is correct
12 Correct 3 ms 9308 KB Output is correct
13 Correct 4 ms 9444 KB Output is correct
14 Correct 3 ms 9304 KB Output is correct
15 Correct 3 ms 9308 KB Output is correct
16 Correct 3 ms 9308 KB Output is correct
17 Correct 3 ms 9308 KB Output is correct
18 Correct 3 ms 9308 KB Output is correct
19 Correct 3 ms 9308 KB Output is correct
20 Correct 3 ms 9304 KB Output is correct
21 Correct 3 ms 9308 KB Output is correct
22 Correct 18 ms 13660 KB Output is correct
23 Correct 25 ms 13660 KB Output is correct
24 Correct 16 ms 13836 KB Output is correct
25 Correct 7 ms 10844 KB Output is correct
26 Correct 6 ms 10844 KB Output is correct
27 Correct 6 ms 10476 KB Output is correct
28 Correct 6 ms 10272 KB Output is correct
29 Correct 5 ms 10012 KB Output is correct
30 Correct 5 ms 9816 KB Output is correct
31 Correct 11 ms 11936 KB Output is correct
32 Correct 12 ms 11804 KB Output is correct
33 Correct 11 ms 11868 KB Output is correct
34 Correct 12 ms 11868 KB Output is correct
35 Correct 12 ms 11868 KB Output is correct
36 Correct 11 ms 11844 KB Output is correct
37 Correct 18 ms 14172 KB Output is correct
38 Correct 18 ms 14172 KB Output is correct
39 Correct 27 ms 14288 KB Output is correct
40 Correct 19 ms 15960 KB Output is correct
41 Correct 13 ms 13404 KB Output is correct
42 Correct 19 ms 14936 KB Output is correct
43 Correct 12 ms 11868 KB Output is correct
44 Correct 10 ms 11100 KB Output is correct
45 Correct 13 ms 11864 KB Output is correct
46 Correct 46 ms 23468 KB Output is correct
47 Correct 27 ms 17232 KB Output is correct
48 Correct 27 ms 19028 KB Output is correct
49 Correct 33 ms 17744 KB Output is correct
50 Correct 31 ms 17500 KB Output is correct
51 Correct 23 ms 15188 KB Output is correct
52 Correct 19 ms 16476 KB Output is correct
53 Correct 23 ms 16500 KB Output is correct
54 Correct 19 ms 15192 KB Output is correct
55 Correct 21 ms 13400 KB Output is correct
56 Correct 15 ms 12256 KB Output is correct
57 Correct 13 ms 11868 KB Output is correct
58 Correct 51 ms 24540 KB Output is correct
59 Correct 61 ms 24660 KB Output is correct
60 Correct 50 ms 24492 KB Output is correct
61 Correct 53 ms 24436 KB Output is correct
62 Correct 48 ms 24660 KB Output is correct
63 Correct 51 ms 24656 KB Output is correct
64 Correct 41 ms 19036 KB Output is correct
65 Correct 38 ms 19028 KB Output is correct
66 Correct 37 ms 19024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 9304 KB Output is correct
2 Correct 3 ms 9308 KB Output is correct
3 Correct 2 ms 9308 KB Output is correct
4 Correct 2 ms 9308 KB Output is correct
5 Correct 3 ms 9308 KB Output is correct
6 Correct 4 ms 9304 KB Output is correct
7 Correct 3 ms 9308 KB Output is correct
8 Correct 3 ms 9304 KB Output is correct
9 Correct 3 ms 9308 KB Output is correct
10 Correct 3 ms 9460 KB Output is correct
11 Correct 3 ms 9440 KB Output is correct
12 Correct 3 ms 9308 KB Output is correct
13 Correct 4 ms 9444 KB Output is correct
14 Correct 3 ms 9304 KB Output is correct
15 Correct 3 ms 9308 KB Output is correct
16 Correct 3 ms 9308 KB Output is correct
17 Correct 3 ms 9308 KB Output is correct
18 Correct 3 ms 9308 KB Output is correct
19 Correct 3 ms 9308 KB Output is correct
20 Correct 3 ms 9304 KB Output is correct
21 Correct 3 ms 9308 KB Output is correct
22 Correct 3 ms 9304 KB Output is correct
23 Correct 3 ms 9308 KB Output is correct
24 Correct 3 ms 9308 KB Output is correct
25 Correct 3 ms 9308 KB Output is correct
26 Correct 4 ms 9308 KB Output is correct
27 Correct 3 ms 9308 KB Output is correct
28 Correct 3 ms 9308 KB Output is correct
29 Correct 3 ms 9304 KB Output is correct
30 Correct 3 ms 9308 KB Output is correct
31 Correct 4 ms 9308 KB Output is correct
32 Correct 3 ms 9308 KB Output is correct
33 Correct 3 ms 9308 KB Output is correct
34 Correct 3 ms 9308 KB Output is correct
35 Correct 3 ms 9308 KB Output is correct
36 Correct 3 ms 9308 KB Output is correct
37 Correct 3 ms 9308 KB Output is correct
38 Correct 3 ms 9304 KB Output is correct
39 Correct 4 ms 9304 KB Output is correct
40 Correct 3 ms 9304 KB Output is correct
41 Correct 3 ms 9308 KB Output is correct
42 Correct 3 ms 9392 KB Output is correct
43 Correct 3 ms 9308 KB Output is correct
44 Correct 3 ms 9308 KB Output is correct
45 Correct 3 ms 9564 KB Output is correct
46 Correct 3 ms 9436 KB Output is correct
47 Correct 3 ms 9304 KB Output is correct
48 Correct 4 ms 9304 KB Output is correct
49 Correct 3 ms 9308 KB Output is correct
50 Correct 3 ms 9308 KB Output is correct
51 Correct 3 ms 9308 KB Output is correct
52 Correct 3 ms 9308 KB Output is correct
53 Correct 3 ms 9440 KB Output is correct
54 Correct 3 ms 9304 KB Output is correct
55 Correct 3 ms 9308 KB Output is correct
56 Correct 3 ms 9304 KB Output is correct
57 Correct 3 ms 9308 KB Output is correct
58 Correct 3 ms 9308 KB Output is correct
59 Correct 3 ms 9348 KB Output is correct
60 Correct 3 ms 9304 KB Output is correct
61 Correct 3 ms 9304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9304 KB Output is correct
2 Correct 3 ms 9308 KB Output is correct
3 Correct 2 ms 9304 KB Output is correct
4 Correct 3 ms 9308 KB Output is correct
5 Correct 2 ms 9308 KB Output is correct
6 Correct 2 ms 9308 KB Output is correct
7 Correct 3 ms 9308 KB Output is correct
8 Correct 4 ms 9304 KB Output is correct
9 Correct 3 ms 9308 KB Output is correct
10 Correct 3 ms 9304 KB Output is correct
11 Correct 3 ms 9308 KB Output is correct
12 Correct 3 ms 9460 KB Output is correct
13 Correct 3 ms 9440 KB Output is correct
14 Correct 3 ms 9308 KB Output is correct
15 Correct 4 ms 9444 KB Output is correct
16 Correct 3 ms 9304 KB Output is correct
17 Correct 3 ms 9308 KB Output is correct
18 Correct 3 ms 9308 KB Output is correct
19 Correct 3 ms 9308 KB Output is correct
20 Correct 3 ms 9308 KB Output is correct
21 Correct 3 ms 9308 KB Output is correct
22 Correct 3 ms 9304 KB Output is correct
23 Correct 3 ms 9308 KB Output is correct
24 Correct 18 ms 13660 KB Output is correct
25 Correct 25 ms 13660 KB Output is correct
26 Correct 16 ms 13836 KB Output is correct
27 Correct 3 ms 9308 KB Output is correct
28 Correct 3 ms 9308 KB Output is correct
29 Correct 4 ms 9308 KB Output is correct
30 Correct 3 ms 9308 KB Output is correct
31 Correct 3 ms 9308 KB Output is correct
32 Correct 3 ms 9304 KB Output is correct
33 Correct 3 ms 9308 KB Output is correct
34 Correct 4 ms 9308 KB Output is correct
35 Correct 3 ms 9308 KB Output is correct
36 Correct 3 ms 9308 KB Output is correct
37 Correct 3 ms 9308 KB Output is correct
38 Correct 3 ms 9308 KB Output is correct
39 Correct 3 ms 9308 KB Output is correct
40 Correct 3 ms 9308 KB Output is correct
41 Correct 3 ms 9304 KB Output is correct
42 Correct 4 ms 9304 KB Output is correct
43 Correct 3 ms 9304 KB Output is correct
44 Correct 3 ms 9308 KB Output is correct
45 Correct 3 ms 9392 KB Output is correct
46 Correct 3 ms 9308 KB Output is correct
47 Correct 3 ms 9308 KB Output is correct
48 Correct 3 ms 9564 KB Output is correct
49 Correct 3 ms 9436 KB Output is correct
50 Correct 3 ms 9304 KB Output is correct
51 Correct 4 ms 9304 KB Output is correct
52 Correct 3 ms 9308 KB Output is correct
53 Correct 3 ms 9308 KB Output is correct
54 Correct 3 ms 9308 KB Output is correct
55 Correct 3 ms 9308 KB Output is correct
56 Correct 3 ms 9440 KB Output is correct
57 Correct 3 ms 9304 KB Output is correct
58 Correct 3 ms 9308 KB Output is correct
59 Correct 3 ms 9304 KB Output is correct
60 Correct 3 ms 9308 KB Output is correct
61 Correct 3 ms 9308 KB Output is correct
62 Correct 3 ms 9348 KB Output is correct
63 Correct 3 ms 9304 KB Output is correct
64 Correct 3 ms 9304 KB Output is correct
65 Correct 4 ms 9564 KB Output is correct
66 Correct 3 ms 9564 KB Output is correct
67 Correct 4 ms 9820 KB Output is correct
68 Correct 4 ms 9820 KB Output is correct
69 Correct 3 ms 9820 KB Output is correct
70 Correct 4 ms 9564 KB Output is correct
71 Correct 5 ms 9508 KB Output is correct
72 Correct 5 ms 9564 KB Output is correct
73 Correct 4 ms 9564 KB Output is correct
74 Correct 5 ms 9716 KB Output is correct
75 Correct 4 ms 9564 KB Output is correct
76 Correct 16 ms 12448 KB Output is correct
77 Correct 19 ms 12888 KB Output is correct
78 Correct 20 ms 13660 KB Output is correct
79 Correct 4 ms 10208 KB Output is correct
80 Correct 4 ms 10076 KB Output is correct
81 Correct 5 ms 10076 KB Output is correct
82 Correct 4 ms 10076 KB Output is correct
83 Correct 5 ms 10076 KB Output is correct
84 Correct 4 ms 10072 KB Output is correct
85 Correct 4 ms 9820 KB Output is correct
86 Correct 6 ms 9792 KB Output is correct
87 Correct 4 ms 9820 KB Output is correct
88 Correct 5 ms 9820 KB Output is correct
89 Correct 5 ms 9708 KB Output is correct
90 Correct 29 ms 13908 KB Output is correct
91 Correct 23 ms 13912 KB Output is correct
92 Correct 23 ms 13904 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9304 KB Output is correct
2 Correct 3 ms 9308 KB Output is correct
3 Correct 2 ms 9304 KB Output is correct
4 Correct 3 ms 9308 KB Output is correct
5 Correct 2 ms 9308 KB Output is correct
6 Correct 2 ms 9308 KB Output is correct
7 Correct 3 ms 9308 KB Output is correct
8 Correct 4 ms 9304 KB Output is correct
9 Correct 3 ms 9308 KB Output is correct
10 Correct 3 ms 9304 KB Output is correct
11 Correct 3 ms 9308 KB Output is correct
12 Correct 3 ms 9460 KB Output is correct
13 Correct 3 ms 9440 KB Output is correct
14 Correct 3 ms 9308 KB Output is correct
15 Correct 4 ms 9444 KB Output is correct
16 Correct 3 ms 9304 KB Output is correct
17 Correct 3 ms 9308 KB Output is correct
18 Correct 3 ms 9308 KB Output is correct
19 Correct 3 ms 9308 KB Output is correct
20 Correct 3 ms 9308 KB Output is correct
21 Correct 3 ms 9308 KB Output is correct
22 Correct 3 ms 9304 KB Output is correct
23 Correct 3 ms 9308 KB Output is correct
24 Correct 18 ms 13660 KB Output is correct
25 Correct 25 ms 13660 KB Output is correct
26 Correct 16 ms 13836 KB Output is correct
27 Correct 7 ms 10844 KB Output is correct
28 Correct 6 ms 10844 KB Output is correct
29 Correct 6 ms 10476 KB Output is correct
30 Correct 6 ms 10272 KB Output is correct
31 Correct 5 ms 10012 KB Output is correct
32 Correct 5 ms 9816 KB Output is correct
33 Correct 11 ms 11936 KB Output is correct
34 Correct 12 ms 11804 KB Output is correct
35 Correct 11 ms 11868 KB Output is correct
36 Correct 12 ms 11868 KB Output is correct
37 Correct 12 ms 11868 KB Output is correct
38 Correct 11 ms 11844 KB Output is correct
39 Correct 18 ms 14172 KB Output is correct
40 Correct 18 ms 14172 KB Output is correct
41 Correct 27 ms 14288 KB Output is correct
42 Correct 3 ms 9308 KB Output is correct
43 Correct 3 ms 9308 KB Output is correct
44 Correct 4 ms 9308 KB Output is correct
45 Correct 3 ms 9308 KB Output is correct
46 Correct 3 ms 9308 KB Output is correct
47 Correct 3 ms 9304 KB Output is correct
48 Correct 3 ms 9308 KB Output is correct
49 Correct 4 ms 9308 KB Output is correct
50 Correct 3 ms 9308 KB Output is correct
51 Correct 3 ms 9308 KB Output is correct
52 Correct 3 ms 9308 KB Output is correct
53 Correct 3 ms 9308 KB Output is correct
54 Correct 3 ms 9308 KB Output is correct
55 Correct 3 ms 9308 KB Output is correct
56 Correct 3 ms 9304 KB Output is correct
57 Correct 4 ms 9304 KB Output is correct
58 Correct 3 ms 9304 KB Output is correct
59 Correct 3 ms 9308 KB Output is correct
60 Correct 3 ms 9392 KB Output is correct
61 Correct 3 ms 9308 KB Output is correct
62 Correct 3 ms 9308 KB Output is correct
63 Correct 3 ms 9564 KB Output is correct
64 Correct 3 ms 9436 KB Output is correct
65 Correct 3 ms 9304 KB Output is correct
66 Correct 4 ms 9304 KB Output is correct
67 Correct 3 ms 9308 KB Output is correct
68 Correct 3 ms 9308 KB Output is correct
69 Correct 3 ms 9308 KB Output is correct
70 Correct 3 ms 9308 KB Output is correct
71 Correct 3 ms 9440 KB Output is correct
72 Correct 3 ms 9304 KB Output is correct
73 Correct 3 ms 9308 KB Output is correct
74 Correct 3 ms 9304 KB Output is correct
75 Correct 3 ms 9308 KB Output is correct
76 Correct 3 ms 9308 KB Output is correct
77 Correct 3 ms 9348 KB Output is correct
78 Correct 3 ms 9304 KB Output is correct
79 Correct 3 ms 9304 KB Output is correct
80 Correct 4 ms 9564 KB Output is correct
81 Correct 3 ms 9564 KB Output is correct
82 Correct 4 ms 9820 KB Output is correct
83 Correct 4 ms 9820 KB Output is correct
84 Correct 3 ms 9820 KB Output is correct
85 Correct 4 ms 9564 KB Output is correct
86 Correct 5 ms 9508 KB Output is correct
87 Correct 5 ms 9564 KB Output is correct
88 Correct 4 ms 9564 KB Output is correct
89 Correct 5 ms 9716 KB Output is correct
90 Correct 4 ms 9564 KB Output is correct
91 Correct 16 ms 12448 KB Output is correct
92 Correct 19 ms 12888 KB Output is correct
93 Correct 20 ms 13660 KB Output is correct
94 Correct 4 ms 10208 KB Output is correct
95 Correct 4 ms 10076 KB Output is correct
96 Correct 5 ms 10076 KB Output is correct
97 Correct 4 ms 10076 KB Output is correct
98 Correct 5 ms 10076 KB Output is correct
99 Correct 4 ms 10072 KB Output is correct
100 Correct 4 ms 9820 KB Output is correct
101 Correct 6 ms 9792 KB Output is correct
102 Correct 4 ms 9820 KB Output is correct
103 Correct 5 ms 9820 KB Output is correct
104 Correct 5 ms 9708 KB Output is correct
105 Correct 29 ms 13908 KB Output is correct
106 Correct 23 ms 13912 KB Output is correct
107 Correct 23 ms 13904 KB Output is correct
108 Correct 7 ms 10840 KB Output is correct
109 Correct 129 ms 123476 KB Output is correct
110 Correct 14 ms 10076 KB Output is correct
111 Correct 11 ms 9820 KB Output is correct
112 Correct 12 ms 10076 KB Output is correct
113 Correct 9 ms 9820 KB Output is correct
114 Correct 14 ms 11612 KB Output is correct
115 Correct 13 ms 11612 KB Output is correct
116 Correct 16 ms 12380 KB Output is correct
117 Correct 13 ms 11508 KB Output is correct
118 Correct 17 ms 11984 KB Output is correct
119 Correct 16 ms 11608 KB Output is correct
120 Correct 15 ms 12380 KB Output is correct
121 Correct 8 ms 10616 KB Output is correct
122 Correct 18 ms 12600 KB Output is correct
123 Correct 7 ms 10588 KB Output is correct
124 Correct 22 ms 13144 KB Output is correct
125 Correct 10 ms 11356 KB Output is correct
126 Correct 8 ms 11096 KB Output is correct
127 Correct 10 ms 11280 KB Output is correct
128 Correct 8 ms 10844 KB Output is correct
129 Correct 8 ms 10844 KB Output is correct
130 Correct 8 ms 10844 KB Output is correct
131 Correct 181 ms 167892 KB Output is correct
132 Correct 22 ms 10576 KB Output is correct
133 Correct 19 ms 10328 KB Output is correct
134 Correct 18 ms 10332 KB Output is correct
135 Correct 15 ms 9820 KB Output is correct
136 Correct 19 ms 12672 KB Output is correct
137 Correct 19 ms 12636 KB Output is correct
138 Correct 23 ms 12628 KB Output is correct
139 Correct 21 ms 12628 KB Output is correct
140 Correct 18 ms 12632 KB Output is correct
141 Correct 26 ms 12636 KB Output is correct
142 Correct 25 ms 14020 KB Output is correct
143 Correct 11 ms 11608 KB Output is correct
144 Correct 28 ms 14172 KB Output is correct
145 Correct 12 ms 11612 KB Output is correct
146 Correct 26 ms 14248 KB Output is correct
147 Correct 12 ms 11696 KB Output is correct
148 Correct 10 ms 11612 KB Output is correct
149 Correct 10 ms 11548 KB Output is correct
150 Correct 10 ms 11356 KB Output is correct
151 Correct 10 ms 11356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9304 KB Output is correct
2 Correct 3 ms 9308 KB Output is correct
3 Correct 2 ms 9304 KB Output is correct
4 Correct 3 ms 9308 KB Output is correct
5 Correct 2 ms 9308 KB Output is correct
6 Correct 2 ms 9308 KB Output is correct
7 Correct 3 ms 9308 KB Output is correct
8 Correct 4 ms 9304 KB Output is correct
9 Correct 3 ms 9308 KB Output is correct
10 Correct 3 ms 9304 KB Output is correct
11 Correct 3 ms 9308 KB Output is correct
12 Correct 3 ms 9460 KB Output is correct
13 Correct 3 ms 9440 KB Output is correct
14 Correct 3 ms 9308 KB Output is correct
15 Correct 4 ms 9444 KB Output is correct
16 Correct 3 ms 9304 KB Output is correct
17 Correct 3 ms 9308 KB Output is correct
18 Correct 3 ms 9308 KB Output is correct
19 Correct 3 ms 9308 KB Output is correct
20 Correct 3 ms 9308 KB Output is correct
21 Correct 3 ms 9308 KB Output is correct
22 Correct 3 ms 9304 KB Output is correct
23 Correct 3 ms 9308 KB Output is correct
24 Correct 18 ms 13660 KB Output is correct
25 Correct 25 ms 13660 KB Output is correct
26 Correct 16 ms 13836 KB Output is correct
27 Correct 7 ms 10844 KB Output is correct
28 Correct 6 ms 10844 KB Output is correct
29 Correct 6 ms 10476 KB Output is correct
30 Correct 6 ms 10272 KB Output is correct
31 Correct 5 ms 10012 KB Output is correct
32 Correct 5 ms 9816 KB Output is correct
33 Correct 11 ms 11936 KB Output is correct
34 Correct 12 ms 11804 KB Output is correct
35 Correct 11 ms 11868 KB Output is correct
36 Correct 12 ms 11868 KB Output is correct
37 Correct 12 ms 11868 KB Output is correct
38 Correct 11 ms 11844 KB Output is correct
39 Correct 18 ms 14172 KB Output is correct
40 Correct 18 ms 14172 KB Output is correct
41 Correct 27 ms 14288 KB Output is correct
42 Correct 19 ms 15960 KB Output is correct
43 Correct 13 ms 13404 KB Output is correct
44 Correct 19 ms 14936 KB Output is correct
45 Correct 12 ms 11868 KB Output is correct
46 Correct 10 ms 11100 KB Output is correct
47 Correct 13 ms 11864 KB Output is correct
48 Correct 46 ms 23468 KB Output is correct
49 Correct 27 ms 17232 KB Output is correct
50 Correct 27 ms 19028 KB Output is correct
51 Correct 33 ms 17744 KB Output is correct
52 Correct 31 ms 17500 KB Output is correct
53 Correct 23 ms 15188 KB Output is correct
54 Correct 19 ms 16476 KB Output is correct
55 Correct 23 ms 16500 KB Output is correct
56 Correct 19 ms 15192 KB Output is correct
57 Correct 21 ms 13400 KB Output is correct
58 Correct 15 ms 12256 KB Output is correct
59 Correct 13 ms 11868 KB Output is correct
60 Correct 51 ms 24540 KB Output is correct
61 Correct 61 ms 24660 KB Output is correct
62 Correct 50 ms 24492 KB Output is correct
63 Correct 53 ms 24436 KB Output is correct
64 Correct 48 ms 24660 KB Output is correct
65 Correct 51 ms 24656 KB Output is correct
66 Correct 41 ms 19036 KB Output is correct
67 Correct 38 ms 19028 KB Output is correct
68 Correct 37 ms 19024 KB Output is correct
69 Correct 3 ms 9308 KB Output is correct
70 Correct 3 ms 9308 KB Output is correct
71 Correct 4 ms 9308 KB Output is correct
72 Correct 3 ms 9308 KB Output is correct
73 Correct 3 ms 9308 KB Output is correct
74 Correct 3 ms 9304 KB Output is correct
75 Correct 3 ms 9308 KB Output is correct
76 Correct 4 ms 9308 KB Output is correct
77 Correct 3 ms 9308 KB Output is correct
78 Correct 3 ms 9308 KB Output is correct
79 Correct 3 ms 9308 KB Output is correct
80 Correct 3 ms 9308 KB Output is correct
81 Correct 3 ms 9308 KB Output is correct
82 Correct 3 ms 9308 KB Output is correct
83 Correct 3 ms 9304 KB Output is correct
84 Correct 4 ms 9304 KB Output is correct
85 Correct 3 ms 9304 KB Output is correct
86 Correct 3 ms 9308 KB Output is correct
87 Correct 3 ms 9392 KB Output is correct
88 Correct 3 ms 9308 KB Output is correct
89 Correct 3 ms 9308 KB Output is correct
90 Correct 3 ms 9564 KB Output is correct
91 Correct 3 ms 9436 KB Output is correct
92 Correct 3 ms 9304 KB Output is correct
93 Correct 4 ms 9304 KB Output is correct
94 Correct 3 ms 9308 KB Output is correct
95 Correct 3 ms 9308 KB Output is correct
96 Correct 3 ms 9308 KB Output is correct
97 Correct 3 ms 9308 KB Output is correct
98 Correct 3 ms 9440 KB Output is correct
99 Correct 3 ms 9304 KB Output is correct
100 Correct 3 ms 9308 KB Output is correct
101 Correct 3 ms 9304 KB Output is correct
102 Correct 3 ms 9308 KB Output is correct
103 Correct 3 ms 9308 KB Output is correct
104 Correct 3 ms 9348 KB Output is correct
105 Correct 3 ms 9304 KB Output is correct
106 Correct 3 ms 9304 KB Output is correct
107 Correct 4 ms 9564 KB Output is correct
108 Correct 3 ms 9564 KB Output is correct
109 Correct 4 ms 9820 KB Output is correct
110 Correct 4 ms 9820 KB Output is correct
111 Correct 3 ms 9820 KB Output is correct
112 Correct 4 ms 9564 KB Output is correct
113 Correct 5 ms 9508 KB Output is correct
114 Correct 5 ms 9564 KB Output is correct
115 Correct 4 ms 9564 KB Output is correct
116 Correct 5 ms 9716 KB Output is correct
117 Correct 4 ms 9564 KB Output is correct
118 Correct 16 ms 12448 KB Output is correct
119 Correct 19 ms 12888 KB Output is correct
120 Correct 20 ms 13660 KB Output is correct
121 Correct 4 ms 10208 KB Output is correct
122 Correct 4 ms 10076 KB Output is correct
123 Correct 5 ms 10076 KB Output is correct
124 Correct 4 ms 10076 KB Output is correct
125 Correct 5 ms 10076 KB Output is correct
126 Correct 4 ms 10072 KB Output is correct
127 Correct 4 ms 9820 KB Output is correct
128 Correct 6 ms 9792 KB Output is correct
129 Correct 4 ms 9820 KB Output is correct
130 Correct 5 ms 9820 KB Output is correct
131 Correct 5 ms 9708 KB Output is correct
132 Correct 29 ms 13908 KB Output is correct
133 Correct 23 ms 13912 KB Output is correct
134 Correct 23 ms 13904 KB Output is correct
135 Correct 7 ms 10840 KB Output is correct
136 Correct 129 ms 123476 KB Output is correct
137 Correct 14 ms 10076 KB Output is correct
138 Correct 11 ms 9820 KB Output is correct
139 Correct 12 ms 10076 KB Output is correct
140 Correct 9 ms 9820 KB Output is correct
141 Correct 14 ms 11612 KB Output is correct
142 Correct 13 ms 11612 KB Output is correct
143 Correct 16 ms 12380 KB Output is correct
144 Correct 13 ms 11508 KB Output is correct
145 Correct 17 ms 11984 KB Output is correct
146 Correct 16 ms 11608 KB Output is correct
147 Correct 15 ms 12380 KB Output is correct
148 Correct 8 ms 10616 KB Output is correct
149 Correct 18 ms 12600 KB Output is correct
150 Correct 7 ms 10588 KB Output is correct
151 Correct 22 ms 13144 KB Output is correct
152 Correct 10 ms 11356 KB Output is correct
153 Correct 8 ms 11096 KB Output is correct
154 Correct 10 ms 11280 KB Output is correct
155 Correct 8 ms 10844 KB Output is correct
156 Correct 8 ms 10844 KB Output is correct
157 Correct 8 ms 10844 KB Output is correct
158 Correct 181 ms 167892 KB Output is correct
159 Correct 22 ms 10576 KB Output is correct
160 Correct 19 ms 10328 KB Output is correct
161 Correct 18 ms 10332 KB Output is correct
162 Correct 15 ms 9820 KB Output is correct
163 Correct 19 ms 12672 KB Output is correct
164 Correct 19 ms 12636 KB Output is correct
165 Correct 23 ms 12628 KB Output is correct
166 Correct 21 ms 12628 KB Output is correct
167 Correct 18 ms 12632 KB Output is correct
168 Correct 26 ms 12636 KB Output is correct
169 Correct 25 ms 14020 KB Output is correct
170 Correct 11 ms 11608 KB Output is correct
171 Correct 28 ms 14172 KB Output is correct
172 Correct 12 ms 11612 KB Output is correct
173 Correct 26 ms 14248 KB Output is correct
174 Correct 12 ms 11696 KB Output is correct
175 Correct 10 ms 11612 KB Output is correct
176 Correct 10 ms 11548 KB Output is correct
177 Correct 10 ms 11356 KB Output is correct
178 Correct 10 ms 11356 KB Output is correct
179 Correct 17 ms 13916 KB Output is correct
180 Correct 296 ms 219212 KB Output is correct
181 Correct 68 ms 14156 KB Output is correct
182 Correct 80 ms 13952 KB Output is correct
183 Correct 42 ms 11600 KB Output is correct
184 Correct 36 ms 11088 KB Output is correct
185 Correct 32 ms 16604 KB Output is correct
186 Correct 31 ms 18012 KB Output is correct
187 Correct 39 ms 17524 KB Output is correct
188 Correct 25 ms 13464 KB Output is correct
189 Correct 42 ms 18752 KB Output is correct
190 Correct 29 ms 14680 KB Output is correct
191 Correct 38 ms 18256 KB Output is correct
192 Correct 23 ms 12960 KB Output is correct
193 Correct 29 ms 16472 KB Output is correct
194 Correct 26 ms 16656 KB Output is correct
195 Runtime error 458 ms 524288 KB Execution killed with signal 9
196 Halted 0 ms 0 KB -