#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, maxk = 2e5 + 10;
int dp[maxn], c[maxn], a[maxn], n, m;
vector < int > b[maxn], col[maxn], sp[maxk];
vector < pair < int, int > > path[maxn];
int minimumInstructions(
int N, int M, int K, vector<int> C,
vector<int> A, vector<vector<int>> B)
{
n = N;
m = M;
for (int i = 0; i < n; i ++)
{
c[i] = C[i];
sp[c[i]].push_back(i);
}
for (int i = 0; i < m; i ++)
{
a[i] = A[i];
for (int j = 0; j < a[i]; j ++)
{
for (int d : sp[B[i][j]])
path[d].push_back({i, 1});
}
}
for (int i = 0; i < N; i ++)
dp[i] = 1e9;
deque < pair < int, int > > dq;
dq.push_back({N, 0});
for (int i = N - 1; i >= 0; i --)
{
/**bool tf = false;
for (int st = 0; st < M; st ++)
{
bool is_pos = true;
for (int pos = 0; pos < M; pos ++)
{
if (col[c[i + pos]][(st + pos) % M] == 0)
{
///cout << "break " << pos << endl;
is_pos = false;
break;
}
}
if (is_pos)
{
///cout << i << " " << st << endl;
tf = true;
break;
}
}*/
bool tf = false;
int pt = 0;
for (int j = 0; j < path[i].size(); j ++)
{
while(pt < path[i + 1].size() && path[i + 1][pt].first <= path[i][j].first)
pt ++;
if (pt != path[i + 1].size() && path[i + 1][pt].first == path[i][j].first + 1)
path[i][j].second = max(path[i][j].second, min(path[i + 1][pt].second + 1, m));
if (path[i][j].first == M - 1)
{
if (path[i + 1].size() > 0 && path[i + 1][0].first == 0)
{
path[i][j].second = max(path[i][j].second, min(path[i + 1][0].second + 1, m));
}
}
if (path[i][j].second == m)
tf = true;
///cout << i << " : " << path[i][j].first << " " << path[i][j].second << endl;
}
while(!dq.empty() && dq.front().first > i + M)
dq.pop_front();///, cout << "rem " << dq.front().first << endl;
if (tf)
{
///cout << "here " << i << " " << dq.front().first << endl;
dp[i] = dq.front().second + 1;
//for (int j = i + 1; j <= i + M; j ++)
// dp[i] = min(dp[i], dp[j] + 1);
}
while(!dq.empty() && dq.back().second >= dp[i])
dq.pop_back();
dq.push_back({i, dp[i]});
}
if (dp[0] > N)
return -1;
return dp[0];
}
Compilation message
paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:64:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
64 | for (int j = 0; j < path[i].size(); j ++)
| ~~^~~~~~~~~~~~~~~~
paint.cpp:66:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
66 | while(pt < path[i + 1].size() && path[i + 1][pt].first <= path[i][j].first)
| ~~~^~~~~~~~~~~~~~~~~~~~
paint.cpp:69:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
69 | if (pt != path[i + 1].size() && path[i + 1][pt].first == path[i][j].first + 1)
| ~~~^~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
19028 KB |
Output is correct |
2 |
Correct |
11 ms |
19100 KB |
Output is correct |
3 |
Correct |
11 ms |
19064 KB |
Output is correct |
4 |
Correct |
10 ms |
19028 KB |
Output is correct |
5 |
Correct |
10 ms |
19108 KB |
Output is correct |
6 |
Correct |
10 ms |
19028 KB |
Output is correct |
7 |
Correct |
11 ms |
19040 KB |
Output is correct |
8 |
Correct |
10 ms |
19028 KB |
Output is correct |
9 |
Correct |
11 ms |
19028 KB |
Output is correct |
10 |
Correct |
11 ms |
19028 KB |
Output is correct |
11 |
Correct |
10 ms |
19112 KB |
Output is correct |
12 |
Correct |
10 ms |
19068 KB |
Output is correct |
13 |
Correct |
10 ms |
19156 KB |
Output is correct |
14 |
Correct |
10 ms |
19144 KB |
Output is correct |
15 |
Correct |
11 ms |
19164 KB |
Output is correct |
16 |
Correct |
11 ms |
19156 KB |
Output is correct |
17 |
Correct |
10 ms |
19156 KB |
Output is correct |
18 |
Correct |
11 ms |
19144 KB |
Output is correct |
19 |
Correct |
10 ms |
19028 KB |
Output is correct |
20 |
Correct |
10 ms |
19076 KB |
Output is correct |
21 |
Correct |
10 ms |
19152 KB |
Output is correct |
22 |
Correct |
18 ms |
19848 KB |
Output is correct |
23 |
Correct |
19 ms |
19884 KB |
Output is correct |
24 |
Correct |
19 ms |
19924 KB |
Output is correct |
25 |
Correct |
14 ms |
20060 KB |
Output is correct |
26 |
Correct |
13 ms |
20052 KB |
Output is correct |
27 |
Correct |
13 ms |
20052 KB |
Output is correct |
28 |
Correct |
13 ms |
20052 KB |
Output is correct |
29 |
Correct |
14 ms |
20072 KB |
Output is correct |
30 |
Correct |
13 ms |
20060 KB |
Output is correct |
31 |
Correct |
19 ms |
20872 KB |
Output is correct |
32 |
Correct |
21 ms |
20864 KB |
Output is correct |
33 |
Correct |
20 ms |
20888 KB |
Output is correct |
34 |
Correct |
25 ms |
20948 KB |
Output is correct |
35 |
Correct |
19 ms |
20964 KB |
Output is correct |
36 |
Correct |
20 ms |
20964 KB |
Output is correct |
37 |
Correct |
28 ms |
21500 KB |
Output is correct |
38 |
Correct |
29 ms |
21504 KB |
Output is correct |
39 |
Correct |
27 ms |
21460 KB |
Output is correct |
40 |
Correct |
24 ms |
23680 KB |
Output is correct |
41 |
Correct |
22 ms |
21920 KB |
Output is correct |
42 |
Correct |
27 ms |
24008 KB |
Output is correct |
43 |
Correct |
22 ms |
22432 KB |
Output is correct |
44 |
Correct |
20 ms |
22072 KB |
Output is correct |
45 |
Correct |
26 ms |
24276 KB |
Output is correct |
46 |
Correct |
55 ms |
31732 KB |
Output is correct |
47 |
Correct |
38 ms |
26320 KB |
Output is correct |
48 |
Correct |
43 ms |
28988 KB |
Output is correct |
49 |
Correct |
58 ms |
28092 KB |
Output is correct |
50 |
Correct |
64 ms |
28004 KB |
Output is correct |
51 |
Correct |
51 ms |
26316 KB |
Output is correct |
52 |
Correct |
27 ms |
24100 KB |
Output is correct |
53 |
Correct |
30 ms |
24156 KB |
Output is correct |
54 |
Correct |
27 ms |
24136 KB |
Output is correct |
55 |
Correct |
28 ms |
24112 KB |
Output is correct |
56 |
Correct |
27 ms |
24192 KB |
Output is correct |
57 |
Correct |
27 ms |
24240 KB |
Output is correct |
58 |
Correct |
56 ms |
32928 KB |
Output is correct |
59 |
Correct |
64 ms |
32960 KB |
Output is correct |
60 |
Correct |
62 ms |
32948 KB |
Output is correct |
61 |
Correct |
60 ms |
32920 KB |
Output is correct |
62 |
Correct |
66 ms |
32952 KB |
Output is correct |
63 |
Correct |
58 ms |
32972 KB |
Output is correct |
64 |
Correct |
78 ms |
30964 KB |
Output is correct |
65 |
Correct |
82 ms |
30964 KB |
Output is correct |
66 |
Correct |
79 ms |
31024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
19028 KB |
Output is correct |
2 |
Correct |
11 ms |
19100 KB |
Output is correct |
3 |
Correct |
11 ms |
19064 KB |
Output is correct |
4 |
Correct |
10 ms |
19028 KB |
Output is correct |
5 |
Correct |
10 ms |
19108 KB |
Output is correct |
6 |
Correct |
10 ms |
19028 KB |
Output is correct |
7 |
Correct |
11 ms |
19040 KB |
Output is correct |
8 |
Correct |
10 ms |
19028 KB |
Output is correct |
9 |
Correct |
11 ms |
19028 KB |
Output is correct |
10 |
Correct |
11 ms |
19028 KB |
Output is correct |
11 |
Correct |
10 ms |
19112 KB |
Output is correct |
12 |
Correct |
10 ms |
19068 KB |
Output is correct |
13 |
Correct |
10 ms |
19156 KB |
Output is correct |
14 |
Correct |
10 ms |
19144 KB |
Output is correct |
15 |
Correct |
11 ms |
19164 KB |
Output is correct |
16 |
Correct |
11 ms |
19156 KB |
Output is correct |
17 |
Correct |
10 ms |
19156 KB |
Output is correct |
18 |
Correct |
11 ms |
19144 KB |
Output is correct |
19 |
Correct |
10 ms |
19028 KB |
Output is correct |
20 |
Correct |
10 ms |
19076 KB |
Output is correct |
21 |
Correct |
10 ms |
19152 KB |
Output is correct |
22 |
Correct |
10 ms |
19028 KB |
Output is correct |
23 |
Correct |
10 ms |
19028 KB |
Output is correct |
24 |
Correct |
10 ms |
19028 KB |
Output is correct |
25 |
Correct |
12 ms |
19084 KB |
Output is correct |
26 |
Correct |
11 ms |
19032 KB |
Output is correct |
27 |
Correct |
11 ms |
19004 KB |
Output is correct |
28 |
Correct |
11 ms |
19204 KB |
Output is correct |
29 |
Correct |
11 ms |
19160 KB |
Output is correct |
30 |
Correct |
10 ms |
19156 KB |
Output is correct |
31 |
Correct |
11 ms |
19160 KB |
Output is correct |
32 |
Correct |
10 ms |
19156 KB |
Output is correct |
33 |
Correct |
11 ms |
19028 KB |
Output is correct |
34 |
Correct |
11 ms |
19156 KB |
Output is correct |
35 |
Correct |
10 ms |
19120 KB |
Output is correct |
36 |
Correct |
10 ms |
19028 KB |
Output is correct |
37 |
Correct |
10 ms |
19028 KB |
Output is correct |
38 |
Correct |
11 ms |
19088 KB |
Output is correct |
39 |
Correct |
10 ms |
19132 KB |
Output is correct |
40 |
Correct |
14 ms |
19028 KB |
Output is correct |
41 |
Correct |
11 ms |
19028 KB |
Output is correct |
42 |
Correct |
11 ms |
19028 KB |
Output is correct |
43 |
Correct |
12 ms |
19056 KB |
Output is correct |
44 |
Correct |
10 ms |
19028 KB |
Output is correct |
45 |
Correct |
11 ms |
19224 KB |
Output is correct |
46 |
Correct |
10 ms |
19284 KB |
Output is correct |
47 |
Correct |
13 ms |
19240 KB |
Output is correct |
48 |
Correct |
11 ms |
19188 KB |
Output is correct |
49 |
Correct |
11 ms |
19240 KB |
Output is correct |
50 |
Correct |
10 ms |
19156 KB |
Output is correct |
51 |
Correct |
13 ms |
19156 KB |
Output is correct |
52 |
Correct |
10 ms |
19156 KB |
Output is correct |
53 |
Correct |
10 ms |
19156 KB |
Output is correct |
54 |
Correct |
9 ms |
19156 KB |
Output is correct |
55 |
Correct |
10 ms |
19156 KB |
Output is correct |
56 |
Correct |
10 ms |
19028 KB |
Output is correct |
57 |
Correct |
10 ms |
19160 KB |
Output is correct |
58 |
Correct |
10 ms |
19028 KB |
Output is correct |
59 |
Correct |
10 ms |
19068 KB |
Output is correct |
60 |
Correct |
11 ms |
19156 KB |
Output is correct |
61 |
Correct |
10 ms |
19156 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
19028 KB |
Output is correct |
2 |
Correct |
10 ms |
19028 KB |
Output is correct |
3 |
Correct |
11 ms |
19028 KB |
Output is correct |
4 |
Correct |
11 ms |
19100 KB |
Output is correct |
5 |
Correct |
11 ms |
19064 KB |
Output is correct |
6 |
Correct |
10 ms |
19028 KB |
Output is correct |
7 |
Correct |
10 ms |
19108 KB |
Output is correct |
8 |
Correct |
10 ms |
19028 KB |
Output is correct |
9 |
Correct |
11 ms |
19040 KB |
Output is correct |
10 |
Correct |
10 ms |
19028 KB |
Output is correct |
11 |
Correct |
11 ms |
19028 KB |
Output is correct |
12 |
Correct |
11 ms |
19028 KB |
Output is correct |
13 |
Correct |
10 ms |
19112 KB |
Output is correct |
14 |
Correct |
10 ms |
19068 KB |
Output is correct |
15 |
Correct |
10 ms |
19156 KB |
Output is correct |
16 |
Correct |
10 ms |
19144 KB |
Output is correct |
17 |
Correct |
11 ms |
19164 KB |
Output is correct |
18 |
Correct |
11 ms |
19156 KB |
Output is correct |
19 |
Correct |
10 ms |
19156 KB |
Output is correct |
20 |
Correct |
11 ms |
19144 KB |
Output is correct |
21 |
Correct |
10 ms |
19028 KB |
Output is correct |
22 |
Correct |
10 ms |
19076 KB |
Output is correct |
23 |
Correct |
10 ms |
19152 KB |
Output is correct |
24 |
Correct |
18 ms |
19848 KB |
Output is correct |
25 |
Correct |
19 ms |
19884 KB |
Output is correct |
26 |
Correct |
19 ms |
19924 KB |
Output is correct |
27 |
Correct |
10 ms |
19028 KB |
Output is correct |
28 |
Correct |
12 ms |
19084 KB |
Output is correct |
29 |
Correct |
11 ms |
19032 KB |
Output is correct |
30 |
Correct |
11 ms |
19004 KB |
Output is correct |
31 |
Correct |
11 ms |
19204 KB |
Output is correct |
32 |
Correct |
11 ms |
19160 KB |
Output is correct |
33 |
Correct |
10 ms |
19156 KB |
Output is correct |
34 |
Correct |
11 ms |
19160 KB |
Output is correct |
35 |
Correct |
10 ms |
19156 KB |
Output is correct |
36 |
Correct |
11 ms |
19028 KB |
Output is correct |
37 |
Correct |
11 ms |
19156 KB |
Output is correct |
38 |
Correct |
10 ms |
19120 KB |
Output is correct |
39 |
Correct |
10 ms |
19028 KB |
Output is correct |
40 |
Correct |
10 ms |
19028 KB |
Output is correct |
41 |
Correct |
11 ms |
19088 KB |
Output is correct |
42 |
Correct |
10 ms |
19132 KB |
Output is correct |
43 |
Correct |
14 ms |
19028 KB |
Output is correct |
44 |
Correct |
11 ms |
19028 KB |
Output is correct |
45 |
Correct |
11 ms |
19028 KB |
Output is correct |
46 |
Correct |
12 ms |
19056 KB |
Output is correct |
47 |
Correct |
10 ms |
19028 KB |
Output is correct |
48 |
Correct |
11 ms |
19224 KB |
Output is correct |
49 |
Correct |
10 ms |
19284 KB |
Output is correct |
50 |
Correct |
13 ms |
19240 KB |
Output is correct |
51 |
Correct |
11 ms |
19188 KB |
Output is correct |
52 |
Correct |
11 ms |
19240 KB |
Output is correct |
53 |
Correct |
10 ms |
19156 KB |
Output is correct |
54 |
Correct |
13 ms |
19156 KB |
Output is correct |
55 |
Correct |
10 ms |
19156 KB |
Output is correct |
56 |
Correct |
10 ms |
19156 KB |
Output is correct |
57 |
Correct |
9 ms |
19156 KB |
Output is correct |
58 |
Correct |
10 ms |
19156 KB |
Output is correct |
59 |
Correct |
10 ms |
19028 KB |
Output is correct |
60 |
Correct |
10 ms |
19160 KB |
Output is correct |
61 |
Correct |
10 ms |
19028 KB |
Output is correct |
62 |
Correct |
10 ms |
19068 KB |
Output is correct |
63 |
Correct |
11 ms |
19156 KB |
Output is correct |
64 |
Correct |
10 ms |
19156 KB |
Output is correct |
65 |
Correct |
12 ms |
19668 KB |
Output is correct |
66 |
Correct |
11 ms |
19284 KB |
Output is correct |
67 |
Correct |
12 ms |
19612 KB |
Output is correct |
68 |
Correct |
12 ms |
19648 KB |
Output is correct |
69 |
Correct |
13 ms |
19540 KB |
Output is correct |
70 |
Correct |
12 ms |
19284 KB |
Output is correct |
71 |
Correct |
15 ms |
19244 KB |
Output is correct |
72 |
Correct |
15 ms |
19284 KB |
Output is correct |
73 |
Correct |
11 ms |
19284 KB |
Output is correct |
74 |
Correct |
15 ms |
19272 KB |
Output is correct |
75 |
Correct |
11 ms |
19276 KB |
Output is correct |
76 |
Correct |
20 ms |
20012 KB |
Output is correct |
77 |
Correct |
22 ms |
20072 KB |
Output is correct |
78 |
Correct |
23 ms |
20184 KB |
Output is correct |
79 |
Correct |
12 ms |
20144 KB |
Output is correct |
80 |
Correct |
14 ms |
20080 KB |
Output is correct |
81 |
Correct |
14 ms |
20172 KB |
Output is correct |
82 |
Correct |
13 ms |
20052 KB |
Output is correct |
83 |
Correct |
15 ms |
20052 KB |
Output is correct |
84 |
Correct |
13 ms |
19412 KB |
Output is correct |
85 |
Correct |
12 ms |
19392 KB |
Output is correct |
86 |
Correct |
12 ms |
19412 KB |
Output is correct |
87 |
Correct |
12 ms |
19424 KB |
Output is correct |
88 |
Correct |
12 ms |
19372 KB |
Output is correct |
89 |
Correct |
13 ms |
19412 KB |
Output is correct |
90 |
Correct |
24 ms |
20356 KB |
Output is correct |
91 |
Correct |
25 ms |
20288 KB |
Output is correct |
92 |
Correct |
28 ms |
20300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
19028 KB |
Output is correct |
2 |
Correct |
10 ms |
19028 KB |
Output is correct |
3 |
Correct |
11 ms |
19028 KB |
Output is correct |
4 |
Correct |
11 ms |
19100 KB |
Output is correct |
5 |
Correct |
11 ms |
19064 KB |
Output is correct |
6 |
Correct |
10 ms |
19028 KB |
Output is correct |
7 |
Correct |
10 ms |
19108 KB |
Output is correct |
8 |
Correct |
10 ms |
19028 KB |
Output is correct |
9 |
Correct |
11 ms |
19040 KB |
Output is correct |
10 |
Correct |
10 ms |
19028 KB |
Output is correct |
11 |
Correct |
11 ms |
19028 KB |
Output is correct |
12 |
Correct |
11 ms |
19028 KB |
Output is correct |
13 |
Correct |
10 ms |
19112 KB |
Output is correct |
14 |
Correct |
10 ms |
19068 KB |
Output is correct |
15 |
Correct |
10 ms |
19156 KB |
Output is correct |
16 |
Correct |
10 ms |
19144 KB |
Output is correct |
17 |
Correct |
11 ms |
19164 KB |
Output is correct |
18 |
Correct |
11 ms |
19156 KB |
Output is correct |
19 |
Correct |
10 ms |
19156 KB |
Output is correct |
20 |
Correct |
11 ms |
19144 KB |
Output is correct |
21 |
Correct |
10 ms |
19028 KB |
Output is correct |
22 |
Correct |
10 ms |
19076 KB |
Output is correct |
23 |
Correct |
10 ms |
19152 KB |
Output is correct |
24 |
Correct |
18 ms |
19848 KB |
Output is correct |
25 |
Correct |
19 ms |
19884 KB |
Output is correct |
26 |
Correct |
19 ms |
19924 KB |
Output is correct |
27 |
Correct |
14 ms |
20060 KB |
Output is correct |
28 |
Correct |
13 ms |
20052 KB |
Output is correct |
29 |
Correct |
13 ms |
20052 KB |
Output is correct |
30 |
Correct |
13 ms |
20052 KB |
Output is correct |
31 |
Correct |
14 ms |
20072 KB |
Output is correct |
32 |
Correct |
13 ms |
20060 KB |
Output is correct |
33 |
Correct |
19 ms |
20872 KB |
Output is correct |
34 |
Correct |
21 ms |
20864 KB |
Output is correct |
35 |
Correct |
20 ms |
20888 KB |
Output is correct |
36 |
Correct |
25 ms |
20948 KB |
Output is correct |
37 |
Correct |
19 ms |
20964 KB |
Output is correct |
38 |
Correct |
20 ms |
20964 KB |
Output is correct |
39 |
Correct |
28 ms |
21500 KB |
Output is correct |
40 |
Correct |
29 ms |
21504 KB |
Output is correct |
41 |
Correct |
27 ms |
21460 KB |
Output is correct |
42 |
Correct |
10 ms |
19028 KB |
Output is correct |
43 |
Correct |
12 ms |
19084 KB |
Output is correct |
44 |
Correct |
11 ms |
19032 KB |
Output is correct |
45 |
Correct |
11 ms |
19004 KB |
Output is correct |
46 |
Correct |
11 ms |
19204 KB |
Output is correct |
47 |
Correct |
11 ms |
19160 KB |
Output is correct |
48 |
Correct |
10 ms |
19156 KB |
Output is correct |
49 |
Correct |
11 ms |
19160 KB |
Output is correct |
50 |
Correct |
10 ms |
19156 KB |
Output is correct |
51 |
Correct |
11 ms |
19028 KB |
Output is correct |
52 |
Correct |
11 ms |
19156 KB |
Output is correct |
53 |
Correct |
10 ms |
19120 KB |
Output is correct |
54 |
Correct |
10 ms |
19028 KB |
Output is correct |
55 |
Correct |
10 ms |
19028 KB |
Output is correct |
56 |
Correct |
11 ms |
19088 KB |
Output is correct |
57 |
Correct |
10 ms |
19132 KB |
Output is correct |
58 |
Correct |
14 ms |
19028 KB |
Output is correct |
59 |
Correct |
11 ms |
19028 KB |
Output is correct |
60 |
Correct |
11 ms |
19028 KB |
Output is correct |
61 |
Correct |
12 ms |
19056 KB |
Output is correct |
62 |
Correct |
10 ms |
19028 KB |
Output is correct |
63 |
Correct |
11 ms |
19224 KB |
Output is correct |
64 |
Correct |
10 ms |
19284 KB |
Output is correct |
65 |
Correct |
13 ms |
19240 KB |
Output is correct |
66 |
Correct |
11 ms |
19188 KB |
Output is correct |
67 |
Correct |
11 ms |
19240 KB |
Output is correct |
68 |
Correct |
10 ms |
19156 KB |
Output is correct |
69 |
Correct |
13 ms |
19156 KB |
Output is correct |
70 |
Correct |
10 ms |
19156 KB |
Output is correct |
71 |
Correct |
10 ms |
19156 KB |
Output is correct |
72 |
Correct |
9 ms |
19156 KB |
Output is correct |
73 |
Correct |
10 ms |
19156 KB |
Output is correct |
74 |
Correct |
10 ms |
19028 KB |
Output is correct |
75 |
Correct |
10 ms |
19160 KB |
Output is correct |
76 |
Correct |
10 ms |
19028 KB |
Output is correct |
77 |
Correct |
10 ms |
19068 KB |
Output is correct |
78 |
Correct |
11 ms |
19156 KB |
Output is correct |
79 |
Correct |
10 ms |
19156 KB |
Output is correct |
80 |
Correct |
12 ms |
19668 KB |
Output is correct |
81 |
Correct |
11 ms |
19284 KB |
Output is correct |
82 |
Correct |
12 ms |
19612 KB |
Output is correct |
83 |
Correct |
12 ms |
19648 KB |
Output is correct |
84 |
Correct |
13 ms |
19540 KB |
Output is correct |
85 |
Correct |
12 ms |
19284 KB |
Output is correct |
86 |
Correct |
15 ms |
19244 KB |
Output is correct |
87 |
Correct |
15 ms |
19284 KB |
Output is correct |
88 |
Correct |
11 ms |
19284 KB |
Output is correct |
89 |
Correct |
15 ms |
19272 KB |
Output is correct |
90 |
Correct |
11 ms |
19276 KB |
Output is correct |
91 |
Correct |
20 ms |
20012 KB |
Output is correct |
92 |
Correct |
22 ms |
20072 KB |
Output is correct |
93 |
Correct |
23 ms |
20184 KB |
Output is correct |
94 |
Correct |
12 ms |
20144 KB |
Output is correct |
95 |
Correct |
14 ms |
20080 KB |
Output is correct |
96 |
Correct |
14 ms |
20172 KB |
Output is correct |
97 |
Correct |
13 ms |
20052 KB |
Output is correct |
98 |
Correct |
15 ms |
20052 KB |
Output is correct |
99 |
Correct |
13 ms |
19412 KB |
Output is correct |
100 |
Correct |
12 ms |
19392 KB |
Output is correct |
101 |
Correct |
12 ms |
19412 KB |
Output is correct |
102 |
Correct |
12 ms |
19424 KB |
Output is correct |
103 |
Correct |
12 ms |
19372 KB |
Output is correct |
104 |
Correct |
13 ms |
19412 KB |
Output is correct |
105 |
Correct |
24 ms |
20356 KB |
Output is correct |
106 |
Correct |
25 ms |
20288 KB |
Output is correct |
107 |
Correct |
28 ms |
20300 KB |
Output is correct |
108 |
Correct |
13 ms |
20052 KB |
Output is correct |
109 |
Correct |
204 ms |
136080 KB |
Output is correct |
110 |
Correct |
130 ms |
68908 KB |
Output is correct |
111 |
Correct |
105 ms |
65920 KB |
Output is correct |
112 |
Correct |
149 ms |
81516 KB |
Output is correct |
113 |
Correct |
98 ms |
49792 KB |
Output is correct |
114 |
Correct |
22 ms |
21168 KB |
Output is correct |
115 |
Correct |
24 ms |
20960 KB |
Output is correct |
116 |
Correct |
27 ms |
21596 KB |
Output is correct |
117 |
Correct |
23 ms |
20984 KB |
Output is correct |
118 |
Correct |
24 ms |
21368 KB |
Output is correct |
119 |
Correct |
21 ms |
20908 KB |
Output is correct |
120 |
Correct |
23 ms |
20700 KB |
Output is correct |
121 |
Correct |
16 ms |
20140 KB |
Output is correct |
122 |
Correct |
33 ms |
20908 KB |
Output is correct |
123 |
Correct |
16 ms |
20052 KB |
Output is correct |
124 |
Correct |
28 ms |
21472 KB |
Output is correct |
125 |
Correct |
19 ms |
20500 KB |
Output is correct |
126 |
Correct |
17 ms |
20388 KB |
Output is correct |
127 |
Correct |
20 ms |
20764 KB |
Output is correct |
128 |
Correct |
18 ms |
20220 KB |
Output is correct |
129 |
Correct |
17 ms |
20308 KB |
Output is correct |
130 |
Correct |
14 ms |
20112 KB |
Output is correct |
131 |
Correct |
303 ms |
180392 KB |
Output is correct |
132 |
Correct |
234 ms |
100252 KB |
Output is correct |
133 |
Correct |
188 ms |
100264 KB |
Output is correct |
134 |
Correct |
177 ms |
100228 KB |
Output is correct |
135 |
Correct |
177 ms |
92396 KB |
Output is correct |
136 |
Correct |
29 ms |
21944 KB |
Output is correct |
137 |
Correct |
29 ms |
21852 KB |
Output is correct |
138 |
Correct |
30 ms |
21968 KB |
Output is correct |
139 |
Correct |
32 ms |
21936 KB |
Output is correct |
140 |
Correct |
39 ms |
21852 KB |
Output is correct |
141 |
Correct |
30 ms |
21972 KB |
Output is correct |
142 |
Correct |
34 ms |
21848 KB |
Output is correct |
143 |
Correct |
19 ms |
20820 KB |
Output is correct |
144 |
Correct |
33 ms |
21844 KB |
Output is correct |
145 |
Correct |
20 ms |
20820 KB |
Output is correct |
146 |
Correct |
35 ms |
21832 KB |
Output is correct |
147 |
Correct |
19 ms |
20744 KB |
Output is correct |
148 |
Correct |
22 ms |
21096 KB |
Output is correct |
149 |
Correct |
21 ms |
21004 KB |
Output is correct |
150 |
Correct |
21 ms |
20928 KB |
Output is correct |
151 |
Correct |
20 ms |
20880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
19028 KB |
Output is correct |
2 |
Correct |
10 ms |
19028 KB |
Output is correct |
3 |
Correct |
11 ms |
19028 KB |
Output is correct |
4 |
Correct |
11 ms |
19100 KB |
Output is correct |
5 |
Correct |
11 ms |
19064 KB |
Output is correct |
6 |
Correct |
10 ms |
19028 KB |
Output is correct |
7 |
Correct |
10 ms |
19108 KB |
Output is correct |
8 |
Correct |
10 ms |
19028 KB |
Output is correct |
9 |
Correct |
11 ms |
19040 KB |
Output is correct |
10 |
Correct |
10 ms |
19028 KB |
Output is correct |
11 |
Correct |
11 ms |
19028 KB |
Output is correct |
12 |
Correct |
11 ms |
19028 KB |
Output is correct |
13 |
Correct |
10 ms |
19112 KB |
Output is correct |
14 |
Correct |
10 ms |
19068 KB |
Output is correct |
15 |
Correct |
10 ms |
19156 KB |
Output is correct |
16 |
Correct |
10 ms |
19144 KB |
Output is correct |
17 |
Correct |
11 ms |
19164 KB |
Output is correct |
18 |
Correct |
11 ms |
19156 KB |
Output is correct |
19 |
Correct |
10 ms |
19156 KB |
Output is correct |
20 |
Correct |
11 ms |
19144 KB |
Output is correct |
21 |
Correct |
10 ms |
19028 KB |
Output is correct |
22 |
Correct |
10 ms |
19076 KB |
Output is correct |
23 |
Correct |
10 ms |
19152 KB |
Output is correct |
24 |
Correct |
18 ms |
19848 KB |
Output is correct |
25 |
Correct |
19 ms |
19884 KB |
Output is correct |
26 |
Correct |
19 ms |
19924 KB |
Output is correct |
27 |
Correct |
14 ms |
20060 KB |
Output is correct |
28 |
Correct |
13 ms |
20052 KB |
Output is correct |
29 |
Correct |
13 ms |
20052 KB |
Output is correct |
30 |
Correct |
13 ms |
20052 KB |
Output is correct |
31 |
Correct |
14 ms |
20072 KB |
Output is correct |
32 |
Correct |
13 ms |
20060 KB |
Output is correct |
33 |
Correct |
19 ms |
20872 KB |
Output is correct |
34 |
Correct |
21 ms |
20864 KB |
Output is correct |
35 |
Correct |
20 ms |
20888 KB |
Output is correct |
36 |
Correct |
25 ms |
20948 KB |
Output is correct |
37 |
Correct |
19 ms |
20964 KB |
Output is correct |
38 |
Correct |
20 ms |
20964 KB |
Output is correct |
39 |
Correct |
28 ms |
21500 KB |
Output is correct |
40 |
Correct |
29 ms |
21504 KB |
Output is correct |
41 |
Correct |
27 ms |
21460 KB |
Output is correct |
42 |
Correct |
24 ms |
23680 KB |
Output is correct |
43 |
Correct |
22 ms |
21920 KB |
Output is correct |
44 |
Correct |
27 ms |
24008 KB |
Output is correct |
45 |
Correct |
22 ms |
22432 KB |
Output is correct |
46 |
Correct |
20 ms |
22072 KB |
Output is correct |
47 |
Correct |
26 ms |
24276 KB |
Output is correct |
48 |
Correct |
55 ms |
31732 KB |
Output is correct |
49 |
Correct |
38 ms |
26320 KB |
Output is correct |
50 |
Correct |
43 ms |
28988 KB |
Output is correct |
51 |
Correct |
58 ms |
28092 KB |
Output is correct |
52 |
Correct |
64 ms |
28004 KB |
Output is correct |
53 |
Correct |
51 ms |
26316 KB |
Output is correct |
54 |
Correct |
27 ms |
24100 KB |
Output is correct |
55 |
Correct |
30 ms |
24156 KB |
Output is correct |
56 |
Correct |
27 ms |
24136 KB |
Output is correct |
57 |
Correct |
28 ms |
24112 KB |
Output is correct |
58 |
Correct |
27 ms |
24192 KB |
Output is correct |
59 |
Correct |
27 ms |
24240 KB |
Output is correct |
60 |
Correct |
56 ms |
32928 KB |
Output is correct |
61 |
Correct |
64 ms |
32960 KB |
Output is correct |
62 |
Correct |
62 ms |
32948 KB |
Output is correct |
63 |
Correct |
60 ms |
32920 KB |
Output is correct |
64 |
Correct |
66 ms |
32952 KB |
Output is correct |
65 |
Correct |
58 ms |
32972 KB |
Output is correct |
66 |
Correct |
78 ms |
30964 KB |
Output is correct |
67 |
Correct |
82 ms |
30964 KB |
Output is correct |
68 |
Correct |
79 ms |
31024 KB |
Output is correct |
69 |
Correct |
10 ms |
19028 KB |
Output is correct |
70 |
Correct |
12 ms |
19084 KB |
Output is correct |
71 |
Correct |
11 ms |
19032 KB |
Output is correct |
72 |
Correct |
11 ms |
19004 KB |
Output is correct |
73 |
Correct |
11 ms |
19204 KB |
Output is correct |
74 |
Correct |
11 ms |
19160 KB |
Output is correct |
75 |
Correct |
10 ms |
19156 KB |
Output is correct |
76 |
Correct |
11 ms |
19160 KB |
Output is correct |
77 |
Correct |
10 ms |
19156 KB |
Output is correct |
78 |
Correct |
11 ms |
19028 KB |
Output is correct |
79 |
Correct |
11 ms |
19156 KB |
Output is correct |
80 |
Correct |
10 ms |
19120 KB |
Output is correct |
81 |
Correct |
10 ms |
19028 KB |
Output is correct |
82 |
Correct |
10 ms |
19028 KB |
Output is correct |
83 |
Correct |
11 ms |
19088 KB |
Output is correct |
84 |
Correct |
10 ms |
19132 KB |
Output is correct |
85 |
Correct |
14 ms |
19028 KB |
Output is correct |
86 |
Correct |
11 ms |
19028 KB |
Output is correct |
87 |
Correct |
11 ms |
19028 KB |
Output is correct |
88 |
Correct |
12 ms |
19056 KB |
Output is correct |
89 |
Correct |
10 ms |
19028 KB |
Output is correct |
90 |
Correct |
11 ms |
19224 KB |
Output is correct |
91 |
Correct |
10 ms |
19284 KB |
Output is correct |
92 |
Correct |
13 ms |
19240 KB |
Output is correct |
93 |
Correct |
11 ms |
19188 KB |
Output is correct |
94 |
Correct |
11 ms |
19240 KB |
Output is correct |
95 |
Correct |
10 ms |
19156 KB |
Output is correct |
96 |
Correct |
13 ms |
19156 KB |
Output is correct |
97 |
Correct |
10 ms |
19156 KB |
Output is correct |
98 |
Correct |
10 ms |
19156 KB |
Output is correct |
99 |
Correct |
9 ms |
19156 KB |
Output is correct |
100 |
Correct |
10 ms |
19156 KB |
Output is correct |
101 |
Correct |
10 ms |
19028 KB |
Output is correct |
102 |
Correct |
10 ms |
19160 KB |
Output is correct |
103 |
Correct |
10 ms |
19028 KB |
Output is correct |
104 |
Correct |
10 ms |
19068 KB |
Output is correct |
105 |
Correct |
11 ms |
19156 KB |
Output is correct |
106 |
Correct |
10 ms |
19156 KB |
Output is correct |
107 |
Correct |
12 ms |
19668 KB |
Output is correct |
108 |
Correct |
11 ms |
19284 KB |
Output is correct |
109 |
Correct |
12 ms |
19612 KB |
Output is correct |
110 |
Correct |
12 ms |
19648 KB |
Output is correct |
111 |
Correct |
13 ms |
19540 KB |
Output is correct |
112 |
Correct |
12 ms |
19284 KB |
Output is correct |
113 |
Correct |
15 ms |
19244 KB |
Output is correct |
114 |
Correct |
15 ms |
19284 KB |
Output is correct |
115 |
Correct |
11 ms |
19284 KB |
Output is correct |
116 |
Correct |
15 ms |
19272 KB |
Output is correct |
117 |
Correct |
11 ms |
19276 KB |
Output is correct |
118 |
Correct |
20 ms |
20012 KB |
Output is correct |
119 |
Correct |
22 ms |
20072 KB |
Output is correct |
120 |
Correct |
23 ms |
20184 KB |
Output is correct |
121 |
Correct |
12 ms |
20144 KB |
Output is correct |
122 |
Correct |
14 ms |
20080 KB |
Output is correct |
123 |
Correct |
14 ms |
20172 KB |
Output is correct |
124 |
Correct |
13 ms |
20052 KB |
Output is correct |
125 |
Correct |
15 ms |
20052 KB |
Output is correct |
126 |
Correct |
13 ms |
19412 KB |
Output is correct |
127 |
Correct |
12 ms |
19392 KB |
Output is correct |
128 |
Correct |
12 ms |
19412 KB |
Output is correct |
129 |
Correct |
12 ms |
19424 KB |
Output is correct |
130 |
Correct |
12 ms |
19372 KB |
Output is correct |
131 |
Correct |
13 ms |
19412 KB |
Output is correct |
132 |
Correct |
24 ms |
20356 KB |
Output is correct |
133 |
Correct |
25 ms |
20288 KB |
Output is correct |
134 |
Correct |
28 ms |
20300 KB |
Output is correct |
135 |
Correct |
13 ms |
20052 KB |
Output is correct |
136 |
Correct |
204 ms |
136080 KB |
Output is correct |
137 |
Correct |
130 ms |
68908 KB |
Output is correct |
138 |
Correct |
105 ms |
65920 KB |
Output is correct |
139 |
Correct |
149 ms |
81516 KB |
Output is correct |
140 |
Correct |
98 ms |
49792 KB |
Output is correct |
141 |
Correct |
22 ms |
21168 KB |
Output is correct |
142 |
Correct |
24 ms |
20960 KB |
Output is correct |
143 |
Correct |
27 ms |
21596 KB |
Output is correct |
144 |
Correct |
23 ms |
20984 KB |
Output is correct |
145 |
Correct |
24 ms |
21368 KB |
Output is correct |
146 |
Correct |
21 ms |
20908 KB |
Output is correct |
147 |
Correct |
23 ms |
20700 KB |
Output is correct |
148 |
Correct |
16 ms |
20140 KB |
Output is correct |
149 |
Correct |
33 ms |
20908 KB |
Output is correct |
150 |
Correct |
16 ms |
20052 KB |
Output is correct |
151 |
Correct |
28 ms |
21472 KB |
Output is correct |
152 |
Correct |
19 ms |
20500 KB |
Output is correct |
153 |
Correct |
17 ms |
20388 KB |
Output is correct |
154 |
Correct |
20 ms |
20764 KB |
Output is correct |
155 |
Correct |
18 ms |
20220 KB |
Output is correct |
156 |
Correct |
17 ms |
20308 KB |
Output is correct |
157 |
Correct |
14 ms |
20112 KB |
Output is correct |
158 |
Correct |
303 ms |
180392 KB |
Output is correct |
159 |
Correct |
234 ms |
100252 KB |
Output is correct |
160 |
Correct |
188 ms |
100264 KB |
Output is correct |
161 |
Correct |
177 ms |
100228 KB |
Output is correct |
162 |
Correct |
177 ms |
92396 KB |
Output is correct |
163 |
Correct |
29 ms |
21944 KB |
Output is correct |
164 |
Correct |
29 ms |
21852 KB |
Output is correct |
165 |
Correct |
30 ms |
21968 KB |
Output is correct |
166 |
Correct |
32 ms |
21936 KB |
Output is correct |
167 |
Correct |
39 ms |
21852 KB |
Output is correct |
168 |
Correct |
30 ms |
21972 KB |
Output is correct |
169 |
Correct |
34 ms |
21848 KB |
Output is correct |
170 |
Correct |
19 ms |
20820 KB |
Output is correct |
171 |
Correct |
33 ms |
21844 KB |
Output is correct |
172 |
Correct |
20 ms |
20820 KB |
Output is correct |
173 |
Correct |
35 ms |
21832 KB |
Output is correct |
174 |
Correct |
19 ms |
20744 KB |
Output is correct |
175 |
Correct |
22 ms |
21096 KB |
Output is correct |
176 |
Correct |
21 ms |
21004 KB |
Output is correct |
177 |
Correct |
21 ms |
20928 KB |
Output is correct |
178 |
Correct |
20 ms |
20880 KB |
Output is correct |
179 |
Correct |
21 ms |
22224 KB |
Output is correct |
180 |
Correct |
577 ms |
229920 KB |
Output is correct |
181 |
Correct |
835 ms |
323972 KB |
Output is correct |
182 |
Correct |
1144 ms |
420456 KB |
Output is correct |
183 |
Correct |
509 ms |
216856 KB |
Output is correct |
184 |
Correct |
418 ms |
146764 KB |
Output is correct |
185 |
Correct |
42 ms |
24396 KB |
Output is correct |
186 |
Correct |
42 ms |
26460 KB |
Output is correct |
187 |
Correct |
61 ms |
25312 KB |
Output is correct |
188 |
Correct |
70 ms |
25368 KB |
Output is correct |
189 |
Correct |
61 ms |
26316 KB |
Output is correct |
190 |
Correct |
67 ms |
26876 KB |
Output is correct |
191 |
Correct |
62 ms |
26772 KB |
Output is correct |
192 |
Correct |
44 ms |
23884 KB |
Output is correct |
193 |
Correct |
49 ms |
24308 KB |
Output is correct |
194 |
Correct |
34 ms |
24092 KB |
Output is correct |
195 |
Runtime error |
1277 ms |
524288 KB |
Execution killed with signal 9 |
196 |
Halted |
0 ms |
0 KB |
- |