#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, maxk = 1e5 + 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 |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
6 ms |
9684 KB |
Output is correct |
3 |
Correct |
6 ms |
9652 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
6 ms |
9684 KB |
Output is correct |
6 |
Correct |
6 ms |
9608 KB |
Output is correct |
7 |
Correct |
6 ms |
9740 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
6 ms |
9684 KB |
Output is correct |
10 |
Correct |
5 ms |
9684 KB |
Output is correct |
11 |
Correct |
6 ms |
9672 KB |
Output is correct |
12 |
Correct |
6 ms |
9684 KB |
Output is correct |
13 |
Correct |
6 ms |
9684 KB |
Output is correct |
14 |
Correct |
5 ms |
9668 KB |
Output is correct |
15 |
Correct |
6 ms |
9684 KB |
Output is correct |
16 |
Correct |
5 ms |
9684 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9684 KB |
Output is correct |
22 |
Correct |
15 ms |
10504 KB |
Output is correct |
23 |
Correct |
14 ms |
10452 KB |
Output is correct |
24 |
Correct |
14 ms |
10480 KB |
Output is correct |
25 |
Correct |
9 ms |
10708 KB |
Output is correct |
26 |
Correct |
11 ms |
10708 KB |
Output is correct |
27 |
Correct |
9 ms |
10708 KB |
Output is correct |
28 |
Correct |
10 ms |
10708 KB |
Output is correct |
29 |
Correct |
9 ms |
10680 KB |
Output is correct |
30 |
Correct |
8 ms |
10708 KB |
Output is correct |
31 |
Correct |
18 ms |
11472 KB |
Output is correct |
32 |
Correct |
17 ms |
11476 KB |
Output is correct |
33 |
Correct |
14 ms |
11476 KB |
Output is correct |
34 |
Correct |
14 ms |
11476 KB |
Output is correct |
35 |
Correct |
18 ms |
11476 KB |
Output is correct |
36 |
Correct |
17 ms |
11476 KB |
Output is correct |
37 |
Correct |
22 ms |
12168 KB |
Output is correct |
38 |
Correct |
27 ms |
12120 KB |
Output is correct |
39 |
Correct |
22 ms |
12152 KB |
Output is correct |
40 |
Correct |
19 ms |
14284 KB |
Output is correct |
41 |
Correct |
14 ms |
12516 KB |
Output is correct |
42 |
Correct |
22 ms |
14660 KB |
Output is correct |
43 |
Correct |
17 ms |
13012 KB |
Output is correct |
44 |
Correct |
19 ms |
12688 KB |
Output is correct |
45 |
Correct |
22 ms |
14840 KB |
Output is correct |
46 |
Correct |
50 ms |
22304 KB |
Output is correct |
47 |
Correct |
33 ms |
16980 KB |
Output is correct |
48 |
Correct |
38 ms |
19532 KB |
Output is correct |
49 |
Correct |
47 ms |
18516 KB |
Output is correct |
50 |
Correct |
48 ms |
18648 KB |
Output is correct |
51 |
Correct |
60 ms |
16916 KB |
Output is correct |
52 |
Correct |
21 ms |
14796 KB |
Output is correct |
53 |
Correct |
20 ms |
14796 KB |
Output is correct |
54 |
Correct |
21 ms |
14704 KB |
Output is correct |
55 |
Correct |
20 ms |
14808 KB |
Output is correct |
56 |
Correct |
22 ms |
14716 KB |
Output is correct |
57 |
Correct |
22 ms |
14836 KB |
Output is correct |
58 |
Correct |
65 ms |
23552 KB |
Output is correct |
59 |
Correct |
57 ms |
23628 KB |
Output is correct |
60 |
Correct |
55 ms |
23476 KB |
Output is correct |
61 |
Correct |
54 ms |
23528 KB |
Output is correct |
62 |
Correct |
57 ms |
23504 KB |
Output is correct |
63 |
Correct |
57 ms |
23504 KB |
Output is correct |
64 |
Correct |
69 ms |
21564 KB |
Output is correct |
65 |
Correct |
66 ms |
21556 KB |
Output is correct |
66 |
Correct |
71 ms |
21616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
6 ms |
9684 KB |
Output is correct |
3 |
Correct |
6 ms |
9652 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
6 ms |
9684 KB |
Output is correct |
6 |
Correct |
6 ms |
9608 KB |
Output is correct |
7 |
Correct |
6 ms |
9740 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
6 ms |
9684 KB |
Output is correct |
10 |
Correct |
5 ms |
9684 KB |
Output is correct |
11 |
Correct |
6 ms |
9672 KB |
Output is correct |
12 |
Correct |
6 ms |
9684 KB |
Output is correct |
13 |
Correct |
6 ms |
9684 KB |
Output is correct |
14 |
Correct |
5 ms |
9668 KB |
Output is correct |
15 |
Correct |
6 ms |
9684 KB |
Output is correct |
16 |
Correct |
5 ms |
9684 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
5 ms |
9684 KB |
Output is correct |
22 |
Correct |
5 ms |
9684 KB |
Output is correct |
23 |
Correct |
5 ms |
9684 KB |
Output is correct |
24 |
Correct |
5 ms |
9684 KB |
Output is correct |
25 |
Correct |
5 ms |
9588 KB |
Output is correct |
26 |
Correct |
6 ms |
9684 KB |
Output is correct |
27 |
Correct |
5 ms |
9684 KB |
Output is correct |
28 |
Correct |
6 ms |
9776 KB |
Output is correct |
29 |
Correct |
5 ms |
9684 KB |
Output is correct |
30 |
Correct |
6 ms |
9684 KB |
Output is correct |
31 |
Correct |
5 ms |
9684 KB |
Output is correct |
32 |
Correct |
5 ms |
9676 KB |
Output is correct |
33 |
Correct |
6 ms |
9684 KB |
Output is correct |
34 |
Correct |
6 ms |
9764 KB |
Output is correct |
35 |
Correct |
6 ms |
9684 KB |
Output is correct |
36 |
Correct |
6 ms |
9752 KB |
Output is correct |
37 |
Correct |
5 ms |
9764 KB |
Output is correct |
38 |
Correct |
6 ms |
9624 KB |
Output is correct |
39 |
Correct |
5 ms |
9624 KB |
Output is correct |
40 |
Correct |
5 ms |
9684 KB |
Output is correct |
41 |
Correct |
5 ms |
9684 KB |
Output is correct |
42 |
Correct |
5 ms |
9712 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9684 KB |
Output is correct |
45 |
Correct |
6 ms |
9812 KB |
Output is correct |
46 |
Correct |
5 ms |
9824 KB |
Output is correct |
47 |
Correct |
5 ms |
9812 KB |
Output is correct |
48 |
Correct |
5 ms |
9812 KB |
Output is correct |
49 |
Correct |
5 ms |
9812 KB |
Output is correct |
50 |
Correct |
5 ms |
9684 KB |
Output is correct |
51 |
Correct |
6 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9684 KB |
Output is correct |
53 |
Correct |
6 ms |
9700 KB |
Output is correct |
54 |
Correct |
5 ms |
9684 KB |
Output is correct |
55 |
Correct |
7 ms |
9684 KB |
Output is correct |
56 |
Correct |
6 ms |
9644 KB |
Output is correct |
57 |
Correct |
6 ms |
9684 KB |
Output is correct |
58 |
Correct |
5 ms |
9684 KB |
Output is correct |
59 |
Correct |
5 ms |
9684 KB |
Output is correct |
60 |
Correct |
5 ms |
9684 KB |
Output is correct |
61 |
Correct |
5 ms |
9760 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
6 ms |
9652 KB |
Output is correct |
6 |
Correct |
6 ms |
9684 KB |
Output is correct |
7 |
Correct |
6 ms |
9684 KB |
Output is correct |
8 |
Correct |
6 ms |
9608 KB |
Output is correct |
9 |
Correct |
6 ms |
9740 KB |
Output is correct |
10 |
Correct |
5 ms |
9684 KB |
Output is correct |
11 |
Correct |
6 ms |
9684 KB |
Output is correct |
12 |
Correct |
5 ms |
9684 KB |
Output is correct |
13 |
Correct |
6 ms |
9672 KB |
Output is correct |
14 |
Correct |
6 ms |
9684 KB |
Output is correct |
15 |
Correct |
6 ms |
9684 KB |
Output is correct |
16 |
Correct |
5 ms |
9668 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
5 ms |
9684 KB |
Output is correct |
24 |
Correct |
15 ms |
10504 KB |
Output is correct |
25 |
Correct |
14 ms |
10452 KB |
Output is correct |
26 |
Correct |
14 ms |
10480 KB |
Output is correct |
27 |
Correct |
5 ms |
9684 KB |
Output is correct |
28 |
Correct |
5 ms |
9588 KB |
Output is correct |
29 |
Correct |
6 ms |
9684 KB |
Output is correct |
30 |
Correct |
5 ms |
9684 KB |
Output is correct |
31 |
Correct |
6 ms |
9776 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
6 ms |
9684 KB |
Output is correct |
34 |
Correct |
5 ms |
9684 KB |
Output is correct |
35 |
Correct |
5 ms |
9676 KB |
Output is correct |
36 |
Correct |
6 ms |
9684 KB |
Output is correct |
37 |
Correct |
6 ms |
9764 KB |
Output is correct |
38 |
Correct |
6 ms |
9684 KB |
Output is correct |
39 |
Correct |
6 ms |
9752 KB |
Output is correct |
40 |
Correct |
5 ms |
9764 KB |
Output is correct |
41 |
Correct |
6 ms |
9624 KB |
Output is correct |
42 |
Correct |
5 ms |
9624 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9684 KB |
Output is correct |
45 |
Correct |
5 ms |
9712 KB |
Output is correct |
46 |
Correct |
5 ms |
9684 KB |
Output is correct |
47 |
Correct |
5 ms |
9684 KB |
Output is correct |
48 |
Correct |
6 ms |
9812 KB |
Output is correct |
49 |
Correct |
5 ms |
9824 KB |
Output is correct |
50 |
Correct |
5 ms |
9812 KB |
Output is correct |
51 |
Correct |
5 ms |
9812 KB |
Output is correct |
52 |
Correct |
5 ms |
9812 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9684 KB |
Output is correct |
55 |
Correct |
6 ms |
9684 KB |
Output is correct |
56 |
Correct |
6 ms |
9700 KB |
Output is correct |
57 |
Correct |
5 ms |
9684 KB |
Output is correct |
58 |
Correct |
7 ms |
9684 KB |
Output is correct |
59 |
Correct |
6 ms |
9644 KB |
Output is correct |
60 |
Correct |
6 ms |
9684 KB |
Output is correct |
61 |
Correct |
5 ms |
9684 KB |
Output is correct |
62 |
Correct |
5 ms |
9684 KB |
Output is correct |
63 |
Correct |
5 ms |
9684 KB |
Output is correct |
64 |
Correct |
5 ms |
9760 KB |
Output is correct |
65 |
Correct |
6 ms |
10196 KB |
Output is correct |
66 |
Correct |
7 ms |
9940 KB |
Output is correct |
67 |
Correct |
6 ms |
10196 KB |
Output is correct |
68 |
Correct |
6 ms |
10248 KB |
Output is correct |
69 |
Correct |
7 ms |
10196 KB |
Output is correct |
70 |
Correct |
7 ms |
9864 KB |
Output is correct |
71 |
Correct |
10 ms |
9940 KB |
Output is correct |
72 |
Correct |
9 ms |
9940 KB |
Output is correct |
73 |
Correct |
6 ms |
9812 KB |
Output is correct |
74 |
Correct |
7 ms |
9816 KB |
Output is correct |
75 |
Correct |
7 ms |
9812 KB |
Output is correct |
76 |
Correct |
14 ms |
10580 KB |
Output is correct |
77 |
Correct |
15 ms |
10708 KB |
Output is correct |
78 |
Correct |
18 ms |
10748 KB |
Output is correct |
79 |
Correct |
8 ms |
10768 KB |
Output is correct |
80 |
Correct |
8 ms |
10708 KB |
Output is correct |
81 |
Correct |
7 ms |
10712 KB |
Output is correct |
82 |
Correct |
7 ms |
10728 KB |
Output is correct |
83 |
Correct |
7 ms |
10708 KB |
Output is correct |
84 |
Correct |
8 ms |
9940 KB |
Output is correct |
85 |
Correct |
7 ms |
9940 KB |
Output is correct |
86 |
Correct |
7 ms |
9960 KB |
Output is correct |
87 |
Correct |
7 ms |
9940 KB |
Output is correct |
88 |
Correct |
7 ms |
9940 KB |
Output is correct |
89 |
Correct |
7 ms |
9940 KB |
Output is correct |
90 |
Correct |
19 ms |
10968 KB |
Output is correct |
91 |
Correct |
18 ms |
10904 KB |
Output is correct |
92 |
Correct |
18 ms |
10932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
6 ms |
9652 KB |
Output is correct |
6 |
Correct |
6 ms |
9684 KB |
Output is correct |
7 |
Correct |
6 ms |
9684 KB |
Output is correct |
8 |
Correct |
6 ms |
9608 KB |
Output is correct |
9 |
Correct |
6 ms |
9740 KB |
Output is correct |
10 |
Correct |
5 ms |
9684 KB |
Output is correct |
11 |
Correct |
6 ms |
9684 KB |
Output is correct |
12 |
Correct |
5 ms |
9684 KB |
Output is correct |
13 |
Correct |
6 ms |
9672 KB |
Output is correct |
14 |
Correct |
6 ms |
9684 KB |
Output is correct |
15 |
Correct |
6 ms |
9684 KB |
Output is correct |
16 |
Correct |
5 ms |
9668 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
5 ms |
9684 KB |
Output is correct |
24 |
Correct |
15 ms |
10504 KB |
Output is correct |
25 |
Correct |
14 ms |
10452 KB |
Output is correct |
26 |
Correct |
14 ms |
10480 KB |
Output is correct |
27 |
Correct |
9 ms |
10708 KB |
Output is correct |
28 |
Correct |
11 ms |
10708 KB |
Output is correct |
29 |
Correct |
9 ms |
10708 KB |
Output is correct |
30 |
Correct |
10 ms |
10708 KB |
Output is correct |
31 |
Correct |
9 ms |
10680 KB |
Output is correct |
32 |
Correct |
8 ms |
10708 KB |
Output is correct |
33 |
Correct |
18 ms |
11472 KB |
Output is correct |
34 |
Correct |
17 ms |
11476 KB |
Output is correct |
35 |
Correct |
14 ms |
11476 KB |
Output is correct |
36 |
Correct |
14 ms |
11476 KB |
Output is correct |
37 |
Correct |
18 ms |
11476 KB |
Output is correct |
38 |
Correct |
17 ms |
11476 KB |
Output is correct |
39 |
Correct |
22 ms |
12168 KB |
Output is correct |
40 |
Correct |
27 ms |
12120 KB |
Output is correct |
41 |
Correct |
22 ms |
12152 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
5 ms |
9588 KB |
Output is correct |
44 |
Correct |
6 ms |
9684 KB |
Output is correct |
45 |
Correct |
5 ms |
9684 KB |
Output is correct |
46 |
Correct |
6 ms |
9776 KB |
Output is correct |
47 |
Correct |
5 ms |
9684 KB |
Output is correct |
48 |
Correct |
6 ms |
9684 KB |
Output is correct |
49 |
Correct |
5 ms |
9684 KB |
Output is correct |
50 |
Correct |
5 ms |
9676 KB |
Output is correct |
51 |
Correct |
6 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9764 KB |
Output is correct |
53 |
Correct |
6 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9752 KB |
Output is correct |
55 |
Correct |
5 ms |
9764 KB |
Output is correct |
56 |
Correct |
6 ms |
9624 KB |
Output is correct |
57 |
Correct |
5 ms |
9624 KB |
Output is correct |
58 |
Correct |
5 ms |
9684 KB |
Output is correct |
59 |
Correct |
5 ms |
9684 KB |
Output is correct |
60 |
Correct |
5 ms |
9712 KB |
Output is correct |
61 |
Correct |
5 ms |
9684 KB |
Output is correct |
62 |
Correct |
5 ms |
9684 KB |
Output is correct |
63 |
Correct |
6 ms |
9812 KB |
Output is correct |
64 |
Correct |
5 ms |
9824 KB |
Output is correct |
65 |
Correct |
5 ms |
9812 KB |
Output is correct |
66 |
Correct |
5 ms |
9812 KB |
Output is correct |
67 |
Correct |
5 ms |
9812 KB |
Output is correct |
68 |
Correct |
5 ms |
9684 KB |
Output is correct |
69 |
Correct |
6 ms |
9684 KB |
Output is correct |
70 |
Correct |
6 ms |
9684 KB |
Output is correct |
71 |
Correct |
6 ms |
9700 KB |
Output is correct |
72 |
Correct |
5 ms |
9684 KB |
Output is correct |
73 |
Correct |
7 ms |
9684 KB |
Output is correct |
74 |
Correct |
6 ms |
9644 KB |
Output is correct |
75 |
Correct |
6 ms |
9684 KB |
Output is correct |
76 |
Correct |
5 ms |
9684 KB |
Output is correct |
77 |
Correct |
5 ms |
9684 KB |
Output is correct |
78 |
Correct |
5 ms |
9684 KB |
Output is correct |
79 |
Correct |
5 ms |
9760 KB |
Output is correct |
80 |
Correct |
6 ms |
10196 KB |
Output is correct |
81 |
Correct |
7 ms |
9940 KB |
Output is correct |
82 |
Correct |
6 ms |
10196 KB |
Output is correct |
83 |
Correct |
6 ms |
10248 KB |
Output is correct |
84 |
Correct |
7 ms |
10196 KB |
Output is correct |
85 |
Correct |
7 ms |
9864 KB |
Output is correct |
86 |
Correct |
10 ms |
9940 KB |
Output is correct |
87 |
Correct |
9 ms |
9940 KB |
Output is correct |
88 |
Correct |
6 ms |
9812 KB |
Output is correct |
89 |
Correct |
7 ms |
9816 KB |
Output is correct |
90 |
Correct |
7 ms |
9812 KB |
Output is correct |
91 |
Correct |
14 ms |
10580 KB |
Output is correct |
92 |
Correct |
15 ms |
10708 KB |
Output is correct |
93 |
Correct |
18 ms |
10748 KB |
Output is correct |
94 |
Correct |
8 ms |
10768 KB |
Output is correct |
95 |
Correct |
8 ms |
10708 KB |
Output is correct |
96 |
Correct |
7 ms |
10712 KB |
Output is correct |
97 |
Correct |
7 ms |
10728 KB |
Output is correct |
98 |
Correct |
7 ms |
10708 KB |
Output is correct |
99 |
Correct |
8 ms |
9940 KB |
Output is correct |
100 |
Correct |
7 ms |
9940 KB |
Output is correct |
101 |
Correct |
7 ms |
9960 KB |
Output is correct |
102 |
Correct |
7 ms |
9940 KB |
Output is correct |
103 |
Correct |
7 ms |
9940 KB |
Output is correct |
104 |
Correct |
7 ms |
9940 KB |
Output is correct |
105 |
Correct |
19 ms |
10968 KB |
Output is correct |
106 |
Correct |
18 ms |
10904 KB |
Output is correct |
107 |
Correct |
18 ms |
10932 KB |
Output is correct |
108 |
Correct |
8 ms |
10672 KB |
Output is correct |
109 |
Correct |
217 ms |
126848 KB |
Output is correct |
110 |
Correct |
143 ms |
59604 KB |
Output is correct |
111 |
Correct |
95 ms |
56524 KB |
Output is correct |
112 |
Correct |
124 ms |
72056 KB |
Output is correct |
113 |
Correct |
84 ms |
40360 KB |
Output is correct |
114 |
Correct |
17 ms |
11700 KB |
Output is correct |
115 |
Correct |
17 ms |
11488 KB |
Output is correct |
116 |
Correct |
21 ms |
12188 KB |
Output is correct |
117 |
Correct |
17 ms |
11704 KB |
Output is correct |
118 |
Correct |
22 ms |
11912 KB |
Output is correct |
119 |
Correct |
15 ms |
11476 KB |
Output is correct |
120 |
Correct |
20 ms |
11348 KB |
Output is correct |
121 |
Correct |
11 ms |
10708 KB |
Output is correct |
122 |
Correct |
20 ms |
11548 KB |
Output is correct |
123 |
Correct |
10 ms |
10708 KB |
Output is correct |
124 |
Correct |
22 ms |
12040 KB |
Output is correct |
125 |
Correct |
16 ms |
11208 KB |
Output is correct |
126 |
Correct |
14 ms |
11040 KB |
Output is correct |
127 |
Correct |
16 ms |
11348 KB |
Output is correct |
128 |
Correct |
17 ms |
10916 KB |
Output is correct |
129 |
Correct |
12 ms |
10908 KB |
Output is correct |
130 |
Correct |
10 ms |
10708 KB |
Output is correct |
131 |
Correct |
277 ms |
170984 KB |
Output is correct |
132 |
Correct |
208 ms |
90768 KB |
Output is correct |
133 |
Correct |
210 ms |
90940 KB |
Output is correct |
134 |
Correct |
186 ms |
90828 KB |
Output is correct |
135 |
Correct |
171 ms |
82892 KB |
Output is correct |
136 |
Correct |
29 ms |
12496 KB |
Output is correct |
137 |
Correct |
24 ms |
12468 KB |
Output is correct |
138 |
Correct |
24 ms |
12496 KB |
Output is correct |
139 |
Correct |
25 ms |
12424 KB |
Output is correct |
140 |
Correct |
24 ms |
12584 KB |
Output is correct |
141 |
Correct |
31 ms |
12528 KB |
Output is correct |
142 |
Correct |
29 ms |
12492 KB |
Output is correct |
143 |
Correct |
17 ms |
11440 KB |
Output is correct |
144 |
Correct |
33 ms |
12536 KB |
Output is correct |
145 |
Correct |
21 ms |
11356 KB |
Output is correct |
146 |
Correct |
34 ms |
12492 KB |
Output is correct |
147 |
Correct |
17 ms |
11348 KB |
Output is correct |
148 |
Correct |
21 ms |
11604 KB |
Output is correct |
149 |
Correct |
18 ms |
11604 KB |
Output is correct |
150 |
Correct |
17 ms |
11544 KB |
Output is correct |
151 |
Correct |
15 ms |
11476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
6 ms |
9652 KB |
Output is correct |
6 |
Correct |
6 ms |
9684 KB |
Output is correct |
7 |
Correct |
6 ms |
9684 KB |
Output is correct |
8 |
Correct |
6 ms |
9608 KB |
Output is correct |
9 |
Correct |
6 ms |
9740 KB |
Output is correct |
10 |
Correct |
5 ms |
9684 KB |
Output is correct |
11 |
Correct |
6 ms |
9684 KB |
Output is correct |
12 |
Correct |
5 ms |
9684 KB |
Output is correct |
13 |
Correct |
6 ms |
9672 KB |
Output is correct |
14 |
Correct |
6 ms |
9684 KB |
Output is correct |
15 |
Correct |
6 ms |
9684 KB |
Output is correct |
16 |
Correct |
5 ms |
9668 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
5 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
5 ms |
9684 KB |
Output is correct |
24 |
Correct |
15 ms |
10504 KB |
Output is correct |
25 |
Correct |
14 ms |
10452 KB |
Output is correct |
26 |
Correct |
14 ms |
10480 KB |
Output is correct |
27 |
Correct |
9 ms |
10708 KB |
Output is correct |
28 |
Correct |
11 ms |
10708 KB |
Output is correct |
29 |
Correct |
9 ms |
10708 KB |
Output is correct |
30 |
Correct |
10 ms |
10708 KB |
Output is correct |
31 |
Correct |
9 ms |
10680 KB |
Output is correct |
32 |
Correct |
8 ms |
10708 KB |
Output is correct |
33 |
Correct |
18 ms |
11472 KB |
Output is correct |
34 |
Correct |
17 ms |
11476 KB |
Output is correct |
35 |
Correct |
14 ms |
11476 KB |
Output is correct |
36 |
Correct |
14 ms |
11476 KB |
Output is correct |
37 |
Correct |
18 ms |
11476 KB |
Output is correct |
38 |
Correct |
17 ms |
11476 KB |
Output is correct |
39 |
Correct |
22 ms |
12168 KB |
Output is correct |
40 |
Correct |
27 ms |
12120 KB |
Output is correct |
41 |
Correct |
22 ms |
12152 KB |
Output is correct |
42 |
Correct |
19 ms |
14284 KB |
Output is correct |
43 |
Correct |
14 ms |
12516 KB |
Output is correct |
44 |
Correct |
22 ms |
14660 KB |
Output is correct |
45 |
Correct |
17 ms |
13012 KB |
Output is correct |
46 |
Correct |
19 ms |
12688 KB |
Output is correct |
47 |
Correct |
22 ms |
14840 KB |
Output is correct |
48 |
Correct |
50 ms |
22304 KB |
Output is correct |
49 |
Correct |
33 ms |
16980 KB |
Output is correct |
50 |
Correct |
38 ms |
19532 KB |
Output is correct |
51 |
Correct |
47 ms |
18516 KB |
Output is correct |
52 |
Correct |
48 ms |
18648 KB |
Output is correct |
53 |
Correct |
60 ms |
16916 KB |
Output is correct |
54 |
Correct |
21 ms |
14796 KB |
Output is correct |
55 |
Correct |
20 ms |
14796 KB |
Output is correct |
56 |
Correct |
21 ms |
14704 KB |
Output is correct |
57 |
Correct |
20 ms |
14808 KB |
Output is correct |
58 |
Correct |
22 ms |
14716 KB |
Output is correct |
59 |
Correct |
22 ms |
14836 KB |
Output is correct |
60 |
Correct |
65 ms |
23552 KB |
Output is correct |
61 |
Correct |
57 ms |
23628 KB |
Output is correct |
62 |
Correct |
55 ms |
23476 KB |
Output is correct |
63 |
Correct |
54 ms |
23528 KB |
Output is correct |
64 |
Correct |
57 ms |
23504 KB |
Output is correct |
65 |
Correct |
57 ms |
23504 KB |
Output is correct |
66 |
Correct |
69 ms |
21564 KB |
Output is correct |
67 |
Correct |
66 ms |
21556 KB |
Output is correct |
68 |
Correct |
71 ms |
21616 KB |
Output is correct |
69 |
Correct |
5 ms |
9684 KB |
Output is correct |
70 |
Correct |
5 ms |
9588 KB |
Output is correct |
71 |
Correct |
6 ms |
9684 KB |
Output is correct |
72 |
Correct |
5 ms |
9684 KB |
Output is correct |
73 |
Correct |
6 ms |
9776 KB |
Output is correct |
74 |
Correct |
5 ms |
9684 KB |
Output is correct |
75 |
Correct |
6 ms |
9684 KB |
Output is correct |
76 |
Correct |
5 ms |
9684 KB |
Output is correct |
77 |
Correct |
5 ms |
9676 KB |
Output is correct |
78 |
Correct |
6 ms |
9684 KB |
Output is correct |
79 |
Correct |
6 ms |
9764 KB |
Output is correct |
80 |
Correct |
6 ms |
9684 KB |
Output is correct |
81 |
Correct |
6 ms |
9752 KB |
Output is correct |
82 |
Correct |
5 ms |
9764 KB |
Output is correct |
83 |
Correct |
6 ms |
9624 KB |
Output is correct |
84 |
Correct |
5 ms |
9624 KB |
Output is correct |
85 |
Correct |
5 ms |
9684 KB |
Output is correct |
86 |
Correct |
5 ms |
9684 KB |
Output is correct |
87 |
Correct |
5 ms |
9712 KB |
Output is correct |
88 |
Correct |
5 ms |
9684 KB |
Output is correct |
89 |
Correct |
5 ms |
9684 KB |
Output is correct |
90 |
Correct |
6 ms |
9812 KB |
Output is correct |
91 |
Correct |
5 ms |
9824 KB |
Output is correct |
92 |
Correct |
5 ms |
9812 KB |
Output is correct |
93 |
Correct |
5 ms |
9812 KB |
Output is correct |
94 |
Correct |
5 ms |
9812 KB |
Output is correct |
95 |
Correct |
5 ms |
9684 KB |
Output is correct |
96 |
Correct |
6 ms |
9684 KB |
Output is correct |
97 |
Correct |
6 ms |
9684 KB |
Output is correct |
98 |
Correct |
6 ms |
9700 KB |
Output is correct |
99 |
Correct |
5 ms |
9684 KB |
Output is correct |
100 |
Correct |
7 ms |
9684 KB |
Output is correct |
101 |
Correct |
6 ms |
9644 KB |
Output is correct |
102 |
Correct |
6 ms |
9684 KB |
Output is correct |
103 |
Correct |
5 ms |
9684 KB |
Output is correct |
104 |
Correct |
5 ms |
9684 KB |
Output is correct |
105 |
Correct |
5 ms |
9684 KB |
Output is correct |
106 |
Correct |
5 ms |
9760 KB |
Output is correct |
107 |
Correct |
6 ms |
10196 KB |
Output is correct |
108 |
Correct |
7 ms |
9940 KB |
Output is correct |
109 |
Correct |
6 ms |
10196 KB |
Output is correct |
110 |
Correct |
6 ms |
10248 KB |
Output is correct |
111 |
Correct |
7 ms |
10196 KB |
Output is correct |
112 |
Correct |
7 ms |
9864 KB |
Output is correct |
113 |
Correct |
10 ms |
9940 KB |
Output is correct |
114 |
Correct |
9 ms |
9940 KB |
Output is correct |
115 |
Correct |
6 ms |
9812 KB |
Output is correct |
116 |
Correct |
7 ms |
9816 KB |
Output is correct |
117 |
Correct |
7 ms |
9812 KB |
Output is correct |
118 |
Correct |
14 ms |
10580 KB |
Output is correct |
119 |
Correct |
15 ms |
10708 KB |
Output is correct |
120 |
Correct |
18 ms |
10748 KB |
Output is correct |
121 |
Correct |
8 ms |
10768 KB |
Output is correct |
122 |
Correct |
8 ms |
10708 KB |
Output is correct |
123 |
Correct |
7 ms |
10712 KB |
Output is correct |
124 |
Correct |
7 ms |
10728 KB |
Output is correct |
125 |
Correct |
7 ms |
10708 KB |
Output is correct |
126 |
Correct |
8 ms |
9940 KB |
Output is correct |
127 |
Correct |
7 ms |
9940 KB |
Output is correct |
128 |
Correct |
7 ms |
9960 KB |
Output is correct |
129 |
Correct |
7 ms |
9940 KB |
Output is correct |
130 |
Correct |
7 ms |
9940 KB |
Output is correct |
131 |
Correct |
7 ms |
9940 KB |
Output is correct |
132 |
Correct |
19 ms |
10968 KB |
Output is correct |
133 |
Correct |
18 ms |
10904 KB |
Output is correct |
134 |
Correct |
18 ms |
10932 KB |
Output is correct |
135 |
Correct |
8 ms |
10672 KB |
Output is correct |
136 |
Correct |
217 ms |
126848 KB |
Output is correct |
137 |
Correct |
143 ms |
59604 KB |
Output is correct |
138 |
Correct |
95 ms |
56524 KB |
Output is correct |
139 |
Correct |
124 ms |
72056 KB |
Output is correct |
140 |
Correct |
84 ms |
40360 KB |
Output is correct |
141 |
Correct |
17 ms |
11700 KB |
Output is correct |
142 |
Correct |
17 ms |
11488 KB |
Output is correct |
143 |
Correct |
21 ms |
12188 KB |
Output is correct |
144 |
Correct |
17 ms |
11704 KB |
Output is correct |
145 |
Correct |
22 ms |
11912 KB |
Output is correct |
146 |
Correct |
15 ms |
11476 KB |
Output is correct |
147 |
Correct |
20 ms |
11348 KB |
Output is correct |
148 |
Correct |
11 ms |
10708 KB |
Output is correct |
149 |
Correct |
20 ms |
11548 KB |
Output is correct |
150 |
Correct |
10 ms |
10708 KB |
Output is correct |
151 |
Correct |
22 ms |
12040 KB |
Output is correct |
152 |
Correct |
16 ms |
11208 KB |
Output is correct |
153 |
Correct |
14 ms |
11040 KB |
Output is correct |
154 |
Correct |
16 ms |
11348 KB |
Output is correct |
155 |
Correct |
17 ms |
10916 KB |
Output is correct |
156 |
Correct |
12 ms |
10908 KB |
Output is correct |
157 |
Correct |
10 ms |
10708 KB |
Output is correct |
158 |
Correct |
277 ms |
170984 KB |
Output is correct |
159 |
Correct |
208 ms |
90768 KB |
Output is correct |
160 |
Correct |
210 ms |
90940 KB |
Output is correct |
161 |
Correct |
186 ms |
90828 KB |
Output is correct |
162 |
Correct |
171 ms |
82892 KB |
Output is correct |
163 |
Correct |
29 ms |
12496 KB |
Output is correct |
164 |
Correct |
24 ms |
12468 KB |
Output is correct |
165 |
Correct |
24 ms |
12496 KB |
Output is correct |
166 |
Correct |
25 ms |
12424 KB |
Output is correct |
167 |
Correct |
24 ms |
12584 KB |
Output is correct |
168 |
Correct |
31 ms |
12528 KB |
Output is correct |
169 |
Correct |
29 ms |
12492 KB |
Output is correct |
170 |
Correct |
17 ms |
11440 KB |
Output is correct |
171 |
Correct |
33 ms |
12536 KB |
Output is correct |
172 |
Correct |
21 ms |
11356 KB |
Output is correct |
173 |
Correct |
34 ms |
12492 KB |
Output is correct |
174 |
Correct |
17 ms |
11348 KB |
Output is correct |
175 |
Correct |
21 ms |
11604 KB |
Output is correct |
176 |
Correct |
18 ms |
11604 KB |
Output is correct |
177 |
Correct |
17 ms |
11544 KB |
Output is correct |
178 |
Correct |
15 ms |
11476 KB |
Output is correct |
179 |
Correct |
17 ms |
12880 KB |
Output is correct |
180 |
Correct |
576 ms |
220432 KB |
Output is correct |
181 |
Correct |
776 ms |
314512 KB |
Output is correct |
182 |
Correct |
1100 ms |
411056 KB |
Output is correct |
183 |
Correct |
581 ms |
207612 KB |
Output is correct |
184 |
Correct |
417 ms |
137300 KB |
Output is correct |
185 |
Correct |
38 ms |
14924 KB |
Output is correct |
186 |
Correct |
34 ms |
17100 KB |
Output is correct |
187 |
Correct |
44 ms |
15948 KB |
Output is correct |
188 |
Correct |
64 ms |
16076 KB |
Output is correct |
189 |
Correct |
54 ms |
16908 KB |
Output is correct |
190 |
Correct |
61 ms |
17556 KB |
Output is correct |
191 |
Correct |
55 ms |
17300 KB |
Output is correct |
192 |
Correct |
44 ms |
14432 KB |
Output is correct |
193 |
Correct |
44 ms |
14924 KB |
Output is correct |
194 |
Correct |
24 ms |
14800 KB |
Output is correct |
195 |
Runtime error |
1322 ms |
524288 KB |
Execution killed with signal 9 |
196 |
Halted |
0 ms |
0 KB |
- |