#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int INF = 1000000010;
int m;
int dp[MAXN];
vector<int> dpComp[MAXN];
vector<int> company[MAXN];
multiset<int> minDP;
bool isGood(int i)
{
for(int j = 0 ; j < (int)dpComp[i].size() ; j++)
if( dpComp[i][j] >= m ) return true;
return false;
}
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector< vector<int> > B)
{
m = M;
C.push_back( K + 1 );
for(int i = 0 ; i < M ; i++)
for(int j = 0 ; j < A[i] ; j++)
company[ B[i][j] ].push_back( i );
for(int i = N - 1 ; i >= 0 ; i--)
{
dpComp[i].resize( company[ C[i] ].size() , 0 );
int pB = 0;
int maxB = (int)company[ C[i + 1] ].size();
for(int pA = 0 ; pA < (int)company[ C[i] ].size() ; pA++)
{
while( pB < maxB )
{
int nxt = company[ C[i + 1] ][pB];
if( company[ C[i] ][pA] < nxt ) break;
pB++;
}
if( pB < maxB && company[ C[i] ][pA] == company[ C[i + 1] ][pB] - 1 )
dpComp[i][pA] = dpComp[i + 1][pB];
}
if( !company[ C[i] ].empty() && !company[ C[i + 1] ].empty() )
{
int ind = (int)company[ C[i] ].size() - 1;
if( company[ C[i] ].back() == M - 1 && company[ C[i + 1] ].front() == 0 )
dpComp[i][ind] = dpComp[i + 1][0];
}
for(int j = 0 ; j < (int)dpComp[i].size() ; j++)
dpComp[i][j]++;
}
dp[N] = 0;
for(int i = 0 ; i < N ; i++)
dp[i] = INF;
for(int i = N - M + 1 ; i <= N ; i++)
minDP.insert( dp[i] );
for(int i = N - M ; i >= 0 ; i--)
{
if( isGood( i ) )
dp[i] = *minDP.begin() + 1;
minDP.insert( dp[i] );
minDP.erase( minDP.find( dp[i + M] ) );
}
if( dp[0] >= INF ) return -1;
return dp[0];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4992 KB |
Output is correct |
2 |
Correct |
3 ms |
4992 KB |
Output is correct |
3 |
Correct |
3 ms |
4992 KB |
Output is correct |
4 |
Correct |
3 ms |
4992 KB |
Output is correct |
5 |
Correct |
4 ms |
4992 KB |
Output is correct |
6 |
Correct |
3 ms |
4992 KB |
Output is correct |
7 |
Correct |
4 ms |
4992 KB |
Output is correct |
8 |
Correct |
4 ms |
4992 KB |
Output is correct |
9 |
Correct |
3 ms |
4992 KB |
Output is correct |
10 |
Correct |
4 ms |
4992 KB |
Output is correct |
11 |
Correct |
4 ms |
4992 KB |
Output is correct |
12 |
Correct |
4 ms |
4992 KB |
Output is correct |
13 |
Correct |
4 ms |
5120 KB |
Output is correct |
14 |
Correct |
4 ms |
5120 KB |
Output is correct |
15 |
Correct |
5 ms |
5120 KB |
Output is correct |
16 |
Correct |
4 ms |
5120 KB |
Output is correct |
17 |
Correct |
4 ms |
5120 KB |
Output is correct |
18 |
Correct |
4 ms |
5120 KB |
Output is correct |
19 |
Correct |
4 ms |
5120 KB |
Output is correct |
20 |
Correct |
4 ms |
5120 KB |
Output is correct |
21 |
Correct |
4 ms |
5120 KB |
Output is correct |
22 |
Correct |
31 ms |
8960 KB |
Output is correct |
23 |
Correct |
31 ms |
8960 KB |
Output is correct |
24 |
Correct |
31 ms |
8960 KB |
Output is correct |
25 |
Correct |
8 ms |
5888 KB |
Output is correct |
26 |
Correct |
8 ms |
5888 KB |
Output is correct |
27 |
Correct |
10 ms |
5888 KB |
Output is correct |
28 |
Correct |
9 ms |
5888 KB |
Output is correct |
29 |
Correct |
9 ms |
5888 KB |
Output is correct |
30 |
Correct |
10 ms |
5888 KB |
Output is correct |
31 |
Correct |
19 ms |
6912 KB |
Output is correct |
32 |
Correct |
18 ms |
6912 KB |
Output is correct |
33 |
Correct |
18 ms |
6912 KB |
Output is correct |
34 |
Correct |
20 ms |
6960 KB |
Output is correct |
35 |
Correct |
19 ms |
6912 KB |
Output is correct |
36 |
Correct |
18 ms |
6784 KB |
Output is correct |
37 |
Correct |
44 ms |
10104 KB |
Output is correct |
38 |
Correct |
41 ms |
10024 KB |
Output is correct |
39 |
Correct |
43 ms |
10104 KB |
Output is correct |
40 |
Correct |
24 ms |
8860 KB |
Output is correct |
41 |
Correct |
16 ms |
7456 KB |
Output is correct |
42 |
Correct |
30 ms |
9212 KB |
Output is correct |
43 |
Correct |
20 ms |
7808 KB |
Output is correct |
44 |
Correct |
19 ms |
7572 KB |
Output is correct |
45 |
Correct |
30 ms |
9336 KB |
Output is correct |
46 |
Correct |
86 ms |
19364 KB |
Output is correct |
47 |
Correct |
54 ms |
13212 KB |
Output is correct |
48 |
Correct |
58 ms |
16668 KB |
Output is correct |
49 |
Correct |
71 ms |
16776 KB |
Output is correct |
50 |
Correct |
75 ms |
16356 KB |
Output is correct |
51 |
Correct |
66 ms |
13656 KB |
Output is correct |
52 |
Correct |
30 ms |
9304 KB |
Output is correct |
53 |
Correct |
26 ms |
9336 KB |
Output is correct |
54 |
Correct |
30 ms |
9296 KB |
Output is correct |
55 |
Correct |
29 ms |
9336 KB |
Output is correct |
56 |
Correct |
29 ms |
9328 KB |
Output is correct |
57 |
Correct |
31 ms |
9336 KB |
Output is correct |
58 |
Correct |
98 ms |
20720 KB |
Output is correct |
59 |
Correct |
99 ms |
20848 KB |
Output is correct |
60 |
Correct |
99 ms |
20720 KB |
Output is correct |
61 |
Correct |
97 ms |
20720 KB |
Output is correct |
62 |
Correct |
97 ms |
20720 KB |
Output is correct |
63 |
Correct |
97 ms |
20720 KB |
Output is correct |
64 |
Correct |
103 ms |
19568 KB |
Output is correct |
65 |
Correct |
104 ms |
19568 KB |
Output is correct |
66 |
Correct |
100 ms |
19568 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4992 KB |
Output is correct |
2 |
Correct |
4 ms |
4992 KB |
Output is correct |
3 |
Correct |
4 ms |
4992 KB |
Output is correct |
4 |
Correct |
3 ms |
4992 KB |
Output is correct |
5 |
Correct |
3 ms |
4992 KB |
Output is correct |
6 |
Correct |
3 ms |
4992 KB |
Output is correct |
7 |
Correct |
4 ms |
4992 KB |
Output is correct |
8 |
Correct |
3 ms |
4992 KB |
Output is correct |
9 |
Correct |
4 ms |
4992 KB |
Output is correct |
10 |
Correct |
4 ms |
4992 KB |
Output is correct |
11 |
Correct |
3 ms |
4992 KB |
Output is correct |
12 |
Correct |
4 ms |
4992 KB |
Output is correct |
13 |
Correct |
4 ms |
4992 KB |
Output is correct |
14 |
Correct |
4 ms |
4992 KB |
Output is correct |
15 |
Correct |
4 ms |
5120 KB |
Output is correct |
16 |
Correct |
4 ms |
5120 KB |
Output is correct |
17 |
Correct |
5 ms |
5120 KB |
Output is correct |
18 |
Correct |
4 ms |
5120 KB |
Output is correct |
19 |
Correct |
4 ms |
5120 KB |
Output is correct |
20 |
Correct |
4 ms |
5120 KB |
Output is correct |
21 |
Correct |
4 ms |
5120 KB |
Output is correct |
22 |
Correct |
4 ms |
5120 KB |
Output is correct |
23 |
Correct |
4 ms |
5120 KB |
Output is correct |
24 |
Correct |
3 ms |
4992 KB |
Output is correct |
25 |
Correct |
3 ms |
4992 KB |
Output is correct |
26 |
Correct |
3 ms |
4992 KB |
Output is correct |
27 |
Correct |
4 ms |
4992 KB |
Output is correct |
28 |
Correct |
4 ms |
5120 KB |
Output is correct |
29 |
Correct |
4 ms |
4992 KB |
Output is correct |
30 |
Correct |
4 ms |
4992 KB |
Output is correct |
31 |
Correct |
4 ms |
4992 KB |
Output is correct |
32 |
Correct |
4 ms |
4992 KB |
Output is correct |
33 |
Correct |
4 ms |
5120 KB |
Output is correct |
34 |
Correct |
4 ms |
5120 KB |
Output is correct |
35 |
Correct |
4 ms |
4992 KB |
Output is correct |
36 |
Correct |
4 ms |
5120 KB |
Output is correct |
37 |
Correct |
4 ms |
5120 KB |
Output is correct |
38 |
Correct |
4 ms |
4992 KB |
Output is correct |
39 |
Correct |
3 ms |
4992 KB |
Output is correct |
40 |
Correct |
4 ms |
5120 KB |
Output is correct |
41 |
Correct |
4 ms |
5120 KB |
Output is correct |
42 |
Correct |
4 ms |
4992 KB |
Output is correct |
43 |
Correct |
4 ms |
4992 KB |
Output is correct |
44 |
Correct |
4 ms |
4992 KB |
Output is correct |
45 |
Correct |
4 ms |
5120 KB |
Output is correct |
46 |
Correct |
4 ms |
5120 KB |
Output is correct |
47 |
Correct |
4 ms |
5120 KB |
Output is correct |
48 |
Correct |
4 ms |
5120 KB |
Output is correct |
49 |
Correct |
4 ms |
5120 KB |
Output is correct |
50 |
Correct |
4 ms |
5120 KB |
Output is correct |
51 |
Correct |
4 ms |
5120 KB |
Output is correct |
52 |
Correct |
4 ms |
5120 KB |
Output is correct |
53 |
Correct |
4 ms |
5120 KB |
Output is correct |
54 |
Correct |
4 ms |
5120 KB |
Output is correct |
55 |
Correct |
4 ms |
5120 KB |
Output is correct |
56 |
Correct |
4 ms |
5120 KB |
Output is correct |
57 |
Correct |
4 ms |
5120 KB |
Output is correct |
58 |
Correct |
4 ms |
5120 KB |
Output is correct |
59 |
Correct |
4 ms |
5120 KB |
Output is correct |
60 |
Correct |
4 ms |
5120 KB |
Output is correct |
61 |
Correct |
4 ms |
5120 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4992 KB |
Output is correct |
2 |
Correct |
4 ms |
4992 KB |
Output is correct |
3 |
Correct |
4 ms |
4992 KB |
Output is correct |
4 |
Correct |
3 ms |
4992 KB |
Output is correct |
5 |
Correct |
3 ms |
4992 KB |
Output is correct |
6 |
Correct |
3 ms |
4992 KB |
Output is correct |
7 |
Correct |
4 ms |
4992 KB |
Output is correct |
8 |
Correct |
3 ms |
4992 KB |
Output is correct |
9 |
Correct |
4 ms |
4992 KB |
Output is correct |
10 |
Correct |
4 ms |
4992 KB |
Output is correct |
11 |
Correct |
3 ms |
4992 KB |
Output is correct |
12 |
Correct |
4 ms |
4992 KB |
Output is correct |
13 |
Correct |
4 ms |
4992 KB |
Output is correct |
14 |
Correct |
4 ms |
4992 KB |
Output is correct |
15 |
Correct |
4 ms |
5120 KB |
Output is correct |
16 |
Correct |
4 ms |
5120 KB |
Output is correct |
17 |
Correct |
5 ms |
5120 KB |
Output is correct |
18 |
Correct |
4 ms |
5120 KB |
Output is correct |
19 |
Correct |
4 ms |
5120 KB |
Output is correct |
20 |
Correct |
4 ms |
5120 KB |
Output is correct |
21 |
Correct |
4 ms |
5120 KB |
Output is correct |
22 |
Correct |
4 ms |
5120 KB |
Output is correct |
23 |
Correct |
4 ms |
5120 KB |
Output is correct |
24 |
Correct |
31 ms |
8960 KB |
Output is correct |
25 |
Correct |
31 ms |
8960 KB |
Output is correct |
26 |
Correct |
31 ms |
8960 KB |
Output is correct |
27 |
Correct |
3 ms |
4992 KB |
Output is correct |
28 |
Correct |
3 ms |
4992 KB |
Output is correct |
29 |
Correct |
3 ms |
4992 KB |
Output is correct |
30 |
Correct |
4 ms |
4992 KB |
Output is correct |
31 |
Correct |
4 ms |
5120 KB |
Output is correct |
32 |
Correct |
4 ms |
4992 KB |
Output is correct |
33 |
Correct |
4 ms |
4992 KB |
Output is correct |
34 |
Correct |
4 ms |
4992 KB |
Output is correct |
35 |
Correct |
4 ms |
4992 KB |
Output is correct |
36 |
Correct |
4 ms |
5120 KB |
Output is correct |
37 |
Correct |
4 ms |
5120 KB |
Output is correct |
38 |
Correct |
4 ms |
4992 KB |
Output is correct |
39 |
Correct |
4 ms |
5120 KB |
Output is correct |
40 |
Correct |
4 ms |
5120 KB |
Output is correct |
41 |
Correct |
4 ms |
4992 KB |
Output is correct |
42 |
Correct |
3 ms |
4992 KB |
Output is correct |
43 |
Correct |
4 ms |
5120 KB |
Output is correct |
44 |
Correct |
4 ms |
5120 KB |
Output is correct |
45 |
Correct |
4 ms |
4992 KB |
Output is correct |
46 |
Correct |
4 ms |
4992 KB |
Output is correct |
47 |
Correct |
4 ms |
4992 KB |
Output is correct |
48 |
Correct |
4 ms |
5120 KB |
Output is correct |
49 |
Correct |
4 ms |
5120 KB |
Output is correct |
50 |
Correct |
4 ms |
5120 KB |
Output is correct |
51 |
Correct |
4 ms |
5120 KB |
Output is correct |
52 |
Correct |
4 ms |
5120 KB |
Output is correct |
53 |
Correct |
4 ms |
5120 KB |
Output is correct |
54 |
Correct |
4 ms |
5120 KB |
Output is correct |
55 |
Correct |
4 ms |
5120 KB |
Output is correct |
56 |
Correct |
4 ms |
5120 KB |
Output is correct |
57 |
Correct |
4 ms |
5120 KB |
Output is correct |
58 |
Correct |
4 ms |
5120 KB |
Output is correct |
59 |
Correct |
4 ms |
5120 KB |
Output is correct |
60 |
Correct |
4 ms |
5120 KB |
Output is correct |
61 |
Correct |
4 ms |
5120 KB |
Output is correct |
62 |
Correct |
4 ms |
5120 KB |
Output is correct |
63 |
Correct |
4 ms |
5120 KB |
Output is correct |
64 |
Correct |
4 ms |
5120 KB |
Output is correct |
65 |
Correct |
4 ms |
5248 KB |
Output is correct |
66 |
Correct |
4 ms |
5120 KB |
Output is correct |
67 |
Correct |
4 ms |
5248 KB |
Output is correct |
68 |
Correct |
4 ms |
5120 KB |
Output is correct |
69 |
Correct |
4 ms |
5376 KB |
Output is correct |
70 |
Correct |
6 ms |
5248 KB |
Output is correct |
71 |
Correct |
6 ms |
5248 KB |
Output is correct |
72 |
Correct |
6 ms |
5248 KB |
Output is correct |
73 |
Correct |
5 ms |
5120 KB |
Output is correct |
74 |
Correct |
6 ms |
5248 KB |
Output is correct |
75 |
Correct |
5 ms |
5248 KB |
Output is correct |
76 |
Correct |
31 ms |
7680 KB |
Output is correct |
77 |
Correct |
29 ms |
8056 KB |
Output is correct |
78 |
Correct |
38 ms |
8568 KB |
Output is correct |
79 |
Correct |
4 ms |
5504 KB |
Output is correct |
80 |
Correct |
4 ms |
5504 KB |
Output is correct |
81 |
Correct |
5 ms |
5504 KB |
Output is correct |
82 |
Correct |
5 ms |
5504 KB |
Output is correct |
83 |
Correct |
5 ms |
5504 KB |
Output is correct |
84 |
Correct |
7 ms |
5376 KB |
Output is correct |
85 |
Correct |
7 ms |
5376 KB |
Output is correct |
86 |
Correct |
7 ms |
5376 KB |
Output is correct |
87 |
Correct |
7 ms |
5248 KB |
Output is correct |
88 |
Correct |
7 ms |
5376 KB |
Output is correct |
89 |
Correct |
7 ms |
5376 KB |
Output is correct |
90 |
Correct |
44 ms |
8824 KB |
Output is correct |
91 |
Correct |
44 ms |
8824 KB |
Output is correct |
92 |
Correct |
48 ms |
8752 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4992 KB |
Output is correct |
2 |
Correct |
4 ms |
4992 KB |
Output is correct |
3 |
Correct |
4 ms |
4992 KB |
Output is correct |
4 |
Correct |
3 ms |
4992 KB |
Output is correct |
5 |
Correct |
3 ms |
4992 KB |
Output is correct |
6 |
Correct |
3 ms |
4992 KB |
Output is correct |
7 |
Correct |
4 ms |
4992 KB |
Output is correct |
8 |
Correct |
3 ms |
4992 KB |
Output is correct |
9 |
Correct |
4 ms |
4992 KB |
Output is correct |
10 |
Correct |
4 ms |
4992 KB |
Output is correct |
11 |
Correct |
3 ms |
4992 KB |
Output is correct |
12 |
Correct |
4 ms |
4992 KB |
Output is correct |
13 |
Correct |
4 ms |
4992 KB |
Output is correct |
14 |
Correct |
4 ms |
4992 KB |
Output is correct |
15 |
Correct |
4 ms |
5120 KB |
Output is correct |
16 |
Correct |
4 ms |
5120 KB |
Output is correct |
17 |
Correct |
5 ms |
5120 KB |
Output is correct |
18 |
Correct |
4 ms |
5120 KB |
Output is correct |
19 |
Correct |
4 ms |
5120 KB |
Output is correct |
20 |
Correct |
4 ms |
5120 KB |
Output is correct |
21 |
Correct |
4 ms |
5120 KB |
Output is correct |
22 |
Correct |
4 ms |
5120 KB |
Output is correct |
23 |
Correct |
4 ms |
5120 KB |
Output is correct |
24 |
Correct |
31 ms |
8960 KB |
Output is correct |
25 |
Correct |
31 ms |
8960 KB |
Output is correct |
26 |
Correct |
31 ms |
8960 KB |
Output is correct |
27 |
Correct |
8 ms |
5888 KB |
Output is correct |
28 |
Correct |
8 ms |
5888 KB |
Output is correct |
29 |
Correct |
10 ms |
5888 KB |
Output is correct |
30 |
Correct |
9 ms |
5888 KB |
Output is correct |
31 |
Correct |
9 ms |
5888 KB |
Output is correct |
32 |
Correct |
10 ms |
5888 KB |
Output is correct |
33 |
Correct |
19 ms |
6912 KB |
Output is correct |
34 |
Correct |
18 ms |
6912 KB |
Output is correct |
35 |
Correct |
18 ms |
6912 KB |
Output is correct |
36 |
Correct |
20 ms |
6960 KB |
Output is correct |
37 |
Correct |
19 ms |
6912 KB |
Output is correct |
38 |
Correct |
18 ms |
6784 KB |
Output is correct |
39 |
Correct |
44 ms |
10104 KB |
Output is correct |
40 |
Correct |
41 ms |
10024 KB |
Output is correct |
41 |
Correct |
43 ms |
10104 KB |
Output is correct |
42 |
Correct |
3 ms |
4992 KB |
Output is correct |
43 |
Correct |
3 ms |
4992 KB |
Output is correct |
44 |
Correct |
3 ms |
4992 KB |
Output is correct |
45 |
Correct |
4 ms |
4992 KB |
Output is correct |
46 |
Correct |
4 ms |
5120 KB |
Output is correct |
47 |
Correct |
4 ms |
4992 KB |
Output is correct |
48 |
Correct |
4 ms |
4992 KB |
Output is correct |
49 |
Correct |
4 ms |
4992 KB |
Output is correct |
50 |
Correct |
4 ms |
4992 KB |
Output is correct |
51 |
Correct |
4 ms |
5120 KB |
Output is correct |
52 |
Correct |
4 ms |
5120 KB |
Output is correct |
53 |
Correct |
4 ms |
4992 KB |
Output is correct |
54 |
Correct |
4 ms |
5120 KB |
Output is correct |
55 |
Correct |
4 ms |
5120 KB |
Output is correct |
56 |
Correct |
4 ms |
4992 KB |
Output is correct |
57 |
Correct |
3 ms |
4992 KB |
Output is correct |
58 |
Correct |
4 ms |
5120 KB |
Output is correct |
59 |
Correct |
4 ms |
5120 KB |
Output is correct |
60 |
Correct |
4 ms |
4992 KB |
Output is correct |
61 |
Correct |
4 ms |
4992 KB |
Output is correct |
62 |
Correct |
4 ms |
4992 KB |
Output is correct |
63 |
Correct |
4 ms |
5120 KB |
Output is correct |
64 |
Correct |
4 ms |
5120 KB |
Output is correct |
65 |
Correct |
4 ms |
5120 KB |
Output is correct |
66 |
Correct |
4 ms |
5120 KB |
Output is correct |
67 |
Correct |
4 ms |
5120 KB |
Output is correct |
68 |
Correct |
4 ms |
5120 KB |
Output is correct |
69 |
Correct |
4 ms |
5120 KB |
Output is correct |
70 |
Correct |
4 ms |
5120 KB |
Output is correct |
71 |
Correct |
4 ms |
5120 KB |
Output is correct |
72 |
Correct |
4 ms |
5120 KB |
Output is correct |
73 |
Correct |
4 ms |
5120 KB |
Output is correct |
74 |
Correct |
4 ms |
5120 KB |
Output is correct |
75 |
Correct |
4 ms |
5120 KB |
Output is correct |
76 |
Correct |
4 ms |
5120 KB |
Output is correct |
77 |
Correct |
4 ms |
5120 KB |
Output is correct |
78 |
Correct |
4 ms |
5120 KB |
Output is correct |
79 |
Correct |
4 ms |
5120 KB |
Output is correct |
80 |
Correct |
4 ms |
5248 KB |
Output is correct |
81 |
Correct |
4 ms |
5120 KB |
Output is correct |
82 |
Correct |
4 ms |
5248 KB |
Output is correct |
83 |
Correct |
4 ms |
5120 KB |
Output is correct |
84 |
Correct |
4 ms |
5376 KB |
Output is correct |
85 |
Correct |
6 ms |
5248 KB |
Output is correct |
86 |
Correct |
6 ms |
5248 KB |
Output is correct |
87 |
Correct |
6 ms |
5248 KB |
Output is correct |
88 |
Correct |
5 ms |
5120 KB |
Output is correct |
89 |
Correct |
6 ms |
5248 KB |
Output is correct |
90 |
Correct |
5 ms |
5248 KB |
Output is correct |
91 |
Correct |
31 ms |
7680 KB |
Output is correct |
92 |
Correct |
29 ms |
8056 KB |
Output is correct |
93 |
Correct |
38 ms |
8568 KB |
Output is correct |
94 |
Correct |
4 ms |
5504 KB |
Output is correct |
95 |
Correct |
4 ms |
5504 KB |
Output is correct |
96 |
Correct |
5 ms |
5504 KB |
Output is correct |
97 |
Correct |
5 ms |
5504 KB |
Output is correct |
98 |
Correct |
5 ms |
5504 KB |
Output is correct |
99 |
Correct |
7 ms |
5376 KB |
Output is correct |
100 |
Correct |
7 ms |
5376 KB |
Output is correct |
101 |
Correct |
7 ms |
5376 KB |
Output is correct |
102 |
Correct |
7 ms |
5248 KB |
Output is correct |
103 |
Correct |
7 ms |
5376 KB |
Output is correct |
104 |
Correct |
7 ms |
5376 KB |
Output is correct |
105 |
Correct |
44 ms |
8824 KB |
Output is correct |
106 |
Correct |
44 ms |
8824 KB |
Output is correct |
107 |
Correct |
48 ms |
8752 KB |
Output is correct |
108 |
Correct |
9 ms |
5888 KB |
Output is correct |
109 |
Correct |
71 ms |
40440 KB |
Output is correct |
110 |
Correct |
57 ms |
24440 KB |
Output is correct |
111 |
Correct |
50 ms |
19364 KB |
Output is correct |
112 |
Correct |
61 ms |
21624 KB |
Output is correct |
113 |
Correct |
46 ms |
16144 KB |
Output is correct |
114 |
Correct |
23 ms |
6656 KB |
Output is correct |
115 |
Correct |
22 ms |
6392 KB |
Output is correct |
116 |
Correct |
30 ms |
7032 KB |
Output is correct |
117 |
Correct |
22 ms |
6528 KB |
Output is correct |
118 |
Correct |
25 ms |
6656 KB |
Output is correct |
119 |
Correct |
21 ms |
6656 KB |
Output is correct |
120 |
Correct |
32 ms |
7936 KB |
Output is correct |
121 |
Correct |
12 ms |
6016 KB |
Output is correct |
122 |
Correct |
39 ms |
8056 KB |
Output is correct |
123 |
Correct |
11 ms |
5888 KB |
Output is correct |
124 |
Correct |
44 ms |
8696 KB |
Output is correct |
125 |
Correct |
16 ms |
6400 KB |
Output is correct |
126 |
Correct |
15 ms |
6272 KB |
Output is correct |
127 |
Correct |
19 ms |
6784 KB |
Output is correct |
128 |
Correct |
14 ms |
6144 KB |
Output is correct |
129 |
Correct |
16 ms |
6272 KB |
Output is correct |
130 |
Correct |
8 ms |
5888 KB |
Output is correct |
131 |
Correct |
95 ms |
55160 KB |
Output is correct |
132 |
Correct |
103 ms |
40572 KB |
Output is correct |
133 |
Correct |
102 ms |
34296 KB |
Output is correct |
134 |
Correct |
93 ms |
30328 KB |
Output is correct |
135 |
Correct |
90 ms |
27768 KB |
Output is correct |
136 |
Correct |
33 ms |
7552 KB |
Output is correct |
137 |
Correct |
33 ms |
7416 KB |
Output is correct |
138 |
Correct |
33 ms |
7416 KB |
Output is correct |
139 |
Correct |
34 ms |
7416 KB |
Output is correct |
140 |
Correct |
32 ms |
7424 KB |
Output is correct |
141 |
Correct |
33 ms |
7424 KB |
Output is correct |
142 |
Correct |
57 ms |
9720 KB |
Output is correct |
143 |
Correct |
18 ms |
6656 KB |
Output is correct |
144 |
Correct |
61 ms |
9748 KB |
Output is correct |
145 |
Correct |
18 ms |
6656 KB |
Output is correct |
146 |
Correct |
57 ms |
9720 KB |
Output is correct |
147 |
Correct |
18 ms |
6656 KB |
Output is correct |
148 |
Correct |
21 ms |
7040 KB |
Output is correct |
149 |
Correct |
21 ms |
6912 KB |
Output is correct |
150 |
Correct |
20 ms |
6784 KB |
Output is correct |
151 |
Correct |
20 ms |
6784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4992 KB |
Output is correct |
2 |
Correct |
4 ms |
4992 KB |
Output is correct |
3 |
Correct |
4 ms |
4992 KB |
Output is correct |
4 |
Correct |
3 ms |
4992 KB |
Output is correct |
5 |
Correct |
3 ms |
4992 KB |
Output is correct |
6 |
Correct |
3 ms |
4992 KB |
Output is correct |
7 |
Correct |
4 ms |
4992 KB |
Output is correct |
8 |
Correct |
3 ms |
4992 KB |
Output is correct |
9 |
Correct |
4 ms |
4992 KB |
Output is correct |
10 |
Correct |
4 ms |
4992 KB |
Output is correct |
11 |
Correct |
3 ms |
4992 KB |
Output is correct |
12 |
Correct |
4 ms |
4992 KB |
Output is correct |
13 |
Correct |
4 ms |
4992 KB |
Output is correct |
14 |
Correct |
4 ms |
4992 KB |
Output is correct |
15 |
Correct |
4 ms |
5120 KB |
Output is correct |
16 |
Correct |
4 ms |
5120 KB |
Output is correct |
17 |
Correct |
5 ms |
5120 KB |
Output is correct |
18 |
Correct |
4 ms |
5120 KB |
Output is correct |
19 |
Correct |
4 ms |
5120 KB |
Output is correct |
20 |
Correct |
4 ms |
5120 KB |
Output is correct |
21 |
Correct |
4 ms |
5120 KB |
Output is correct |
22 |
Correct |
4 ms |
5120 KB |
Output is correct |
23 |
Correct |
4 ms |
5120 KB |
Output is correct |
24 |
Correct |
31 ms |
8960 KB |
Output is correct |
25 |
Correct |
31 ms |
8960 KB |
Output is correct |
26 |
Correct |
31 ms |
8960 KB |
Output is correct |
27 |
Correct |
8 ms |
5888 KB |
Output is correct |
28 |
Correct |
8 ms |
5888 KB |
Output is correct |
29 |
Correct |
10 ms |
5888 KB |
Output is correct |
30 |
Correct |
9 ms |
5888 KB |
Output is correct |
31 |
Correct |
9 ms |
5888 KB |
Output is correct |
32 |
Correct |
10 ms |
5888 KB |
Output is correct |
33 |
Correct |
19 ms |
6912 KB |
Output is correct |
34 |
Correct |
18 ms |
6912 KB |
Output is correct |
35 |
Correct |
18 ms |
6912 KB |
Output is correct |
36 |
Correct |
20 ms |
6960 KB |
Output is correct |
37 |
Correct |
19 ms |
6912 KB |
Output is correct |
38 |
Correct |
18 ms |
6784 KB |
Output is correct |
39 |
Correct |
44 ms |
10104 KB |
Output is correct |
40 |
Correct |
41 ms |
10024 KB |
Output is correct |
41 |
Correct |
43 ms |
10104 KB |
Output is correct |
42 |
Correct |
24 ms |
8860 KB |
Output is correct |
43 |
Correct |
16 ms |
7456 KB |
Output is correct |
44 |
Correct |
30 ms |
9212 KB |
Output is correct |
45 |
Correct |
20 ms |
7808 KB |
Output is correct |
46 |
Correct |
19 ms |
7572 KB |
Output is correct |
47 |
Correct |
30 ms |
9336 KB |
Output is correct |
48 |
Correct |
86 ms |
19364 KB |
Output is correct |
49 |
Correct |
54 ms |
13212 KB |
Output is correct |
50 |
Correct |
58 ms |
16668 KB |
Output is correct |
51 |
Correct |
71 ms |
16776 KB |
Output is correct |
52 |
Correct |
75 ms |
16356 KB |
Output is correct |
53 |
Correct |
66 ms |
13656 KB |
Output is correct |
54 |
Correct |
30 ms |
9304 KB |
Output is correct |
55 |
Correct |
26 ms |
9336 KB |
Output is correct |
56 |
Correct |
30 ms |
9296 KB |
Output is correct |
57 |
Correct |
29 ms |
9336 KB |
Output is correct |
58 |
Correct |
29 ms |
9328 KB |
Output is correct |
59 |
Correct |
31 ms |
9336 KB |
Output is correct |
60 |
Correct |
98 ms |
20720 KB |
Output is correct |
61 |
Correct |
99 ms |
20848 KB |
Output is correct |
62 |
Correct |
99 ms |
20720 KB |
Output is correct |
63 |
Correct |
97 ms |
20720 KB |
Output is correct |
64 |
Correct |
97 ms |
20720 KB |
Output is correct |
65 |
Correct |
97 ms |
20720 KB |
Output is correct |
66 |
Correct |
103 ms |
19568 KB |
Output is correct |
67 |
Correct |
104 ms |
19568 KB |
Output is correct |
68 |
Correct |
100 ms |
19568 KB |
Output is correct |
69 |
Correct |
3 ms |
4992 KB |
Output is correct |
70 |
Correct |
3 ms |
4992 KB |
Output is correct |
71 |
Correct |
3 ms |
4992 KB |
Output is correct |
72 |
Correct |
4 ms |
4992 KB |
Output is correct |
73 |
Correct |
4 ms |
5120 KB |
Output is correct |
74 |
Correct |
4 ms |
4992 KB |
Output is correct |
75 |
Correct |
4 ms |
4992 KB |
Output is correct |
76 |
Correct |
4 ms |
4992 KB |
Output is correct |
77 |
Correct |
4 ms |
4992 KB |
Output is correct |
78 |
Correct |
4 ms |
5120 KB |
Output is correct |
79 |
Correct |
4 ms |
5120 KB |
Output is correct |
80 |
Correct |
4 ms |
4992 KB |
Output is correct |
81 |
Correct |
4 ms |
5120 KB |
Output is correct |
82 |
Correct |
4 ms |
5120 KB |
Output is correct |
83 |
Correct |
4 ms |
4992 KB |
Output is correct |
84 |
Correct |
3 ms |
4992 KB |
Output is correct |
85 |
Correct |
4 ms |
5120 KB |
Output is correct |
86 |
Correct |
4 ms |
5120 KB |
Output is correct |
87 |
Correct |
4 ms |
4992 KB |
Output is correct |
88 |
Correct |
4 ms |
4992 KB |
Output is correct |
89 |
Correct |
4 ms |
4992 KB |
Output is correct |
90 |
Correct |
4 ms |
5120 KB |
Output is correct |
91 |
Correct |
4 ms |
5120 KB |
Output is correct |
92 |
Correct |
4 ms |
5120 KB |
Output is correct |
93 |
Correct |
4 ms |
5120 KB |
Output is correct |
94 |
Correct |
4 ms |
5120 KB |
Output is correct |
95 |
Correct |
4 ms |
5120 KB |
Output is correct |
96 |
Correct |
4 ms |
5120 KB |
Output is correct |
97 |
Correct |
4 ms |
5120 KB |
Output is correct |
98 |
Correct |
4 ms |
5120 KB |
Output is correct |
99 |
Correct |
4 ms |
5120 KB |
Output is correct |
100 |
Correct |
4 ms |
5120 KB |
Output is correct |
101 |
Correct |
4 ms |
5120 KB |
Output is correct |
102 |
Correct |
4 ms |
5120 KB |
Output is correct |
103 |
Correct |
4 ms |
5120 KB |
Output is correct |
104 |
Correct |
4 ms |
5120 KB |
Output is correct |
105 |
Correct |
4 ms |
5120 KB |
Output is correct |
106 |
Correct |
4 ms |
5120 KB |
Output is correct |
107 |
Correct |
4 ms |
5248 KB |
Output is correct |
108 |
Correct |
4 ms |
5120 KB |
Output is correct |
109 |
Correct |
4 ms |
5248 KB |
Output is correct |
110 |
Correct |
4 ms |
5120 KB |
Output is correct |
111 |
Correct |
4 ms |
5376 KB |
Output is correct |
112 |
Correct |
6 ms |
5248 KB |
Output is correct |
113 |
Correct |
6 ms |
5248 KB |
Output is correct |
114 |
Correct |
6 ms |
5248 KB |
Output is correct |
115 |
Correct |
5 ms |
5120 KB |
Output is correct |
116 |
Correct |
6 ms |
5248 KB |
Output is correct |
117 |
Correct |
5 ms |
5248 KB |
Output is correct |
118 |
Correct |
31 ms |
7680 KB |
Output is correct |
119 |
Correct |
29 ms |
8056 KB |
Output is correct |
120 |
Correct |
38 ms |
8568 KB |
Output is correct |
121 |
Correct |
4 ms |
5504 KB |
Output is correct |
122 |
Correct |
4 ms |
5504 KB |
Output is correct |
123 |
Correct |
5 ms |
5504 KB |
Output is correct |
124 |
Correct |
5 ms |
5504 KB |
Output is correct |
125 |
Correct |
5 ms |
5504 KB |
Output is correct |
126 |
Correct |
7 ms |
5376 KB |
Output is correct |
127 |
Correct |
7 ms |
5376 KB |
Output is correct |
128 |
Correct |
7 ms |
5376 KB |
Output is correct |
129 |
Correct |
7 ms |
5248 KB |
Output is correct |
130 |
Correct |
7 ms |
5376 KB |
Output is correct |
131 |
Correct |
7 ms |
5376 KB |
Output is correct |
132 |
Correct |
44 ms |
8824 KB |
Output is correct |
133 |
Correct |
44 ms |
8824 KB |
Output is correct |
134 |
Correct |
48 ms |
8752 KB |
Output is correct |
135 |
Correct |
9 ms |
5888 KB |
Output is correct |
136 |
Correct |
71 ms |
40440 KB |
Output is correct |
137 |
Correct |
57 ms |
24440 KB |
Output is correct |
138 |
Correct |
50 ms |
19364 KB |
Output is correct |
139 |
Correct |
61 ms |
21624 KB |
Output is correct |
140 |
Correct |
46 ms |
16144 KB |
Output is correct |
141 |
Correct |
23 ms |
6656 KB |
Output is correct |
142 |
Correct |
22 ms |
6392 KB |
Output is correct |
143 |
Correct |
30 ms |
7032 KB |
Output is correct |
144 |
Correct |
22 ms |
6528 KB |
Output is correct |
145 |
Correct |
25 ms |
6656 KB |
Output is correct |
146 |
Correct |
21 ms |
6656 KB |
Output is correct |
147 |
Correct |
32 ms |
7936 KB |
Output is correct |
148 |
Correct |
12 ms |
6016 KB |
Output is correct |
149 |
Correct |
39 ms |
8056 KB |
Output is correct |
150 |
Correct |
11 ms |
5888 KB |
Output is correct |
151 |
Correct |
44 ms |
8696 KB |
Output is correct |
152 |
Correct |
16 ms |
6400 KB |
Output is correct |
153 |
Correct |
15 ms |
6272 KB |
Output is correct |
154 |
Correct |
19 ms |
6784 KB |
Output is correct |
155 |
Correct |
14 ms |
6144 KB |
Output is correct |
156 |
Correct |
16 ms |
6272 KB |
Output is correct |
157 |
Correct |
8 ms |
5888 KB |
Output is correct |
158 |
Correct |
95 ms |
55160 KB |
Output is correct |
159 |
Correct |
103 ms |
40572 KB |
Output is correct |
160 |
Correct |
102 ms |
34296 KB |
Output is correct |
161 |
Correct |
93 ms |
30328 KB |
Output is correct |
162 |
Correct |
90 ms |
27768 KB |
Output is correct |
163 |
Correct |
33 ms |
7552 KB |
Output is correct |
164 |
Correct |
33 ms |
7416 KB |
Output is correct |
165 |
Correct |
33 ms |
7416 KB |
Output is correct |
166 |
Correct |
34 ms |
7416 KB |
Output is correct |
167 |
Correct |
32 ms |
7424 KB |
Output is correct |
168 |
Correct |
33 ms |
7424 KB |
Output is correct |
169 |
Correct |
57 ms |
9720 KB |
Output is correct |
170 |
Correct |
18 ms |
6656 KB |
Output is correct |
171 |
Correct |
61 ms |
9748 KB |
Output is correct |
172 |
Correct |
18 ms |
6656 KB |
Output is correct |
173 |
Correct |
57 ms |
9720 KB |
Output is correct |
174 |
Correct |
18 ms |
6656 KB |
Output is correct |
175 |
Correct |
21 ms |
7040 KB |
Output is correct |
176 |
Correct |
21 ms |
6912 KB |
Output is correct |
177 |
Correct |
20 ms |
6784 KB |
Output is correct |
178 |
Correct |
20 ms |
6784 KB |
Output is correct |
179 |
Correct |
19 ms |
7692 KB |
Output is correct |
180 |
Correct |
201 ms |
105136 KB |
Output is correct |
181 |
Correct |
335 ms |
117328 KB |
Output is correct |
182 |
Correct |
458 ms |
145524 KB |
Output is correct |
183 |
Correct |
251 ms |
75768 KB |
Output is correct |
184 |
Correct |
217 ms |
63364 KB |
Output is correct |
185 |
Correct |
54 ms |
10412 KB |
Output is correct |
186 |
Correct |
57 ms |
13052 KB |
Output is correct |
187 |
Correct |
65 ms |
11400 KB |
Output is correct |
188 |
Correct |
72 ms |
11040 KB |
Output is correct |
189 |
Correct |
71 ms |
11552 KB |
Output is correct |
190 |
Correct |
78 ms |
12872 KB |
Output is correct |
191 |
Correct |
71 ms |
12744 KB |
Output is correct |
192 |
Correct |
56 ms |
9844 KB |
Output is correct |
193 |
Correct |
51 ms |
9844 KB |
Output is correct |
194 |
Correct |
27 ms |
9336 KB |
Output is correct |
195 |
Correct |
464 ms |
255216 KB |
Output is correct |
196 |
Correct |
518 ms |
182488 KB |
Output is correct |
197 |
Correct |
475 ms |
150504 KB |
Output is correct |
198 |
Correct |
449 ms |
131272 KB |
Output is correct |
199 |
Correct |
427 ms |
117872 KB |
Output is correct |
200 |
Correct |
135 ms |
20720 KB |
Output is correct |
201 |
Correct |
131 ms |
20720 KB |
Output is correct |
202 |
Correct |
132 ms |
20720 KB |
Output is correct |
203 |
Correct |
129 ms |
20720 KB |
Output is correct |
204 |
Correct |
130 ms |
20720 KB |
Output is correct |
205 |
Correct |
125 ms |
20724 KB |
Output is correct |
206 |
Correct |
123 ms |
19056 KB |
Output is correct |
207 |
Correct |
119 ms |
19572 KB |
Output is correct |
208 |
Correct |
117 ms |
19056 KB |
Output is correct |
209 |
Correct |
112 ms |
19524 KB |
Output is correct |
210 |
Correct |
123 ms |
19184 KB |
Output is correct |
211 |
Correct |
101 ms |
19568 KB |
Output is correct |
212 |
Correct |
110 ms |
20684 KB |
Output is correct |
213 |
Correct |
107 ms |
16496 KB |
Output is correct |
214 |
Correct |
104 ms |
15732 KB |
Output is correct |
215 |
Correct |
109 ms |
15348 KB |
Output is correct |