Submission #564483

# Submission time Handle Problem Language Result Execution time Memory
564483 2022-05-19T09:41:57 Z ngpin04 Painting Walls (APIO20_paint) C++14
100 / 100
882 ms 269312 KB
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define TASK ""
#define bit(x) (1LL << (x))
#define getbit(x, i) (((x) >> (i)) & 1)
#define ALL(x) (x).begin(), (x).end() 
using namespace std;
template <typename T1, typename T2> bool mini(T1 &a, T2 b) {
    if (a > b) {a = b; return true;} return false;
}
template <typename T1, typename T2> bool maxi(T1 &a, T2 b) {
    if (a < b) {a = b; return true;} return false;
}
mt19937_64 rd(chrono::steady_clock::now().time_since_epoch().count());

int rand(int l, int r) {
    return l + rd() % (r - l + 1);
}
const int N = 1e5 + 5; 
const int oo = 1e9;
const long long ooo = 1e18;
const int mod = 1e9 + 7; // 998244353;
const long double pi = acos(-1);

vector <int> pos[N];
vector <int> ok[N];
vector <int> b[N];

int a[N];
int c[N];
int dp[N];
int n,m,k;

bool col[N];

int solve() {
    for (int i = 0; i < m; i++)
    for (int j = 0; j < a[i]; j++) 
        pos[b[i][j]].push_back(i);
    
    for (int i = 0; i < n; i++) {
        int v = i % m;
        for (int j : pos[c[i]]) {
            int val = j - v;
            if (val < 0)
                val += m;
            ok[val].push_back(i);
        }
    }

    for (int i = 0; i < m; i++) 
    for (int l = 0, r = m - 1; r < (int) ok[i].size(); l++, r++) 
        if (ok[i][r] - ok[i][l] + 1 == m) 
            col[ok[i][l]] = true;
    
    int ans = 0;
    int cur = 0;
    int pre = -1;
    while (cur < n) {
        ans++;
        bool found = false;
        for (int i = cur; i > pre; i--) if (col[i]) {
            found = true;
            pre = cur;
            cur = i + m;
            break;
        }   
        if (!found)
            break;
    }
    if (cur < n)
        ans = -1;
    return ans;
}

int minimumInstructions(int N, int M, int K, 
    vector<int> C,
    vector<int> A, 
    vector<vector<int>> B) {

    n = N;
    m = M;
    k = K;
    for (int i = 0; i < n; i++)
        c[i] = C[i];

    for (int i = 0; i < m; i++) 
        a[i] = A[i];

    for (int i = 0; i < m; i++) {
        b[i].resize(a[i]);
        for (int j = 0; j < a[i]; j++)
            b[i][j] = B[i][j];
    }

    return solve();
}

