#ifndef FEXT
#include "paint.h"
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl '\n'
#define fi first
#define se second
#define For(i, l, r) for (auto i = (l); i < (r); i++)
#define ForE(i, l, r) for (auto i = (l); i <= (r); i++)
#define FordE(i, l, r) for (auto i = (l); i >= (r); i--)
#define Fora(v, a) for (auto v: (a))
#define bend(a) (a).begin(), (a).end()
#define isz(a) ((signed)(a).size())
using ll = long long;
using ld = long double;
using pii = pair <int, int>;
using vi = vector <int>;
using vpii = vector <pii>;
using vvi = vector <vi>;
const int N = 1e5 + 5, M = 5e4 + 5, K = 1e5 + 5, F = sqrt(4e5) + 5, LN = 17;
int n, m, k;
int a[N];
vi b[M];
vi rb[K]; // rb[i] = {j such that b[j] contains i}
bool c[N]; // c[i] = 1 if there exist a valid instruction (x, y = i - m + 1)
int dp[N][LN];
int dp_range_min(int l, int r){
if (l > r){
return N;
}
int z = __lg(r - l + 1);
return min(dp[l + (1 << z) - 1][z], dp[r][z]);
}
int prev(int i){
return i == 1 ? m : i - 1;
}
int next(int i){
return i == m ? 1 : i + 1;
}
int minimumInstructions(int _n, int _m, int _k, vi _c, vi _a, vvi _b){
n = _n; m = _m; k = _k;
ForE(i, 1, n){
a[i] = _c[i - 1];
}
ForE(j, 1, m){
b[j] = _b[j - 1];
}
ForE(j, 1, m){
Fora(i, b[j]){
rb[i].emplace_back(j);
}
}
for (int anchor = m; anchor <= n; anchor += m){
Fora(j, rb[a[anchor]]){
int l = anchor, r = anchor;
int jl = j, jr = j;
while (l - 1 > anchor - m){
if (binary_search(bend(b[prev(jl)]), a[l - 1])){
l--;
jl = prev(jl);
}
else{
break;
}
}
while (r + 1 < anchor + m and r + 1 <= n){
if (binary_search(bend(b[next(jr)]), a[r + 1])){
r++;
jr = next(jr);
}
else{
break;
}
}
ForE(i, l + m - 1, r){
c[i] = 1;
}
}
}
dp[0][0] = 0;
For(j, 1, LN){
if (0 - (1 << (j - 1)) >= 0){
dp[0][j] = min(dp[0][j - 1], dp[0 - (1 << (j - 1))][j - 1]);
}
}
ForE(i, 1, n){
dp[i][0] = N;
if (c[i]){
dp[i][0] = min(dp[i][0], dp_range_min(max(0, i - m), i - 1) + 1);
}
For(j, 1, LN){
if (i - (1 << (j - 1)) >= 0){
dp[i][j] = min(dp[i][j - 1], dp[i - (1 << (j - 1))][j - 1]);
}
}
}
return (dp[n][0] == N ? -1 : dp[n][0]);
}
#ifdef FEXT
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
freopen("KEK.inp", "r", stdin);
freopen("KEK.out", "w", stdout);
int N, M, K;
assert(3 == scanf("%d %d %d", &N, &M, &K));
std::vector<int> C(N);
for (int i = 0; i < N; ++i) {
assert(1 == scanf("%d", &C[i]));
}
std::vector<int> A(M);
std::vector<std::vector<int>> B(M);
for (int i = 0; i < M; ++i) {
assert(1 == scanf("%d", &A[i]));
B[i].resize(A[i]);
for (int j = 0; j < A[i]; ++j) {
assert(1 == scanf("%d", &B[i][j]));
}
}
int minimum_instructions = minimumInstructions(N, M, K, C, A, B);
printf("%d\n", minimum_instructions);
return 0;
}
#endif
/*
==================================================+
INPUT: |
--------------------------------------------------|
8 3 5
3 3 1 3 4 4 2 2
3 0 1 2
2 2 3
2 3 4
--------------------------------------------------|
5 4 4
1 0 1 2 2
2 0 1
1 1
1 2
1 3
--------------------------------------------------|
==================================================+
OUTPUT: |
--------------------------------------------------|
3
--------------------------------------------------|
-1
--------------------------------------------------|
==================================================+
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
3840 KB |
Output is correct |
2 |
Correct |
2 ms |
3796 KB |
Output is correct |
3 |
Correct |
2 ms |
3828 KB |
Output is correct |
4 |
Correct |
2 ms |
3924 KB |
Output is correct |
5 |
Correct |
2 ms |
3796 KB |
Output is correct |
6 |
Correct |
2 ms |
3796 KB |
Output is correct |
7 |
Correct |
2 ms |
3796 KB |
Output is correct |
8 |
Correct |
2 ms |
3796 KB |
Output is correct |
9 |
Correct |
2 ms |
3796 KB |
Output is correct |
10 |
Correct |
2 ms |
3796 KB |
Output is correct |
11 |
Correct |
3 ms |
3796 KB |
Output is correct |
12 |
Correct |
2 ms |
3796 KB |
Output is correct |
13 |
Correct |
3 ms |
3796 KB |
Output is correct |
14 |
Correct |
3 ms |
3796 KB |
Output is correct |
15 |
Correct |
2 ms |
3836 KB |
Output is correct |
16 |
Correct |
2 ms |
3924 KB |
Output is correct |
17 |
Correct |
2 ms |
3924 KB |
Output is correct |
18 |
Correct |
3 ms |
3796 KB |
Output is correct |
19 |
Correct |
2 ms |
3924 KB |
Output is correct |
20 |
Correct |
2 ms |
3924 KB |
Output is correct |
21 |
Correct |
2 ms |
3924 KB |
Output is correct |
22 |
Correct |
20 ms |
8752 KB |
Output is correct |
23 |
Correct |
20 ms |
8652 KB |
Output is correct |
24 |
Correct |
20 ms |
8692 KB |
Output is correct |
25 |
Correct |
6 ms |
5460 KB |
Output is correct |
26 |
Correct |
6 ms |
5360 KB |
Output is correct |
27 |
Correct |
5 ms |
5356 KB |
Output is correct |
28 |
Correct |
5 ms |
5460 KB |
Output is correct |
29 |
Correct |
5 ms |
5460 KB |
Output is correct |
30 |
Correct |
5 ms |
5376 KB |
Output is correct |
31 |
Correct |
11 ms |
6604 KB |
Output is correct |
32 |
Correct |
11 ms |
6612 KB |
Output is correct |
33 |
Correct |
10 ms |
6612 KB |
Output is correct |
34 |
Correct |
11 ms |
6580 KB |
Output is correct |
35 |
Correct |
11 ms |
6612 KB |
Output is correct |
36 |
Correct |
12 ms |
6612 KB |
Output is correct |
37 |
Correct |
26 ms |
10532 KB |
Output is correct |
38 |
Correct |
24 ms |
10540 KB |
Output is correct |
39 |
Correct |
27 ms |
10492 KB |
Output is correct |
40 |
Correct |
15 ms |
11092 KB |
Output is correct |
41 |
Correct |
11 ms |
8452 KB |
Output is correct |
42 |
Correct |
19 ms |
11776 KB |
Output is correct |
43 |
Correct |
12 ms |
9084 KB |
Output is correct |
44 |
Correct |
11 ms |
8660 KB |
Output is correct |
45 |
Correct |
19 ms |
11876 KB |
Output is correct |
46 |
Correct |
45 ms |
21628 KB |
Output is correct |
47 |
Correct |
35 ms |
14244 KB |
Output is correct |
48 |
Correct |
35 ms |
17472 KB |
Output is correct |
49 |
Correct |
40 ms |
17892 KB |
Output is correct |
50 |
Correct |
45 ms |
17996 KB |
Output is correct |
51 |
Correct |
32 ms |
15620 KB |
Output is correct |
52 |
Correct |
18 ms |
11908 KB |
Output is correct |
53 |
Correct |
19 ms |
11852 KB |
Output is correct |
54 |
Correct |
20 ms |
11840 KB |
Output is correct |
55 |
Correct |
18 ms |
11920 KB |
Output is correct |
56 |
Correct |
18 ms |
11852 KB |
Output is correct |
57 |
Correct |
17 ms |
11852 KB |
Output is correct |
58 |
Correct |
55 ms |
23480 KB |
Output is correct |
59 |
Correct |
52 ms |
23404 KB |
Output is correct |
60 |
Correct |
54 ms |
23408 KB |
Output is correct |
61 |
Correct |
53 ms |
23416 KB |
Output is correct |
62 |
Correct |
54 ms |
23396 KB |
Output is correct |
63 |
Correct |
55 ms |
23508 KB |
Output is correct |
64 |
Correct |
48 ms |
22348 KB |
Output is correct |
65 |
Correct |
50 ms |
22380 KB |
Output is correct |
66 |
Correct |
51 ms |
22412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
3840 KB |
Output is correct |
2 |
Correct |
2 ms |
3796 KB |
Output is correct |
3 |
Correct |
2 ms |
3828 KB |
Output is correct |
4 |
Correct |
2 ms |
3924 KB |
Output is correct |
5 |
Correct |
2 ms |
3796 KB |
Output is correct |
6 |
Correct |
2 ms |
3796 KB |
Output is correct |
7 |
Correct |
2 ms |
3796 KB |
Output is correct |
8 |
Correct |
2 ms |
3796 KB |
Output is correct |
9 |
Correct |
2 ms |
3796 KB |
Output is correct |
10 |
Correct |
2 ms |
3796 KB |
Output is correct |
11 |
Correct |
3 ms |
3796 KB |
Output is correct |
12 |
Correct |
2 ms |
3796 KB |
Output is correct |
13 |
Correct |
3 ms |
3796 KB |
Output is correct |
14 |
Correct |
3 ms |
3796 KB |
Output is correct |
15 |
Correct |
2 ms |
3836 KB |
Output is correct |
16 |
Correct |
2 ms |
3924 KB |
Output is correct |
17 |
Correct |
2 ms |
3924 KB |
Output is correct |
18 |
Correct |
3 ms |
3796 KB |
Output is correct |
19 |
Correct |
2 ms |
3924 KB |
Output is correct |
20 |
Correct |
2 ms |
3924 KB |
Output is correct |
21 |
Correct |
2 ms |
3924 KB |
Output is correct |
22 |
Correct |
2 ms |
3796 KB |
Output is correct |
23 |
Correct |
2 ms |
3796 KB |
Output is correct |
24 |
Correct |
3 ms |
3796 KB |
Output is correct |
25 |
Correct |
2 ms |
3796 KB |
Output is correct |
26 |
Correct |
2 ms |
3828 KB |
Output is correct |
27 |
Correct |
2 ms |
3832 KB |
Output is correct |
28 |
Correct |
2 ms |
3832 KB |
Output is correct |
29 |
Correct |
2 ms |
3796 KB |
Output is correct |
30 |
Correct |
2 ms |
3832 KB |
Output is correct |
31 |
Correct |
2 ms |
3828 KB |
Output is correct |
32 |
Correct |
2 ms |
3796 KB |
Output is correct |
33 |
Correct |
2 ms |
3796 KB |
Output is correct |
34 |
Correct |
2 ms |
3796 KB |
Output is correct |
35 |
Correct |
3 ms |
3796 KB |
Output is correct |
36 |
Correct |
2 ms |
3836 KB |
Output is correct |
37 |
Correct |
2 ms |
3796 KB |
Output is correct |
38 |
Correct |
2 ms |
3796 KB |
Output is correct |
39 |
Correct |
2 ms |
3796 KB |
Output is correct |
40 |
Correct |
2 ms |
3836 KB |
Output is correct |
41 |
Correct |
2 ms |
3796 KB |
Output is correct |
42 |
Correct |
2 ms |
3832 KB |
Output is correct |
43 |
Correct |
2 ms |
3796 KB |
Output is correct |
44 |
Correct |
2 ms |
3796 KB |
Output is correct |
45 |
Correct |
2 ms |
3796 KB |
Output is correct |
46 |
Correct |
2 ms |
3832 KB |
Output is correct |
47 |
Correct |
3 ms |
3796 KB |
Output is correct |
48 |
Correct |
3 ms |
3836 KB |
Output is correct |
49 |
Correct |
2 ms |
3796 KB |
Output is correct |
50 |
Correct |
3 ms |
3924 KB |
Output is correct |
51 |
Correct |
2 ms |
3924 KB |
Output is correct |
52 |
Correct |
2 ms |
3924 KB |
Output is correct |
53 |
Correct |
3 ms |
3924 KB |
Output is correct |
54 |
Correct |
3 ms |
3796 KB |
Output is correct |
55 |
Correct |
3 ms |
3832 KB |
Output is correct |
56 |
Correct |
3 ms |
3924 KB |
Output is correct |
57 |
Correct |
2 ms |
3796 KB |
Output is correct |
58 |
Correct |
3 ms |
3924 KB |
Output is correct |
59 |
Correct |
2 ms |
3796 KB |
Output is correct |
60 |
Correct |
3 ms |
3924 KB |
Output is correct |
61 |
Correct |
3 ms |
3832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3796 KB |
Output is correct |
2 |
Correct |
2 ms |
3796 KB |
Output is correct |
3 |
Correct |
3 ms |
3840 KB |
Output is correct |
4 |
Correct |
2 ms |
3796 KB |
Output is correct |
5 |
Correct |
2 ms |
3828 KB |
Output is correct |
6 |
Correct |
2 ms |
3924 KB |
Output is correct |
7 |
Correct |
2 ms |
3796 KB |
Output is correct |
8 |
Correct |
2 ms |
3796 KB |
Output is correct |
9 |
Correct |
2 ms |
3796 KB |
Output is correct |
10 |
Correct |
2 ms |
3796 KB |
Output is correct |
11 |
Correct |
2 ms |
3796 KB |
Output is correct |
12 |
Correct |
2 ms |
3796 KB |
Output is correct |
13 |
Correct |
3 ms |
3796 KB |
Output is correct |
14 |
Correct |
2 ms |
3796 KB |
Output is correct |
15 |
Correct |
3 ms |
3796 KB |
Output is correct |
16 |
Correct |
3 ms |
3796 KB |
Output is correct |
17 |
Correct |
2 ms |
3836 KB |
Output is correct |
18 |
Correct |
2 ms |
3924 KB |
Output is correct |
19 |
Correct |
2 ms |
3924 KB |
Output is correct |
20 |
Correct |
3 ms |
3796 KB |
Output is correct |
21 |
Correct |
2 ms |
3924 KB |
Output is correct |
22 |
Correct |
2 ms |
3924 KB |
Output is correct |
23 |
Correct |
2 ms |
3924 KB |
Output is correct |
24 |
Correct |
20 ms |
8752 KB |
Output is correct |
25 |
Correct |
20 ms |
8652 KB |
Output is correct |
26 |
Correct |
20 ms |
8692 KB |
Output is correct |
27 |
Correct |
3 ms |
3796 KB |
Output is correct |
28 |
Correct |
2 ms |
3796 KB |
Output is correct |
29 |
Correct |
2 ms |
3828 KB |
Output is correct |
30 |
Correct |
2 ms |
3832 KB |
Output is correct |
31 |
Correct |
2 ms |
3832 KB |
Output is correct |
32 |
Correct |
2 ms |
3796 KB |
Output is correct |
33 |
Correct |
2 ms |
3832 KB |
Output is correct |
34 |
Correct |
2 ms |
3828 KB |
Output is correct |
35 |
Correct |
2 ms |
3796 KB |
Output is correct |
36 |
Correct |
2 ms |
3796 KB |
Output is correct |
37 |
Correct |
2 ms |
3796 KB |
Output is correct |
38 |
Correct |
3 ms |
3796 KB |
Output is correct |
39 |
Correct |
2 ms |
3836 KB |
Output is correct |
40 |
Correct |
2 ms |
3796 KB |
Output is correct |
41 |
Correct |
2 ms |
3796 KB |
Output is correct |
42 |
Correct |
2 ms |
3796 KB |
Output is correct |
43 |
Correct |
2 ms |
3836 KB |
Output is correct |
44 |
Correct |
2 ms |
3796 KB |
Output is correct |
45 |
Correct |
2 ms |
3832 KB |
Output is correct |
46 |
Correct |
2 ms |
3796 KB |
Output is correct |
47 |
Correct |
2 ms |
3796 KB |
Output is correct |
48 |
Correct |
2 ms |
3796 KB |
Output is correct |
49 |
Correct |
2 ms |
3832 KB |
Output is correct |
50 |
Correct |
3 ms |
3796 KB |
Output is correct |
51 |
Correct |
3 ms |
3836 KB |
Output is correct |
52 |
Correct |
2 ms |
3796 KB |
Output is correct |
53 |
Correct |
3 ms |
3924 KB |
Output is correct |
54 |
Correct |
2 ms |
3924 KB |
Output is correct |
55 |
Correct |
2 ms |
3924 KB |
Output is correct |
56 |
Correct |
3 ms |
3924 KB |
Output is correct |
57 |
Correct |
3 ms |
3796 KB |
Output is correct |
58 |
Correct |
3 ms |
3832 KB |
Output is correct |
59 |
Correct |
3 ms |
3924 KB |
Output is correct |
60 |
Correct |
2 ms |
3796 KB |
Output is correct |
61 |
Correct |
3 ms |
3924 KB |
Output is correct |
62 |
Correct |
2 ms |
3796 KB |
Output is correct |
63 |
Correct |
3 ms |
3924 KB |
Output is correct |
64 |
Correct |
3 ms |
3832 KB |
Output is correct |
65 |
Correct |
2 ms |
3796 KB |
Output is correct |
66 |
Correct |
3 ms |
3796 KB |
Output is correct |
67 |
Correct |
4 ms |
3832 KB |
Output is correct |
68 |
Correct |
3 ms |
3796 KB |
Output is correct |
69 |
Correct |
3 ms |
3832 KB |
Output is correct |
70 |
Correct |
4 ms |
4052 KB |
Output is correct |
71 |
Correct |
5 ms |
4180 KB |
Output is correct |
72 |
Correct |
5 ms |
4028 KB |
Output is correct |
73 |
Correct |
4 ms |
3924 KB |
Output is correct |
74 |
Correct |
4 ms |
4104 KB |
Output is correct |
75 |
Correct |
3 ms |
4016 KB |
Output is correct |
76 |
Correct |
20 ms |
7524 KB |
Output is correct |
77 |
Correct |
18 ms |
8064 KB |
Output is correct |
78 |
Correct |
24 ms |
8664 KB |
Output is correct |
79 |
Correct |
3 ms |
3832 KB |
Output is correct |
80 |
Correct |
4 ms |
3796 KB |
Output is correct |
81 |
Correct |
4 ms |
3796 KB |
Output is correct |
82 |
Correct |
4 ms |
3796 KB |
Output is correct |
83 |
Correct |
4 ms |
3796 KB |
Output is correct |
84 |
Correct |
5 ms |
4180 KB |
Output is correct |
85 |
Correct |
5 ms |
4180 KB |
Output is correct |
86 |
Correct |
6 ms |
4180 KB |
Output is correct |
87 |
Correct |
5 ms |
4180 KB |
Output is correct |
88 |
Correct |
5 ms |
4180 KB |
Output is correct |
89 |
Correct |
5 ms |
4176 KB |
Output is correct |
90 |
Correct |
27 ms |
9004 KB |
Output is correct |
91 |
Correct |
28 ms |
9036 KB |
Output is correct |
92 |
Correct |
28 ms |
9068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3796 KB |
Output is correct |
2 |
Correct |
2 ms |
3796 KB |
Output is correct |
3 |
Correct |
3 ms |
3840 KB |
Output is correct |
4 |
Correct |
2 ms |
3796 KB |
Output is correct |
5 |
Correct |
2 ms |
3828 KB |
Output is correct |
6 |
Correct |
2 ms |
3924 KB |
Output is correct |
7 |
Correct |
2 ms |
3796 KB |
Output is correct |
8 |
Correct |
2 ms |
3796 KB |
Output is correct |
9 |
Correct |
2 ms |
3796 KB |
Output is correct |
10 |
Correct |
2 ms |
3796 KB |
Output is correct |
11 |
Correct |
2 ms |
3796 KB |
Output is correct |
12 |
Correct |
2 ms |
3796 KB |
Output is correct |
13 |
Correct |
3 ms |
3796 KB |
Output is correct |
14 |
Correct |
2 ms |
3796 KB |
Output is correct |
15 |
Correct |
3 ms |
3796 KB |
Output is correct |
16 |
Correct |
3 ms |
3796 KB |
Output is correct |
17 |
Correct |
2 ms |
3836 KB |
Output is correct |
18 |
Correct |
2 ms |
3924 KB |
Output is correct |
19 |
Correct |
2 ms |
3924 KB |
Output is correct |
20 |
Correct |
3 ms |
3796 KB |
Output is correct |
21 |
Correct |
2 ms |
3924 KB |
Output is correct |
22 |
Correct |
2 ms |
3924 KB |
Output is correct |
23 |
Correct |
2 ms |
3924 KB |
Output is correct |
24 |
Correct |
20 ms |
8752 KB |
Output is correct |
25 |
Correct |
20 ms |
8652 KB |
Output is correct |
26 |
Correct |
20 ms |
8692 KB |
Output is correct |
27 |
Correct |
6 ms |
5460 KB |
Output is correct |
28 |
Correct |
6 ms |
5360 KB |
Output is correct |
29 |
Correct |
5 ms |
5356 KB |
Output is correct |
30 |
Correct |
5 ms |
5460 KB |
Output is correct |
31 |
Correct |
5 ms |
5460 KB |
Output is correct |
32 |
Correct |
5 ms |
5376 KB |
Output is correct |
33 |
Correct |
11 ms |
6604 KB |
Output is correct |
34 |
Correct |
11 ms |
6612 KB |
Output is correct |
35 |
Correct |
10 ms |
6612 KB |
Output is correct |
36 |
Correct |
11 ms |
6580 KB |
Output is correct |
37 |
Correct |
11 ms |
6612 KB |
Output is correct |
38 |
Correct |
12 ms |
6612 KB |
Output is correct |
39 |
Correct |
26 ms |
10532 KB |
Output is correct |
40 |
Correct |
24 ms |
10540 KB |
Output is correct |
41 |
Correct |
27 ms |
10492 KB |
Output is correct |
42 |
Correct |
3 ms |
3796 KB |
Output is correct |
43 |
Correct |
2 ms |
3796 KB |
Output is correct |
44 |
Correct |
2 ms |
3828 KB |
Output is correct |
45 |
Correct |
2 ms |
3832 KB |
Output is correct |
46 |
Correct |
2 ms |
3832 KB |
Output is correct |
47 |
Correct |
2 ms |
3796 KB |
Output is correct |
48 |
Correct |
2 ms |
3832 KB |
Output is correct |
49 |
Correct |
2 ms |
3828 KB |
Output is correct |
50 |
Correct |
2 ms |
3796 KB |
Output is correct |
51 |
Correct |
2 ms |
3796 KB |
Output is correct |
52 |
Correct |
2 ms |
3796 KB |
Output is correct |
53 |
Correct |
3 ms |
3796 KB |
Output is correct |
54 |
Correct |
2 ms |
3836 KB |
Output is correct |
55 |
Correct |
2 ms |
3796 KB |
Output is correct |
56 |
Correct |
2 ms |
3796 KB |
Output is correct |
57 |
Correct |
2 ms |
3796 KB |
Output is correct |
58 |
Correct |
2 ms |
3836 KB |
Output is correct |
59 |
Correct |
2 ms |
3796 KB |
Output is correct |
60 |
Correct |
2 ms |
3832 KB |
Output is correct |
61 |
Correct |
2 ms |
3796 KB |
Output is correct |
62 |
Correct |
2 ms |
3796 KB |
Output is correct |
63 |
Correct |
2 ms |
3796 KB |
Output is correct |
64 |
Correct |
2 ms |
3832 KB |
Output is correct |
65 |
Correct |
3 ms |
3796 KB |
Output is correct |
66 |
Correct |
3 ms |
3836 KB |
Output is correct |
67 |
Correct |
2 ms |
3796 KB |
Output is correct |
68 |
Correct |
3 ms |
3924 KB |
Output is correct |
69 |
Correct |
2 ms |
3924 KB |
Output is correct |
70 |
Correct |
2 ms |
3924 KB |
Output is correct |
71 |
Correct |
3 ms |
3924 KB |
Output is correct |
72 |
Correct |
3 ms |
3796 KB |
Output is correct |
73 |
Correct |
3 ms |
3832 KB |
Output is correct |
74 |
Correct |
3 ms |
3924 KB |
Output is correct |
75 |
Correct |
2 ms |
3796 KB |
Output is correct |
76 |
Correct |
3 ms |
3924 KB |
Output is correct |
77 |
Correct |
2 ms |
3796 KB |
Output is correct |
78 |
Correct |
3 ms |
3924 KB |
Output is correct |
79 |
Correct |
3 ms |
3832 KB |
Output is correct |
80 |
Correct |
2 ms |
3796 KB |
Output is correct |
81 |
Correct |
3 ms |
3796 KB |
Output is correct |
82 |
Correct |
4 ms |
3832 KB |
Output is correct |
83 |
Correct |
3 ms |
3796 KB |
Output is correct |
84 |
Correct |
3 ms |
3832 KB |
Output is correct |
85 |
Correct |
4 ms |
4052 KB |
Output is correct |
86 |
Correct |
5 ms |
4180 KB |
Output is correct |
87 |
Correct |
5 ms |
4028 KB |
Output is correct |
88 |
Correct |
4 ms |
3924 KB |
Output is correct |
89 |
Correct |
4 ms |
4104 KB |
Output is correct |
90 |
Correct |
3 ms |
4016 KB |
Output is correct |
91 |
Correct |
20 ms |
7524 KB |
Output is correct |
92 |
Correct |
18 ms |
8064 KB |
Output is correct |
93 |
Correct |
24 ms |
8664 KB |
Output is correct |
94 |
Correct |
3 ms |
3832 KB |
Output is correct |
95 |
Correct |
4 ms |
3796 KB |
Output is correct |
96 |
Correct |
4 ms |
3796 KB |
Output is correct |
97 |
Correct |
4 ms |
3796 KB |
Output is correct |
98 |
Correct |
4 ms |
3796 KB |
Output is correct |
99 |
Correct |
5 ms |
4180 KB |
Output is correct |
100 |
Correct |
5 ms |
4180 KB |
Output is correct |
101 |
Correct |
6 ms |
4180 KB |
Output is correct |
102 |
Correct |
5 ms |
4180 KB |
Output is correct |
103 |
Correct |
5 ms |
4180 KB |
Output is correct |
104 |
Correct |
5 ms |
4176 KB |
Output is correct |
105 |
Correct |
27 ms |
9004 KB |
Output is correct |
106 |
Correct |
28 ms |
9036 KB |
Output is correct |
107 |
Correct |
28 ms |
9068 KB |
Output is correct |
108 |
Correct |
6 ms |
5332 KB |
Output is correct |
109 |
Correct |
54 ms |
5032 KB |
Output is correct |
110 |
Correct |
4 ms |
4820 KB |
Output is correct |
111 |
Correct |
4 ms |
4820 KB |
Output is correct |
112 |
Correct |
5 ms |
5072 KB |
Output is correct |
113 |
Correct |
4 ms |
4820 KB |
Output is correct |
114 |
Correct |
16 ms |
6424 KB |
Output is correct |
115 |
Correct |
21 ms |
6312 KB |
Output is correct |
116 |
Correct |
26 ms |
7220 KB |
Output is correct |
117 |
Correct |
16 ms |
6220 KB |
Output is correct |
118 |
Correct |
19 ms |
6612 KB |
Output is correct |
119 |
Correct |
14 ms |
6268 KB |
Output is correct |
120 |
Correct |
20 ms |
8020 KB |
Output is correct |
121 |
Correct |
7 ms |
5332 KB |
Output is correct |
122 |
Correct |
24 ms |
8396 KB |
Output is correct |
123 |
Correct |
8 ms |
5204 KB |
Output is correct |
124 |
Correct |
28 ms |
9520 KB |
Output is correct |
125 |
Correct |
10 ms |
6016 KB |
Output is correct |
126 |
Correct |
10 ms |
5920 KB |
Output is correct |
127 |
Correct |
11 ms |
6532 KB |
Output is correct |
128 |
Correct |
9 ms |
5716 KB |
Output is correct |
129 |
Correct |
12 ms |
5764 KB |
Output is correct |
130 |
Correct |
10 ms |
5352 KB |
Output is correct |
131 |
Correct |
84 ms |
5480 KB |
Output is correct |
132 |
Correct |
6 ms |
5460 KB |
Output is correct |
133 |
Correct |
7 ms |
5508 KB |
Output is correct |
134 |
Correct |
6 ms |
5504 KB |
Output is correct |
135 |
Correct |
6 ms |
5508 KB |
Output is correct |
136 |
Correct |
24 ms |
7684 KB |
Output is correct |
137 |
Correct |
22 ms |
7708 KB |
Output is correct |
138 |
Correct |
22 ms |
7724 KB |
Output is correct |
139 |
Correct |
23 ms |
7632 KB |
Output is correct |
140 |
Correct |
24 ms |
7732 KB |
Output is correct |
141 |
Correct |
21 ms |
7724 KB |
Output is correct |
142 |
Correct |
34 ms |
10928 KB |
Output is correct |
143 |
Correct |
10 ms |
6324 KB |
Output is correct |
144 |
Correct |
35 ms |
10800 KB |
Output is correct |
145 |
Correct |
10 ms |
6356 KB |
Output is correct |
146 |
Correct |
34 ms |
10832 KB |
Output is correct |
147 |
Correct |
11 ms |
6364 KB |
Output is correct |
148 |
Correct |
12 ms |
6868 KB |
Output is correct |
149 |
Correct |
16 ms |
6740 KB |
Output is correct |
150 |
Correct |
12 ms |
6740 KB |
Output is correct |
151 |
Correct |
12 ms |
6604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3796 KB |
Output is correct |
2 |
Correct |
2 ms |
3796 KB |
Output is correct |
3 |
Correct |
3 ms |
3840 KB |
Output is correct |
4 |
Correct |
2 ms |
3796 KB |
Output is correct |
5 |
Correct |
2 ms |
3828 KB |
Output is correct |
6 |
Correct |
2 ms |
3924 KB |
Output is correct |
7 |
Correct |
2 ms |
3796 KB |
Output is correct |
8 |
Correct |
2 ms |
3796 KB |
Output is correct |
9 |
Correct |
2 ms |
3796 KB |
Output is correct |
10 |
Correct |
2 ms |
3796 KB |
Output is correct |
11 |
Correct |
2 ms |
3796 KB |
Output is correct |
12 |
Correct |
2 ms |
3796 KB |
Output is correct |
13 |
Correct |
3 ms |
3796 KB |
Output is correct |
14 |
Correct |
2 ms |
3796 KB |
Output is correct |
15 |
Correct |
3 ms |
3796 KB |
Output is correct |
16 |
Correct |
3 ms |
3796 KB |
Output is correct |
17 |
Correct |
2 ms |
3836 KB |
Output is correct |
18 |
Correct |
2 ms |
3924 KB |
Output is correct |
19 |
Correct |
2 ms |
3924 KB |
Output is correct |
20 |
Correct |
3 ms |
3796 KB |
Output is correct |
21 |
Correct |
2 ms |
3924 KB |
Output is correct |
22 |
Correct |
2 ms |
3924 KB |
Output is correct |
23 |
Correct |
2 ms |
3924 KB |
Output is correct |
24 |
Correct |
20 ms |
8752 KB |
Output is correct |
25 |
Correct |
20 ms |
8652 KB |
Output is correct |
26 |
Correct |
20 ms |
8692 KB |
Output is correct |
27 |
Correct |
6 ms |
5460 KB |
Output is correct |
28 |
Correct |
6 ms |
5360 KB |
Output is correct |
29 |
Correct |
5 ms |
5356 KB |
Output is correct |
30 |
Correct |
5 ms |
5460 KB |
Output is correct |
31 |
Correct |
5 ms |
5460 KB |
Output is correct |
32 |
Correct |
5 ms |
5376 KB |
Output is correct |
33 |
Correct |
11 ms |
6604 KB |
Output is correct |
34 |
Correct |
11 ms |
6612 KB |
Output is correct |
35 |
Correct |
10 ms |
6612 KB |
Output is correct |
36 |
Correct |
11 ms |
6580 KB |
Output is correct |
37 |
Correct |
11 ms |
6612 KB |
Output is correct |
38 |
Correct |
12 ms |
6612 KB |
Output is correct |
39 |
Correct |
26 ms |
10532 KB |
Output is correct |
40 |
Correct |
24 ms |
10540 KB |
Output is correct |
41 |
Correct |
27 ms |
10492 KB |
Output is correct |
42 |
Correct |
15 ms |
11092 KB |
Output is correct |
43 |
Correct |
11 ms |
8452 KB |
Output is correct |
44 |
Correct |
19 ms |
11776 KB |
Output is correct |
45 |
Correct |
12 ms |
9084 KB |
Output is correct |
46 |
Correct |
11 ms |
8660 KB |
Output is correct |
47 |
Correct |
19 ms |
11876 KB |
Output is correct |
48 |
Correct |
45 ms |
21628 KB |
Output is correct |
49 |
Correct |
35 ms |
14244 KB |
Output is correct |
50 |
Correct |
35 ms |
17472 KB |
Output is correct |
51 |
Correct |
40 ms |
17892 KB |
Output is correct |
52 |
Correct |
45 ms |
17996 KB |
Output is correct |
53 |
Correct |
32 ms |
15620 KB |
Output is correct |
54 |
Correct |
18 ms |
11908 KB |
Output is correct |
55 |
Correct |
19 ms |
11852 KB |
Output is correct |
56 |
Correct |
20 ms |
11840 KB |
Output is correct |
57 |
Correct |
18 ms |
11920 KB |
Output is correct |
58 |
Correct |
18 ms |
11852 KB |
Output is correct |
59 |
Correct |
17 ms |
11852 KB |
Output is correct |
60 |
Correct |
55 ms |
23480 KB |
Output is correct |
61 |
Correct |
52 ms |
23404 KB |
Output is correct |
62 |
Correct |
54 ms |
23408 KB |
Output is correct |
63 |
Correct |
53 ms |
23416 KB |
Output is correct |
64 |
Correct |
54 ms |
23396 KB |
Output is correct |
65 |
Correct |
55 ms |
23508 KB |
Output is correct |
66 |
Correct |
48 ms |
22348 KB |
Output is correct |
67 |
Correct |
50 ms |
22380 KB |
Output is correct |
68 |
Correct |
51 ms |
22412 KB |
Output is correct |
69 |
Correct |
3 ms |
3796 KB |
Output is correct |
70 |
Correct |
2 ms |
3796 KB |
Output is correct |
71 |
Correct |
2 ms |
3828 KB |
Output is correct |
72 |
Correct |
2 ms |
3832 KB |
Output is correct |
73 |
Correct |
2 ms |
3832 KB |
Output is correct |
74 |
Correct |
2 ms |
3796 KB |
Output is correct |
75 |
Correct |
2 ms |
3832 KB |
Output is correct |
76 |
Correct |
2 ms |
3828 KB |
Output is correct |
77 |
Correct |
2 ms |
3796 KB |
Output is correct |
78 |
Correct |
2 ms |
3796 KB |
Output is correct |
79 |
Correct |
2 ms |
3796 KB |
Output is correct |
80 |
Correct |
3 ms |
3796 KB |
Output is correct |
81 |
Correct |
2 ms |
3836 KB |
Output is correct |
82 |
Correct |
2 ms |
3796 KB |
Output is correct |
83 |
Correct |
2 ms |
3796 KB |
Output is correct |
84 |
Correct |
2 ms |
3796 KB |
Output is correct |
85 |
Correct |
2 ms |
3836 KB |
Output is correct |
86 |
Correct |
2 ms |
3796 KB |
Output is correct |
87 |
Correct |
2 ms |
3832 KB |
Output is correct |
88 |
Correct |
2 ms |
3796 KB |
Output is correct |
89 |
Correct |
2 ms |
3796 KB |
Output is correct |
90 |
Correct |
2 ms |
3796 KB |
Output is correct |
91 |
Correct |
2 ms |
3832 KB |
Output is correct |
92 |
Correct |
3 ms |
3796 KB |
Output is correct |
93 |
Correct |
3 ms |
3836 KB |
Output is correct |
94 |
Correct |
2 ms |
3796 KB |
Output is correct |
95 |
Correct |
3 ms |
3924 KB |
Output is correct |
96 |
Correct |
2 ms |
3924 KB |
Output is correct |
97 |
Correct |
2 ms |
3924 KB |
Output is correct |
98 |
Correct |
3 ms |
3924 KB |
Output is correct |
99 |
Correct |
3 ms |
3796 KB |
Output is correct |
100 |
Correct |
3 ms |
3832 KB |
Output is correct |
101 |
Correct |
3 ms |
3924 KB |
Output is correct |
102 |
Correct |
2 ms |
3796 KB |
Output is correct |
103 |
Correct |
3 ms |
3924 KB |
Output is correct |
104 |
Correct |
2 ms |
3796 KB |
Output is correct |
105 |
Correct |
3 ms |
3924 KB |
Output is correct |
106 |
Correct |
3 ms |
3832 KB |
Output is correct |
107 |
Correct |
2 ms |
3796 KB |
Output is correct |
108 |
Correct |
3 ms |
3796 KB |
Output is correct |
109 |
Correct |
4 ms |
3832 KB |
Output is correct |
110 |
Correct |
3 ms |
3796 KB |
Output is correct |
111 |
Correct |
3 ms |
3832 KB |
Output is correct |
112 |
Correct |
4 ms |
4052 KB |
Output is correct |
113 |
Correct |
5 ms |
4180 KB |
Output is correct |
114 |
Correct |
5 ms |
4028 KB |
Output is correct |
115 |
Correct |
4 ms |
3924 KB |
Output is correct |
116 |
Correct |
4 ms |
4104 KB |
Output is correct |
117 |
Correct |
3 ms |
4016 KB |
Output is correct |
118 |
Correct |
20 ms |
7524 KB |
Output is correct |
119 |
Correct |
18 ms |
8064 KB |
Output is correct |
120 |
Correct |
24 ms |
8664 KB |
Output is correct |
121 |
Correct |
3 ms |
3832 KB |
Output is correct |
122 |
Correct |
4 ms |
3796 KB |
Output is correct |
123 |
Correct |
4 ms |
3796 KB |
Output is correct |
124 |
Correct |
4 ms |
3796 KB |
Output is correct |
125 |
Correct |
4 ms |
3796 KB |
Output is correct |
126 |
Correct |
5 ms |
4180 KB |
Output is correct |
127 |
Correct |
5 ms |
4180 KB |
Output is correct |
128 |
Correct |
6 ms |
4180 KB |
Output is correct |
129 |
Correct |
5 ms |
4180 KB |
Output is correct |
130 |
Correct |
5 ms |
4180 KB |
Output is correct |
131 |
Correct |
5 ms |
4176 KB |
Output is correct |
132 |
Correct |
27 ms |
9004 KB |
Output is correct |
133 |
Correct |
28 ms |
9036 KB |
Output is correct |
134 |
Correct |
28 ms |
9068 KB |
Output is correct |
135 |
Correct |
6 ms |
5332 KB |
Output is correct |
136 |
Correct |
54 ms |
5032 KB |
Output is correct |
137 |
Correct |
4 ms |
4820 KB |
Output is correct |
138 |
Correct |
4 ms |
4820 KB |
Output is correct |
139 |
Correct |
5 ms |
5072 KB |
Output is correct |
140 |
Correct |
4 ms |
4820 KB |
Output is correct |
141 |
Correct |
16 ms |
6424 KB |
Output is correct |
142 |
Correct |
21 ms |
6312 KB |
Output is correct |
143 |
Correct |
26 ms |
7220 KB |
Output is correct |
144 |
Correct |
16 ms |
6220 KB |
Output is correct |
145 |
Correct |
19 ms |
6612 KB |
Output is correct |
146 |
Correct |
14 ms |
6268 KB |
Output is correct |
147 |
Correct |
20 ms |
8020 KB |
Output is correct |
148 |
Correct |
7 ms |
5332 KB |
Output is correct |
149 |
Correct |
24 ms |
8396 KB |
Output is correct |
150 |
Correct |
8 ms |
5204 KB |
Output is correct |
151 |
Correct |
28 ms |
9520 KB |
Output is correct |
152 |
Correct |
10 ms |
6016 KB |
Output is correct |
153 |
Correct |
10 ms |
5920 KB |
Output is correct |
154 |
Correct |
11 ms |
6532 KB |
Output is correct |
155 |
Correct |
9 ms |
5716 KB |
Output is correct |
156 |
Correct |
12 ms |
5764 KB |
Output is correct |
157 |
Correct |
10 ms |
5352 KB |
Output is correct |
158 |
Correct |
84 ms |
5480 KB |
Output is correct |
159 |
Correct |
6 ms |
5460 KB |
Output is correct |
160 |
Correct |
7 ms |
5508 KB |
Output is correct |
161 |
Correct |
6 ms |
5504 KB |
Output is correct |
162 |
Correct |
6 ms |
5508 KB |
Output is correct |
163 |
Correct |
24 ms |
7684 KB |
Output is correct |
164 |
Correct |
22 ms |
7708 KB |
Output is correct |
165 |
Correct |
22 ms |
7724 KB |
Output is correct |
166 |
Correct |
23 ms |
7632 KB |
Output is correct |
167 |
Correct |
24 ms |
7732 KB |
Output is correct |
168 |
Correct |
21 ms |
7724 KB |
Output is correct |
169 |
Correct |
34 ms |
10928 KB |
Output is correct |
170 |
Correct |
10 ms |
6324 KB |
Output is correct |
171 |
Correct |
35 ms |
10800 KB |
Output is correct |
172 |
Correct |
10 ms |
6356 KB |
Output is correct |
173 |
Correct |
34 ms |
10832 KB |
Output is correct |
174 |
Correct |
11 ms |
6364 KB |
Output is correct |
175 |
Correct |
12 ms |
6868 KB |
Output is correct |
176 |
Correct |
16 ms |
6740 KB |
Output is correct |
177 |
Correct |
12 ms |
6740 KB |
Output is correct |
178 |
Correct |
12 ms |
6604 KB |
Output is correct |
179 |
Correct |
12 ms |
8780 KB |
Output is correct |
180 |
Correct |
151 ms |
8092 KB |
Output is correct |
181 |
Correct |
15 ms |
9988 KB |
Output is correct |
182 |
Correct |
19 ms |
11904 KB |
Output is correct |
183 |
Correct |
12 ms |
9136 KB |
Output is correct |
184 |
Correct |
13 ms |
8916 KB |
Output is correct |
185 |
Correct |
36 ms |
12164 KB |
Output is correct |
186 |
Correct |
32 ms |
14604 KB |
Output is correct |
187 |
Correct |
41 ms |
13724 KB |
Output is correct |
188 |
Correct |
37 ms |
14908 KB |
Output is correct |
189 |
Correct |
40 ms |
14796 KB |
Output is correct |
190 |
Correct |
40 ms |
15568 KB |
Output is correct |
191 |
Correct |
39 ms |
14964 KB |
Output is correct |
192 |
Correct |
35 ms |
12620 KB |
Output is correct |
193 |
Correct |
31 ms |
11880 KB |
Output is correct |
194 |
Correct |
30 ms |
11912 KB |
Output is correct |
195 |
Correct |
427 ms |
12032 KB |
Output is correct |
196 |
Correct |
21 ms |
11984 KB |
Output is correct |
197 |
Correct |
22 ms |
12036 KB |
Output is correct |
198 |
Correct |
19 ms |
11916 KB |
Output is correct |
199 |
Correct |
18 ms |
12040 KB |
Output is correct |
200 |
Correct |
70 ms |
24012 KB |
Output is correct |
201 |
Correct |
74 ms |
24060 KB |
Output is correct |
202 |
Correct |
68 ms |
23960 KB |
Output is correct |
203 |
Correct |
65 ms |
24064 KB |
Output is correct |
204 |
Correct |
74 ms |
24032 KB |
Output is correct |
205 |
Correct |
72 ms |
24048 KB |
Output is correct |
206 |
Correct |
65 ms |
22836 KB |
Output is correct |
207 |
Correct |
51 ms |
22296 KB |
Output is correct |
208 |
Correct |
59 ms |
22884 KB |
Output is correct |
209 |
Correct |
51 ms |
22352 KB |
Output is correct |
210 |
Correct |
62 ms |
22900 KB |
Output is correct |
211 |
Correct |
53 ms |
22384 KB |
Output is correct |
212 |
Correct |
61 ms |
23628 KB |
Output is correct |
213 |
Correct |
59 ms |
19940 KB |
Output is correct |
214 |
Correct |
60 ms |
19536 KB |
Output is correct |
215 |
Correct |
53 ms |
19404 KB |
Output is correct |