#include "paint.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define X real()
#define Y imag()
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MOD 1000000007
#define MOD1 1000000009
#define sqr(x) sqr((x)*(x))
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...); }
#ifdef BE_DEBUG
#define debug(...) cerr << "\033[1;31m(" << #__VA_ARGS__ << "):\033[0m", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
vector<int> v[100005];
int cnt[100005];
int level,zereg[30];
vector<int> a[30];
int l,r;
int mn;
void dfs(int k, int x) {
int y = zereg[level-k] * x;
int z = zereg[level-k] * (x + 1) - 1;
if(l <= y && z <= r) {
mn = min(mn,a[k][x]);
return;
}
if(z < l || y > r || k == level) return;
dfs(k + 1, x * 2);
dfs(k + 1, x * 2 + 1);
}
void update(int pos, int val) {
a[level][pos] = val;
for(int i = level - 1; i >= 0; i --) {
pos /= 2;
a[i][pos] = min(a[i + 1][pos * 2],a[i + 1][pos * 2 + 1]);
}
}
int minimumInstructions( int N, int M, int K, std::vector<int> C, std::vector<int> A, std::vector<std::vector<int>> B) {
for(int i = 0; i < M; i ++) {
for(int j = 0; j < B[i].size(); j ++) {
// i-th person likes to paint color B[i][j]
v[B[i][j]].pb(i);
}
}
//
zereg[0] = 1;
for(int i = 0; i <= 30; i ++) {
if(zereg[i] >= N) {
level = i;
break;
}
zereg[i + 1] = zereg[i] * 2;
}
for(int i = 0; i <= level; i ++) {
for(int j = 0; j < zereg[i]; j ++) {
a[i].pb(1e9);
}
}
bool b[3][M + 5];
int pos = 0;
int next;
//
for(int i = 0; i < N; i ++) {
bool check = 0;
int tur;
if(b[pos][M - 1] == 1) tur = cnt[M - 1];
else tur = 0;
//
next = pos + 1;
if(next == 3) next = 0;
//
for(int j = v[C[i]].size() - 1; j >= 0; j --) {
int x = v[C[i]][j];
int pre = x - 1;
if(pre != - 1) {
if(b[pos][pre] == 1) {
cnt[x] = cnt[pre] + 1;
if(cnt[x] >= M) cnt[x] = M;
}
else cnt[x] = 1;
if(cnt[x] == M) check = 1;
b[next][x] = 1;
}
else {
pre = M - 1;
cnt[x] = tur + 1;
if(cnt[x] >= M) cnt[x] = M;
if(cnt[x] == M) check = 1;
b[next][x] = 1;
}
}
if(pos == 1) memset(b[0],0,sizeof(b[0]));
if(pos == 2) memset(b[1],0,sizeof(b[1]));
if(pos == 0) memset(b[2],0,sizeof(b[2]));
pos = next;
if(check == 1) {
if(i == M - 1) {
update(i,1);
continue;
}
l = i - M;
r = i - 1;
mn = 1e9;
dfs(0,0);
update(i,mn + 1);
}
}
if(a[level][N - 1] >= 1e9) return -1;
return a[level][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:58:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
58 | for(int j = 0; j < B[i].size(); j ++) {
| ~~^~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
1 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2644 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
21 ms |
6484 KB |
Output is correct |
23 |
Correct |
26 ms |
6568 KB |
Output is correct |
24 |
Correct |
25 ms |
6476 KB |
Output is correct |
25 |
Correct |
8 ms |
3156 KB |
Output is correct |
26 |
Correct |
7 ms |
3156 KB |
Output is correct |
27 |
Correct |
7 ms |
3156 KB |
Output is correct |
28 |
Correct |
7 ms |
3112 KB |
Output is correct |
29 |
Correct |
4 ms |
3156 KB |
Output is correct |
30 |
Correct |
5 ms |
3080 KB |
Output is correct |
31 |
Correct |
14 ms |
3996 KB |
Output is correct |
32 |
Correct |
14 ms |
4124 KB |
Output is correct |
33 |
Correct |
14 ms |
4052 KB |
Output is correct |
34 |
Correct |
18 ms |
4128 KB |
Output is correct |
35 |
Correct |
13 ms |
4052 KB |
Output is correct |
36 |
Correct |
16 ms |
4056 KB |
Output is correct |
37 |
Correct |
30 ms |
7236 KB |
Output is correct |
38 |
Correct |
35 ms |
7252 KB |
Output is correct |
39 |
Correct |
38 ms |
7192 KB |
Output is correct |
40 |
Correct |
29 ms |
4560 KB |
Output is correct |
41 |
Correct |
17 ms |
3668 KB |
Output is correct |
42 |
Correct |
22 ms |
4688 KB |
Output is correct |
43 |
Correct |
11 ms |
3796 KB |
Output is correct |
44 |
Correct |
8 ms |
3668 KB |
Output is correct |
45 |
Correct |
18 ms |
4736 KB |
Output is correct |
46 |
Correct |
150 ms |
13188 KB |
Output is correct |
47 |
Correct |
81 ms |
8444 KB |
Output is correct |
48 |
Correct |
105 ms |
11080 KB |
Output is correct |
49 |
Correct |
93 ms |
11248 KB |
Output is correct |
50 |
Correct |
99 ms |
11368 KB |
Output is correct |
51 |
Correct |
80 ms |
9116 KB |
Output is correct |
52 |
Correct |
29 ms |
4688 KB |
Output is correct |
53 |
Correct |
30 ms |
4688 KB |
Output is correct |
54 |
Correct |
22 ms |
4716 KB |
Output is correct |
55 |
Correct |
15 ms |
4688 KB |
Output is correct |
56 |
Correct |
13 ms |
4688 KB |
Output is correct |
57 |
Correct |
14 ms |
4688 KB |
Output is correct |
58 |
Correct |
189 ms |
14120 KB |
Output is correct |
59 |
Correct |
189 ms |
13928 KB |
Output is correct |
60 |
Correct |
184 ms |
14004 KB |
Output is correct |
61 |
Correct |
178 ms |
13912 KB |
Output is correct |
62 |
Correct |
181 ms |
14004 KB |
Output is correct |
63 |
Correct |
201 ms |
14008 KB |
Output is correct |
64 |
Correct |
157 ms |
13184 KB |
Output is correct |
65 |
Correct |
148 ms |
13184 KB |
Output is correct |
66 |
Correct |
170 ms |
13180 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
1 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2644 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
3 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2644 KB |
Output is correct |
24 |
Correct |
1 ms |
2644 KB |
Output is correct |
25 |
Correct |
1 ms |
2644 KB |
Output is correct |
26 |
Correct |
1 ms |
2644 KB |
Output is correct |
27 |
Correct |
2 ms |
2644 KB |
Output is correct |
28 |
Correct |
2 ms |
2644 KB |
Output is correct |
29 |
Correct |
2 ms |
2644 KB |
Output is correct |
30 |
Correct |
2 ms |
2644 KB |
Output is correct |
31 |
Correct |
2 ms |
2644 KB |
Output is correct |
32 |
Correct |
2 ms |
2644 KB |
Output is correct |
33 |
Correct |
2 ms |
2644 KB |
Output is correct |
34 |
Correct |
2 ms |
2644 KB |
Output is correct |
35 |
Correct |
2 ms |
2644 KB |
Output is correct |
36 |
Correct |
3 ms |
2644 KB |
Output is correct |
37 |
Correct |
2 ms |
2644 KB |
Output is correct |
38 |
Correct |
2 ms |
2644 KB |
Output is correct |
39 |
Correct |
2 ms |
2644 KB |
Output is correct |
40 |
Correct |
2 ms |
2644 KB |
Output is correct |
41 |
Correct |
2 ms |
2644 KB |
Output is correct |
42 |
Correct |
2 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
2 ms |
2644 KB |
Output is correct |
45 |
Correct |
2 ms |
2644 KB |
Output is correct |
46 |
Correct |
2 ms |
2644 KB |
Output is correct |
47 |
Correct |
2 ms |
2644 KB |
Output is correct |
48 |
Correct |
2 ms |
2644 KB |
Output is correct |
49 |
Correct |
2 ms |
2644 KB |
Output is correct |
50 |
Correct |
2 ms |
2644 KB |
Output is correct |
51 |
Correct |
2 ms |
2644 KB |
Output is correct |
52 |
Correct |
2 ms |
2644 KB |
Output is correct |
53 |
Correct |
2 ms |
2644 KB |
Output is correct |
54 |
Correct |
2 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2644 KB |
Output is correct |
57 |
Correct |
2 ms |
2644 KB |
Output is correct |
58 |
Correct |
2 ms |
2644 KB |
Output is correct |
59 |
Correct |
2 ms |
2572 KB |
Output is correct |
60 |
Correct |
3 ms |
2644 KB |
Output is correct |
61 |
Correct |
2 ms |
2644 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
1 ms |
2644 KB |
Output is correct |
4 |
Correct |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
1 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2644 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2644 KB |
Output is correct |
24 |
Correct |
21 ms |
6484 KB |
Output is correct |
25 |
Correct |
26 ms |
6568 KB |
Output is correct |
26 |
Correct |
25 ms |
6476 KB |
Output is correct |
27 |
Correct |
1 ms |
2644 KB |
Output is correct |
28 |
Correct |
1 ms |
2644 KB |
Output is correct |
29 |
Correct |
1 ms |
2644 KB |
Output is correct |
30 |
Correct |
2 ms |
2644 KB |
Output is correct |
31 |
Correct |
2 ms |
2644 KB |
Output is correct |
32 |
Correct |
2 ms |
2644 KB |
Output is correct |
33 |
Correct |
2 ms |
2644 KB |
Output is correct |
34 |
Correct |
2 ms |
2644 KB |
Output is correct |
35 |
Correct |
2 ms |
2644 KB |
Output is correct |
36 |
Correct |
2 ms |
2644 KB |
Output is correct |
37 |
Correct |
2 ms |
2644 KB |
Output is correct |
38 |
Correct |
2 ms |
2644 KB |
Output is correct |
39 |
Correct |
3 ms |
2644 KB |
Output is correct |
40 |
Correct |
2 ms |
2644 KB |
Output is correct |
41 |
Correct |
2 ms |
2644 KB |
Output is correct |
42 |
Correct |
2 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
2 ms |
2644 KB |
Output is correct |
45 |
Correct |
2 ms |
2644 KB |
Output is correct |
46 |
Correct |
2 ms |
2644 KB |
Output is correct |
47 |
Correct |
2 ms |
2644 KB |
Output is correct |
48 |
Correct |
2 ms |
2644 KB |
Output is correct |
49 |
Correct |
2 ms |
2644 KB |
Output is correct |
50 |
Correct |
2 ms |
2644 KB |
Output is correct |
51 |
Correct |
2 ms |
2644 KB |
Output is correct |
52 |
Correct |
2 ms |
2644 KB |
Output is correct |
53 |
Correct |
2 ms |
2644 KB |
Output is correct |
54 |
Correct |
2 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2644 KB |
Output is correct |
57 |
Correct |
2 ms |
2644 KB |
Output is correct |
58 |
Correct |
2 ms |
2644 KB |
Output is correct |
59 |
Correct |
2 ms |
2644 KB |
Output is correct |
60 |
Correct |
2 ms |
2644 KB |
Output is correct |
61 |
Correct |
2 ms |
2644 KB |
Output is correct |
62 |
Correct |
2 ms |
2572 KB |
Output is correct |
63 |
Correct |
3 ms |
2644 KB |
Output is correct |
64 |
Correct |
2 ms |
2644 KB |
Output is correct |
65 |
Correct |
3 ms |
2644 KB |
Output is correct |
66 |
Correct |
2 ms |
2644 KB |
Output is correct |
67 |
Correct |
2 ms |
2644 KB |
Output is correct |
68 |
Correct |
2 ms |
2644 KB |
Output is correct |
69 |
Correct |
2 ms |
2644 KB |
Output is correct |
70 |
Correct |
4 ms |
2772 KB |
Output is correct |
71 |
Correct |
3 ms |
2772 KB |
Output is correct |
72 |
Correct |
3 ms |
2772 KB |
Output is correct |
73 |
Correct |
2 ms |
2728 KB |
Output is correct |
74 |
Correct |
3 ms |
2772 KB |
Output is correct |
75 |
Correct |
3 ms |
2772 KB |
Output is correct |
76 |
Correct |
21 ms |
5204 KB |
Output is correct |
77 |
Correct |
17 ms |
5680 KB |
Output is correct |
78 |
Correct |
26 ms |
6088 KB |
Output is correct |
79 |
Correct |
3 ms |
2644 KB |
Output is correct |
80 |
Correct |
2 ms |
2644 KB |
Output is correct |
81 |
Correct |
3 ms |
2644 KB |
Output is correct |
82 |
Correct |
3 ms |
2644 KB |
Output is correct |
83 |
Correct |
3 ms |
2644 KB |
Output is correct |
84 |
Correct |
4 ms |
2772 KB |
Output is correct |
85 |
Correct |
4 ms |
2892 KB |
Output is correct |
86 |
Correct |
3 ms |
2772 KB |
Output is correct |
87 |
Correct |
3 ms |
2860 KB |
Output is correct |
88 |
Correct |
3 ms |
2772 KB |
Output is correct |
89 |
Correct |
4 ms |
2772 KB |
Output is correct |
90 |
Correct |
39 ms |
6352 KB |
Output is correct |
91 |
Correct |
39 ms |
6356 KB |
Output is correct |
92 |
Correct |
39 ms |
6396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
1 ms |
2644 KB |
Output is correct |
4 |
Correct |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
1 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2644 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2644 KB |
Output is correct |
24 |
Correct |
21 ms |
6484 KB |
Output is correct |
25 |
Correct |
26 ms |
6568 KB |
Output is correct |
26 |
Correct |
25 ms |
6476 KB |
Output is correct |
27 |
Correct |
8 ms |
3156 KB |
Output is correct |
28 |
Correct |
7 ms |
3156 KB |
Output is correct |
29 |
Correct |
7 ms |
3156 KB |
Output is correct |
30 |
Correct |
7 ms |
3112 KB |
Output is correct |
31 |
Correct |
4 ms |
3156 KB |
Output is correct |
32 |
Correct |
5 ms |
3080 KB |
Output is correct |
33 |
Correct |
14 ms |
3996 KB |
Output is correct |
34 |
Correct |
14 ms |
4124 KB |
Output is correct |
35 |
Correct |
14 ms |
4052 KB |
Output is correct |
36 |
Correct |
18 ms |
4128 KB |
Output is correct |
37 |
Correct |
13 ms |
4052 KB |
Output is correct |
38 |
Correct |
16 ms |
4056 KB |
Output is correct |
39 |
Correct |
30 ms |
7236 KB |
Output is correct |
40 |
Correct |
35 ms |
7252 KB |
Output is correct |
41 |
Correct |
38 ms |
7192 KB |
Output is correct |
42 |
Correct |
1 ms |
2644 KB |
Output is correct |
43 |
Correct |
1 ms |
2644 KB |
Output is correct |
44 |
Correct |
1 ms |
2644 KB |
Output is correct |
45 |
Correct |
2 ms |
2644 KB |
Output is correct |
46 |
Correct |
2 ms |
2644 KB |
Output is correct |
47 |
Correct |
2 ms |
2644 KB |
Output is correct |
48 |
Correct |
2 ms |
2644 KB |
Output is correct |
49 |
Correct |
2 ms |
2644 KB |
Output is correct |
50 |
Correct |
2 ms |
2644 KB |
Output is correct |
51 |
Correct |
2 ms |
2644 KB |
Output is correct |
52 |
Correct |
2 ms |
2644 KB |
Output is correct |
53 |
Correct |
2 ms |
2644 KB |
Output is correct |
54 |
Correct |
3 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2644 KB |
Output is correct |
57 |
Correct |
2 ms |
2644 KB |
Output is correct |
58 |
Correct |
2 ms |
2644 KB |
Output is correct |
59 |
Correct |
2 ms |
2644 KB |
Output is correct |
60 |
Correct |
2 ms |
2644 KB |
Output is correct |
61 |
Correct |
2 ms |
2644 KB |
Output is correct |
62 |
Correct |
2 ms |
2644 KB |
Output is correct |
63 |
Correct |
2 ms |
2644 KB |
Output is correct |
64 |
Correct |
2 ms |
2644 KB |
Output is correct |
65 |
Correct |
2 ms |
2644 KB |
Output is correct |
66 |
Correct |
2 ms |
2644 KB |
Output is correct |
67 |
Correct |
2 ms |
2644 KB |
Output is correct |
68 |
Correct |
2 ms |
2644 KB |
Output is correct |
69 |
Correct |
2 ms |
2644 KB |
Output is correct |
70 |
Correct |
2 ms |
2644 KB |
Output is correct |
71 |
Correct |
2 ms |
2644 KB |
Output is correct |
72 |
Correct |
2 ms |
2644 KB |
Output is correct |
73 |
Correct |
2 ms |
2644 KB |
Output is correct |
74 |
Correct |
2 ms |
2644 KB |
Output is correct |
75 |
Correct |
2 ms |
2644 KB |
Output is correct |
76 |
Correct |
2 ms |
2644 KB |
Output is correct |
77 |
Correct |
2 ms |
2572 KB |
Output is correct |
78 |
Correct |
3 ms |
2644 KB |
Output is correct |
79 |
Correct |
2 ms |
2644 KB |
Output is correct |
80 |
Correct |
3 ms |
2644 KB |
Output is correct |
81 |
Correct |
2 ms |
2644 KB |
Output is correct |
82 |
Correct |
2 ms |
2644 KB |
Output is correct |
83 |
Correct |
2 ms |
2644 KB |
Output is correct |
84 |
Correct |
2 ms |
2644 KB |
Output is correct |
85 |
Correct |
4 ms |
2772 KB |
Output is correct |
86 |
Correct |
3 ms |
2772 KB |
Output is correct |
87 |
Correct |
3 ms |
2772 KB |
Output is correct |
88 |
Correct |
2 ms |
2728 KB |
Output is correct |
89 |
Correct |
3 ms |
2772 KB |
Output is correct |
90 |
Correct |
3 ms |
2772 KB |
Output is correct |
91 |
Correct |
21 ms |
5204 KB |
Output is correct |
92 |
Correct |
17 ms |
5680 KB |
Output is correct |
93 |
Correct |
26 ms |
6088 KB |
Output is correct |
94 |
Correct |
3 ms |
2644 KB |
Output is correct |
95 |
Correct |
2 ms |
2644 KB |
Output is correct |
96 |
Correct |
3 ms |
2644 KB |
Output is correct |
97 |
Correct |
3 ms |
2644 KB |
Output is correct |
98 |
Correct |
3 ms |
2644 KB |
Output is correct |
99 |
Correct |
4 ms |
2772 KB |
Output is correct |
100 |
Correct |
4 ms |
2892 KB |
Output is correct |
101 |
Correct |
3 ms |
2772 KB |
Output is correct |
102 |
Correct |
3 ms |
2860 KB |
Output is correct |
103 |
Correct |
3 ms |
2772 KB |
Output is correct |
104 |
Correct |
4 ms |
2772 KB |
Output is correct |
105 |
Correct |
39 ms |
6352 KB |
Output is correct |
106 |
Correct |
39 ms |
6356 KB |
Output is correct |
107 |
Correct |
39 ms |
6396 KB |
Output is correct |
108 |
Correct |
7 ms |
3156 KB |
Output is correct |
109 |
Correct |
66 ms |
3028 KB |
Output is correct |
110 |
Correct |
40 ms |
2900 KB |
Output is correct |
111 |
Correct |
32 ms |
3004 KB |
Output is correct |
112 |
Correct |
43 ms |
3044 KB |
Output is correct |
113 |
Correct |
34 ms |
3028 KB |
Output is correct |
114 |
Correct |
25 ms |
4052 KB |
Output is correct |
115 |
Correct |
14 ms |
3892 KB |
Output is correct |
116 |
Correct |
19 ms |
4308 KB |
Output is correct |
117 |
Correct |
14 ms |
4028 KB |
Output is correct |
118 |
Correct |
16 ms |
4052 KB |
Output is correct |
119 |
Correct |
15 ms |
3824 KB |
Output is correct |
120 |
Correct |
19 ms |
5296 KB |
Output is correct |
121 |
Correct |
8 ms |
3364 KB |
Output is correct |
122 |
Correct |
20 ms |
5496 KB |
Output is correct |
123 |
Correct |
8 ms |
3284 KB |
Output is correct |
124 |
Correct |
24 ms |
6080 KB |
Output is correct |
125 |
Correct |
12 ms |
3668 KB |
Output is correct |
126 |
Correct |
10 ms |
3540 KB |
Output is correct |
127 |
Correct |
13 ms |
4008 KB |
Output is correct |
128 |
Correct |
8 ms |
3540 KB |
Output is correct |
129 |
Correct |
8 ms |
3540 KB |
Output is correct |
130 |
Correct |
8 ms |
3156 KB |
Output is correct |
131 |
Correct |
97 ms |
3284 KB |
Output is correct |
132 |
Correct |
74 ms |
3284 KB |
Output is correct |
133 |
Correct |
70 ms |
3284 KB |
Output is correct |
134 |
Correct |
65 ms |
3244 KB |
Output is correct |
135 |
Correct |
64 ms |
3332 KB |
Output is correct |
136 |
Correct |
26 ms |
4564 KB |
Output is correct |
137 |
Correct |
26 ms |
4536 KB |
Output is correct |
138 |
Correct |
22 ms |
4604 KB |
Output is correct |
139 |
Correct |
23 ms |
4508 KB |
Output is correct |
140 |
Correct |
22 ms |
4564 KB |
Output is correct |
141 |
Correct |
21 ms |
4580 KB |
Output is correct |
142 |
Correct |
36 ms |
7096 KB |
Output is correct |
143 |
Correct |
14 ms |
3796 KB |
Output is correct |
144 |
Correct |
32 ms |
7060 KB |
Output is correct |
145 |
Correct |
17 ms |
3884 KB |
Output is correct |
146 |
Correct |
39 ms |
6980 KB |
Output is correct |
147 |
Correct |
15 ms |
3852 KB |
Output is correct |
148 |
Correct |
11 ms |
4180 KB |
Output is correct |
149 |
Correct |
10 ms |
4052 KB |
Output is correct |
150 |
Correct |
11 ms |
4004 KB |
Output is correct |
151 |
Correct |
9 ms |
4012 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
1 ms |
2644 KB |
Output is correct |
4 |
Correct |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
1 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2644 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2644 KB |
Output is correct |
24 |
Correct |
21 ms |
6484 KB |
Output is correct |
25 |
Correct |
26 ms |
6568 KB |
Output is correct |
26 |
Correct |
25 ms |
6476 KB |
Output is correct |
27 |
Correct |
8 ms |
3156 KB |
Output is correct |
28 |
Correct |
7 ms |
3156 KB |
Output is correct |
29 |
Correct |
7 ms |
3156 KB |
Output is correct |
30 |
Correct |
7 ms |
3112 KB |
Output is correct |
31 |
Correct |
4 ms |
3156 KB |
Output is correct |
32 |
Correct |
5 ms |
3080 KB |
Output is correct |
33 |
Correct |
14 ms |
3996 KB |
Output is correct |
34 |
Correct |
14 ms |
4124 KB |
Output is correct |
35 |
Correct |
14 ms |
4052 KB |
Output is correct |
36 |
Correct |
18 ms |
4128 KB |
Output is correct |
37 |
Correct |
13 ms |
4052 KB |
Output is correct |
38 |
Correct |
16 ms |
4056 KB |
Output is correct |
39 |
Correct |
30 ms |
7236 KB |
Output is correct |
40 |
Correct |
35 ms |
7252 KB |
Output is correct |
41 |
Correct |
38 ms |
7192 KB |
Output is correct |
42 |
Correct |
29 ms |
4560 KB |
Output is correct |
43 |
Correct |
17 ms |
3668 KB |
Output is correct |
44 |
Correct |
22 ms |
4688 KB |
Output is correct |
45 |
Correct |
11 ms |
3796 KB |
Output is correct |
46 |
Correct |
8 ms |
3668 KB |
Output is correct |
47 |
Correct |
18 ms |
4736 KB |
Output is correct |
48 |
Correct |
150 ms |
13188 KB |
Output is correct |
49 |
Correct |
81 ms |
8444 KB |
Output is correct |
50 |
Correct |
105 ms |
11080 KB |
Output is correct |
51 |
Correct |
93 ms |
11248 KB |
Output is correct |
52 |
Correct |
99 ms |
11368 KB |
Output is correct |
53 |
Correct |
80 ms |
9116 KB |
Output is correct |
54 |
Correct |
29 ms |
4688 KB |
Output is correct |
55 |
Correct |
30 ms |
4688 KB |
Output is correct |
56 |
Correct |
22 ms |
4716 KB |
Output is correct |
57 |
Correct |
15 ms |
4688 KB |
Output is correct |
58 |
Correct |
13 ms |
4688 KB |
Output is correct |
59 |
Correct |
14 ms |
4688 KB |
Output is correct |
60 |
Correct |
189 ms |
14120 KB |
Output is correct |
61 |
Correct |
189 ms |
13928 KB |
Output is correct |
62 |
Correct |
184 ms |
14004 KB |
Output is correct |
63 |
Correct |
178 ms |
13912 KB |
Output is correct |
64 |
Correct |
181 ms |
14004 KB |
Output is correct |
65 |
Correct |
201 ms |
14008 KB |
Output is correct |
66 |
Correct |
157 ms |
13184 KB |
Output is correct |
67 |
Correct |
148 ms |
13184 KB |
Output is correct |
68 |
Correct |
170 ms |
13180 KB |
Output is correct |
69 |
Correct |
1 ms |
2644 KB |
Output is correct |
70 |
Correct |
1 ms |
2644 KB |
Output is correct |
71 |
Correct |
1 ms |
2644 KB |
Output is correct |
72 |
Correct |
2 ms |
2644 KB |
Output is correct |
73 |
Correct |
2 ms |
2644 KB |
Output is correct |
74 |
Correct |
2 ms |
2644 KB |
Output is correct |
75 |
Correct |
2 ms |
2644 KB |
Output is correct |
76 |
Correct |
2 ms |
2644 KB |
Output is correct |
77 |
Correct |
2 ms |
2644 KB |
Output is correct |
78 |
Correct |
2 ms |
2644 KB |
Output is correct |
79 |
Correct |
2 ms |
2644 KB |
Output is correct |
80 |
Correct |
2 ms |
2644 KB |
Output is correct |
81 |
Correct |
3 ms |
2644 KB |
Output is correct |
82 |
Correct |
2 ms |
2644 KB |
Output is correct |
83 |
Correct |
2 ms |
2644 KB |
Output is correct |
84 |
Correct |
2 ms |
2644 KB |
Output is correct |
85 |
Correct |
2 ms |
2644 KB |
Output is correct |
86 |
Correct |
2 ms |
2644 KB |
Output is correct |
87 |
Correct |
2 ms |
2644 KB |
Output is correct |
88 |
Correct |
2 ms |
2644 KB |
Output is correct |
89 |
Correct |
2 ms |
2644 KB |
Output is correct |
90 |
Correct |
2 ms |
2644 KB |
Output is correct |
91 |
Correct |
2 ms |
2644 KB |
Output is correct |
92 |
Correct |
2 ms |
2644 KB |
Output is correct |
93 |
Correct |
2 ms |
2644 KB |
Output is correct |
94 |
Correct |
2 ms |
2644 KB |
Output is correct |
95 |
Correct |
2 ms |
2644 KB |
Output is correct |
96 |
Correct |
2 ms |
2644 KB |
Output is correct |
97 |
Correct |
2 ms |
2644 KB |
Output is correct |
98 |
Correct |
2 ms |
2644 KB |
Output is correct |
99 |
Correct |
2 ms |
2644 KB |
Output is correct |
100 |
Correct |
2 ms |
2644 KB |
Output is correct |
101 |
Correct |
2 ms |
2644 KB |
Output is correct |
102 |
Correct |
2 ms |
2644 KB |
Output is correct |
103 |
Correct |
2 ms |
2644 KB |
Output is correct |
104 |
Correct |
2 ms |
2572 KB |
Output is correct |
105 |
Correct |
3 ms |
2644 KB |
Output is correct |
106 |
Correct |
2 ms |
2644 KB |
Output is correct |
107 |
Correct |
3 ms |
2644 KB |
Output is correct |
108 |
Correct |
2 ms |
2644 KB |
Output is correct |
109 |
Correct |
2 ms |
2644 KB |
Output is correct |
110 |
Correct |
2 ms |
2644 KB |
Output is correct |
111 |
Correct |
2 ms |
2644 KB |
Output is correct |
112 |
Correct |
4 ms |
2772 KB |
Output is correct |
113 |
Correct |
3 ms |
2772 KB |
Output is correct |
114 |
Correct |
3 ms |
2772 KB |
Output is correct |
115 |
Correct |
2 ms |
2728 KB |
Output is correct |
116 |
Correct |
3 ms |
2772 KB |
Output is correct |
117 |
Correct |
3 ms |
2772 KB |
Output is correct |
118 |
Correct |
21 ms |
5204 KB |
Output is correct |
119 |
Correct |
17 ms |
5680 KB |
Output is correct |
120 |
Correct |
26 ms |
6088 KB |
Output is correct |
121 |
Correct |
3 ms |
2644 KB |
Output is correct |
122 |
Correct |
2 ms |
2644 KB |
Output is correct |
123 |
Correct |
3 ms |
2644 KB |
Output is correct |
124 |
Correct |
3 ms |
2644 KB |
Output is correct |
125 |
Correct |
3 ms |
2644 KB |
Output is correct |
126 |
Correct |
4 ms |
2772 KB |
Output is correct |
127 |
Correct |
4 ms |
2892 KB |
Output is correct |
128 |
Correct |
3 ms |
2772 KB |
Output is correct |
129 |
Correct |
3 ms |
2860 KB |
Output is correct |
130 |
Correct |
3 ms |
2772 KB |
Output is correct |
131 |
Correct |
4 ms |
2772 KB |
Output is correct |
132 |
Correct |
39 ms |
6352 KB |
Output is correct |
133 |
Correct |
39 ms |
6356 KB |
Output is correct |
134 |
Correct |
39 ms |
6396 KB |
Output is correct |
135 |
Correct |
7 ms |
3156 KB |
Output is correct |
136 |
Correct |
66 ms |
3028 KB |
Output is correct |
137 |
Correct |
40 ms |
2900 KB |
Output is correct |
138 |
Correct |
32 ms |
3004 KB |
Output is correct |
139 |
Correct |
43 ms |
3044 KB |
Output is correct |
140 |
Correct |
34 ms |
3028 KB |
Output is correct |
141 |
Correct |
25 ms |
4052 KB |
Output is correct |
142 |
Correct |
14 ms |
3892 KB |
Output is correct |
143 |
Correct |
19 ms |
4308 KB |
Output is correct |
144 |
Correct |
14 ms |
4028 KB |
Output is correct |
145 |
Correct |
16 ms |
4052 KB |
Output is correct |
146 |
Correct |
15 ms |
3824 KB |
Output is correct |
147 |
Correct |
19 ms |
5296 KB |
Output is correct |
148 |
Correct |
8 ms |
3364 KB |
Output is correct |
149 |
Correct |
20 ms |
5496 KB |
Output is correct |
150 |
Correct |
8 ms |
3284 KB |
Output is correct |
151 |
Correct |
24 ms |
6080 KB |
Output is correct |
152 |
Correct |
12 ms |
3668 KB |
Output is correct |
153 |
Correct |
10 ms |
3540 KB |
Output is correct |
154 |
Correct |
13 ms |
4008 KB |
Output is correct |
155 |
Correct |
8 ms |
3540 KB |
Output is correct |
156 |
Correct |
8 ms |
3540 KB |
Output is correct |
157 |
Correct |
8 ms |
3156 KB |
Output is correct |
158 |
Correct |
97 ms |
3284 KB |
Output is correct |
159 |
Correct |
74 ms |
3284 KB |
Output is correct |
160 |
Correct |
70 ms |
3284 KB |
Output is correct |
161 |
Correct |
65 ms |
3244 KB |
Output is correct |
162 |
Correct |
64 ms |
3332 KB |
Output is correct |
163 |
Correct |
26 ms |
4564 KB |
Output is correct |
164 |
Correct |
26 ms |
4536 KB |
Output is correct |
165 |
Correct |
22 ms |
4604 KB |
Output is correct |
166 |
Correct |
23 ms |
4508 KB |
Output is correct |
167 |
Correct |
22 ms |
4564 KB |
Output is correct |
168 |
Correct |
21 ms |
4580 KB |
Output is correct |
169 |
Correct |
36 ms |
7096 KB |
Output is correct |
170 |
Correct |
14 ms |
3796 KB |
Output is correct |
171 |
Correct |
32 ms |
7060 KB |
Output is correct |
172 |
Correct |
17 ms |
3884 KB |
Output is correct |
173 |
Correct |
39 ms |
6980 KB |
Output is correct |
174 |
Correct |
15 ms |
3852 KB |
Output is correct |
175 |
Correct |
11 ms |
4180 KB |
Output is correct |
176 |
Correct |
10 ms |
4052 KB |
Output is correct |
177 |
Correct |
11 ms |
4004 KB |
Output is correct |
178 |
Correct |
9 ms |
4012 KB |
Output is correct |
179 |
Correct |
19 ms |
3800 KB |
Output is correct |
180 |
Correct |
187 ms |
3768 KB |
Output is correct |
181 |
Correct |
241 ms |
4716 KB |
Output is correct |
182 |
Correct |
328 ms |
4944 KB |
Output is correct |
183 |
Correct |
169 ms |
4072 KB |
Output is correct |
184 |
Correct |
148 ms |
4072 KB |
Output is correct |
185 |
Correct |
76 ms |
7508 KB |
Output is correct |
186 |
Correct |
70 ms |
9068 KB |
Output is correct |
187 |
Correct |
65 ms |
8312 KB |
Output is correct |
188 |
Correct |
47 ms |
8424 KB |
Output is correct |
189 |
Correct |
77 ms |
8260 KB |
Output is correct |
190 |
Correct |
75 ms |
9620 KB |
Output is correct |
191 |
Correct |
86 ms |
9200 KB |
Output is correct |
192 |
Correct |
27 ms |
7624 KB |
Output is correct |
193 |
Correct |
43 ms |
7000 KB |
Output is correct |
194 |
Correct |
33 ms |
4932 KB |
Output is correct |
195 |
Correct |
451 ms |
4944 KB |
Output is correct |
196 |
Correct |
367 ms |
5060 KB |
Output is correct |
197 |
Correct |
350 ms |
5072 KB |
Output is correct |
198 |
Correct |
291 ms |
5036 KB |
Output is correct |
199 |
Correct |
279 ms |
5052 KB |
Output is correct |
200 |
Correct |
238 ms |
15900 KB |
Output is correct |
201 |
Correct |
223 ms |
15828 KB |
Output is correct |
202 |
Correct |
205 ms |
15832 KB |
Output is correct |
203 |
Correct |
224 ms |
15848 KB |
Output is correct |
204 |
Correct |
203 ms |
15828 KB |
Output is correct |
205 |
Correct |
203 ms |
15792 KB |
Output is correct |
206 |
Correct |
194 ms |
14792 KB |
Output is correct |
207 |
Correct |
182 ms |
14100 KB |
Output is correct |
208 |
Correct |
165 ms |
14684 KB |
Output is correct |
209 |
Correct |
189 ms |
14152 KB |
Output is correct |
210 |
Correct |
190 ms |
14844 KB |
Output is correct |
211 |
Correct |
176 ms |
14104 KB |
Output is correct |
212 |
Correct |
218 ms |
15620 KB |
Output is correct |
213 |
Correct |
118 ms |
12292 KB |
Output is correct |
214 |
Correct |
91 ms |
11796 KB |
Output is correct |
215 |
Correct |
100 ms |
11660 KB |
Output is correct |