#include "paint.h"
//#include "grader.cpp"
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7252 KB Output is correct
2 Correct 5 ms 7356 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 6 ms 7252 KB Output is correct
5 Correct 5 ms 7252 KB Output is correct
6 Correct 4 ms 7252 KB Output is correct
7 Correct 4 ms 7352 KB Output is correct
8 Correct 4 ms 7352 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7380 KB Output is correct
11 Correct 4 ms 7360 KB Output is correct
12 Correct 4 ms 7356 KB Output is correct
13 Correct 5 ms 7380 KB Output is correct
14 Correct 4 ms 7380 KB Output is correct
15 Correct 4 ms 7360 KB Output is correct
16 Correct 6 ms 7380 KB Output is correct
17 Correct 4 ms 7380 KB Output is correct
18 Correct 6 ms 7380 KB Output is correct
19 Correct 7 ms 7380 KB Output is correct
20 Correct 5 ms 7364 KB Output is correct
21 Correct 5 ms 7380 KB Output is correct
22 Correct 31 ms 12220 KB Output is correct
23 Correct 25 ms 12144 KB Output is correct
24 Correct 21 ms 12244 KB Output is correct
25 Correct 6 ms 7764 KB Output is correct
26 Correct 6 ms 7764 KB Output is correct
27 Correct 6 ms 7764 KB Output is correct
28 Correct 8 ms 7752 KB Output is correct
29 Correct 7 ms 7764 KB Output is correct
30 Correct 7 ms 7764 KB Output is correct
31 Correct 13 ms 9072 KB Output is correct
32 Correct 13 ms 9028 KB Output is correct
33 Correct 12 ms 9044 KB Output is correct
34 Correct 12 ms 9044 KB Output is correct
35 Correct 12 ms 9044 KB Output is correct
36 Correct 12 ms 9044 KB Output is correct
37 Correct 27 ms 12872 KB Output is correct
38 Correct 28 ms 12876 KB Output is correct
39 Correct 27 ms 12892 KB Output is correct
40 Correct 16 ms 9244 KB Output is correct
41 Correct 13 ms 8528 KB Output is correct
42 Correct 16 ms 9404 KB Output is correct
43 Correct 13 ms 8660 KB Output is correct
44 Correct 10 ms 8508 KB Output is correct
45 Correct 15 ms 9408 KB Output is correct
46 Correct 46 ms 20196 KB Output is correct
47 Correct 39 ms 14416 KB Output is correct
48 Correct 34 ms 17800 KB Output is correct
49 Correct 56 ms 18468 KB Output is correct
50 Correct 56 ms 17980 KB Output is correct
51 Correct 44 ms 15060 KB Output is correct
52 Correct 16 ms 9324 KB Output is correct
53 Correct 15 ms 9296 KB Output is correct
54 Correct 16 ms 9272 KB Output is correct
55 Correct 15 ms 9416 KB Output is correct
56 Correct 17 ms 9368 KB Output is correct
57 Correct 16 ms 9556 KB Output is correct
58 Correct 56 ms 21096 KB Output is correct
59 Correct 60 ms 21180 KB Output is correct
60 Correct 56 ms 21136 KB Output is correct
61 Correct 53 ms 21136 KB Output is correct
62 Correct 58 ms 21172 KB Output is correct
63 Correct 73 ms 21064 KB Output is correct
64 Correct 113 ms 20784 KB Output is correct
65 Correct 121 ms 20788 KB Output is correct
66 Correct 70 ms 20788 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7252 KB Output is correct
2 Correct 5 ms 7356 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 6 ms 7252 KB Output is correct
5 Correct 5 ms 7252 KB Output is correct
6 Correct 4 ms 7252 KB Output is correct
7 Correct 4 ms 7352 KB Output is correct
8 Correct 4 ms 7352 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7380 KB Output is correct
11 Correct 4 ms 7360 KB Output is correct
12 Correct 4 ms 7356 KB Output is correct
13 Correct 5 ms 7380 KB Output is correct
14 Correct 4 ms 7380 KB Output is correct
15 Correct 4 ms 7360 KB Output is correct
16 Correct 6 ms 7380 KB Output is correct
17 Correct 4 ms 7380 KB Output is correct
18 Correct 6 ms 7380 KB Output is correct
19 Correct 7 ms 7380 KB Output is correct
20 Correct 5 ms 7364 KB Output is correct
21 Correct 5 ms 7380 KB Output is correct
22 Correct 5 ms 7332 KB Output is correct
23 Correct 4 ms 7252 KB Output is correct
24 Correct 4 ms 7252 KB Output is correct
25 Correct 6 ms 7340 KB Output is correct
26 Correct 4 ms 7252 KB Output is correct
27 Correct 4 ms 7380 KB Output is correct
28 Correct 7 ms 7380 KB Output is correct
29 Correct 5 ms 7380 KB Output is correct
30 Correct 5 ms 7356 KB Output is correct
31 Correct 6 ms 7380 KB Output is correct
32 Correct 7 ms 7360 KB Output is correct
33 Correct 5 ms 7380 KB Output is correct
34 Correct 5 ms 7360 KB Output is correct
35 Correct 4 ms 7380 KB Output is correct
36 Correct 6 ms 7356 KB Output is correct
37 Correct 4 ms 7380 KB Output is correct
38 Correct 4 ms 7352 KB Output is correct
39 Correct 5 ms 7380 KB Output is correct
40 Correct 6 ms 7316 KB Output is correct
41 Correct 4 ms 7356 KB Output is correct
42 Correct 6 ms 7380 KB Output is correct
43 Correct 6 ms 7380 KB Output is correct
44 Correct 4 ms 7380 KB Output is correct
45 Correct 5 ms 7380 KB Output is correct
46 Correct 4 ms 7380 KB Output is correct
47 Correct 5 ms 7356 KB Output is correct
48 Correct 4 ms 7356 KB Output is correct
49 Correct 5 ms 7380 KB Output is correct
50 Correct 6 ms 7380 KB Output is correct
51 Correct 4 ms 7400 KB Output is correct
52 Correct 5 ms 7356 KB Output is correct
53 Correct 5 ms 7380 KB Output is correct
54 Correct 5 ms 7360 KB Output is correct
55 Correct 6 ms 7380 KB Output is correct
56 Correct 5 ms 7360 KB Output is correct
57 Correct 4 ms 7380 KB Output is correct
58 Correct 6 ms 7380 KB Output is correct
59 Correct 4 ms 7360 KB Output is correct
60 Correct 5 ms 7380 KB Output is correct
61 Correct 5 ms 7380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7332 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 6 ms 7252 KB Output is correct
4 Correct 5 ms 7356 KB Output is correct
5 Correct 4 ms 7252 KB Output is correct
6 Correct 6 ms 7252 KB Output is correct
7 Correct 5 ms 7252 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 4 ms 7352 KB Output is correct
10 Correct 4 ms 7352 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7380 KB Output is correct
13 Correct 4 ms 7360 KB Output is correct
14 Correct 4 ms 7356 KB Output is correct
15 Correct 5 ms 7380 KB Output is correct
16 Correct 4 ms 7380 KB Output is correct
17 Correct 4 ms 7360 KB Output is correct
18 Correct 6 ms 7380 KB Output is correct
19 Correct 4 ms 7380 KB Output is correct
20 Correct 6 ms 7380 KB Output is correct
21 Correct 7 ms 7380 KB Output is correct
22 Correct 5 ms 7364 KB Output is correct
23 Correct 5 ms 7380 KB Output is correct
24 Correct 31 ms 12220 KB Output is correct
25 Correct 25 ms 12144 KB Output is correct
26 Correct 21 ms 12244 KB Output is correct
27 Correct 4 ms 7252 KB Output is correct
28 Correct 6 ms 7340 KB Output is correct
29 Correct 4 ms 7252 KB Output is correct
30 Correct 4 ms 7380 KB Output is correct
31 Correct 7 ms 7380 KB Output is correct
32 Correct 5 ms 7380 KB Output is correct
33 Correct 5 ms 7356 KB Output is correct
34 Correct 6 ms 7380 KB Output is correct
35 Correct 7 ms 7360 KB Output is correct
36 Correct 5 ms 7380 KB Output is correct
37 Correct 5 ms 7360 KB Output is correct
38 Correct 4 ms 7380 KB Output is correct
39 Correct 6 ms 7356 KB Output is correct
40 Correct 4 ms 7380 KB Output is correct
41 Correct 4 ms 7352 KB Output is correct
42 Correct 5 ms 7380 KB Output is correct
43 Correct 6 ms 7316 KB Output is correct
44 Correct 4 ms 7356 KB Output is correct
45 Correct 6 ms 7380 KB Output is correct
46 Correct 6 ms 7380 KB Output is correct
47 Correct 4 ms 7380 KB Output is correct
48 Correct 5 ms 7380 KB Output is correct
49 Correct 4 ms 7380 KB Output is correct
50 Correct 5 ms 7356 KB Output is correct
51 Correct 4 ms 7356 KB Output is correct
52 Correct 5 ms 7380 KB Output is correct
53 Correct 6 ms 7380 KB Output is correct
54 Correct 4 ms 7400 KB Output is correct
55 Correct 5 ms 7356 KB Output is correct
56 Correct 5 ms 7380 KB Output is correct
57 Correct 5 ms 7360 KB Output is correct
58 Correct 6 ms 7380 KB Output is correct
59 Correct 5 ms 7360 KB Output is correct
60 Correct 4 ms 7380 KB Output is correct
61 Correct 6 ms 7380 KB Output is correct
62 Correct 4 ms 7360 KB Output is correct
63 Correct 5 ms 7380 KB Output is correct
64 Correct 5 ms 7380 KB Output is correct
65 Correct 4 ms 7508 KB Output is correct
66 Correct 4 ms 7380 KB Output is correct
67 Correct 6 ms 7680 KB Output is correct
68 Correct 5 ms 7484 KB Output is correct
69 Correct 6 ms 7636 KB Output is correct
70 Correct 7 ms 7608 KB Output is correct
71 Correct 8 ms 7636 KB Output is correct
72 Correct 8 ms 7636 KB Output is correct
73 Correct 5 ms 7508 KB Output is correct
74 Correct 7 ms 7632 KB Output is correct
75 Correct 5 ms 7628 KB Output is correct
76 Correct 44 ms 11064 KB Output is correct
77 Correct 31 ms 11556 KB Output is correct
78 Correct 37 ms 12168 KB Output is correct
79 Correct 6 ms 7764 KB Output is correct
80 Correct 7 ms 7740 KB Output is correct
81 Correct 7 ms 7764 KB Output is correct
82 Correct 6 ms 7764 KB Output is correct
83 Correct 7 ms 7764 KB Output is correct
84 Correct 7 ms 7764 KB Output is correct
85 Correct 9 ms 7764 KB Output is correct
86 Correct 7 ms 7764 KB Output is correct
87 Correct 8 ms 7764 KB Output is correct
88 Correct 8 ms 7736 KB Output is correct
89 Correct 8 ms 7756 KB Output is correct
90 Correct 37 ms 12512 KB Output is correct
91 Correct 65 ms 12492 KB Output is correct
92 Correct 49 ms 12624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7332 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 6 ms 7252 KB Output is correct
4 Correct 5 ms 7356 KB Output is correct
5 Correct 4 ms 7252 KB Output is correct
6 Correct 6 ms 7252 KB Output is correct
7 Correct 5 ms 7252 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 4 ms 7352 KB Output is correct
10 Correct 4 ms 7352 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7380 KB Output is correct
13 Correct 4 ms 7360 KB Output is correct
14 Correct 4 ms 7356 KB Output is correct
15 Correct 5 ms 7380 KB Output is correct
16 Correct 4 ms 7380 KB Output is correct
17 Correct 4 ms 7360 KB Output is correct
18 Correct 6 ms 7380 KB Output is correct
19 Correct 4 ms 7380 KB Output is correct
20 Correct 6 ms 7380 KB Output is correct
21 Correct 7 ms 7380 KB Output is correct
22 Correct 5 ms 7364 KB Output is correct
23 Correct 5 ms 7380 KB Output is correct
24 Correct 31 ms 12220 KB Output is correct
25 Correct 25 ms 12144 KB Output is correct
26 Correct 21 ms 12244 KB Output is correct
27 Correct 6 ms 7764 KB Output is correct
28 Correct 6 ms 7764 KB Output is correct
29 Correct 6 ms 7764 KB Output is correct
30 Correct 8 ms 7752 KB Output is correct
31 Correct 7 ms 7764 KB Output is correct
32 Correct 7 ms 7764 KB Output is correct
33 Correct 13 ms 9072 KB Output is correct
34 Correct 13 ms 9028 KB Output is correct
35 Correct 12 ms 9044 KB Output is correct
36 Correct 12 ms 9044 KB Output is correct
37 Correct 12 ms 9044 KB Output is correct
38 Correct 12 ms 9044 KB Output is correct
39 Correct 27 ms 12872 KB Output is correct
40 Correct 28 ms 12876 KB Output is correct
41 Correct 27 ms 12892 KB Output is correct
42 Correct 4 ms 7252 KB Output is correct
43 Correct 6 ms 7340 KB Output is correct
44 Correct 4 ms 7252 KB Output is correct
45 Correct 4 ms 7380 KB Output is correct
46 Correct 7 ms 7380 KB Output is correct
47 Correct 5 ms 7380 KB Output is correct
48 Correct 5 ms 7356 KB Output is correct
49 Correct 6 ms 7380 KB Output is correct
50 Correct 7 ms 7360 KB Output is correct
51 Correct 5 ms 7380 KB Output is correct
52 Correct 5 ms 7360 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 6 ms 7356 KB Output is correct
55 Correct 4 ms 7380 KB Output is correct
56 Correct 4 ms 7352 KB Output is correct
57 Correct 5 ms 7380 KB Output is correct
58 Correct 6 ms 7316 KB Output is correct
59 Correct 4 ms 7356 KB Output is correct
60 Correct 6 ms 7380 KB Output is correct
61 Correct 6 ms 7380 KB Output is correct
62 Correct 4 ms 7380 KB Output is correct
63 Correct 5 ms 7380 KB Output is correct
64 Correct 4 ms 7380 KB Output is correct
65 Correct 5 ms 7356 KB Output is correct
66 Correct 4 ms 7356 KB Output is correct
67 Correct 5 ms 7380 KB Output is correct
68 Correct 6 ms 7380 KB Output is correct
69 Correct 4 ms 7400 KB Output is correct
70 Correct 5 ms 7356 KB Output is correct
71 Correct 5 ms 7380 KB Output is correct
72 Correct 5 ms 7360 KB Output is correct
73 Correct 6 ms 7380 KB Output is correct
74 Correct 5 ms 7360 KB Output is correct
75 Correct 4 ms 7380 KB Output is correct
76 Correct 6 ms 7380 KB Output is correct
77 Correct 4 ms 7360 KB Output is correct
78 Correct 5 ms 7380 KB Output is correct
79 Correct 5 ms 7380 KB Output is correct
80 Correct 4 ms 7508 KB Output is correct
81 Correct 4 ms 7380 KB Output is correct
82 Correct 6 ms 7680 KB Output is correct
83 Correct 5 ms 7484 KB Output is correct
84 Correct 6 ms 7636 KB Output is correct
85 Correct 7 ms 7608 KB Output is correct
86 Correct 8 ms 7636 KB Output is correct
87 Correct 8 ms 7636 KB Output is correct
88 Correct 5 ms 7508 KB Output is correct
89 Correct 7 ms 7632 KB Output is correct
90 Correct 5 ms 7628 KB Output is correct
91 Correct 44 ms 11064 KB Output is correct
92 Correct 31 ms 11556 KB Output is correct
93 Correct 37 ms 12168 KB Output is correct
94 Correct 6 ms 7764 KB Output is correct
95 Correct 7 ms 7740 KB Output is correct
96 Correct 7 ms 7764 KB Output is correct
97 Correct 6 ms 7764 KB Output is correct
98 Correct 7 ms 7764 KB Output is correct
99 Correct 7 ms 7764 KB Output is correct
100 Correct 9 ms 7764 KB Output is correct
101 Correct 7 ms 7764 KB Output is correct
102 Correct 8 ms 7764 KB Output is correct
103 Correct 8 ms 7736 KB Output is correct
104 Correct 8 ms 7756 KB Output is correct
105 Correct 37 ms 12512 KB Output is correct
106 Correct 65 ms 12492 KB Output is correct
107 Correct 49 ms 12624 KB Output is correct
108 Correct 9 ms 7884 KB Output is correct
109 Correct 134 ms 46684 KB Output is correct
110 Correct 66 ms 30256 KB Output is correct
111 Correct 50 ms 28536 KB Output is correct
112 Correct 59 ms 30928 KB Output is correct
113 Correct 42 ms 23872 KB Output is correct
114 Correct 26 ms 9448 KB Output is correct
115 Correct 18 ms 9480 KB Output is correct
116 Correct 25 ms 10004 KB Output is correct
117 Correct 18 ms 9384 KB Output is correct
118 Correct 24 ms 9676 KB Output is correct
119 Correct 17 ms 9172 KB Output is correct
120 Correct 30 ms 11012 KB Output is correct
121 Correct 9 ms 8276 KB Output is correct
122 Correct 30 ms 11412 KB Output is correct
123 Correct 10 ms 8148 KB Output is correct
124 Correct 40 ms 12076 KB Output is correct
125 Correct 13 ms 8600 KB Output is correct
126 Correct 11 ms 8660 KB Output is correct
127 Correct 20 ms 9032 KB Output is correct
128 Correct 12 ms 8516 KB Output is correct
129 Correct 14 ms 8540 KB Output is correct
130 Correct 7 ms 7892 KB Output is correct
131 Correct 177 ms 74208 KB Output is correct
132 Correct 129 ms 56708 KB Output is correct
133 Correct 87 ms 39968 KB Output is correct
134 Correct 90 ms 40908 KB Output is correct
135 Correct 76 ms 40768 KB Output is correct
136 Correct 28 ms 10236 KB Output is correct
137 Correct 24 ms 10276 KB Output is correct
138 Correct 26 ms 10292 KB Output is correct
139 Correct 25 ms 10264 KB Output is correct
140 Correct 33 ms 10316 KB Output is correct
141 Correct 31 ms 10220 KB Output is correct
142 Correct 49 ms 13388 KB Output is correct
143 Correct 14 ms 8784 KB Output is correct
144 Correct 48 ms 13376 KB Output is correct
145 Correct 15 ms 8900 KB Output is correct
146 Correct 49 ms 13408 KB Output is correct
147 Correct 13 ms 8808 KB Output is correct
148 Correct 18 ms 9164 KB Output is correct
149 Correct 17 ms 9060 KB Output is correct
150 Correct 20 ms 9112 KB Output is correct
151 Correct 15 ms 8992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7332 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 6 ms 7252 KB Output is correct
4 Correct 5 ms 7356 KB Output is correct
5 Correct 4 ms 7252 KB Output is correct
6 Correct 6 ms 7252 KB Output is correct
7 Correct 5 ms 7252 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 4 ms 7352 KB Output is correct
10 Correct 4 ms 7352 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7380 KB Output is correct
13 Correct 4 ms 7360 KB Output is correct
14 Correct 4 ms 7356 KB Output is correct
15 Correct 5 ms 7380 KB Output is correct
16 Correct 4 ms 7380 KB Output is correct
17 Correct 4 ms 7360 KB Output is correct
18 Correct 6 ms 7380 KB Output is correct
19 Correct 4 ms 7380 KB Output is correct
20 Correct 6 ms 7380 KB Output is correct
21 Correct 7 ms 7380 KB Output is correct
22 Correct 5 ms 7364 KB Output is correct
23 Correct 5 ms 7380 KB Output is correct
24 Correct 31 ms 12220 KB Output is correct
25 Correct 25 ms 12144 KB Output is correct
26 Correct 21 ms 12244 KB Output is correct
27 Correct 6 ms 7764 KB Output is correct
28 Correct 6 ms 7764 KB Output is correct
29 Correct 6 ms 7764 KB Output is correct
30 Correct 8 ms 7752 KB Output is correct
31 Correct 7 ms 7764 KB Output is correct
32 Correct 7 ms 7764 KB Output is correct
33 Correct 13 ms 9072 KB Output is correct
34 Correct 13 ms 9028 KB Output is correct
35 Correct 12 ms 9044 KB Output is correct
36 Correct 12 ms 9044 KB Output is correct
37 Correct 12 ms 9044 KB Output is correct
38 Correct 12 ms 9044 KB Output is correct
39 Correct 27 ms 12872 KB Output is correct
40 Correct 28 ms 12876 KB Output is correct
41 Correct 27 ms 12892 KB Output is correct
42 Correct 16 ms 9244 KB Output is correct
43 Correct 13 ms 8528 KB Output is correct
44 Correct 16 ms 9404 KB Output is correct
45 Correct 13 ms 8660 KB Output is correct
46 Correct 10 ms 8508 KB Output is correct
47 Correct 15 ms 9408 KB Output is correct
48 Correct 46 ms 20196 KB Output is correct
49 Correct 39 ms 14416 KB Output is correct
50 Correct 34 ms 17800 KB Output is correct
51 Correct 56 ms 18468 KB Output is correct
52 Correct 56 ms 17980 KB Output is correct
53 Correct 44 ms 15060 KB Output is correct
54 Correct 16 ms 9324 KB Output is correct
55 Correct 15 ms 9296 KB Output is correct
56 Correct 16 ms 9272 KB Output is correct
57 Correct 15 ms 9416 KB Output is correct
58 Correct 17 ms 9368 KB Output is correct
59 Correct 16 ms 9556 KB Output is correct
60 Correct 56 ms 21096 KB Output is correct
61 Correct 60 ms 21180 KB Output is correct
62 Correct 56 ms 21136 KB Output is correct
63 Correct 53 ms 21136 KB Output is correct
64 Correct 58 ms 21172 KB Output is correct
65 Correct 73 ms 21064 KB Output is correct
66 Correct 113 ms 20784 KB Output is correct
67 Correct 121 ms 20788 KB Output is correct
68 Correct 70 ms 20788 KB Output is correct
69 Correct 4 ms 7252 KB Output is correct
70 Correct 6 ms 7340 KB Output is correct
71 Correct 4 ms 7252 KB Output is correct
72 Correct 4 ms 7380 KB Output is correct
73 Correct 7 ms 7380 KB Output is correct
74 Correct 5 ms 7380 KB Output is correct
75 Correct 5 ms 7356 KB Output is correct
76 Correct 6 ms 7380 KB Output is correct
77 Correct 7 ms 7360 KB Output is correct
78 Correct 5 ms 7380 KB Output is correct
79 Correct 5 ms 7360 KB Output is correct
80 Correct 4 ms 7380 KB Output is correct
81 Correct 6 ms 7356 KB Output is correct
82 Correct 4 ms 7380 KB Output is correct
83 Correct 4 ms 7352 KB Output is correct
84 Correct 5 ms 7380 KB Output is correct
85 Correct 6 ms 7316 KB Output is correct
86 Correct 4 ms 7356 KB Output is correct
87 Correct 6 ms 7380 KB Output is correct
88 Correct 6 ms 7380 KB Output is correct
89 Correct 4 ms 7380 KB Output is correct
90 Correct 5 ms 7380 KB Output is correct
91 Correct 4 ms 7380 KB Output is correct
92 Correct 5 ms 7356 KB Output is correct
93 Correct 4 ms 7356 KB Output is correct
94 Correct 5 ms 7380 KB Output is correct
95 Correct 6 ms 7380 KB Output is correct
96 Correct 4 ms 7400 KB Output is correct
97 Correct 5 ms 7356 KB Output is correct
98 Correct 5 ms 7380 KB Output is correct
99 Correct 5 ms 7360 KB Output is correct
100 Correct 6 ms 7380 KB Output is correct
101 Correct 5 ms 7360 KB Output is correct
102 Correct 4 ms 7380 KB Output is correct
103 Correct 6 ms 7380 KB Output is correct
104 Correct 4 ms 7360 KB Output is correct
105 Correct 5 ms 7380 KB Output is correct
106 Correct 5 ms 7380 KB Output is correct
107 Correct 4 ms 7508 KB Output is correct
108 Correct 4 ms 7380 KB Output is correct
109 Correct 6 ms 7680 KB Output is correct
110 Correct 5 ms 7484 KB Output is correct
111 Correct 6 ms 7636 KB Output is correct
112 Correct 7 ms 7608 KB Output is correct
113 Correct 8 ms 7636 KB Output is correct
114 Correct 8 ms 7636 KB Output is correct
115 Correct 5 ms 7508 KB Output is correct
116 Correct 7 ms 7632 KB Output is correct
117 Correct 5 ms 7628 KB Output is correct
118 Correct 44 ms 11064 KB Output is correct
119 Correct 31 ms 11556 KB Output is correct
120 Correct 37 ms 12168 KB Output is correct
121 Correct 6 ms 7764 KB Output is correct
122 Correct 7 ms 7740 KB Output is correct
123 Correct 7 ms 7764 KB Output is correct
124 Correct 6 ms 7764 KB Output is correct
125 Correct 7 ms 7764 KB Output is correct
126 Correct 7 ms 7764 KB Output is correct
127 Correct 9 ms 7764 KB Output is correct
128 Correct 7 ms 7764 KB Output is correct
129 Correct 8 ms 7764 KB Output is correct
130 Correct 8 ms 7736 KB Output is correct
131 Correct 8 ms 7756 KB Output is correct
132 Correct 37 ms 12512 KB Output is correct
133 Correct 65 ms 12492 KB Output is correct
134 Correct 49 ms 12624 KB Output is correct
135 Correct 9 ms 7884 KB Output is correct
136 Correct 134 ms 46684 KB Output is correct
137 Correct 66 ms 30256 KB Output is correct
138 Correct 50 ms 28536 KB Output is correct
139 Correct 59 ms 30928 KB Output is correct
140 Correct 42 ms 23872 KB Output is correct
141 Correct 26 ms 9448 KB Output is correct
142 Correct 18 ms 9480 KB Output is correct
143 Correct 25 ms 10004 KB Output is correct
144 Correct 18 ms 9384 KB Output is correct
145 Correct 24 ms 9676 KB Output is correct
146 Correct 17 ms 9172 KB Output is correct
147 Correct 30 ms 11012 KB Output is correct
148 Correct 9 ms 8276 KB Output is correct
149 Correct 30 ms 11412 KB Output is correct
150 Correct 10 ms 8148 KB Output is correct
151 Correct 40 ms 12076 KB Output is correct
152 Correct 13 ms 8600 KB Output is correct
153 Correct 11 ms 8660 KB Output is correct
154 Correct 20 ms 9032 KB Output is correct
155 Correct 12 ms 8516 KB Output is correct
156 Correct 14 ms 8540 KB Output is correct
157 Correct 7 ms 7892 KB Output is correct
158 Correct 177 ms 74208 KB Output is correct
159 Correct 129 ms 56708 KB Output is correct
160 Correct 87 ms 39968 KB Output is correct
161 Correct 90 ms 40908 KB Output is correct
162 Correct 76 ms 40768 KB Output is correct
163 Correct 28 ms 10236 KB Output is correct
164 Correct 24 ms 10276 KB Output is correct
165 Correct 26 ms 10292 KB Output is correct
166 Correct 25 ms 10264 KB Output is correct
167 Correct 33 ms 10316 KB Output is correct
168 Correct 31 ms 10220 KB Output is correct
169 Correct 49 ms 13388 KB Output is correct
170 Correct 14 ms 8784 KB Output is correct
171 Correct 48 ms 13376 KB Output is correct
172 Correct 15 ms 8900 KB Output is correct
173 Correct 49 ms 13408 KB Output is correct
174 Correct 13 ms 8808 KB Output is correct
175 Correct 18 ms 9164 KB Output is correct
176 Correct 17 ms 9060 KB Output is correct
177 Correct 20 ms 9112 KB Output is correct
178 Correct 15 ms 8992 KB Output is correct
179 Correct 12 ms 8904 KB Output is correct
180 Correct 326 ms 115192 KB Output is correct
181 Correct 368 ms 147628 KB Output is correct
182 Correct 480 ms 182648 KB Output is correct
183 Correct 243 ms 106412 KB Output is correct
184 Correct 205 ms 80932 KB Output is correct
185 Correct 50 ms 12664 KB Output is correct
186 Correct 35 ms 14296 KB Output is correct
187 Correct 51 ms 13756 KB Output is correct
188 Correct 52 ms 13528 KB Output is correct
189 Correct 45 ms 13432 KB Output is correct
190 Correct 56 ms 15436 KB Output is correct
191 Correct 51 ms 14644 KB Output is correct
192 Correct 38 ms 12236 KB Output is correct
193 Correct 37 ms 11976 KB Output is correct
194 Correct 22 ms 9920 KB Output is correct
195 Correct 882 ms 269312 KB Output is correct
196 Correct 597 ms 209944 KB Output is correct
197 Correct 512 ms 197400 KB Output is correct
198 Correct 438 ms 163140 KB Output is correct
199 Correct 383 ms 166872 KB Output is correct
200 Correct 85 ms 22104 KB Output is correct
201 Correct 96 ms 22192 KB Output is correct
202 Correct 97 ms 22092 KB Output is correct
203 Correct 92 ms 22084 KB Output is correct
204 Correct 84 ms 22104 KB Output is correct
205 Correct 85 ms 22112 KB Output is correct
206 Correct 80 ms 21656 KB Output is correct
207 Correct 78 ms 21192 KB Output is correct
208 Correct 86 ms 21728 KB Output is correct
209 Correct 80 ms 21164 KB Output is correct
210 Correct 118 ms 21624 KB Output is correct
211 Correct 88 ms 21144 KB Output is correct
212 Correct 65 ms 21596 KB Output is correct
213 Correct 68 ms 17736 KB Output is correct
214 Correct 66 ms 17184 KB Output is correct
215 Correct 63 ms 17040 KB Output is correct