#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 tur[100005];
int cnt[100005];
int level,zereg[30];
vector<int> a[30];
int l,r;
int mn;
map<int,bool> mp,mm;
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);
}
}
//
for(int i = 0; i < N; i ++) {
bool check = 0;
int tur;
if(mm[M - 1] == 1) tur = cnt[M - 1];
else tur = 0;
//debug(i);
for(int j = v[C[i]].size() - 1; j >= 0; j --) {
int x = v[C[i]][j];
//debug(x);
int pre = x - 1;
if(pre != - 1) {
if(mm[pre] == 1) {
cnt[x] = cnt[pre] + 1;
if(cnt[x] >= M) cnt[x] = M;
}
else cnt[x] = 1;
if(cnt[x] == M) check = 1;
mp[x] = 1;
}
else {
pre = M - 1;
cnt[x] = tur + 1;
if(cnt[x] >= M) cnt[x] = M;
if(cnt[x] == M) check = 1;
mp[x] = 1;
}
}
/*
for(int j = 0; j < M; j ++) {
cout << j <<": " << mp[j] << ' ';
if(mp[j] == 1) cout << cnt[j];
else cout << 0;
cout << "\n";
}
*/
mm = mp;
mp.clear();
if(check == 1) {
//debug("WTF");
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:61:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
61 | for(int j = 0; j < B[i].size(); j ++) {
| ~~^~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2656 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
3 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 |
2660 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 |
2668 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 |
2672 KB |
Output is correct |
21 |
Correct |
2 ms |
2668 KB |
Output is correct |
22 |
Correct |
18 ms |
6856 KB |
Output is correct |
23 |
Correct |
18 ms |
6932 KB |
Output is correct |
24 |
Correct |
20 ms |
6980 KB |
Output is correct |
25 |
Correct |
9 ms |
3156 KB |
Output is correct |
26 |
Correct |
11 ms |
3184 KB |
Output is correct |
27 |
Correct |
7 ms |
3156 KB |
Output is correct |
28 |
Correct |
7 ms |
3156 KB |
Output is correct |
29 |
Correct |
6 ms |
3188 KB |
Output is correct |
30 |
Correct |
6 ms |
3156 KB |
Output is correct |
31 |
Correct |
15 ms |
4308 KB |
Output is correct |
32 |
Correct |
14 ms |
4308 KB |
Output is correct |
33 |
Correct |
15 ms |
4308 KB |
Output is correct |
34 |
Correct |
14 ms |
4252 KB |
Output is correct |
35 |
Correct |
16 ms |
4356 KB |
Output is correct |
36 |
Correct |
15 ms |
4308 KB |
Output is correct |
37 |
Correct |
26 ms |
7580 KB |
Output is correct |
38 |
Correct |
24 ms |
7588 KB |
Output is correct |
39 |
Correct |
26 ms |
7616 KB |
Output is correct |
40 |
Correct |
32 ms |
4816 KB |
Output is correct |
41 |
Correct |
21 ms |
3824 KB |
Output is correct |
42 |
Correct |
34 ms |
4912 KB |
Output is correct |
43 |
Correct |
18 ms |
3948 KB |
Output is correct |
44 |
Correct |
14 ms |
3796 KB |
Output is correct |
45 |
Correct |
24 ms |
4916 KB |
Output is correct |
46 |
Correct |
65 ms |
13388 KB |
Output is correct |
47 |
Correct |
45 ms |
9032 KB |
Output is correct |
48 |
Correct |
38 ms |
11824 KB |
Output is correct |
49 |
Correct |
45 ms |
11976 KB |
Output is correct |
50 |
Correct |
51 ms |
12364 KB |
Output is correct |
51 |
Correct |
39 ms |
9860 KB |
Output is correct |
52 |
Correct |
35 ms |
4844 KB |
Output is correct |
53 |
Correct |
34 ms |
4916 KB |
Output is correct |
54 |
Correct |
30 ms |
4816 KB |
Output is correct |
55 |
Correct |
24 ms |
4944 KB |
Output is correct |
56 |
Correct |
27 ms |
4840 KB |
Output is correct |
57 |
Correct |
24 ms |
4816 KB |
Output is correct |
58 |
Correct |
73 ms |
14988 KB |
Output is correct |
59 |
Correct |
66 ms |
15104 KB |
Output is correct |
60 |
Correct |
68 ms |
15008 KB |
Output is correct |
61 |
Correct |
71 ms |
15108 KB |
Output is correct |
62 |
Correct |
72 ms |
15004 KB |
Output is correct |
63 |
Correct |
67 ms |
15000 KB |
Output is correct |
64 |
Correct |
62 ms |
14292 KB |
Output is correct |
65 |
Correct |
59 ms |
14212 KB |
Output is correct |
66 |
Correct |
59 ms |
14300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2656 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
3 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 |
2660 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 |
2668 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 |
2672 KB |
Output is correct |
21 |
Correct |
2 ms |
2668 KB |
Output is correct |
22 |
Correct |
2 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 |
2 ms |
2644 KB |
Output is correct |
26 |
Correct |
2 ms |
2664 KB |
Output is correct |
27 |
Correct |
2 ms |
2548 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 |
2772 KB |
Output is correct |
32 |
Correct |
2 ms |
2660 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 |
2664 KB |
Output is correct |
37 |
Correct |
2 ms |
2644 KB |
Output is correct |
38 |
Correct |
2 ms |
2660 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 |
2660 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
2 ms |
2644 KB |
Output is correct |
45 |
Correct |
3 ms |
2644 KB |
Output is correct |
46 |
Correct |
3 ms |
2644 KB |
Output is correct |
47 |
Correct |
3 ms |
2656 KB |
Output is correct |
48 |
Correct |
3 ms |
2660 KB |
Output is correct |
49 |
Correct |
3 ms |
2644 KB |
Output is correct |
50 |
Correct |
3 ms |
2644 KB |
Output is correct |
51 |
Correct |
2 ms |
2664 KB |
Output is correct |
52 |
Correct |
2 ms |
2644 KB |
Output is correct |
53 |
Correct |
2 ms |
2664 KB |
Output is correct |
54 |
Correct |
2 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2660 KB |
Output is correct |
56 |
Correct |
2 ms |
2668 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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2656 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
1 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
3 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 |
2660 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 |
2668 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 |
2672 KB |
Output is correct |
23 |
Correct |
2 ms |
2668 KB |
Output is correct |
24 |
Correct |
18 ms |
6856 KB |
Output is correct |
25 |
Correct |
18 ms |
6932 KB |
Output is correct |
26 |
Correct |
20 ms |
6980 KB |
Output is correct |
27 |
Correct |
1 ms |
2644 KB |
Output is correct |
28 |
Correct |
2 ms |
2644 KB |
Output is correct |
29 |
Correct |
2 ms |
2664 KB |
Output is correct |
30 |
Correct |
2 ms |
2548 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 |
2772 KB |
Output is correct |
35 |
Correct |
2 ms |
2660 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 |
2 ms |
2664 KB |
Output is correct |
40 |
Correct |
2 ms |
2644 KB |
Output is correct |
41 |
Correct |
2 ms |
2660 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 |
2660 KB |
Output is correct |
46 |
Correct |
2 ms |
2644 KB |
Output is correct |
47 |
Correct |
2 ms |
2644 KB |
Output is correct |
48 |
Correct |
3 ms |
2644 KB |
Output is correct |
49 |
Correct |
3 ms |
2644 KB |
Output is correct |
50 |
Correct |
3 ms |
2656 KB |
Output is correct |
51 |
Correct |
3 ms |
2660 KB |
Output is correct |
52 |
Correct |
3 ms |
2644 KB |
Output is correct |
53 |
Correct |
3 ms |
2644 KB |
Output is correct |
54 |
Correct |
2 ms |
2664 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2664 KB |
Output is correct |
57 |
Correct |
2 ms |
2644 KB |
Output is correct |
58 |
Correct |
2 ms |
2660 KB |
Output is correct |
59 |
Correct |
2 ms |
2668 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 |
7 ms |
2644 KB |
Output is correct |
66 |
Correct |
3 ms |
2644 KB |
Output is correct |
67 |
Correct |
7 ms |
2644 KB |
Output is correct |
68 |
Correct |
5 ms |
2660 KB |
Output is correct |
69 |
Correct |
6 ms |
2644 KB |
Output is correct |
70 |
Correct |
4 ms |
2860 KB |
Output is correct |
71 |
Correct |
4 ms |
2900 KB |
Output is correct |
72 |
Correct |
4 ms |
2800 KB |
Output is correct |
73 |
Correct |
3 ms |
2772 KB |
Output is correct |
74 |
Correct |
4 ms |
2900 KB |
Output is correct |
75 |
Correct |
4 ms |
2800 KB |
Output is correct |
76 |
Correct |
19 ms |
5732 KB |
Output is correct |
77 |
Correct |
18 ms |
6228 KB |
Output is correct |
78 |
Correct |
23 ms |
6548 KB |
Output is correct |
79 |
Correct |
12 ms |
2644 KB |
Output is correct |
80 |
Correct |
11 ms |
2644 KB |
Output is correct |
81 |
Correct |
14 ms |
2644 KB |
Output is correct |
82 |
Correct |
11 ms |
2664 KB |
Output is correct |
83 |
Correct |
11 ms |
2648 KB |
Output is correct |
84 |
Correct |
5 ms |
2900 KB |
Output is correct |
85 |
Correct |
5 ms |
3032 KB |
Output is correct |
86 |
Correct |
4 ms |
2884 KB |
Output is correct |
87 |
Correct |
4 ms |
2900 KB |
Output is correct |
88 |
Correct |
5 ms |
2900 KB |
Output is correct |
89 |
Correct |
5 ms |
2924 KB |
Output is correct |
90 |
Correct |
27 ms |
6812 KB |
Output is correct |
91 |
Correct |
27 ms |
6860 KB |
Output is correct |
92 |
Correct |
27 ms |
6776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2656 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
1 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
3 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 |
2660 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 |
2668 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 |
2672 KB |
Output is correct |
23 |
Correct |
2 ms |
2668 KB |
Output is correct |
24 |
Correct |
18 ms |
6856 KB |
Output is correct |
25 |
Correct |
18 ms |
6932 KB |
Output is correct |
26 |
Correct |
20 ms |
6980 KB |
Output is correct |
27 |
Correct |
9 ms |
3156 KB |
Output is correct |
28 |
Correct |
11 ms |
3184 KB |
Output is correct |
29 |
Correct |
7 ms |
3156 KB |
Output is correct |
30 |
Correct |
7 ms |
3156 KB |
Output is correct |
31 |
Correct |
6 ms |
3188 KB |
Output is correct |
32 |
Correct |
6 ms |
3156 KB |
Output is correct |
33 |
Correct |
15 ms |
4308 KB |
Output is correct |
34 |
Correct |
14 ms |
4308 KB |
Output is correct |
35 |
Correct |
15 ms |
4308 KB |
Output is correct |
36 |
Correct |
14 ms |
4252 KB |
Output is correct |
37 |
Correct |
16 ms |
4356 KB |
Output is correct |
38 |
Correct |
15 ms |
4308 KB |
Output is correct |
39 |
Correct |
26 ms |
7580 KB |
Output is correct |
40 |
Correct |
24 ms |
7588 KB |
Output is correct |
41 |
Correct |
26 ms |
7616 KB |
Output is correct |
42 |
Correct |
1 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
2 ms |
2664 KB |
Output is correct |
45 |
Correct |
2 ms |
2548 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 |
2772 KB |
Output is correct |
50 |
Correct |
2 ms |
2660 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 |
2664 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2660 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 |
2660 KB |
Output is correct |
61 |
Correct |
2 ms |
2644 KB |
Output is correct |
62 |
Correct |
2 ms |
2644 KB |
Output is correct |
63 |
Correct |
3 ms |
2644 KB |
Output is correct |
64 |
Correct |
3 ms |
2644 KB |
Output is correct |
65 |
Correct |
3 ms |
2656 KB |
Output is correct |
66 |
Correct |
3 ms |
2660 KB |
Output is correct |
67 |
Correct |
3 ms |
2644 KB |
Output is correct |
68 |
Correct |
3 ms |
2644 KB |
Output is correct |
69 |
Correct |
2 ms |
2664 KB |
Output is correct |
70 |
Correct |
2 ms |
2644 KB |
Output is correct |
71 |
Correct |
2 ms |
2664 KB |
Output is correct |
72 |
Correct |
2 ms |
2644 KB |
Output is correct |
73 |
Correct |
2 ms |
2660 KB |
Output is correct |
74 |
Correct |
2 ms |
2668 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 |
7 ms |
2644 KB |
Output is correct |
81 |
Correct |
3 ms |
2644 KB |
Output is correct |
82 |
Correct |
7 ms |
2644 KB |
Output is correct |
83 |
Correct |
5 ms |
2660 KB |
Output is correct |
84 |
Correct |
6 ms |
2644 KB |
Output is correct |
85 |
Correct |
4 ms |
2860 KB |
Output is correct |
86 |
Correct |
4 ms |
2900 KB |
Output is correct |
87 |
Correct |
4 ms |
2800 KB |
Output is correct |
88 |
Correct |
3 ms |
2772 KB |
Output is correct |
89 |
Correct |
4 ms |
2900 KB |
Output is correct |
90 |
Correct |
4 ms |
2800 KB |
Output is correct |
91 |
Correct |
19 ms |
5732 KB |
Output is correct |
92 |
Correct |
18 ms |
6228 KB |
Output is correct |
93 |
Correct |
23 ms |
6548 KB |
Output is correct |
94 |
Correct |
12 ms |
2644 KB |
Output is correct |
95 |
Correct |
11 ms |
2644 KB |
Output is correct |
96 |
Correct |
14 ms |
2644 KB |
Output is correct |
97 |
Correct |
11 ms |
2664 KB |
Output is correct |
98 |
Correct |
11 ms |
2648 KB |
Output is correct |
99 |
Correct |
5 ms |
2900 KB |
Output is correct |
100 |
Correct |
5 ms |
3032 KB |
Output is correct |
101 |
Correct |
4 ms |
2884 KB |
Output is correct |
102 |
Correct |
4 ms |
2900 KB |
Output is correct |
103 |
Correct |
5 ms |
2900 KB |
Output is correct |
104 |
Correct |
5 ms |
2924 KB |
Output is correct |
105 |
Correct |
27 ms |
6812 KB |
Output is correct |
106 |
Correct |
27 ms |
6860 KB |
Output is correct |
107 |
Correct |
27 ms |
6776 KB |
Output is correct |
108 |
Correct |
9 ms |
3160 KB |
Output is correct |
109 |
Correct |
1065 ms |
3148 KB |
Output is correct |
110 |
Correct |
725 ms |
3032 KB |
Output is correct |
111 |
Correct |
576 ms |
3036 KB |
Output is correct |
112 |
Correct |
683 ms |
3088 KB |
Output is correct |
113 |
Correct |
467 ms |
3076 KB |
Output is correct |
114 |
Correct |
17 ms |
4444 KB |
Output is correct |
115 |
Correct |
19 ms |
4180 KB |
Output is correct |
116 |
Correct |
27 ms |
4760 KB |
Output is correct |
117 |
Correct |
17 ms |
4376 KB |
Output is correct |
118 |
Correct |
19 ms |
4476 KB |
Output is correct |
119 |
Correct |
16 ms |
4084 KB |
Output is correct |
120 |
Correct |
20 ms |
5580 KB |
Output is correct |
121 |
Correct |
10 ms |
3412 KB |
Output is correct |
122 |
Correct |
28 ms |
5724 KB |
Output is correct |
123 |
Correct |
12 ms |
3308 KB |
Output is correct |
124 |
Correct |
28 ms |
6496 KB |
Output is correct |
125 |
Correct |
17 ms |
3824 KB |
Output is correct |
126 |
Correct |
10 ms |
3796 KB |
Output is correct |
127 |
Correct |
12 ms |
4308 KB |
Output is correct |
128 |
Correct |
10 ms |
3716 KB |
Output is correct |
129 |
Correct |
9 ms |
3696 KB |
Output is correct |
130 |
Correct |
9 ms |
3156 KB |
Output is correct |
131 |
Correct |
1497 ms |
3316 KB |
Output is correct |
132 |
Correct |
1497 ms |
3284 KB |
Output is correct |
133 |
Correct |
1376 ms |
3284 KB |
Output is correct |
134 |
Correct |
1326 ms |
3284 KB |
Output is correct |
135 |
Correct |
1132 ms |
3284 KB |
Output is correct |
136 |
Correct |
33 ms |
4940 KB |
Output is correct |
137 |
Correct |
40 ms |
4940 KB |
Output is correct |
138 |
Correct |
39 ms |
4812 KB |
Output is correct |
139 |
Correct |
49 ms |
4916 KB |
Output is correct |
140 |
Correct |
48 ms |
4908 KB |
Output is correct |
141 |
Correct |
49 ms |
4868 KB |
Output is correct |
142 |
Correct |
71 ms |
7392 KB |
Output is correct |
143 |
Correct |
21 ms |
4052 KB |
Output is correct |
144 |
Correct |
48 ms |
7408 KB |
Output is correct |
145 |
Correct |
36 ms |
4052 KB |
Output is correct |
146 |
Correct |
61 ms |
7328 KB |
Output is correct |
147 |
Correct |
21 ms |
4072 KB |
Output is correct |
148 |
Correct |
17 ms |
4544 KB |
Output is correct |
149 |
Correct |
21 ms |
4464 KB |
Output is correct |
150 |
Correct |
14 ms |
4308 KB |
Output is correct |
151 |
Correct |
17 ms |
4336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2656 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
1 ms |
2644 KB |
Output is correct |
8 |
Correct |
2 ms |
2644 KB |
Output is correct |
9 |
Correct |
3 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 |
2660 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 |
2668 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 |
2672 KB |
Output is correct |
23 |
Correct |
2 ms |
2668 KB |
Output is correct |
24 |
Correct |
18 ms |
6856 KB |
Output is correct |
25 |
Correct |
18 ms |
6932 KB |
Output is correct |
26 |
Correct |
20 ms |
6980 KB |
Output is correct |
27 |
Correct |
9 ms |
3156 KB |
Output is correct |
28 |
Correct |
11 ms |
3184 KB |
Output is correct |
29 |
Correct |
7 ms |
3156 KB |
Output is correct |
30 |
Correct |
7 ms |
3156 KB |
Output is correct |
31 |
Correct |
6 ms |
3188 KB |
Output is correct |
32 |
Correct |
6 ms |
3156 KB |
Output is correct |
33 |
Correct |
15 ms |
4308 KB |
Output is correct |
34 |
Correct |
14 ms |
4308 KB |
Output is correct |
35 |
Correct |
15 ms |
4308 KB |
Output is correct |
36 |
Correct |
14 ms |
4252 KB |
Output is correct |
37 |
Correct |
16 ms |
4356 KB |
Output is correct |
38 |
Correct |
15 ms |
4308 KB |
Output is correct |
39 |
Correct |
26 ms |
7580 KB |
Output is correct |
40 |
Correct |
24 ms |
7588 KB |
Output is correct |
41 |
Correct |
26 ms |
7616 KB |
Output is correct |
42 |
Correct |
32 ms |
4816 KB |
Output is correct |
43 |
Correct |
21 ms |
3824 KB |
Output is correct |
44 |
Correct |
34 ms |
4912 KB |
Output is correct |
45 |
Correct |
18 ms |
3948 KB |
Output is correct |
46 |
Correct |
14 ms |
3796 KB |
Output is correct |
47 |
Correct |
24 ms |
4916 KB |
Output is correct |
48 |
Correct |
65 ms |
13388 KB |
Output is correct |
49 |
Correct |
45 ms |
9032 KB |
Output is correct |
50 |
Correct |
38 ms |
11824 KB |
Output is correct |
51 |
Correct |
45 ms |
11976 KB |
Output is correct |
52 |
Correct |
51 ms |
12364 KB |
Output is correct |
53 |
Correct |
39 ms |
9860 KB |
Output is correct |
54 |
Correct |
35 ms |
4844 KB |
Output is correct |
55 |
Correct |
34 ms |
4916 KB |
Output is correct |
56 |
Correct |
30 ms |
4816 KB |
Output is correct |
57 |
Correct |
24 ms |
4944 KB |
Output is correct |
58 |
Correct |
27 ms |
4840 KB |
Output is correct |
59 |
Correct |
24 ms |
4816 KB |
Output is correct |
60 |
Correct |
73 ms |
14988 KB |
Output is correct |
61 |
Correct |
66 ms |
15104 KB |
Output is correct |
62 |
Correct |
68 ms |
15008 KB |
Output is correct |
63 |
Correct |
71 ms |
15108 KB |
Output is correct |
64 |
Correct |
72 ms |
15004 KB |
Output is correct |
65 |
Correct |
67 ms |
15000 KB |
Output is correct |
66 |
Correct |
62 ms |
14292 KB |
Output is correct |
67 |
Correct |
59 ms |
14212 KB |
Output is correct |
68 |
Correct |
59 ms |
14300 KB |
Output is correct |
69 |
Correct |
1 ms |
2644 KB |
Output is correct |
70 |
Correct |
2 ms |
2644 KB |
Output is correct |
71 |
Correct |
2 ms |
2664 KB |
Output is correct |
72 |
Correct |
2 ms |
2548 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 |
2772 KB |
Output is correct |
77 |
Correct |
2 ms |
2660 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 |
2 ms |
2664 KB |
Output is correct |
82 |
Correct |
2 ms |
2644 KB |
Output is correct |
83 |
Correct |
2 ms |
2660 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 |
2660 KB |
Output is correct |
88 |
Correct |
2 ms |
2644 KB |
Output is correct |
89 |
Correct |
2 ms |
2644 KB |
Output is correct |
90 |
Correct |
3 ms |
2644 KB |
Output is correct |
91 |
Correct |
3 ms |
2644 KB |
Output is correct |
92 |
Correct |
3 ms |
2656 KB |
Output is correct |
93 |
Correct |
3 ms |
2660 KB |
Output is correct |
94 |
Correct |
3 ms |
2644 KB |
Output is correct |
95 |
Correct |
3 ms |
2644 KB |
Output is correct |
96 |
Correct |
2 ms |
2664 KB |
Output is correct |
97 |
Correct |
2 ms |
2644 KB |
Output is correct |
98 |
Correct |
2 ms |
2664 KB |
Output is correct |
99 |
Correct |
2 ms |
2644 KB |
Output is correct |
100 |
Correct |
2 ms |
2660 KB |
Output is correct |
101 |
Correct |
2 ms |
2668 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 |
2644 KB |
Output is correct |
105 |
Correct |
2 ms |
2644 KB |
Output is correct |
106 |
Correct |
2 ms |
2644 KB |
Output is correct |
107 |
Correct |
7 ms |
2644 KB |
Output is correct |
108 |
Correct |
3 ms |
2644 KB |
Output is correct |
109 |
Correct |
7 ms |
2644 KB |
Output is correct |
110 |
Correct |
5 ms |
2660 KB |
Output is correct |
111 |
Correct |
6 ms |
2644 KB |
Output is correct |
112 |
Correct |
4 ms |
2860 KB |
Output is correct |
113 |
Correct |
4 ms |
2900 KB |
Output is correct |
114 |
Correct |
4 ms |
2800 KB |
Output is correct |
115 |
Correct |
3 ms |
2772 KB |
Output is correct |
116 |
Correct |
4 ms |
2900 KB |
Output is correct |
117 |
Correct |
4 ms |
2800 KB |
Output is correct |
118 |
Correct |
19 ms |
5732 KB |
Output is correct |
119 |
Correct |
18 ms |
6228 KB |
Output is correct |
120 |
Correct |
23 ms |
6548 KB |
Output is correct |
121 |
Correct |
12 ms |
2644 KB |
Output is correct |
122 |
Correct |
11 ms |
2644 KB |
Output is correct |
123 |
Correct |
14 ms |
2644 KB |
Output is correct |
124 |
Correct |
11 ms |
2664 KB |
Output is correct |
125 |
Correct |
11 ms |
2648 KB |
Output is correct |
126 |
Correct |
5 ms |
2900 KB |
Output is correct |
127 |
Correct |
5 ms |
3032 KB |
Output is correct |
128 |
Correct |
4 ms |
2884 KB |
Output is correct |
129 |
Correct |
4 ms |
2900 KB |
Output is correct |
130 |
Correct |
5 ms |
2900 KB |
Output is correct |
131 |
Correct |
5 ms |
2924 KB |
Output is correct |
132 |
Correct |
27 ms |
6812 KB |
Output is correct |
133 |
Correct |
27 ms |
6860 KB |
Output is correct |
134 |
Correct |
27 ms |
6776 KB |
Output is correct |
135 |
Correct |
9 ms |
3160 KB |
Output is correct |
136 |
Correct |
1065 ms |
3148 KB |
Output is correct |
137 |
Correct |
725 ms |
3032 KB |
Output is correct |
138 |
Correct |
576 ms |
3036 KB |
Output is correct |
139 |
Correct |
683 ms |
3088 KB |
Output is correct |
140 |
Correct |
467 ms |
3076 KB |
Output is correct |
141 |
Correct |
17 ms |
4444 KB |
Output is correct |
142 |
Correct |
19 ms |
4180 KB |
Output is correct |
143 |
Correct |
27 ms |
4760 KB |
Output is correct |
144 |
Correct |
17 ms |
4376 KB |
Output is correct |
145 |
Correct |
19 ms |
4476 KB |
Output is correct |
146 |
Correct |
16 ms |
4084 KB |
Output is correct |
147 |
Correct |
20 ms |
5580 KB |
Output is correct |
148 |
Correct |
10 ms |
3412 KB |
Output is correct |
149 |
Correct |
28 ms |
5724 KB |
Output is correct |
150 |
Correct |
12 ms |
3308 KB |
Output is correct |
151 |
Correct |
28 ms |
6496 KB |
Output is correct |
152 |
Correct |
17 ms |
3824 KB |
Output is correct |
153 |
Correct |
10 ms |
3796 KB |
Output is correct |
154 |
Correct |
12 ms |
4308 KB |
Output is correct |
155 |
Correct |
10 ms |
3716 KB |
Output is correct |
156 |
Correct |
9 ms |
3696 KB |
Output is correct |
157 |
Correct |
9 ms |
3156 KB |
Output is correct |
158 |
Correct |
1497 ms |
3316 KB |
Output is correct |
159 |
Correct |
1497 ms |
3284 KB |
Output is correct |
160 |
Correct |
1376 ms |
3284 KB |
Output is correct |
161 |
Correct |
1326 ms |
3284 KB |
Output is correct |
162 |
Correct |
1132 ms |
3284 KB |
Output is correct |
163 |
Correct |
33 ms |
4940 KB |
Output is correct |
164 |
Correct |
40 ms |
4940 KB |
Output is correct |
165 |
Correct |
39 ms |
4812 KB |
Output is correct |
166 |
Correct |
49 ms |
4916 KB |
Output is correct |
167 |
Correct |
48 ms |
4908 KB |
Output is correct |
168 |
Correct |
49 ms |
4868 KB |
Output is correct |
169 |
Correct |
71 ms |
7392 KB |
Output is correct |
170 |
Correct |
21 ms |
4052 KB |
Output is correct |
171 |
Correct |
48 ms |
7408 KB |
Output is correct |
172 |
Correct |
36 ms |
4052 KB |
Output is correct |
173 |
Correct |
61 ms |
7328 KB |
Output is correct |
174 |
Correct |
21 ms |
4072 KB |
Output is correct |
175 |
Correct |
17 ms |
4544 KB |
Output is correct |
176 |
Correct |
21 ms |
4464 KB |
Output is correct |
177 |
Correct |
14 ms |
4308 KB |
Output is correct |
178 |
Correct |
17 ms |
4336 KB |
Output is correct |
179 |
Correct |
28 ms |
3796 KB |
Output is correct |
180 |
Execution timed out |
1568 ms |
3796 KB |
Time limit exceeded |
181 |
Halted |
0 ms |
0 KB |
- |