#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
#define REP(i, j, k) for (int i = j; i < k; i++)
#define RREP(i, j, k) for (int i = j; i >= k; i--)
template <class T>
inline bool mxto(T &a, T b) {return a < b ? a = b, 1 : 0;}
template <class T>
inline bool mnto(T &a, T b) {return a > b ? a = b, 1 : 0;}
typedef long long ll;
#define FI first
#define SE second
#define MP make_pair
typedef pair<int, int> ii;
#define pb push_back
#define ALL(x) x.begin(), x.end()
typedef vector<int> vi;
#ifndef DEBUG
#define cerr if (0) cerr
#endif
#define MAXN 100005
#define INF 1000000005
int n, m, k;
vi c, a;
vector<vi> b;
vi mp[MAXN];
int dp[2][MAXN];
int minimumInstructions(int n, int m, int k, vi c, vi a, vector<vi> b) {
::n = n; ::m = m; ::k = k; ::c = c; ::a = a; ::b = b;
REP (i, 0, m) {
for (int j : b[i]) {
mp[j].pb(i);
}
}
REP (i, 0, m) {
dp[0][i] = dp[1][i] = -INF;
}
vi rng;
int prv = 1, cur = 0;
RREP (i, n - 1, 0) {
if (i + 2 < n) {
for (int j : mp[c[i + 2]]) {
dp[cur][j] = -INF;
}
}
int mx = -INF;
for (int j : mp[c[i]]) {
dp[cur][j] = i;
int k = j + 1 == m ? 0 : j + 1;
if (i != n - 1 && dp[prv][k] != -INF) {
dp[cur][j] = dp[prv][k];
}
mxto(mx, dp[cur][j]);
}
if (mx - i + 1 >= m) {
rng.pb(i);
}
swap(prv, cur);
}
reverse(ALL(rng));
if (rng.empty() || rng[0] != 0 || rng.back() != n - m) {
return -1;
}
if (rng.size() == 1) {
return 1;
}
int r = m;
int ans = 2;
REP (i, 1, rng.size() - 1) {
if (rng[i] > r) {
return -1;
}
if (rng[i + 1] > r) {
r = rng[i] + m;
ans++;
}
}
if (n - m > r) return -1;
return ans;
}
Compilation message
paint.cpp: In function 'int minimumInstructions(int, int, int, vi, vi, std::vector<std::vector<int> >)':
paint.cpp:5:40: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
5 | #define REP(i, j, k) for (int i = j; i < k; i++)
......
76 | REP (i, 1, rng.size() - 1) {
| ~~~~~~~~~~~~~~~~~~~~
paint.cpp:76:5: note: in expansion of macro 'REP'
76 | REP (i, 1, rng.size() - 1) {
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
2 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
2 ms |
2636 KB |
Output is correct |
6 |
Correct |
2 ms |
2636 KB |
Output is correct |
7 |
Correct |
1 ms |
2636 KB |
Output is correct |
8 |
Correct |
1 ms |
2636 KB |
Output is correct |
9 |
Correct |
1 ms |
2636 KB |
Output is correct |
10 |
Correct |
2 ms |
2636 KB |
Output is correct |
11 |
Correct |
2 ms |
2636 KB |
Output is correct |
12 |
Correct |
2 ms |
2636 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2672 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2636 KB |
Output is correct |
18 |
Correct |
1 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
2 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
27 ms |
6892 KB |
Output is correct |
23 |
Correct |
20 ms |
6988 KB |
Output is correct |
24 |
Correct |
19 ms |
6964 KB |
Output is correct |
25 |
Correct |
4 ms |
3020 KB |
Output is correct |
26 |
Correct |
3 ms |
3020 KB |
Output is correct |
27 |
Correct |
3 ms |
2892 KB |
Output is correct |
28 |
Correct |
3 ms |
2892 KB |
Output is correct |
29 |
Correct |
4 ms |
2892 KB |
Output is correct |
30 |
Correct |
3 ms |
2892 KB |
Output is correct |
31 |
Correct |
8 ms |
4172 KB |
Output is correct |
32 |
Correct |
8 ms |
4172 KB |
Output is correct |
33 |
Correct |
8 ms |
4172 KB |
Output is correct |
34 |
Correct |
8 ms |
4172 KB |
Output is correct |
35 |
Correct |
9 ms |
4136 KB |
Output is correct |
36 |
Correct |
13 ms |
4116 KB |
Output is correct |
37 |
Correct |
34 ms |
7372 KB |
Output is correct |
38 |
Correct |
30 ms |
7372 KB |
Output is correct |
39 |
Correct |
23 ms |
7372 KB |
Output is correct |
40 |
Correct |
10 ms |
4296 KB |
Output is correct |
41 |
Correct |
7 ms |
3660 KB |
Output is correct |
42 |
Correct |
11 ms |
4108 KB |
Output is correct |
43 |
Correct |
8 ms |
3404 KB |
Output is correct |
44 |
Correct |
7 ms |
3276 KB |
Output is correct |
45 |
Correct |
10 ms |
3844 KB |
Output is correct |
46 |
Correct |
40 ms |
15660 KB |
Output is correct |
47 |
Correct |
26 ms |
9676 KB |
Output is correct |
48 |
Correct |
47 ms |
13580 KB |
Output is correct |
49 |
Correct |
42 ms |
13112 KB |
Output is correct |
50 |
Correct |
39 ms |
12400 KB |
Output is correct |
51 |
Correct |
31 ms |
9292 KB |
Output is correct |
52 |
Correct |
11 ms |
4452 KB |
Output is correct |
53 |
Correct |
10 ms |
4452 KB |
Output is correct |
54 |
Correct |
11 ms |
4200 KB |
Output is correct |
55 |
Correct |
11 ms |
3916 KB |
Output is correct |
56 |
Correct |
13 ms |
3792 KB |
Output is correct |
57 |
Correct |
10 ms |
3788 KB |
Output is correct |
58 |
Correct |
46 ms |
16424 KB |
Output is correct |
59 |
Correct |
50 ms |
16488 KB |
Output is correct |
60 |
Correct |
56 ms |
16484 KB |
Output is correct |
61 |
Correct |
44 ms |
16452 KB |
Output is correct |
62 |
Correct |
45 ms |
16480 KB |
Output is correct |
63 |
Correct |
44 ms |
16452 KB |
Output is correct |
64 |
Correct |
46 ms |
14916 KB |
Output is correct |
65 |
Correct |
46 ms |
14936 KB |
Output is correct |
66 |
Correct |
47 ms |
14872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
2 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
2 ms |
2636 KB |
Output is correct |
6 |
Correct |
2 ms |
2636 KB |
Output is correct |
7 |
Correct |
1 ms |
2636 KB |
Output is correct |
8 |
Correct |
1 ms |
2636 KB |
Output is correct |
9 |
Correct |
1 ms |
2636 KB |
Output is correct |
10 |
Correct |
2 ms |
2636 KB |
Output is correct |
11 |
Correct |
2 ms |
2636 KB |
Output is correct |
12 |
Correct |
2 ms |
2636 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2672 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2636 KB |
Output is correct |
18 |
Correct |
1 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
2 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
2 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
2 ms |
2636 KB |
Output is correct |
25 |
Correct |
2 ms |
2636 KB |
Output is correct |
26 |
Correct |
2 ms |
2636 KB |
Output is correct |
27 |
Correct |
2 ms |
2636 KB |
Output is correct |
28 |
Correct |
2 ms |
2636 KB |
Output is correct |
29 |
Correct |
2 ms |
2636 KB |
Output is correct |
30 |
Correct |
1 ms |
2636 KB |
Output is correct |
31 |
Correct |
1 ms |
2636 KB |
Output is correct |
32 |
Correct |
1 ms |
2636 KB |
Output is correct |
33 |
Correct |
2 ms |
2636 KB |
Output is correct |
34 |
Correct |
2 ms |
2636 KB |
Output is correct |
35 |
Correct |
2 ms |
2636 KB |
Output is correct |
36 |
Correct |
2 ms |
2636 KB |
Output is correct |
37 |
Correct |
2 ms |
2636 KB |
Output is correct |
38 |
Correct |
2 ms |
2636 KB |
Output is correct |
39 |
Correct |
2 ms |
2636 KB |
Output is correct |
40 |
Correct |
2 ms |
2636 KB |
Output is correct |
41 |
Correct |
3 ms |
2636 KB |
Output is correct |
42 |
Correct |
2 ms |
2636 KB |
Output is correct |
43 |
Correct |
2 ms |
2636 KB |
Output is correct |
44 |
Correct |
3 ms |
2636 KB |
Output is correct |
45 |
Correct |
2 ms |
2636 KB |
Output is correct |
46 |
Correct |
2 ms |
2636 KB |
Output is correct |
47 |
Correct |
2 ms |
2636 KB |
Output is correct |
48 |
Correct |
1 ms |
2636 KB |
Output is correct |
49 |
Correct |
1 ms |
2636 KB |
Output is correct |
50 |
Correct |
1 ms |
2636 KB |
Output is correct |
51 |
Correct |
1 ms |
2636 KB |
Output is correct |
52 |
Correct |
2 ms |
2636 KB |
Output is correct |
53 |
Correct |
2 ms |
2636 KB |
Output is correct |
54 |
Correct |
2 ms |
2636 KB |
Output is correct |
55 |
Correct |
2 ms |
2636 KB |
Output is correct |
56 |
Correct |
2 ms |
2636 KB |
Output is correct |
57 |
Correct |
2 ms |
2636 KB |
Output is correct |
58 |
Correct |
2 ms |
2636 KB |
Output is correct |
59 |
Correct |
2 ms |
2636 KB |
Output is correct |
60 |
Correct |
2 ms |
2636 KB |
Output is correct |
61 |
Correct |
1 ms |
2636 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
1 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
2 ms |
2636 KB |
Output is correct |
6 |
Correct |
2 ms |
2636 KB |
Output is correct |
7 |
Correct |
2 ms |
2636 KB |
Output is correct |
8 |
Correct |
2 ms |
2636 KB |
Output is correct |
9 |
Correct |
1 ms |
2636 KB |
Output is correct |
10 |
Correct |
1 ms |
2636 KB |
Output is correct |
11 |
Correct |
1 ms |
2636 KB |
Output is correct |
12 |
Correct |
2 ms |
2636 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2636 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2672 KB |
Output is correct |
18 |
Correct |
2 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
1 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
2 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
27 ms |
6892 KB |
Output is correct |
25 |
Correct |
20 ms |
6988 KB |
Output is correct |
26 |
Correct |
19 ms |
6964 KB |
Output is correct |
27 |
Correct |
2 ms |
2636 KB |
Output is correct |
28 |
Correct |
2 ms |
2636 KB |
Output is correct |
29 |
Correct |
2 ms |
2636 KB |
Output is correct |
30 |
Correct |
2 ms |
2636 KB |
Output is correct |
31 |
Correct |
2 ms |
2636 KB |
Output is correct |
32 |
Correct |
2 ms |
2636 KB |
Output is correct |
33 |
Correct |
1 ms |
2636 KB |
Output is correct |
34 |
Correct |
1 ms |
2636 KB |
Output is correct |
35 |
Correct |
1 ms |
2636 KB |
Output is correct |
36 |
Correct |
2 ms |
2636 KB |
Output is correct |
37 |
Correct |
2 ms |
2636 KB |
Output is correct |
38 |
Correct |
2 ms |
2636 KB |
Output is correct |
39 |
Correct |
2 ms |
2636 KB |
Output is correct |
40 |
Correct |
2 ms |
2636 KB |
Output is correct |
41 |
Correct |
2 ms |
2636 KB |
Output is correct |
42 |
Correct |
2 ms |
2636 KB |
Output is correct |
43 |
Correct |
2 ms |
2636 KB |
Output is correct |
44 |
Correct |
3 ms |
2636 KB |
Output is correct |
45 |
Correct |
2 ms |
2636 KB |
Output is correct |
46 |
Correct |
2 ms |
2636 KB |
Output is correct |
47 |
Correct |
3 ms |
2636 KB |
Output is correct |
48 |
Correct |
2 ms |
2636 KB |
Output is correct |
49 |
Correct |
2 ms |
2636 KB |
Output is correct |
50 |
Correct |
2 ms |
2636 KB |
Output is correct |
51 |
Correct |
1 ms |
2636 KB |
Output is correct |
52 |
Correct |
1 ms |
2636 KB |
Output is correct |
53 |
Correct |
1 ms |
2636 KB |
Output is correct |
54 |
Correct |
1 ms |
2636 KB |
Output is correct |
55 |
Correct |
2 ms |
2636 KB |
Output is correct |
56 |
Correct |
2 ms |
2636 KB |
Output is correct |
57 |
Correct |
2 ms |
2636 KB |
Output is correct |
58 |
Correct |
2 ms |
2636 KB |
Output is correct |
59 |
Correct |
2 ms |
2636 KB |
Output is correct |
60 |
Correct |
2 ms |
2636 KB |
Output is correct |
61 |
Correct |
2 ms |
2636 KB |
Output is correct |
62 |
Correct |
2 ms |
2636 KB |
Output is correct |
63 |
Correct |
2 ms |
2636 KB |
Output is correct |
64 |
Correct |
1 ms |
2636 KB |
Output is correct |
65 |
Correct |
2 ms |
2636 KB |
Output is correct |
66 |
Correct |
2 ms |
2636 KB |
Output is correct |
67 |
Correct |
3 ms |
2688 KB |
Output is correct |
68 |
Correct |
2 ms |
2636 KB |
Output is correct |
69 |
Correct |
2 ms |
2636 KB |
Output is correct |
70 |
Correct |
3 ms |
2892 KB |
Output is correct |
71 |
Correct |
3 ms |
2912 KB |
Output is correct |
72 |
Correct |
3 ms |
2764 KB |
Output is correct |
73 |
Correct |
2 ms |
2764 KB |
Output is correct |
74 |
Correct |
3 ms |
2764 KB |
Output is correct |
75 |
Correct |
2 ms |
2764 KB |
Output is correct |
76 |
Correct |
30 ms |
5716 KB |
Output is correct |
77 |
Correct |
24 ms |
6208 KB |
Output is correct |
78 |
Correct |
35 ms |
6656 KB |
Output is correct |
79 |
Correct |
3 ms |
2636 KB |
Output is correct |
80 |
Correct |
2 ms |
2636 KB |
Output is correct |
81 |
Correct |
2 ms |
2636 KB |
Output is correct |
82 |
Correct |
2 ms |
2636 KB |
Output is correct |
83 |
Correct |
2 ms |
2636 KB |
Output is correct |
84 |
Correct |
5 ms |
3020 KB |
Output is correct |
85 |
Correct |
3 ms |
2892 KB |
Output is correct |
86 |
Correct |
3 ms |
2892 KB |
Output is correct |
87 |
Correct |
3 ms |
2848 KB |
Output is correct |
88 |
Correct |
3 ms |
2892 KB |
Output is correct |
89 |
Correct |
3 ms |
2892 KB |
Output is correct |
90 |
Correct |
26 ms |
6968 KB |
Output is correct |
91 |
Correct |
35 ms |
6996 KB |
Output is correct |
92 |
Correct |
26 ms |
6908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
1 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
2 ms |
2636 KB |
Output is correct |
6 |
Correct |
2 ms |
2636 KB |
Output is correct |
7 |
Correct |
2 ms |
2636 KB |
Output is correct |
8 |
Correct |
2 ms |
2636 KB |
Output is correct |
9 |
Correct |
1 ms |
2636 KB |
Output is correct |
10 |
Correct |
1 ms |
2636 KB |
Output is correct |
11 |
Correct |
1 ms |
2636 KB |
Output is correct |
12 |
Correct |
2 ms |
2636 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2636 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2672 KB |
Output is correct |
18 |
Correct |
2 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
1 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
2 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
27 ms |
6892 KB |
Output is correct |
25 |
Correct |
20 ms |
6988 KB |
Output is correct |
26 |
Correct |
19 ms |
6964 KB |
Output is correct |
27 |
Correct |
4 ms |
3020 KB |
Output is correct |
28 |
Correct |
3 ms |
3020 KB |
Output is correct |
29 |
Correct |
3 ms |
2892 KB |
Output is correct |
30 |
Correct |
3 ms |
2892 KB |
Output is correct |
31 |
Correct |
4 ms |
2892 KB |
Output is correct |
32 |
Correct |
3 ms |
2892 KB |
Output is correct |
33 |
Correct |
8 ms |
4172 KB |
Output is correct |
34 |
Correct |
8 ms |
4172 KB |
Output is correct |
35 |
Correct |
8 ms |
4172 KB |
Output is correct |
36 |
Correct |
8 ms |
4172 KB |
Output is correct |
37 |
Correct |
9 ms |
4136 KB |
Output is correct |
38 |
Correct |
13 ms |
4116 KB |
Output is correct |
39 |
Correct |
34 ms |
7372 KB |
Output is correct |
40 |
Correct |
30 ms |
7372 KB |
Output is correct |
41 |
Correct |
23 ms |
7372 KB |
Output is correct |
42 |
Correct |
2 ms |
2636 KB |
Output is correct |
43 |
Correct |
2 ms |
2636 KB |
Output is correct |
44 |
Correct |
2 ms |
2636 KB |
Output is correct |
45 |
Correct |
2 ms |
2636 KB |
Output is correct |
46 |
Correct |
2 ms |
2636 KB |
Output is correct |
47 |
Correct |
2 ms |
2636 KB |
Output is correct |
48 |
Correct |
1 ms |
2636 KB |
Output is correct |
49 |
Correct |
1 ms |
2636 KB |
Output is correct |
50 |
Correct |
1 ms |
2636 KB |
Output is correct |
51 |
Correct |
2 ms |
2636 KB |
Output is correct |
52 |
Correct |
2 ms |
2636 KB |
Output is correct |
53 |
Correct |
2 ms |
2636 KB |
Output is correct |
54 |
Correct |
2 ms |
2636 KB |
Output is correct |
55 |
Correct |
2 ms |
2636 KB |
Output is correct |
56 |
Correct |
2 ms |
2636 KB |
Output is correct |
57 |
Correct |
2 ms |
2636 KB |
Output is correct |
58 |
Correct |
2 ms |
2636 KB |
Output is correct |
59 |
Correct |
3 ms |
2636 KB |
Output is correct |
60 |
Correct |
2 ms |
2636 KB |
Output is correct |
61 |
Correct |
2 ms |
2636 KB |
Output is correct |
62 |
Correct |
3 ms |
2636 KB |
Output is correct |
63 |
Correct |
2 ms |
2636 KB |
Output is correct |
64 |
Correct |
2 ms |
2636 KB |
Output is correct |
65 |
Correct |
2 ms |
2636 KB |
Output is correct |
66 |
Correct |
1 ms |
2636 KB |
Output is correct |
67 |
Correct |
1 ms |
2636 KB |
Output is correct |
68 |
Correct |
1 ms |
2636 KB |
Output is correct |
69 |
Correct |
1 ms |
2636 KB |
Output is correct |
70 |
Correct |
2 ms |
2636 KB |
Output is correct |
71 |
Correct |
2 ms |
2636 KB |
Output is correct |
72 |
Correct |
2 ms |
2636 KB |
Output is correct |
73 |
Correct |
2 ms |
2636 KB |
Output is correct |
74 |
Correct |
2 ms |
2636 KB |
Output is correct |
75 |
Correct |
2 ms |
2636 KB |
Output is correct |
76 |
Correct |
2 ms |
2636 KB |
Output is correct |
77 |
Correct |
2 ms |
2636 KB |
Output is correct |
78 |
Correct |
2 ms |
2636 KB |
Output is correct |
79 |
Correct |
1 ms |
2636 KB |
Output is correct |
80 |
Correct |
2 ms |
2636 KB |
Output is correct |
81 |
Correct |
2 ms |
2636 KB |
Output is correct |
82 |
Correct |
3 ms |
2688 KB |
Output is correct |
83 |
Correct |
2 ms |
2636 KB |
Output is correct |
84 |
Correct |
2 ms |
2636 KB |
Output is correct |
85 |
Correct |
3 ms |
2892 KB |
Output is correct |
86 |
Correct |
3 ms |
2912 KB |
Output is correct |
87 |
Correct |
3 ms |
2764 KB |
Output is correct |
88 |
Correct |
2 ms |
2764 KB |
Output is correct |
89 |
Correct |
3 ms |
2764 KB |
Output is correct |
90 |
Correct |
2 ms |
2764 KB |
Output is correct |
91 |
Correct |
30 ms |
5716 KB |
Output is correct |
92 |
Correct |
24 ms |
6208 KB |
Output is correct |
93 |
Correct |
35 ms |
6656 KB |
Output is correct |
94 |
Correct |
3 ms |
2636 KB |
Output is correct |
95 |
Correct |
2 ms |
2636 KB |
Output is correct |
96 |
Correct |
2 ms |
2636 KB |
Output is correct |
97 |
Correct |
2 ms |
2636 KB |
Output is correct |
98 |
Correct |
2 ms |
2636 KB |
Output is correct |
99 |
Correct |
5 ms |
3020 KB |
Output is correct |
100 |
Correct |
3 ms |
2892 KB |
Output is correct |
101 |
Correct |
3 ms |
2892 KB |
Output is correct |
102 |
Correct |
3 ms |
2848 KB |
Output is correct |
103 |
Correct |
3 ms |
2892 KB |
Output is correct |
104 |
Correct |
3 ms |
2892 KB |
Output is correct |
105 |
Correct |
26 ms |
6968 KB |
Output is correct |
106 |
Correct |
35 ms |
6996 KB |
Output is correct |
107 |
Correct |
26 ms |
6908 KB |
Output is correct |
108 |
Correct |
4 ms |
3020 KB |
Output is correct |
109 |
Correct |
64 ms |
2968 KB |
Output is correct |
110 |
Correct |
36 ms |
2896 KB |
Output is correct |
111 |
Correct |
27 ms |
2924 KB |
Output is correct |
112 |
Correct |
35 ms |
2972 KB |
Output is correct |
113 |
Correct |
25 ms |
2968 KB |
Output is correct |
114 |
Correct |
13 ms |
4172 KB |
Output is correct |
115 |
Correct |
12 ms |
4044 KB |
Output is correct |
116 |
Correct |
15 ms |
4556 KB |
Output is correct |
117 |
Correct |
12 ms |
4176 KB |
Output is correct |
118 |
Correct |
15 ms |
4428 KB |
Output is correct |
119 |
Correct |
10 ms |
4056 KB |
Output is correct |
120 |
Correct |
17 ms |
5604 KB |
Output is correct |
121 |
Correct |
5 ms |
3404 KB |
Output is correct |
122 |
Correct |
23 ms |
5824 KB |
Output is correct |
123 |
Correct |
5 ms |
3276 KB |
Output is correct |
124 |
Correct |
37 ms |
6340 KB |
Output is correct |
125 |
Correct |
8 ms |
3660 KB |
Output is correct |
126 |
Correct |
7 ms |
3608 KB |
Output is correct |
127 |
Correct |
9 ms |
3844 KB |
Output is correct |
128 |
Correct |
8 ms |
3532 KB |
Output is correct |
129 |
Correct |
7 ms |
3532 KB |
Output is correct |
130 |
Correct |
3 ms |
3020 KB |
Output is correct |
131 |
Correct |
82 ms |
3216 KB |
Output is correct |
132 |
Correct |
63 ms |
3020 KB |
Output is correct |
133 |
Correct |
54 ms |
3020 KB |
Output is correct |
134 |
Correct |
55 ms |
3028 KB |
Output is correct |
135 |
Correct |
51 ms |
3028 KB |
Output is correct |
136 |
Correct |
20 ms |
4812 KB |
Output is correct |
137 |
Correct |
19 ms |
4992 KB |
Output is correct |
138 |
Correct |
17 ms |
4928 KB |
Output is correct |
139 |
Correct |
16 ms |
4864 KB |
Output is correct |
140 |
Correct |
17 ms |
4884 KB |
Output is correct |
141 |
Correct |
17 ms |
4864 KB |
Output is correct |
142 |
Correct |
29 ms |
7372 KB |
Output is correct |
143 |
Correct |
9 ms |
3916 KB |
Output is correct |
144 |
Correct |
31 ms |
7436 KB |
Output is correct |
145 |
Correct |
13 ms |
3872 KB |
Output is correct |
146 |
Correct |
32 ms |
7464 KB |
Output is correct |
147 |
Correct |
13 ms |
3876 KB |
Output is correct |
148 |
Correct |
10 ms |
4128 KB |
Output is correct |
149 |
Correct |
10 ms |
3916 KB |
Output is correct |
150 |
Correct |
14 ms |
3908 KB |
Output is correct |
151 |
Correct |
9 ms |
3788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2636 KB |
Output is correct |
2 |
Correct |
2 ms |
2636 KB |
Output is correct |
3 |
Correct |
1 ms |
2636 KB |
Output is correct |
4 |
Correct |
2 ms |
2636 KB |
Output is correct |
5 |
Correct |
2 ms |
2636 KB |
Output is correct |
6 |
Correct |
2 ms |
2636 KB |
Output is correct |
7 |
Correct |
2 ms |
2636 KB |
Output is correct |
8 |
Correct |
2 ms |
2636 KB |
Output is correct |
9 |
Correct |
1 ms |
2636 KB |
Output is correct |
10 |
Correct |
1 ms |
2636 KB |
Output is correct |
11 |
Correct |
1 ms |
2636 KB |
Output is correct |
12 |
Correct |
2 ms |
2636 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2636 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2672 KB |
Output is correct |
18 |
Correct |
2 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
1 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
2 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
27 ms |
6892 KB |
Output is correct |
25 |
Correct |
20 ms |
6988 KB |
Output is correct |
26 |
Correct |
19 ms |
6964 KB |
Output is correct |
27 |
Correct |
4 ms |
3020 KB |
Output is correct |
28 |
Correct |
3 ms |
3020 KB |
Output is correct |
29 |
Correct |
3 ms |
2892 KB |
Output is correct |
30 |
Correct |
3 ms |
2892 KB |
Output is correct |
31 |
Correct |
4 ms |
2892 KB |
Output is correct |
32 |
Correct |
3 ms |
2892 KB |
Output is correct |
33 |
Correct |
8 ms |
4172 KB |
Output is correct |
34 |
Correct |
8 ms |
4172 KB |
Output is correct |
35 |
Correct |
8 ms |
4172 KB |
Output is correct |
36 |
Correct |
8 ms |
4172 KB |
Output is correct |
37 |
Correct |
9 ms |
4136 KB |
Output is correct |
38 |
Correct |
13 ms |
4116 KB |
Output is correct |
39 |
Correct |
34 ms |
7372 KB |
Output is correct |
40 |
Correct |
30 ms |
7372 KB |
Output is correct |
41 |
Correct |
23 ms |
7372 KB |
Output is correct |
42 |
Correct |
10 ms |
4296 KB |
Output is correct |
43 |
Correct |
7 ms |
3660 KB |
Output is correct |
44 |
Correct |
11 ms |
4108 KB |
Output is correct |
45 |
Correct |
8 ms |
3404 KB |
Output is correct |
46 |
Correct |
7 ms |
3276 KB |
Output is correct |
47 |
Correct |
10 ms |
3844 KB |
Output is correct |
48 |
Correct |
40 ms |
15660 KB |
Output is correct |
49 |
Correct |
26 ms |
9676 KB |
Output is correct |
50 |
Correct |
47 ms |
13580 KB |
Output is correct |
51 |
Correct |
42 ms |
13112 KB |
Output is correct |
52 |
Correct |
39 ms |
12400 KB |
Output is correct |
53 |
Correct |
31 ms |
9292 KB |
Output is correct |
54 |
Correct |
11 ms |
4452 KB |
Output is correct |
55 |
Correct |
10 ms |
4452 KB |
Output is correct |
56 |
Correct |
11 ms |
4200 KB |
Output is correct |
57 |
Correct |
11 ms |
3916 KB |
Output is correct |
58 |
Correct |
13 ms |
3792 KB |
Output is correct |
59 |
Correct |
10 ms |
3788 KB |
Output is correct |
60 |
Correct |
46 ms |
16424 KB |
Output is correct |
61 |
Correct |
50 ms |
16488 KB |
Output is correct |
62 |
Correct |
56 ms |
16484 KB |
Output is correct |
63 |
Correct |
44 ms |
16452 KB |
Output is correct |
64 |
Correct |
45 ms |
16480 KB |
Output is correct |
65 |
Correct |
44 ms |
16452 KB |
Output is correct |
66 |
Correct |
46 ms |
14916 KB |
Output is correct |
67 |
Correct |
46 ms |
14936 KB |
Output is correct |
68 |
Correct |
47 ms |
14872 KB |
Output is correct |
69 |
Correct |
2 ms |
2636 KB |
Output is correct |
70 |
Correct |
2 ms |
2636 KB |
Output is correct |
71 |
Correct |
2 ms |
2636 KB |
Output is correct |
72 |
Correct |
2 ms |
2636 KB |
Output is correct |
73 |
Correct |
2 ms |
2636 KB |
Output is correct |
74 |
Correct |
2 ms |
2636 KB |
Output is correct |
75 |
Correct |
1 ms |
2636 KB |
Output is correct |
76 |
Correct |
1 ms |
2636 KB |
Output is correct |
77 |
Correct |
1 ms |
2636 KB |
Output is correct |
78 |
Correct |
2 ms |
2636 KB |
Output is correct |
79 |
Correct |
2 ms |
2636 KB |
Output is correct |
80 |
Correct |
2 ms |
2636 KB |
Output is correct |
81 |
Correct |
2 ms |
2636 KB |
Output is correct |
82 |
Correct |
2 ms |
2636 KB |
Output is correct |
83 |
Correct |
2 ms |
2636 KB |
Output is correct |
84 |
Correct |
2 ms |
2636 KB |
Output is correct |
85 |
Correct |
2 ms |
2636 KB |
Output is correct |
86 |
Correct |
3 ms |
2636 KB |
Output is correct |
87 |
Correct |
2 ms |
2636 KB |
Output is correct |
88 |
Correct |
2 ms |
2636 KB |
Output is correct |
89 |
Correct |
3 ms |
2636 KB |
Output is correct |
90 |
Correct |
2 ms |
2636 KB |
Output is correct |
91 |
Correct |
2 ms |
2636 KB |
Output is correct |
92 |
Correct |
2 ms |
2636 KB |
Output is correct |
93 |
Correct |
1 ms |
2636 KB |
Output is correct |
94 |
Correct |
1 ms |
2636 KB |
Output is correct |
95 |
Correct |
1 ms |
2636 KB |
Output is correct |
96 |
Correct |
1 ms |
2636 KB |
Output is correct |
97 |
Correct |
2 ms |
2636 KB |
Output is correct |
98 |
Correct |
2 ms |
2636 KB |
Output is correct |
99 |
Correct |
2 ms |
2636 KB |
Output is correct |
100 |
Correct |
2 ms |
2636 KB |
Output is correct |
101 |
Correct |
2 ms |
2636 KB |
Output is correct |
102 |
Correct |
2 ms |
2636 KB |
Output is correct |
103 |
Correct |
2 ms |
2636 KB |
Output is correct |
104 |
Correct |
2 ms |
2636 KB |
Output is correct |
105 |
Correct |
2 ms |
2636 KB |
Output is correct |
106 |
Correct |
1 ms |
2636 KB |
Output is correct |
107 |
Correct |
2 ms |
2636 KB |
Output is correct |
108 |
Correct |
2 ms |
2636 KB |
Output is correct |
109 |
Correct |
3 ms |
2688 KB |
Output is correct |
110 |
Correct |
2 ms |
2636 KB |
Output is correct |
111 |
Correct |
2 ms |
2636 KB |
Output is correct |
112 |
Correct |
3 ms |
2892 KB |
Output is correct |
113 |
Correct |
3 ms |
2912 KB |
Output is correct |
114 |
Correct |
3 ms |
2764 KB |
Output is correct |
115 |
Correct |
2 ms |
2764 KB |
Output is correct |
116 |
Correct |
3 ms |
2764 KB |
Output is correct |
117 |
Correct |
2 ms |
2764 KB |
Output is correct |
118 |
Correct |
30 ms |
5716 KB |
Output is correct |
119 |
Correct |
24 ms |
6208 KB |
Output is correct |
120 |
Correct |
35 ms |
6656 KB |
Output is correct |
121 |
Correct |
3 ms |
2636 KB |
Output is correct |
122 |
Correct |
2 ms |
2636 KB |
Output is correct |
123 |
Correct |
2 ms |
2636 KB |
Output is correct |
124 |
Correct |
2 ms |
2636 KB |
Output is correct |
125 |
Correct |
2 ms |
2636 KB |
Output is correct |
126 |
Correct |
5 ms |
3020 KB |
Output is correct |
127 |
Correct |
3 ms |
2892 KB |
Output is correct |
128 |
Correct |
3 ms |
2892 KB |
Output is correct |
129 |
Correct |
3 ms |
2848 KB |
Output is correct |
130 |
Correct |
3 ms |
2892 KB |
Output is correct |
131 |
Correct |
3 ms |
2892 KB |
Output is correct |
132 |
Correct |
26 ms |
6968 KB |
Output is correct |
133 |
Correct |
35 ms |
6996 KB |
Output is correct |
134 |
Correct |
26 ms |
6908 KB |
Output is correct |
135 |
Correct |
4 ms |
3020 KB |
Output is correct |
136 |
Correct |
64 ms |
2968 KB |
Output is correct |
137 |
Correct |
36 ms |
2896 KB |
Output is correct |
138 |
Correct |
27 ms |
2924 KB |
Output is correct |
139 |
Correct |
35 ms |
2972 KB |
Output is correct |
140 |
Correct |
25 ms |
2968 KB |
Output is correct |
141 |
Correct |
13 ms |
4172 KB |
Output is correct |
142 |
Correct |
12 ms |
4044 KB |
Output is correct |
143 |
Correct |
15 ms |
4556 KB |
Output is correct |
144 |
Correct |
12 ms |
4176 KB |
Output is correct |
145 |
Correct |
15 ms |
4428 KB |
Output is correct |
146 |
Correct |
10 ms |
4056 KB |
Output is correct |
147 |
Correct |
17 ms |
5604 KB |
Output is correct |
148 |
Correct |
5 ms |
3404 KB |
Output is correct |
149 |
Correct |
23 ms |
5824 KB |
Output is correct |
150 |
Correct |
5 ms |
3276 KB |
Output is correct |
151 |
Correct |
37 ms |
6340 KB |
Output is correct |
152 |
Correct |
8 ms |
3660 KB |
Output is correct |
153 |
Correct |
7 ms |
3608 KB |
Output is correct |
154 |
Correct |
9 ms |
3844 KB |
Output is correct |
155 |
Correct |
8 ms |
3532 KB |
Output is correct |
156 |
Correct |
7 ms |
3532 KB |
Output is correct |
157 |
Correct |
3 ms |
3020 KB |
Output is correct |
158 |
Correct |
82 ms |
3216 KB |
Output is correct |
159 |
Correct |
63 ms |
3020 KB |
Output is correct |
160 |
Correct |
54 ms |
3020 KB |
Output is correct |
161 |
Correct |
55 ms |
3028 KB |
Output is correct |
162 |
Correct |
51 ms |
3028 KB |
Output is correct |
163 |
Correct |
20 ms |
4812 KB |
Output is correct |
164 |
Correct |
19 ms |
4992 KB |
Output is correct |
165 |
Correct |
17 ms |
4928 KB |
Output is correct |
166 |
Correct |
16 ms |
4864 KB |
Output is correct |
167 |
Correct |
17 ms |
4884 KB |
Output is correct |
168 |
Correct |
17 ms |
4864 KB |
Output is correct |
169 |
Correct |
29 ms |
7372 KB |
Output is correct |
170 |
Correct |
9 ms |
3916 KB |
Output is correct |
171 |
Correct |
31 ms |
7436 KB |
Output is correct |
172 |
Correct |
13 ms |
3872 KB |
Output is correct |
173 |
Correct |
32 ms |
7464 KB |
Output is correct |
174 |
Correct |
13 ms |
3876 KB |
Output is correct |
175 |
Correct |
10 ms |
4128 KB |
Output is correct |
176 |
Correct |
10 ms |
3916 KB |
Output is correct |
177 |
Correct |
14 ms |
3908 KB |
Output is correct |
178 |
Correct |
9 ms |
3788 KB |
Output is correct |
179 |
Correct |
8 ms |
3660 KB |
Output is correct |
180 |
Correct |
155 ms |
3696 KB |
Output is correct |
181 |
Correct |
202 ms |
3684 KB |
Output is correct |
182 |
Correct |
248 ms |
3992 KB |
Output is correct |
183 |
Correct |
136 ms |
3616 KB |
Output is correct |
184 |
Correct |
129 ms |
3532 KB |
Output is correct |
185 |
Correct |
29 ms |
7176 KB |
Output is correct |
186 |
Correct |
37 ms |
9432 KB |
Output is correct |
187 |
Correct |
33 ms |
7888 KB |
Output is correct |
188 |
Correct |
31 ms |
6860 KB |
Output is correct |
189 |
Correct |
31 ms |
7380 KB |
Output is correct |
190 |
Correct |
37 ms |
8776 KB |
Output is correct |
191 |
Correct |
39 ms |
8724 KB |
Output is correct |
192 |
Correct |
24 ms |
6228 KB |
Output is correct |
193 |
Correct |
24 ms |
5964 KB |
Output is correct |
194 |
Correct |
11 ms |
4412 KB |
Output is correct |
195 |
Correct |
401 ms |
4528 KB |
Output is correct |
196 |
Correct |
305 ms |
3988 KB |
Output is correct |
197 |
Correct |
252 ms |
4044 KB |
Output is correct |
198 |
Correct |
235 ms |
4060 KB |
Output is correct |
199 |
Correct |
232 ms |
4088 KB |
Output is correct |
200 |
Correct |
61 ms |
16532 KB |
Output is correct |
201 |
Correct |
62 ms |
16464 KB |
Output is correct |
202 |
Correct |
62 ms |
16416 KB |
Output is correct |
203 |
Correct |
80 ms |
16456 KB |
Output is correct |
204 |
Correct |
77 ms |
16524 KB |
Output is correct |
205 |
Correct |
70 ms |
16512 KB |
Output is correct |
206 |
Correct |
57 ms |
15228 KB |
Output is correct |
207 |
Correct |
47 ms |
15292 KB |
Output is correct |
208 |
Correct |
55 ms |
15140 KB |
Output is correct |
209 |
Correct |
50 ms |
15324 KB |
Output is correct |
210 |
Correct |
59 ms |
15236 KB |
Output is correct |
211 |
Correct |
50 ms |
15304 KB |
Output is correct |
212 |
Correct |
71 ms |
16096 KB |
Output is correct |
213 |
Correct |
47 ms |
11540 KB |
Output is correct |
214 |
Correct |
49 ms |
10760 KB |
Output is correct |
215 |
Correct |
50 ms |
10436 KB |
Output is correct |