#include "paint.h"
#include <vector>
#include <deque>
#include <set>
using namespace std;
/*
f(k) <= â400000 = ~650
For every color, we can compute the list of contractors who can paint it.
For every wall segment, we can compute the list of contractors who can paint it.
*/
int n, m, k;
vector<int>* c;
vector<int>* a;
vector< vector<int> >* b;
vector<int> col_workers[100000];
vector<int> start_ct(100000, 0);
vector<int> compute_startpos(int i)
{
vector<int> temp;
for(int w: col_workers[(*c)[i]])
{
// cerr << i << ' ' << C[i] << ' ' << w << ' ' << i-w << ' ' << i-w+M << '\n';
if(0 <= i-w)
temp.push_back(i-w);
if(w != 0 && i-w+m < n)
temp.push_back(i-w+m);
}
return temp;
}
void add_startpos(int i, int a)
{
for(int w: col_workers[(*c)[i]])
{
// cerr << i << ' ' << C[i] << ' ' << w << ' ' << i-w << ' ' << i-w+M << '\n';
if(0 <= i-w)
start_ct[i-w] += a;
if(w != 0 && i-w+m < n)
start_ct[i-w+m] += a;
}
}
int minimumInstructions(
int N, int M, int K, vector<int> C, vector<int> A, vector< vector<int> > B)
{
n = N;
m = M;
k = K;
c = &C;
a = &A;
b = &B;
//N = number of wall segments
//M = number of contractors
//K = number of colors
//C[i] = intended color of i'th segment
//A[i] = B[i].size
//B[i] = set of colors that contractor i can work with
// vector<int> col_workers[K]; //list of workers that can work with color k
for(int j = 0; j < M; j++)
for(int b: B[j])
col_workers[b].push_back(j);
// vector<int> startpos[N]; //list of starting positions (position of worker 0) from which color i can be painted
// for(int i = 0; i < N; i++)
// for(int w: col_workers[C[i]])
// {
// // cerr << i << ' ' << C[i] << ' ' << w << ' ' << i-w << ' ' << i-w+M << '\n';
// if(0 <= i-w)
// startpos[i].push_back(i-w);
//
// if(w != 0 && i-w+M < N)
// startpos[i].push_back(i-w+M);
// }
int res = 0;
// for(int i = 0; i < N; i++)
// {
// cerr << i << ": ";
// for(int s: startpos[i]) cerr << s << ' ';
// cerr << '\n';
// }
vector<int> can_start(N, 0); //whether the M contractors can paint i ... i+M-1 in one operation
for(int i = 0; i < M; i++)
{
add_startpos(i, +1);
}
int mx_start = 0;
for(int i = 1; i < N; i++)
{
if(start_ct[i] >= start_ct[mx_start])
mx_start = i;
}
can_start[0] = (start_ct[mx_start] == M);
for(int i = 1; i+M-1 < N; i++)
{
add_startpos(i-1, -1);
mx_start = -1;
vector<int> temp = compute_startpos(i+M-1);
for(int x: temp)
{
start_ct[x]++;
// cerr << x << "++\n";
if(mx_start == -1 || start_ct[x] >= start_ct[mx_start])
mx_start = x;
}
// cerr << "pos i = " << i << '\n';
// for(int j = 0; j < N; j++) cerr << start_ct[j] << ' ';
// cerr << '\n';
if(start_ct[mx_start] == M)
can_start[i] = 1;
}
// for(int i = 0; i < N; i++) cerr << can_start[i] << ' ';
// cerr << '\n';
if(can_start[0] == 0) return -1;
deque<int> S;
for(int i = 0; i < N; i++)
if(can_start[i])
S.push_back(i);
// for(int q:S) cerr << q << ' ';
// cerr << '\n';
vector<int> dp(N, 1e9);
for(int i = 0; i < M; i++) dp[i] = 1;
for(int i = M; i < N; i++)
{
// cerr << "i = " << i << '\n';
// for(int s:S) cerr << s << ' ';
// cerr << '\n';
while(S.size() > 1 && S[0]+M-1 < i)
S.pop_front();
// for(int s:S) cerr << s << ' ';
// cerr << '\n';
if(S.empty() || S[0] + M - 1 < i || S[0] > i)
return -1;
dp[i] = dp[S.front() - 1] + 1;
}
return dp[N-1];
}
Compilation message
paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:82:9: warning: unused variable 'res' [-Wunused-variable]
82 | int res = 0;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3020 KB |
Output is correct |
2 |
Correct |
2 ms |
3020 KB |
Output is correct |
3 |
Correct |
2 ms |
3004 KB |
Output is correct |
4 |
Correct |
2 ms |
3020 KB |
Output is correct |
5 |
Correct |
2 ms |
3020 KB |
Output is correct |
6 |
Correct |
2 ms |
3020 KB |
Output is correct |
7 |
Correct |
2 ms |
2936 KB |
Output is correct |
8 |
Correct |
2 ms |
3020 KB |
Output is correct |
9 |
Correct |
2 ms |
3020 KB |
Output is correct |
10 |
Correct |
2 ms |
3020 KB |
Output is correct |
11 |
Correct |
2 ms |
3020 KB |
Output is correct |
12 |
Correct |
2 ms |
3020 KB |
Output is correct |
13 |
Correct |
2 ms |
3020 KB |
Output is correct |
14 |
Correct |
2 ms |
3020 KB |
Output is correct |
15 |
Correct |
2 ms |
3020 KB |
Output is correct |
16 |
Correct |
2 ms |
3020 KB |
Output is correct |
17 |
Correct |
2 ms |
3020 KB |
Output is correct |
18 |
Correct |
2 ms |
3020 KB |
Output is correct |
19 |
Correct |
2 ms |
3020 KB |
Output is correct |
20 |
Correct |
2 ms |
3020 KB |
Output is correct |
21 |
Correct |
2 ms |
3020 KB |
Output is correct |
22 |
Correct |
23 ms |
6932 KB |
Output is correct |
23 |
Correct |
24 ms |
6900 KB |
Output is correct |
24 |
Correct |
23 ms |
6860 KB |
Output is correct |
25 |
Correct |
5 ms |
3404 KB |
Output is correct |
26 |
Correct |
5 ms |
3396 KB |
Output is correct |
27 |
Correct |
6 ms |
3148 KB |
Output is correct |
28 |
Correct |
6 ms |
3148 KB |
Output is correct |
29 |
Correct |
6 ms |
3148 KB |
Output is correct |
30 |
Correct |
6 ms |
3148 KB |
Output is correct |
31 |
Correct |
12 ms |
4256 KB |
Output is correct |
32 |
Correct |
14 ms |
4264 KB |
Output is correct |
33 |
Correct |
12 ms |
4300 KB |
Output is correct |
34 |
Correct |
14 ms |
4260 KB |
Output is correct |
35 |
Correct |
12 ms |
4256 KB |
Output is correct |
36 |
Correct |
12 ms |
4300 KB |
Output is correct |
37 |
Correct |
34 ms |
7280 KB |
Output is correct |
38 |
Correct |
31 ms |
7276 KB |
Output is correct |
39 |
Correct |
30 ms |
7236 KB |
Output is correct |
40 |
Correct |
17 ms |
4812 KB |
Output is correct |
41 |
Correct |
11 ms |
4080 KB |
Output is correct |
42 |
Correct |
22 ms |
4692 KB |
Output is correct |
43 |
Correct |
15 ms |
3792 KB |
Output is correct |
44 |
Correct |
13 ms |
3744 KB |
Output is correct |
45 |
Correct |
21 ms |
4204 KB |
Output is correct |
46 |
Correct |
56 ms |
12840 KB |
Output is correct |
47 |
Correct |
33 ms |
8524 KB |
Output is correct |
48 |
Correct |
39 ms |
10952 KB |
Output is correct |
49 |
Correct |
52 ms |
10940 KB |
Output is correct |
50 |
Correct |
50 ms |
10548 KB |
Output is correct |
51 |
Correct |
44 ms |
8388 KB |
Output is correct |
52 |
Correct |
19 ms |
4940 KB |
Output is correct |
53 |
Correct |
23 ms |
4940 KB |
Output is correct |
54 |
Correct |
22 ms |
4724 KB |
Output is correct |
55 |
Correct |
21 ms |
4208 KB |
Output is correct |
56 |
Correct |
21 ms |
4212 KB |
Output is correct |
57 |
Correct |
21 ms |
4192 KB |
Output is correct |
58 |
Correct |
61 ms |
13676 KB |
Output is correct |
59 |
Correct |
58 ms |
13764 KB |
Output is correct |
60 |
Correct |
60 ms |
13712 KB |
Output is correct |
61 |
Correct |
60 ms |
13720 KB |
Output is correct |
62 |
Correct |
60 ms |
13692 KB |
Output is correct |
63 |
Correct |
61 ms |
13764 KB |
Output is correct |
64 |
Correct |
71 ms |
12360 KB |
Output is correct |
65 |
Correct |
69 ms |
12324 KB |
Output is correct |
66 |
Correct |
66 ms |
12344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3020 KB |
Output is correct |
2 |
Correct |
2 ms |
3020 KB |
Output is correct |
3 |
Correct |
2 ms |
3004 KB |
Output is correct |
4 |
Correct |
2 ms |
3020 KB |
Output is correct |
5 |
Correct |
2 ms |
3020 KB |
Output is correct |
6 |
Correct |
2 ms |
3020 KB |
Output is correct |
7 |
Correct |
2 ms |
2936 KB |
Output is correct |
8 |
Correct |
2 ms |
3020 KB |
Output is correct |
9 |
Correct |
2 ms |
3020 KB |
Output is correct |
10 |
Correct |
2 ms |
3020 KB |
Output is correct |
11 |
Correct |
2 ms |
3020 KB |
Output is correct |
12 |
Correct |
2 ms |
3020 KB |
Output is correct |
13 |
Correct |
2 ms |
3020 KB |
Output is correct |
14 |
Correct |
2 ms |
3020 KB |
Output is correct |
15 |
Correct |
2 ms |
3020 KB |
Output is correct |
16 |
Correct |
2 ms |
3020 KB |
Output is correct |
17 |
Correct |
2 ms |
3020 KB |
Output is correct |
18 |
Correct |
2 ms |
3020 KB |
Output is correct |
19 |
Correct |
2 ms |
3020 KB |
Output is correct |
20 |
Correct |
2 ms |
3020 KB |
Output is correct |
21 |
Correct |
2 ms |
3020 KB |
Output is correct |
22 |
Correct |
2 ms |
3020 KB |
Output is correct |
23 |
Correct |
2 ms |
3020 KB |
Output is correct |
24 |
Correct |
2 ms |
3020 KB |
Output is correct |
25 |
Correct |
3 ms |
3020 KB |
Output is correct |
26 |
Correct |
2 ms |
3020 KB |
Output is correct |
27 |
Correct |
2 ms |
3020 KB |
Output is correct |
28 |
Correct |
2 ms |
3020 KB |
Output is correct |
29 |
Correct |
3 ms |
3020 KB |
Output is correct |
30 |
Correct |
2 ms |
2920 KB |
Output is correct |
31 |
Correct |
2 ms |
3020 KB |
Output is correct |
32 |
Correct |
2 ms |
3020 KB |
Output is correct |
33 |
Correct |
2 ms |
3020 KB |
Output is correct |
34 |
Correct |
2 ms |
3052 KB |
Output is correct |
35 |
Correct |
2 ms |
3020 KB |
Output is correct |
36 |
Correct |
2 ms |
3020 KB |
Output is correct |
37 |
Correct |
2 ms |
3020 KB |
Output is correct |
38 |
Correct |
2 ms |
3020 KB |
Output is correct |
39 |
Correct |
2 ms |
3020 KB |
Output is correct |
40 |
Correct |
2 ms |
3020 KB |
Output is correct |
41 |
Correct |
2 ms |
3020 KB |
Output is correct |
42 |
Correct |
2 ms |
3020 KB |
Output is correct |
43 |
Correct |
2 ms |
3020 KB |
Output is correct |
44 |
Correct |
2 ms |
3020 KB |
Output is correct |
45 |
Correct |
2 ms |
3020 KB |
Output is correct |
46 |
Correct |
2 ms |
3020 KB |
Output is correct |
47 |
Correct |
2 ms |
3020 KB |
Output is correct |
48 |
Correct |
2 ms |
3020 KB |
Output is correct |
49 |
Correct |
2 ms |
3020 KB |
Output is correct |
50 |
Correct |
2 ms |
3020 KB |
Output is correct |
51 |
Correct |
2 ms |
3020 KB |
Output is correct |
52 |
Correct |
2 ms |
3020 KB |
Output is correct |
53 |
Correct |
2 ms |
3020 KB |
Output is correct |
54 |
Correct |
2 ms |
3020 KB |
Output is correct |
55 |
Correct |
2 ms |
3020 KB |
Output is correct |
56 |
Correct |
3 ms |
3020 KB |
Output is correct |
57 |
Correct |
2 ms |
3020 KB |
Output is correct |
58 |
Correct |
2 ms |
3020 KB |
Output is correct |
59 |
Correct |
2 ms |
3020 KB |
Output is correct |
60 |
Correct |
2 ms |
3020 KB |
Output is correct |
61 |
Correct |
2 ms |
3020 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3020 KB |
Output is correct |
2 |
Correct |
2 ms |
3020 KB |
Output is correct |
3 |
Correct |
2 ms |
3020 KB |
Output is correct |
4 |
Correct |
2 ms |
3020 KB |
Output is correct |
5 |
Correct |
2 ms |
3004 KB |
Output is correct |
6 |
Correct |
2 ms |
3020 KB |
Output is correct |
7 |
Correct |
2 ms |
3020 KB |
Output is correct |
8 |
Correct |
2 ms |
3020 KB |
Output is correct |
9 |
Correct |
2 ms |
2936 KB |
Output is correct |
10 |
Correct |
2 ms |
3020 KB |
Output is correct |
11 |
Correct |
2 ms |
3020 KB |
Output is correct |
12 |
Correct |
2 ms |
3020 KB |
Output is correct |
13 |
Correct |
2 ms |
3020 KB |
Output is correct |
14 |
Correct |
2 ms |
3020 KB |
Output is correct |
15 |
Correct |
2 ms |
3020 KB |
Output is correct |
16 |
Correct |
2 ms |
3020 KB |
Output is correct |
17 |
Correct |
2 ms |
3020 KB |
Output is correct |
18 |
Correct |
2 ms |
3020 KB |
Output is correct |
19 |
Correct |
2 ms |
3020 KB |
Output is correct |
20 |
Correct |
2 ms |
3020 KB |
Output is correct |
21 |
Correct |
2 ms |
3020 KB |
Output is correct |
22 |
Correct |
2 ms |
3020 KB |
Output is correct |
23 |
Correct |
2 ms |
3020 KB |
Output is correct |
24 |
Correct |
23 ms |
6932 KB |
Output is correct |
25 |
Correct |
24 ms |
6900 KB |
Output is correct |
26 |
Correct |
23 ms |
6860 KB |
Output is correct |
27 |
Correct |
2 ms |
3020 KB |
Output is correct |
28 |
Correct |
3 ms |
3020 KB |
Output is correct |
29 |
Correct |
2 ms |
3020 KB |
Output is correct |
30 |
Correct |
2 ms |
3020 KB |
Output is correct |
31 |
Correct |
2 ms |
3020 KB |
Output is correct |
32 |
Correct |
3 ms |
3020 KB |
Output is correct |
33 |
Correct |
2 ms |
2920 KB |
Output is correct |
34 |
Correct |
2 ms |
3020 KB |
Output is correct |
35 |
Correct |
2 ms |
3020 KB |
Output is correct |
36 |
Correct |
2 ms |
3020 KB |
Output is correct |
37 |
Correct |
2 ms |
3052 KB |
Output is correct |
38 |
Correct |
2 ms |
3020 KB |
Output is correct |
39 |
Correct |
2 ms |
3020 KB |
Output is correct |
40 |
Correct |
2 ms |
3020 KB |
Output is correct |
41 |
Correct |
2 ms |
3020 KB |
Output is correct |
42 |
Correct |
2 ms |
3020 KB |
Output is correct |
43 |
Correct |
2 ms |
3020 KB |
Output is correct |
44 |
Correct |
2 ms |
3020 KB |
Output is correct |
45 |
Correct |
2 ms |
3020 KB |
Output is correct |
46 |
Correct |
2 ms |
3020 KB |
Output is correct |
47 |
Correct |
2 ms |
3020 KB |
Output is correct |
48 |
Correct |
2 ms |
3020 KB |
Output is correct |
49 |
Correct |
2 ms |
3020 KB |
Output is correct |
50 |
Correct |
2 ms |
3020 KB |
Output is correct |
51 |
Correct |
2 ms |
3020 KB |
Output is correct |
52 |
Correct |
2 ms |
3020 KB |
Output is correct |
53 |
Correct |
2 ms |
3020 KB |
Output is correct |
54 |
Correct |
2 ms |
3020 KB |
Output is correct |
55 |
Correct |
2 ms |
3020 KB |
Output is correct |
56 |
Correct |
2 ms |
3020 KB |
Output is correct |
57 |
Correct |
2 ms |
3020 KB |
Output is correct |
58 |
Correct |
2 ms |
3020 KB |
Output is correct |
59 |
Correct |
3 ms |
3020 KB |
Output is correct |
60 |
Correct |
2 ms |
3020 KB |
Output is correct |
61 |
Correct |
2 ms |
3020 KB |
Output is correct |
62 |
Correct |
2 ms |
3020 KB |
Output is correct |
63 |
Correct |
2 ms |
3020 KB |
Output is correct |
64 |
Correct |
2 ms |
3020 KB |
Output is correct |
65 |
Correct |
2 ms |
3020 KB |
Output is correct |
66 |
Correct |
3 ms |
3020 KB |
Output is correct |
67 |
Correct |
3 ms |
3020 KB |
Output is correct |
68 |
Correct |
3 ms |
3020 KB |
Output is correct |
69 |
Correct |
3 ms |
3052 KB |
Output is correct |
70 |
Correct |
4 ms |
3148 KB |
Output is correct |
71 |
Correct |
5 ms |
3276 KB |
Output is correct |
72 |
Correct |
4 ms |
3196 KB |
Output is correct |
73 |
Correct |
3 ms |
3020 KB |
Output is correct |
74 |
Correct |
4 ms |
3148 KB |
Output is correct |
75 |
Correct |
4 ms |
3180 KB |
Output is correct |
76 |
Correct |
27 ms |
5572 KB |
Output is correct |
77 |
Correct |
27 ms |
6036 KB |
Output is correct |
78 |
Correct |
30 ms |
6476 KB |
Output is correct |
79 |
Correct |
4 ms |
3020 KB |
Output is correct |
80 |
Correct |
4 ms |
3020 KB |
Output is correct |
81 |
Correct |
4 ms |
3020 KB |
Output is correct |
82 |
Correct |
4 ms |
3020 KB |
Output is correct |
83 |
Correct |
4 ms |
3020 KB |
Output is correct |
84 |
Correct |
5 ms |
3148 KB |
Output is correct |
85 |
Correct |
5 ms |
3148 KB |
Output is correct |
86 |
Correct |
5 ms |
3148 KB |
Output is correct |
87 |
Correct |
5 ms |
3148 KB |
Output is correct |
88 |
Correct |
5 ms |
3148 KB |
Output is correct |
89 |
Correct |
5 ms |
3148 KB |
Output is correct |
90 |
Correct |
35 ms |
6752 KB |
Output is correct |
91 |
Correct |
34 ms |
6680 KB |
Output is correct |
92 |
Correct |
33 ms |
6724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3020 KB |
Output is correct |
2 |
Correct |
2 ms |
3020 KB |
Output is correct |
3 |
Correct |
2 ms |
3020 KB |
Output is correct |
4 |
Correct |
2 ms |
3020 KB |
Output is correct |
5 |
Correct |
2 ms |
3004 KB |
Output is correct |
6 |
Correct |
2 ms |
3020 KB |
Output is correct |
7 |
Correct |
2 ms |
3020 KB |
Output is correct |
8 |
Correct |
2 ms |
3020 KB |
Output is correct |
9 |
Correct |
2 ms |
2936 KB |
Output is correct |
10 |
Correct |
2 ms |
3020 KB |
Output is correct |
11 |
Correct |
2 ms |
3020 KB |
Output is correct |
12 |
Correct |
2 ms |
3020 KB |
Output is correct |
13 |
Correct |
2 ms |
3020 KB |
Output is correct |
14 |
Correct |
2 ms |
3020 KB |
Output is correct |
15 |
Correct |
2 ms |
3020 KB |
Output is correct |
16 |
Correct |
2 ms |
3020 KB |
Output is correct |
17 |
Correct |
2 ms |
3020 KB |
Output is correct |
18 |
Correct |
2 ms |
3020 KB |
Output is correct |
19 |
Correct |
2 ms |
3020 KB |
Output is correct |
20 |
Correct |
2 ms |
3020 KB |
Output is correct |
21 |
Correct |
2 ms |
3020 KB |
Output is correct |
22 |
Correct |
2 ms |
3020 KB |
Output is correct |
23 |
Correct |
2 ms |
3020 KB |
Output is correct |
24 |
Correct |
23 ms |
6932 KB |
Output is correct |
25 |
Correct |
24 ms |
6900 KB |
Output is correct |
26 |
Correct |
23 ms |
6860 KB |
Output is correct |
27 |
Correct |
5 ms |
3404 KB |
Output is correct |
28 |
Correct |
5 ms |
3396 KB |
Output is correct |
29 |
Correct |
6 ms |
3148 KB |
Output is correct |
30 |
Correct |
6 ms |
3148 KB |
Output is correct |
31 |
Correct |
6 ms |
3148 KB |
Output is correct |
32 |
Correct |
6 ms |
3148 KB |
Output is correct |
33 |
Correct |
12 ms |
4256 KB |
Output is correct |
34 |
Correct |
14 ms |
4264 KB |
Output is correct |
35 |
Correct |
12 ms |
4300 KB |
Output is correct |
36 |
Correct |
14 ms |
4260 KB |
Output is correct |
37 |
Correct |
12 ms |
4256 KB |
Output is correct |
38 |
Correct |
12 ms |
4300 KB |
Output is correct |
39 |
Correct |
34 ms |
7280 KB |
Output is correct |
40 |
Correct |
31 ms |
7276 KB |
Output is correct |
41 |
Correct |
30 ms |
7236 KB |
Output is correct |
42 |
Correct |
2 ms |
3020 KB |
Output is correct |
43 |
Correct |
3 ms |
3020 KB |
Output is correct |
44 |
Correct |
2 ms |
3020 KB |
Output is correct |
45 |
Correct |
2 ms |
3020 KB |
Output is correct |
46 |
Correct |
2 ms |
3020 KB |
Output is correct |
47 |
Correct |
3 ms |
3020 KB |
Output is correct |
48 |
Correct |
2 ms |
2920 KB |
Output is correct |
49 |
Correct |
2 ms |
3020 KB |
Output is correct |
50 |
Correct |
2 ms |
3020 KB |
Output is correct |
51 |
Correct |
2 ms |
3020 KB |
Output is correct |
52 |
Correct |
2 ms |
3052 KB |
Output is correct |
53 |
Correct |
2 ms |
3020 KB |
Output is correct |
54 |
Correct |
2 ms |
3020 KB |
Output is correct |
55 |
Correct |
2 ms |
3020 KB |
Output is correct |
56 |
Correct |
2 ms |
3020 KB |
Output is correct |
57 |
Correct |
2 ms |
3020 KB |
Output is correct |
58 |
Correct |
2 ms |
3020 KB |
Output is correct |
59 |
Correct |
2 ms |
3020 KB |
Output is correct |
60 |
Correct |
2 ms |
3020 KB |
Output is correct |
61 |
Correct |
2 ms |
3020 KB |
Output is correct |
62 |
Correct |
2 ms |
3020 KB |
Output is correct |
63 |
Correct |
2 ms |
3020 KB |
Output is correct |
64 |
Correct |
2 ms |
3020 KB |
Output is correct |
65 |
Correct |
2 ms |
3020 KB |
Output is correct |
66 |
Correct |
2 ms |
3020 KB |
Output is correct |
67 |
Correct |
2 ms |
3020 KB |
Output is correct |
68 |
Correct |
2 ms |
3020 KB |
Output is correct |
69 |
Correct |
2 ms |
3020 KB |
Output is correct |
70 |
Correct |
2 ms |
3020 KB |
Output is correct |
71 |
Correct |
2 ms |
3020 KB |
Output is correct |
72 |
Correct |
2 ms |
3020 KB |
Output is correct |
73 |
Correct |
2 ms |
3020 KB |
Output is correct |
74 |
Correct |
3 ms |
3020 KB |
Output is correct |
75 |
Correct |
2 ms |
3020 KB |
Output is correct |
76 |
Correct |
2 ms |
3020 KB |
Output is correct |
77 |
Correct |
2 ms |
3020 KB |
Output is correct |
78 |
Correct |
2 ms |
3020 KB |
Output is correct |
79 |
Correct |
2 ms |
3020 KB |
Output is correct |
80 |
Correct |
2 ms |
3020 KB |
Output is correct |
81 |
Correct |
3 ms |
3020 KB |
Output is correct |
82 |
Correct |
3 ms |
3020 KB |
Output is correct |
83 |
Correct |
3 ms |
3020 KB |
Output is correct |
84 |
Correct |
3 ms |
3052 KB |
Output is correct |
85 |
Correct |
4 ms |
3148 KB |
Output is correct |
86 |
Correct |
5 ms |
3276 KB |
Output is correct |
87 |
Correct |
4 ms |
3196 KB |
Output is correct |
88 |
Correct |
3 ms |
3020 KB |
Output is correct |
89 |
Correct |
4 ms |
3148 KB |
Output is correct |
90 |
Correct |
4 ms |
3180 KB |
Output is correct |
91 |
Correct |
27 ms |
5572 KB |
Output is correct |
92 |
Correct |
27 ms |
6036 KB |
Output is correct |
93 |
Correct |
30 ms |
6476 KB |
Output is correct |
94 |
Correct |
4 ms |
3020 KB |
Output is correct |
95 |
Correct |
4 ms |
3020 KB |
Output is correct |
96 |
Correct |
4 ms |
3020 KB |
Output is correct |
97 |
Correct |
4 ms |
3020 KB |
Output is correct |
98 |
Correct |
4 ms |
3020 KB |
Output is correct |
99 |
Correct |
5 ms |
3148 KB |
Output is correct |
100 |
Correct |
5 ms |
3148 KB |
Output is correct |
101 |
Correct |
5 ms |
3148 KB |
Output is correct |
102 |
Correct |
5 ms |
3148 KB |
Output is correct |
103 |
Correct |
5 ms |
3148 KB |
Output is correct |
104 |
Correct |
5 ms |
3148 KB |
Output is correct |
105 |
Correct |
35 ms |
6752 KB |
Output is correct |
106 |
Correct |
34 ms |
6680 KB |
Output is correct |
107 |
Correct |
33 ms |
6724 KB |
Output is correct |
108 |
Correct |
7 ms |
3404 KB |
Output is correct |
109 |
Correct |
197 ms |
3276 KB |
Output is correct |
110 |
Correct |
107 ms |
3240 KB |
Output is correct |
111 |
Correct |
83 ms |
3236 KB |
Output is correct |
112 |
Correct |
98 ms |
3276 KB |
Output is correct |
113 |
Correct |
62 ms |
3276 KB |
Output is correct |
114 |
Correct |
18 ms |
4396 KB |
Output is correct |
115 |
Correct |
18 ms |
4148 KB |
Output is correct |
116 |
Correct |
23 ms |
4496 KB |
Output is correct |
117 |
Correct |
18 ms |
4300 KB |
Output is correct |
118 |
Correct |
29 ms |
4416 KB |
Output is correct |
119 |
Correct |
16 ms |
4172 KB |
Output is correct |
120 |
Correct |
24 ms |
5432 KB |
Output is correct |
121 |
Correct |
8 ms |
3696 KB |
Output is correct |
122 |
Correct |
29 ms |
5632 KB |
Output is correct |
123 |
Correct |
8 ms |
3532 KB |
Output is correct |
124 |
Correct |
35 ms |
6188 KB |
Output is correct |
125 |
Correct |
12 ms |
3900 KB |
Output is correct |
126 |
Correct |
11 ms |
3916 KB |
Output is correct |
127 |
Correct |
21 ms |
4088 KB |
Output is correct |
128 |
Correct |
11 ms |
3788 KB |
Output is correct |
129 |
Correct |
11 ms |
3788 KB |
Output is correct |
130 |
Correct |
7 ms |
3404 KB |
Output is correct |
131 |
Correct |
275 ms |
3396 KB |
Output is correct |
132 |
Correct |
195 ms |
3276 KB |
Output is correct |
133 |
Correct |
163 ms |
3276 KB |
Output is correct |
134 |
Correct |
143 ms |
3276 KB |
Output is correct |
135 |
Correct |
128 ms |
3404 KB |
Output is correct |
136 |
Correct |
25 ms |
4768 KB |
Output is correct |
137 |
Correct |
26 ms |
4812 KB |
Output is correct |
138 |
Correct |
26 ms |
4812 KB |
Output is correct |
139 |
Correct |
28 ms |
4696 KB |
Output is correct |
140 |
Correct |
25 ms |
4836 KB |
Output is correct |
141 |
Correct |
27 ms |
4756 KB |
Output is correct |
142 |
Correct |
50 ms |
7108 KB |
Output is correct |
143 |
Correct |
13 ms |
4044 KB |
Output is correct |
144 |
Correct |
41 ms |
7112 KB |
Output is correct |
145 |
Correct |
13 ms |
4084 KB |
Output is correct |
146 |
Correct |
42 ms |
7112 KB |
Output is correct |
147 |
Correct |
13 ms |
4044 KB |
Output is correct |
148 |
Correct |
15 ms |
4268 KB |
Output is correct |
149 |
Correct |
15 ms |
4300 KB |
Output is correct |
150 |
Correct |
14 ms |
4172 KB |
Output is correct |
151 |
Correct |
14 ms |
4152 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
3020 KB |
Output is correct |
2 |
Correct |
2 ms |
3020 KB |
Output is correct |
3 |
Correct |
2 ms |
3020 KB |
Output is correct |
4 |
Correct |
2 ms |
3020 KB |
Output is correct |
5 |
Correct |
2 ms |
3004 KB |
Output is correct |
6 |
Correct |
2 ms |
3020 KB |
Output is correct |
7 |
Correct |
2 ms |
3020 KB |
Output is correct |
8 |
Correct |
2 ms |
3020 KB |
Output is correct |
9 |
Correct |
2 ms |
2936 KB |
Output is correct |
10 |
Correct |
2 ms |
3020 KB |
Output is correct |
11 |
Correct |
2 ms |
3020 KB |
Output is correct |
12 |
Correct |
2 ms |
3020 KB |
Output is correct |
13 |
Correct |
2 ms |
3020 KB |
Output is correct |
14 |
Correct |
2 ms |
3020 KB |
Output is correct |
15 |
Correct |
2 ms |
3020 KB |
Output is correct |
16 |
Correct |
2 ms |
3020 KB |
Output is correct |
17 |
Correct |
2 ms |
3020 KB |
Output is correct |
18 |
Correct |
2 ms |
3020 KB |
Output is correct |
19 |
Correct |
2 ms |
3020 KB |
Output is correct |
20 |
Correct |
2 ms |
3020 KB |
Output is correct |
21 |
Correct |
2 ms |
3020 KB |
Output is correct |
22 |
Correct |
2 ms |
3020 KB |
Output is correct |
23 |
Correct |
2 ms |
3020 KB |
Output is correct |
24 |
Correct |
23 ms |
6932 KB |
Output is correct |
25 |
Correct |
24 ms |
6900 KB |
Output is correct |
26 |
Correct |
23 ms |
6860 KB |
Output is correct |
27 |
Correct |
5 ms |
3404 KB |
Output is correct |
28 |
Correct |
5 ms |
3396 KB |
Output is correct |
29 |
Correct |
6 ms |
3148 KB |
Output is correct |
30 |
Correct |
6 ms |
3148 KB |
Output is correct |
31 |
Correct |
6 ms |
3148 KB |
Output is correct |
32 |
Correct |
6 ms |
3148 KB |
Output is correct |
33 |
Correct |
12 ms |
4256 KB |
Output is correct |
34 |
Correct |
14 ms |
4264 KB |
Output is correct |
35 |
Correct |
12 ms |
4300 KB |
Output is correct |
36 |
Correct |
14 ms |
4260 KB |
Output is correct |
37 |
Correct |
12 ms |
4256 KB |
Output is correct |
38 |
Correct |
12 ms |
4300 KB |
Output is correct |
39 |
Correct |
34 ms |
7280 KB |
Output is correct |
40 |
Correct |
31 ms |
7276 KB |
Output is correct |
41 |
Correct |
30 ms |
7236 KB |
Output is correct |
42 |
Correct |
17 ms |
4812 KB |
Output is correct |
43 |
Correct |
11 ms |
4080 KB |
Output is correct |
44 |
Correct |
22 ms |
4692 KB |
Output is correct |
45 |
Correct |
15 ms |
3792 KB |
Output is correct |
46 |
Correct |
13 ms |
3744 KB |
Output is correct |
47 |
Correct |
21 ms |
4204 KB |
Output is correct |
48 |
Correct |
56 ms |
12840 KB |
Output is correct |
49 |
Correct |
33 ms |
8524 KB |
Output is correct |
50 |
Correct |
39 ms |
10952 KB |
Output is correct |
51 |
Correct |
52 ms |
10940 KB |
Output is correct |
52 |
Correct |
50 ms |
10548 KB |
Output is correct |
53 |
Correct |
44 ms |
8388 KB |
Output is correct |
54 |
Correct |
19 ms |
4940 KB |
Output is correct |
55 |
Correct |
23 ms |
4940 KB |
Output is correct |
56 |
Correct |
22 ms |
4724 KB |
Output is correct |
57 |
Correct |
21 ms |
4208 KB |
Output is correct |
58 |
Correct |
21 ms |
4212 KB |
Output is correct |
59 |
Correct |
21 ms |
4192 KB |
Output is correct |
60 |
Correct |
61 ms |
13676 KB |
Output is correct |
61 |
Correct |
58 ms |
13764 KB |
Output is correct |
62 |
Correct |
60 ms |
13712 KB |
Output is correct |
63 |
Correct |
60 ms |
13720 KB |
Output is correct |
64 |
Correct |
60 ms |
13692 KB |
Output is correct |
65 |
Correct |
61 ms |
13764 KB |
Output is correct |
66 |
Correct |
71 ms |
12360 KB |
Output is correct |
67 |
Correct |
69 ms |
12324 KB |
Output is correct |
68 |
Correct |
66 ms |
12344 KB |
Output is correct |
69 |
Correct |
2 ms |
3020 KB |
Output is correct |
70 |
Correct |
3 ms |
3020 KB |
Output is correct |
71 |
Correct |
2 ms |
3020 KB |
Output is correct |
72 |
Correct |
2 ms |
3020 KB |
Output is correct |
73 |
Correct |
2 ms |
3020 KB |
Output is correct |
74 |
Correct |
3 ms |
3020 KB |
Output is correct |
75 |
Correct |
2 ms |
2920 KB |
Output is correct |
76 |
Correct |
2 ms |
3020 KB |
Output is correct |
77 |
Correct |
2 ms |
3020 KB |
Output is correct |
78 |
Correct |
2 ms |
3020 KB |
Output is correct |
79 |
Correct |
2 ms |
3052 KB |
Output is correct |
80 |
Correct |
2 ms |
3020 KB |
Output is correct |
81 |
Correct |
2 ms |
3020 KB |
Output is correct |
82 |
Correct |
2 ms |
3020 KB |
Output is correct |
83 |
Correct |
2 ms |
3020 KB |
Output is correct |
84 |
Correct |
2 ms |
3020 KB |
Output is correct |
85 |
Correct |
2 ms |
3020 KB |
Output is correct |
86 |
Correct |
2 ms |
3020 KB |
Output is correct |
87 |
Correct |
2 ms |
3020 KB |
Output is correct |
88 |
Correct |
2 ms |
3020 KB |
Output is correct |
89 |
Correct |
2 ms |
3020 KB |
Output is correct |
90 |
Correct |
2 ms |
3020 KB |
Output is correct |
91 |
Correct |
2 ms |
3020 KB |
Output is correct |
92 |
Correct |
2 ms |
3020 KB |
Output is correct |
93 |
Correct |
2 ms |
3020 KB |
Output is correct |
94 |
Correct |
2 ms |
3020 KB |
Output is correct |
95 |
Correct |
2 ms |
3020 KB |
Output is correct |
96 |
Correct |
2 ms |
3020 KB |
Output is correct |
97 |
Correct |
2 ms |
3020 KB |
Output is correct |
98 |
Correct |
2 ms |
3020 KB |
Output is correct |
99 |
Correct |
2 ms |
3020 KB |
Output is correct |
100 |
Correct |
2 ms |
3020 KB |
Output is correct |
101 |
Correct |
3 ms |
3020 KB |
Output is correct |
102 |
Correct |
2 ms |
3020 KB |
Output is correct |
103 |
Correct |
2 ms |
3020 KB |
Output is correct |
104 |
Correct |
2 ms |
3020 KB |
Output is correct |
105 |
Correct |
2 ms |
3020 KB |
Output is correct |
106 |
Correct |
2 ms |
3020 KB |
Output is correct |
107 |
Correct |
2 ms |
3020 KB |
Output is correct |
108 |
Correct |
3 ms |
3020 KB |
Output is correct |
109 |
Correct |
3 ms |
3020 KB |
Output is correct |
110 |
Correct |
3 ms |
3020 KB |
Output is correct |
111 |
Correct |
3 ms |
3052 KB |
Output is correct |
112 |
Correct |
4 ms |
3148 KB |
Output is correct |
113 |
Correct |
5 ms |
3276 KB |
Output is correct |
114 |
Correct |
4 ms |
3196 KB |
Output is correct |
115 |
Correct |
3 ms |
3020 KB |
Output is correct |
116 |
Correct |
4 ms |
3148 KB |
Output is correct |
117 |
Correct |
4 ms |
3180 KB |
Output is correct |
118 |
Correct |
27 ms |
5572 KB |
Output is correct |
119 |
Correct |
27 ms |
6036 KB |
Output is correct |
120 |
Correct |
30 ms |
6476 KB |
Output is correct |
121 |
Correct |
4 ms |
3020 KB |
Output is correct |
122 |
Correct |
4 ms |
3020 KB |
Output is correct |
123 |
Correct |
4 ms |
3020 KB |
Output is correct |
124 |
Correct |
4 ms |
3020 KB |
Output is correct |
125 |
Correct |
4 ms |
3020 KB |
Output is correct |
126 |
Correct |
5 ms |
3148 KB |
Output is correct |
127 |
Correct |
5 ms |
3148 KB |
Output is correct |
128 |
Correct |
5 ms |
3148 KB |
Output is correct |
129 |
Correct |
5 ms |
3148 KB |
Output is correct |
130 |
Correct |
5 ms |
3148 KB |
Output is correct |
131 |
Correct |
5 ms |
3148 KB |
Output is correct |
132 |
Correct |
35 ms |
6752 KB |
Output is correct |
133 |
Correct |
34 ms |
6680 KB |
Output is correct |
134 |
Correct |
33 ms |
6724 KB |
Output is correct |
135 |
Correct |
7 ms |
3404 KB |
Output is correct |
136 |
Correct |
197 ms |
3276 KB |
Output is correct |
137 |
Correct |
107 ms |
3240 KB |
Output is correct |
138 |
Correct |
83 ms |
3236 KB |
Output is correct |
139 |
Correct |
98 ms |
3276 KB |
Output is correct |
140 |
Correct |
62 ms |
3276 KB |
Output is correct |
141 |
Correct |
18 ms |
4396 KB |
Output is correct |
142 |
Correct |
18 ms |
4148 KB |
Output is correct |
143 |
Correct |
23 ms |
4496 KB |
Output is correct |
144 |
Correct |
18 ms |
4300 KB |
Output is correct |
145 |
Correct |
29 ms |
4416 KB |
Output is correct |
146 |
Correct |
16 ms |
4172 KB |
Output is correct |
147 |
Correct |
24 ms |
5432 KB |
Output is correct |
148 |
Correct |
8 ms |
3696 KB |
Output is correct |
149 |
Correct |
29 ms |
5632 KB |
Output is correct |
150 |
Correct |
8 ms |
3532 KB |
Output is correct |
151 |
Correct |
35 ms |
6188 KB |
Output is correct |
152 |
Correct |
12 ms |
3900 KB |
Output is correct |
153 |
Correct |
11 ms |
3916 KB |
Output is correct |
154 |
Correct |
21 ms |
4088 KB |
Output is correct |
155 |
Correct |
11 ms |
3788 KB |
Output is correct |
156 |
Correct |
11 ms |
3788 KB |
Output is correct |
157 |
Correct |
7 ms |
3404 KB |
Output is correct |
158 |
Correct |
275 ms |
3396 KB |
Output is correct |
159 |
Correct |
195 ms |
3276 KB |
Output is correct |
160 |
Correct |
163 ms |
3276 KB |
Output is correct |
161 |
Correct |
143 ms |
3276 KB |
Output is correct |
162 |
Correct |
128 ms |
3404 KB |
Output is correct |
163 |
Correct |
25 ms |
4768 KB |
Output is correct |
164 |
Correct |
26 ms |
4812 KB |
Output is correct |
165 |
Correct |
26 ms |
4812 KB |
Output is correct |
166 |
Correct |
28 ms |
4696 KB |
Output is correct |
167 |
Correct |
25 ms |
4836 KB |
Output is correct |
168 |
Correct |
27 ms |
4756 KB |
Output is correct |
169 |
Correct |
50 ms |
7108 KB |
Output is correct |
170 |
Correct |
13 ms |
4044 KB |
Output is correct |
171 |
Correct |
41 ms |
7112 KB |
Output is correct |
172 |
Correct |
13 ms |
4084 KB |
Output is correct |
173 |
Correct |
42 ms |
7112 KB |
Output is correct |
174 |
Correct |
13 ms |
4044 KB |
Output is correct |
175 |
Correct |
15 ms |
4268 KB |
Output is correct |
176 |
Correct |
15 ms |
4300 KB |
Output is correct |
177 |
Correct |
14 ms |
4172 KB |
Output is correct |
178 |
Correct |
14 ms |
4152 KB |
Output is correct |
179 |
Correct |
17 ms |
4140 KB |
Output is correct |
180 |
Correct |
558 ms |
4072 KB |
Output is correct |
181 |
Correct |
639 ms |
4016 KB |
Output is correct |
182 |
Correct |
806 ms |
4300 KB |
Output is correct |
183 |
Correct |
410 ms |
4036 KB |
Output is correct |
184 |
Correct |
334 ms |
3884 KB |
Output is correct |
185 |
Correct |
40 ms |
6852 KB |
Output is correct |
186 |
Correct |
37 ms |
8560 KB |
Output is correct |
187 |
Correct |
48 ms |
7532 KB |
Output is correct |
188 |
Correct |
49 ms |
6688 KB |
Output is correct |
189 |
Correct |
53 ms |
7308 KB |
Output is correct |
190 |
Correct |
54 ms |
7748 KB |
Output is correct |
191 |
Correct |
50 ms |
8032 KB |
Output is correct |
192 |
Correct |
39 ms |
6164 KB |
Output is correct |
193 |
Correct |
38 ms |
6112 KB |
Output is correct |
194 |
Correct |
27 ms |
4968 KB |
Output is correct |
195 |
Correct |
1409 ms |
5056 KB |
Output is correct |
196 |
Correct |
1002 ms |
4516 KB |
Output is correct |
197 |
Correct |
827 ms |
4536 KB |
Output is correct |
198 |
Correct |
733 ms |
4580 KB |
Output is correct |
199 |
Correct |
672 ms |
4576 KB |
Output is correct |
200 |
Correct |
85 ms |
15556 KB |
Output is correct |
201 |
Correct |
87 ms |
15556 KB |
Output is correct |
202 |
Correct |
84 ms |
15508 KB |
Output is correct |
203 |
Correct |
84 ms |
15712 KB |
Output is correct |
204 |
Correct |
83 ms |
15500 KB |
Output is correct |
205 |
Correct |
85 ms |
15560 KB |
Output is correct |
206 |
Correct |
83 ms |
13892 KB |
Output is correct |
207 |
Correct |
65 ms |
13804 KB |
Output is correct |
208 |
Correct |
77 ms |
13928 KB |
Output is correct |
209 |
Correct |
65 ms |
13900 KB |
Output is correct |
210 |
Correct |
77 ms |
13956 KB |
Output is correct |
211 |
Correct |
66 ms |
13808 KB |
Output is correct |
212 |
Correct |
70 ms |
15044 KB |
Output is correct |
213 |
Correct |
69 ms |
12052 KB |
Output is correct |
214 |
Correct |
72 ms |
11660 KB |
Output is correct |
215 |
Correct |
73 ms |
11460 KB |
Output is correct |