#include "paint.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define ll int
#define MAX 202020
#define INF 101010101
//0-based index를 사용
//i번 회전 -> i번째 사람이 맨 앞으로 오도록 하는 것(실제 의미와 다름)
bool rksmd[MAX]; //[i-M+1, i]를 칠하는것이 "가능"한지 저장
ll rodtls[MAX]; //j번 회전했을때 첫번째 값이 맞았던 최근 인덱스를 저장(마지막으로 dp가 "갱신"된 for문의 i시점)
ll dp[MAX]; //for 문 i번째 실행했을때 dp[j]=k : i-1번째 상황에서 j번 돌려서 색칠하게 했을때 오른쪽에서 k번째에 터진다.
set<ll> tor[MAX]; // i번째 "색"을 칠할 수 있는 사람의 세트
bool exist(const set<ll>& s, ll x) {
return s.find(x) != s.end();
}
//"이전" 사람이 누구인지 반환
ll dlwjs(ll x, ll M) {
if (x == 0) return M - 1;
else return x - 1;
}
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
ll i;
for (i = 0; i < M; i++) for (auto x : B[i]) tor[x].insert(i);
//[i-M+1, i]을 확인, 음수인 곳은 아무도 못 칠한다 가정
for (i = 0; i <= M; i++) rodtls[i] = -1;
for (i = 0; i < N; i++) {
vector<pair<ll, ll>> memo; //i번째 시점에 dp를 갱신한 k만 저장
for (auto k : tor[C[i]]) {
//갱신 가능한 경우 : 바로 전 항목이 전 사람에 의해 갱신된 경우
if (rodtls[dlwjs(k, M)] == i - 1) memo.push_back({ k, dp[dlwjs(k, M)] + 1 });
else memo.push_back({ k, 1 });
}
for (auto a : memo) rodtls[a.first] = i, dp[a.first] = a.second;
for (auto a : memo) if (a.second >= M) rksmd[i] = 1;
}
ll cnt = 0;
ll mn = INF, lim = INF;
for (i = N - 1; i >= 0; i--) {
if (rksmd[i]) mn = i;
if (i < lim) {
lim = mn - M + 1;
if (i < lim) return -1;
cnt++;
}
}
return cnt;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9804 KB |
Output is correct |
2 |
Correct |
6 ms |
9804 KB |
Output is correct |
3 |
Correct |
6 ms |
9676 KB |
Output is correct |
4 |
Correct |
6 ms |
9804 KB |
Output is correct |
5 |
Correct |
6 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
6 ms |
9780 KB |
Output is correct |
8 |
Correct |
6 ms |
9804 KB |
Output is correct |
9 |
Correct |
7 ms |
9760 KB |
Output is correct |
10 |
Correct |
6 ms |
9804 KB |
Output is correct |
11 |
Correct |
8 ms |
9804 KB |
Output is correct |
12 |
Correct |
7 ms |
9804 KB |
Output is correct |
13 |
Correct |
7 ms |
9804 KB |
Output is correct |
14 |
Correct |
7 ms |
9804 KB |
Output is correct |
15 |
Correct |
8 ms |
9804 KB |
Output is correct |
16 |
Correct |
6 ms |
9804 KB |
Output is correct |
17 |
Correct |
7 ms |
9804 KB |
Output is correct |
18 |
Correct |
7 ms |
9804 KB |
Output is correct |
19 |
Correct |
7 ms |
9804 KB |
Output is correct |
20 |
Correct |
7 ms |
9852 KB |
Output is correct |
21 |
Correct |
7 ms |
9804 KB |
Output is correct |
22 |
Correct |
33 ms |
15252 KB |
Output is correct |
23 |
Correct |
33 ms |
15200 KB |
Output is correct |
24 |
Correct |
33 ms |
15196 KB |
Output is correct |
25 |
Correct |
9 ms |
9932 KB |
Output is correct |
26 |
Correct |
9 ms |
9980 KB |
Output is correct |
27 |
Correct |
10 ms |
9932 KB |
Output is correct |
28 |
Correct |
9 ms |
9932 KB |
Output is correct |
29 |
Correct |
9 ms |
9872 KB |
Output is correct |
30 |
Correct |
9 ms |
9932 KB |
Output is correct |
31 |
Correct |
17 ms |
11212 KB |
Output is correct |
32 |
Correct |
18 ms |
11228 KB |
Output is correct |
33 |
Correct |
18 ms |
11156 KB |
Output is correct |
34 |
Correct |
17 ms |
11260 KB |
Output is correct |
35 |
Correct |
20 ms |
11212 KB |
Output is correct |
36 |
Correct |
17 ms |
11212 KB |
Output is correct |
37 |
Correct |
43 ms |
15536 KB |
Output is correct |
38 |
Correct |
42 ms |
15592 KB |
Output is correct |
39 |
Correct |
41 ms |
15556 KB |
Output is correct |
40 |
Correct |
19 ms |
10572 KB |
Output is correct |
41 |
Correct |
14 ms |
10188 KB |
Output is correct |
42 |
Correct |
21 ms |
10572 KB |
Output is correct |
43 |
Correct |
16 ms |
10316 KB |
Output is correct |
44 |
Correct |
15 ms |
10324 KB |
Output is correct |
45 |
Correct |
21 ms |
10580 KB |
Output is correct |
46 |
Correct |
68 ms |
20548 KB |
Output is correct |
47 |
Correct |
42 ms |
15808 KB |
Output is correct |
48 |
Correct |
49 ms |
18564 KB |
Output is correct |
49 |
Correct |
61 ms |
19240 KB |
Output is correct |
50 |
Correct |
65 ms |
18756 KB |
Output is correct |
51 |
Correct |
53 ms |
16108 KB |
Output is correct |
52 |
Correct |
20 ms |
10572 KB |
Output is correct |
53 |
Correct |
21 ms |
10580 KB |
Output is correct |
54 |
Correct |
22 ms |
10580 KB |
Output is correct |
55 |
Correct |
21 ms |
10580 KB |
Output is correct |
56 |
Correct |
21 ms |
10656 KB |
Output is correct |
57 |
Correct |
21 ms |
10680 KB |
Output is correct |
58 |
Correct |
74 ms |
21572 KB |
Output is correct |
59 |
Correct |
73 ms |
21452 KB |
Output is correct |
60 |
Correct |
87 ms |
21524 KB |
Output is correct |
61 |
Correct |
75 ms |
21580 KB |
Output is correct |
62 |
Correct |
80 ms |
21672 KB |
Output is correct |
63 |
Correct |
79 ms |
21572 KB |
Output is correct |
64 |
Correct |
82 ms |
20664 KB |
Output is correct |
65 |
Correct |
81 ms |
20644 KB |
Output is correct |
66 |
Correct |
93 ms |
20764 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
9804 KB |
Output is correct |
2 |
Correct |
6 ms |
9804 KB |
Output is correct |
3 |
Correct |
6 ms |
9676 KB |
Output is correct |
4 |
Correct |
6 ms |
9804 KB |
Output is correct |
5 |
Correct |
6 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
6 ms |
9780 KB |
Output is correct |
8 |
Correct |
6 ms |
9804 KB |
Output is correct |
9 |
Correct |
7 ms |
9760 KB |
Output is correct |
10 |
Correct |
6 ms |
9804 KB |
Output is correct |
11 |
Correct |
8 ms |
9804 KB |
Output is correct |
12 |
Correct |
7 ms |
9804 KB |
Output is correct |
13 |
Correct |
7 ms |
9804 KB |
Output is correct |
14 |
Correct |
7 ms |
9804 KB |
Output is correct |
15 |
Correct |
8 ms |
9804 KB |
Output is correct |
16 |
Correct |
6 ms |
9804 KB |
Output is correct |
17 |
Correct |
7 ms |
9804 KB |
Output is correct |
18 |
Correct |
7 ms |
9804 KB |
Output is correct |
19 |
Correct |
7 ms |
9804 KB |
Output is correct |
20 |
Correct |
7 ms |
9852 KB |
Output is correct |
21 |
Correct |
7 ms |
9804 KB |
Output is correct |
22 |
Correct |
7 ms |
9804 KB |
Output is correct |
23 |
Correct |
6 ms |
9676 KB |
Output is correct |
24 |
Correct |
7 ms |
9740 KB |
Output is correct |
25 |
Correct |
6 ms |
9676 KB |
Output is correct |
26 |
Correct |
6 ms |
9808 KB |
Output is correct |
27 |
Correct |
6 ms |
9804 KB |
Output is correct |
28 |
Correct |
7 ms |
9804 KB |
Output is correct |
29 |
Correct |
7 ms |
9804 KB |
Output is correct |
30 |
Correct |
6 ms |
9804 KB |
Output is correct |
31 |
Correct |
6 ms |
9804 KB |
Output is correct |
32 |
Correct |
7 ms |
9808 KB |
Output is correct |
33 |
Correct |
7 ms |
9804 KB |
Output is correct |
34 |
Correct |
7 ms |
9808 KB |
Output is correct |
35 |
Correct |
7 ms |
9808 KB |
Output is correct |
36 |
Correct |
7 ms |
9804 KB |
Output is correct |
37 |
Correct |
7 ms |
9804 KB |
Output is correct |
38 |
Correct |
7 ms |
9804 KB |
Output is correct |
39 |
Correct |
6 ms |
9804 KB |
Output is correct |
40 |
Correct |
7 ms |
9804 KB |
Output is correct |
41 |
Correct |
7 ms |
9804 KB |
Output is correct |
42 |
Correct |
7 ms |
9804 KB |
Output is correct |
43 |
Correct |
7 ms |
9804 KB |
Output is correct |
44 |
Correct |
6 ms |
9804 KB |
Output is correct |
45 |
Correct |
7 ms |
9804 KB |
Output is correct |
46 |
Correct |
7 ms |
9804 KB |
Output is correct |
47 |
Correct |
7 ms |
9804 KB |
Output is correct |
48 |
Correct |
7 ms |
9804 KB |
Output is correct |
49 |
Correct |
7 ms |
9804 KB |
Output is correct |
50 |
Correct |
7 ms |
9804 KB |
Output is correct |
51 |
Correct |
7 ms |
9856 KB |
Output is correct |
52 |
Correct |
7 ms |
9764 KB |
Output is correct |
53 |
Correct |
7 ms |
9804 KB |
Output is correct |
54 |
Correct |
7 ms |
9804 KB |
Output is correct |
55 |
Correct |
7 ms |
9804 KB |
Output is correct |
56 |
Correct |
7 ms |
9832 KB |
Output is correct |
57 |
Correct |
7 ms |
9804 KB |
Output is correct |
58 |
Correct |
7 ms |
9804 KB |
Output is correct |
59 |
Correct |
7 ms |
9804 KB |
Output is correct |
60 |
Correct |
7 ms |
9932 KB |
Output is correct |
61 |
Correct |
7 ms |
9804 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
9804 KB |
Output is correct |
2 |
Correct |
6 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9804 KB |
Output is correct |
4 |
Correct |
6 ms |
9804 KB |
Output is correct |
5 |
Correct |
6 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9804 KB |
Output is correct |
7 |
Correct |
6 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9780 KB |
Output is correct |
10 |
Correct |
6 ms |
9804 KB |
Output is correct |
11 |
Correct |
7 ms |
9760 KB |
Output is correct |
12 |
Correct |
6 ms |
9804 KB |
Output is correct |
13 |
Correct |
8 ms |
9804 KB |
Output is correct |
14 |
Correct |
7 ms |
9804 KB |
Output is correct |
15 |
Correct |
7 ms |
9804 KB |
Output is correct |
16 |
Correct |
7 ms |
9804 KB |
Output is correct |
17 |
Correct |
8 ms |
9804 KB |
Output is correct |
18 |
Correct |
6 ms |
9804 KB |
Output is correct |
19 |
Correct |
7 ms |
9804 KB |
Output is correct |
20 |
Correct |
7 ms |
9804 KB |
Output is correct |
21 |
Correct |
7 ms |
9804 KB |
Output is correct |
22 |
Correct |
7 ms |
9852 KB |
Output is correct |
23 |
Correct |
7 ms |
9804 KB |
Output is correct |
24 |
Correct |
33 ms |
15252 KB |
Output is correct |
25 |
Correct |
33 ms |
15200 KB |
Output is correct |
26 |
Correct |
33 ms |
15196 KB |
Output is correct |
27 |
Correct |
7 ms |
9740 KB |
Output is correct |
28 |
Correct |
6 ms |
9676 KB |
Output is correct |
29 |
Correct |
6 ms |
9808 KB |
Output is correct |
30 |
Correct |
6 ms |
9804 KB |
Output is correct |
31 |
Correct |
7 ms |
9804 KB |
Output is correct |
32 |
Correct |
7 ms |
9804 KB |
Output is correct |
33 |
Correct |
6 ms |
9804 KB |
Output is correct |
34 |
Correct |
6 ms |
9804 KB |
Output is correct |
35 |
Correct |
7 ms |
9808 KB |
Output is correct |
36 |
Correct |
7 ms |
9804 KB |
Output is correct |
37 |
Correct |
7 ms |
9808 KB |
Output is correct |
38 |
Correct |
7 ms |
9808 KB |
Output is correct |
39 |
Correct |
7 ms |
9804 KB |
Output is correct |
40 |
Correct |
7 ms |
9804 KB |
Output is correct |
41 |
Correct |
7 ms |
9804 KB |
Output is correct |
42 |
Correct |
6 ms |
9804 KB |
Output is correct |
43 |
Correct |
7 ms |
9804 KB |
Output is correct |
44 |
Correct |
7 ms |
9804 KB |
Output is correct |
45 |
Correct |
7 ms |
9804 KB |
Output is correct |
46 |
Correct |
7 ms |
9804 KB |
Output is correct |
47 |
Correct |
6 ms |
9804 KB |
Output is correct |
48 |
Correct |
7 ms |
9804 KB |
Output is correct |
49 |
Correct |
7 ms |
9804 KB |
Output is correct |
50 |
Correct |
7 ms |
9804 KB |
Output is correct |
51 |
Correct |
7 ms |
9804 KB |
Output is correct |
52 |
Correct |
7 ms |
9804 KB |
Output is correct |
53 |
Correct |
7 ms |
9804 KB |
Output is correct |
54 |
Correct |
7 ms |
9856 KB |
Output is correct |
55 |
Correct |
7 ms |
9764 KB |
Output is correct |
56 |
Correct |
7 ms |
9804 KB |
Output is correct |
57 |
Correct |
7 ms |
9804 KB |
Output is correct |
58 |
Correct |
7 ms |
9804 KB |
Output is correct |
59 |
Correct |
7 ms |
9832 KB |
Output is correct |
60 |
Correct |
7 ms |
9804 KB |
Output is correct |
61 |
Correct |
7 ms |
9804 KB |
Output is correct |
62 |
Correct |
7 ms |
9804 KB |
Output is correct |
63 |
Correct |
7 ms |
9932 KB |
Output is correct |
64 |
Correct |
7 ms |
9804 KB |
Output is correct |
65 |
Correct |
7 ms |
9804 KB |
Output is correct |
66 |
Correct |
7 ms |
9804 KB |
Output is correct |
67 |
Correct |
7 ms |
9776 KB |
Output is correct |
68 |
Correct |
7 ms |
9804 KB |
Output is correct |
69 |
Correct |
7 ms |
9804 KB |
Output is correct |
70 |
Correct |
10 ms |
10316 KB |
Output is correct |
71 |
Correct |
10 ms |
10444 KB |
Output is correct |
72 |
Correct |
10 ms |
10316 KB |
Output is correct |
73 |
Correct |
8 ms |
10068 KB |
Output is correct |
74 |
Correct |
9 ms |
10316 KB |
Output is correct |
75 |
Correct |
9 ms |
10188 KB |
Output is correct |
76 |
Correct |
49 ms |
15844 KB |
Output is correct |
77 |
Correct |
32 ms |
16572 KB |
Output is correct |
78 |
Correct |
51 ms |
17608 KB |
Output is correct |
79 |
Correct |
8 ms |
9804 KB |
Output is correct |
80 |
Correct |
8 ms |
9848 KB |
Output is correct |
81 |
Correct |
8 ms |
9804 KB |
Output is correct |
82 |
Correct |
8 ms |
9752 KB |
Output is correct |
83 |
Correct |
8 ms |
9804 KB |
Output is correct |
84 |
Correct |
11 ms |
10572 KB |
Output is correct |
85 |
Correct |
11 ms |
10572 KB |
Output is correct |
86 |
Correct |
11 ms |
10572 KB |
Output is correct |
87 |
Correct |
11 ms |
10572 KB |
Output is correct |
88 |
Correct |
11 ms |
10572 KB |
Output is correct |
89 |
Correct |
12 ms |
10580 KB |
Output is correct |
90 |
Correct |
62 ms |
18372 KB |
Output is correct |
91 |
Correct |
58 ms |
18288 KB |
Output is correct |
92 |
Correct |
57 ms |
18316 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
9804 KB |
Output is correct |
2 |
Correct |
6 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9804 KB |
Output is correct |
4 |
Correct |
6 ms |
9804 KB |
Output is correct |
5 |
Correct |
6 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9804 KB |
Output is correct |
7 |
Correct |
6 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9780 KB |
Output is correct |
10 |
Correct |
6 ms |
9804 KB |
Output is correct |
11 |
Correct |
7 ms |
9760 KB |
Output is correct |
12 |
Correct |
6 ms |
9804 KB |
Output is correct |
13 |
Correct |
8 ms |
9804 KB |
Output is correct |
14 |
Correct |
7 ms |
9804 KB |
Output is correct |
15 |
Correct |
7 ms |
9804 KB |
Output is correct |
16 |
Correct |
7 ms |
9804 KB |
Output is correct |
17 |
Correct |
8 ms |
9804 KB |
Output is correct |
18 |
Correct |
6 ms |
9804 KB |
Output is correct |
19 |
Correct |
7 ms |
9804 KB |
Output is correct |
20 |
Correct |
7 ms |
9804 KB |
Output is correct |
21 |
Correct |
7 ms |
9804 KB |
Output is correct |
22 |
Correct |
7 ms |
9852 KB |
Output is correct |
23 |
Correct |
7 ms |
9804 KB |
Output is correct |
24 |
Correct |
33 ms |
15252 KB |
Output is correct |
25 |
Correct |
33 ms |
15200 KB |
Output is correct |
26 |
Correct |
33 ms |
15196 KB |
Output is correct |
27 |
Correct |
9 ms |
9932 KB |
Output is correct |
28 |
Correct |
9 ms |
9980 KB |
Output is correct |
29 |
Correct |
10 ms |
9932 KB |
Output is correct |
30 |
Correct |
9 ms |
9932 KB |
Output is correct |
31 |
Correct |
9 ms |
9872 KB |
Output is correct |
32 |
Correct |
9 ms |
9932 KB |
Output is correct |
33 |
Correct |
17 ms |
11212 KB |
Output is correct |
34 |
Correct |
18 ms |
11228 KB |
Output is correct |
35 |
Correct |
18 ms |
11156 KB |
Output is correct |
36 |
Correct |
17 ms |
11260 KB |
Output is correct |
37 |
Correct |
20 ms |
11212 KB |
Output is correct |
38 |
Correct |
17 ms |
11212 KB |
Output is correct |
39 |
Correct |
43 ms |
15536 KB |
Output is correct |
40 |
Correct |
42 ms |
15592 KB |
Output is correct |
41 |
Correct |
41 ms |
15556 KB |
Output is correct |
42 |
Correct |
7 ms |
9740 KB |
Output is correct |
43 |
Correct |
6 ms |
9676 KB |
Output is correct |
44 |
Correct |
6 ms |
9808 KB |
Output is correct |
45 |
Correct |
6 ms |
9804 KB |
Output is correct |
46 |
Correct |
7 ms |
9804 KB |
Output is correct |
47 |
Correct |
7 ms |
9804 KB |
Output is correct |
48 |
Correct |
6 ms |
9804 KB |
Output is correct |
49 |
Correct |
6 ms |
9804 KB |
Output is correct |
50 |
Correct |
7 ms |
9808 KB |
Output is correct |
51 |
Correct |
7 ms |
9804 KB |
Output is correct |
52 |
Correct |
7 ms |
9808 KB |
Output is correct |
53 |
Correct |
7 ms |
9808 KB |
Output is correct |
54 |
Correct |
7 ms |
9804 KB |
Output is correct |
55 |
Correct |
7 ms |
9804 KB |
Output is correct |
56 |
Correct |
7 ms |
9804 KB |
Output is correct |
57 |
Correct |
6 ms |
9804 KB |
Output is correct |
58 |
Correct |
7 ms |
9804 KB |
Output is correct |
59 |
Correct |
7 ms |
9804 KB |
Output is correct |
60 |
Correct |
7 ms |
9804 KB |
Output is correct |
61 |
Correct |
7 ms |
9804 KB |
Output is correct |
62 |
Correct |
6 ms |
9804 KB |
Output is correct |
63 |
Correct |
7 ms |
9804 KB |
Output is correct |
64 |
Correct |
7 ms |
9804 KB |
Output is correct |
65 |
Correct |
7 ms |
9804 KB |
Output is correct |
66 |
Correct |
7 ms |
9804 KB |
Output is correct |
67 |
Correct |
7 ms |
9804 KB |
Output is correct |
68 |
Correct |
7 ms |
9804 KB |
Output is correct |
69 |
Correct |
7 ms |
9856 KB |
Output is correct |
70 |
Correct |
7 ms |
9764 KB |
Output is correct |
71 |
Correct |
7 ms |
9804 KB |
Output is correct |
72 |
Correct |
7 ms |
9804 KB |
Output is correct |
73 |
Correct |
7 ms |
9804 KB |
Output is correct |
74 |
Correct |
7 ms |
9832 KB |
Output is correct |
75 |
Correct |
7 ms |
9804 KB |
Output is correct |
76 |
Correct |
7 ms |
9804 KB |
Output is correct |
77 |
Correct |
7 ms |
9804 KB |
Output is correct |
78 |
Correct |
7 ms |
9932 KB |
Output is correct |
79 |
Correct |
7 ms |
9804 KB |
Output is correct |
80 |
Correct |
7 ms |
9804 KB |
Output is correct |
81 |
Correct |
7 ms |
9804 KB |
Output is correct |
82 |
Correct |
7 ms |
9776 KB |
Output is correct |
83 |
Correct |
7 ms |
9804 KB |
Output is correct |
84 |
Correct |
7 ms |
9804 KB |
Output is correct |
85 |
Correct |
10 ms |
10316 KB |
Output is correct |
86 |
Correct |
10 ms |
10444 KB |
Output is correct |
87 |
Correct |
10 ms |
10316 KB |
Output is correct |
88 |
Correct |
8 ms |
10068 KB |
Output is correct |
89 |
Correct |
9 ms |
10316 KB |
Output is correct |
90 |
Correct |
9 ms |
10188 KB |
Output is correct |
91 |
Correct |
49 ms |
15844 KB |
Output is correct |
92 |
Correct |
32 ms |
16572 KB |
Output is correct |
93 |
Correct |
51 ms |
17608 KB |
Output is correct |
94 |
Correct |
8 ms |
9804 KB |
Output is correct |
95 |
Correct |
8 ms |
9848 KB |
Output is correct |
96 |
Correct |
8 ms |
9804 KB |
Output is correct |
97 |
Correct |
8 ms |
9752 KB |
Output is correct |
98 |
Correct |
8 ms |
9804 KB |
Output is correct |
99 |
Correct |
11 ms |
10572 KB |
Output is correct |
100 |
Correct |
11 ms |
10572 KB |
Output is correct |
101 |
Correct |
11 ms |
10572 KB |
Output is correct |
102 |
Correct |
11 ms |
10572 KB |
Output is correct |
103 |
Correct |
11 ms |
10572 KB |
Output is correct |
104 |
Correct |
12 ms |
10580 KB |
Output is correct |
105 |
Correct |
62 ms |
18372 KB |
Output is correct |
106 |
Correct |
58 ms |
18288 KB |
Output is correct |
107 |
Correct |
57 ms |
18316 KB |
Output is correct |
108 |
Correct |
10 ms |
9932 KB |
Output is correct |
109 |
Correct |
137 ms |
9932 KB |
Output is correct |
110 |
Correct |
95 ms |
9932 KB |
Output is correct |
111 |
Correct |
81 ms |
9932 KB |
Output is correct |
112 |
Correct |
104 ms |
10064 KB |
Output is correct |
113 |
Correct |
62 ms |
10060 KB |
Output is correct |
114 |
Correct |
28 ms |
12988 KB |
Output is correct |
115 |
Correct |
29 ms |
13124 KB |
Output is correct |
116 |
Correct |
35 ms |
14000 KB |
Output is correct |
117 |
Correct |
26 ms |
12932 KB |
Output is correct |
118 |
Correct |
33 ms |
13508 KB |
Output is correct |
119 |
Correct |
24 ms |
12404 KB |
Output is correct |
120 |
Correct |
39 ms |
14932 KB |
Output is correct |
121 |
Correct |
13 ms |
10608 KB |
Output is correct |
122 |
Correct |
50 ms |
16328 KB |
Output is correct |
123 |
Correct |
12 ms |
10572 KB |
Output is correct |
124 |
Correct |
55 ms |
16708 KB |
Output is correct |
125 |
Correct |
19 ms |
10912 KB |
Output is correct |
126 |
Correct |
19 ms |
11032 KB |
Output is correct |
127 |
Correct |
19 ms |
11484 KB |
Output is correct |
128 |
Correct |
15 ms |
10956 KB |
Output is correct |
129 |
Correct |
18 ms |
11212 KB |
Output is correct |
130 |
Correct |
10 ms |
9872 KB |
Output is correct |
131 |
Correct |
189 ms |
10080 KB |
Output is correct |
132 |
Correct |
172 ms |
10080 KB |
Output is correct |
133 |
Correct |
152 ms |
10104 KB |
Output is correct |
134 |
Correct |
137 ms |
10124 KB |
Output is correct |
135 |
Correct |
122 ms |
10060 KB |
Output is correct |
136 |
Correct |
40 ms |
14548 KB |
Output is correct |
137 |
Correct |
40 ms |
14520 KB |
Output is correct |
138 |
Correct |
42 ms |
14468 KB |
Output is correct |
139 |
Correct |
40 ms |
14452 KB |
Output is correct |
140 |
Correct |
41 ms |
14436 KB |
Output is correct |
141 |
Correct |
41 ms |
14440 KB |
Output is correct |
142 |
Correct |
69 ms |
18588 KB |
Output is correct |
143 |
Correct |
17 ms |
11212 KB |
Output is correct |
144 |
Correct |
68 ms |
18652 KB |
Output is correct |
145 |
Correct |
18 ms |
11220 KB |
Output is correct |
146 |
Correct |
70 ms |
18608 KB |
Output is correct |
147 |
Correct |
18 ms |
11120 KB |
Output is correct |
148 |
Correct |
20 ms |
11816 KB |
Output is correct |
149 |
Correct |
21 ms |
11752 KB |
Output is correct |
150 |
Correct |
20 ms |
11640 KB |
Output is correct |
151 |
Correct |
20 ms |
11580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
9804 KB |
Output is correct |
2 |
Correct |
6 ms |
9676 KB |
Output is correct |
3 |
Correct |
6 ms |
9804 KB |
Output is correct |
4 |
Correct |
6 ms |
9804 KB |
Output is correct |
5 |
Correct |
6 ms |
9676 KB |
Output is correct |
6 |
Correct |
6 ms |
9804 KB |
Output is correct |
7 |
Correct |
6 ms |
9676 KB |
Output is correct |
8 |
Correct |
6 ms |
9676 KB |
Output is correct |
9 |
Correct |
6 ms |
9780 KB |
Output is correct |
10 |
Correct |
6 ms |
9804 KB |
Output is correct |
11 |
Correct |
7 ms |
9760 KB |
Output is correct |
12 |
Correct |
6 ms |
9804 KB |
Output is correct |
13 |
Correct |
8 ms |
9804 KB |
Output is correct |
14 |
Correct |
7 ms |
9804 KB |
Output is correct |
15 |
Correct |
7 ms |
9804 KB |
Output is correct |
16 |
Correct |
7 ms |
9804 KB |
Output is correct |
17 |
Correct |
8 ms |
9804 KB |
Output is correct |
18 |
Correct |
6 ms |
9804 KB |
Output is correct |
19 |
Correct |
7 ms |
9804 KB |
Output is correct |
20 |
Correct |
7 ms |
9804 KB |
Output is correct |
21 |
Correct |
7 ms |
9804 KB |
Output is correct |
22 |
Correct |
7 ms |
9852 KB |
Output is correct |
23 |
Correct |
7 ms |
9804 KB |
Output is correct |
24 |
Correct |
33 ms |
15252 KB |
Output is correct |
25 |
Correct |
33 ms |
15200 KB |
Output is correct |
26 |
Correct |
33 ms |
15196 KB |
Output is correct |
27 |
Correct |
9 ms |
9932 KB |
Output is correct |
28 |
Correct |
9 ms |
9980 KB |
Output is correct |
29 |
Correct |
10 ms |
9932 KB |
Output is correct |
30 |
Correct |
9 ms |
9932 KB |
Output is correct |
31 |
Correct |
9 ms |
9872 KB |
Output is correct |
32 |
Correct |
9 ms |
9932 KB |
Output is correct |
33 |
Correct |
17 ms |
11212 KB |
Output is correct |
34 |
Correct |
18 ms |
11228 KB |
Output is correct |
35 |
Correct |
18 ms |
11156 KB |
Output is correct |
36 |
Correct |
17 ms |
11260 KB |
Output is correct |
37 |
Correct |
20 ms |
11212 KB |
Output is correct |
38 |
Correct |
17 ms |
11212 KB |
Output is correct |
39 |
Correct |
43 ms |
15536 KB |
Output is correct |
40 |
Correct |
42 ms |
15592 KB |
Output is correct |
41 |
Correct |
41 ms |
15556 KB |
Output is correct |
42 |
Correct |
19 ms |
10572 KB |
Output is correct |
43 |
Correct |
14 ms |
10188 KB |
Output is correct |
44 |
Correct |
21 ms |
10572 KB |
Output is correct |
45 |
Correct |
16 ms |
10316 KB |
Output is correct |
46 |
Correct |
15 ms |
10324 KB |
Output is correct |
47 |
Correct |
21 ms |
10580 KB |
Output is correct |
48 |
Correct |
68 ms |
20548 KB |
Output is correct |
49 |
Correct |
42 ms |
15808 KB |
Output is correct |
50 |
Correct |
49 ms |
18564 KB |
Output is correct |
51 |
Correct |
61 ms |
19240 KB |
Output is correct |
52 |
Correct |
65 ms |
18756 KB |
Output is correct |
53 |
Correct |
53 ms |
16108 KB |
Output is correct |
54 |
Correct |
20 ms |
10572 KB |
Output is correct |
55 |
Correct |
21 ms |
10580 KB |
Output is correct |
56 |
Correct |
22 ms |
10580 KB |
Output is correct |
57 |
Correct |
21 ms |
10580 KB |
Output is correct |
58 |
Correct |
21 ms |
10656 KB |
Output is correct |
59 |
Correct |
21 ms |
10680 KB |
Output is correct |
60 |
Correct |
74 ms |
21572 KB |
Output is correct |
61 |
Correct |
73 ms |
21452 KB |
Output is correct |
62 |
Correct |
87 ms |
21524 KB |
Output is correct |
63 |
Correct |
75 ms |
21580 KB |
Output is correct |
64 |
Correct |
80 ms |
21672 KB |
Output is correct |
65 |
Correct |
79 ms |
21572 KB |
Output is correct |
66 |
Correct |
82 ms |
20664 KB |
Output is correct |
67 |
Correct |
81 ms |
20644 KB |
Output is correct |
68 |
Correct |
93 ms |
20764 KB |
Output is correct |
69 |
Correct |
7 ms |
9740 KB |
Output is correct |
70 |
Correct |
6 ms |
9676 KB |
Output is correct |
71 |
Correct |
6 ms |
9808 KB |
Output is correct |
72 |
Correct |
6 ms |
9804 KB |
Output is correct |
73 |
Correct |
7 ms |
9804 KB |
Output is correct |
74 |
Correct |
7 ms |
9804 KB |
Output is correct |
75 |
Correct |
6 ms |
9804 KB |
Output is correct |
76 |
Correct |
6 ms |
9804 KB |
Output is correct |
77 |
Correct |
7 ms |
9808 KB |
Output is correct |
78 |
Correct |
7 ms |
9804 KB |
Output is correct |
79 |
Correct |
7 ms |
9808 KB |
Output is correct |
80 |
Correct |
7 ms |
9808 KB |
Output is correct |
81 |
Correct |
7 ms |
9804 KB |
Output is correct |
82 |
Correct |
7 ms |
9804 KB |
Output is correct |
83 |
Correct |
7 ms |
9804 KB |
Output is correct |
84 |
Correct |
6 ms |
9804 KB |
Output is correct |
85 |
Correct |
7 ms |
9804 KB |
Output is correct |
86 |
Correct |
7 ms |
9804 KB |
Output is correct |
87 |
Correct |
7 ms |
9804 KB |
Output is correct |
88 |
Correct |
7 ms |
9804 KB |
Output is correct |
89 |
Correct |
6 ms |
9804 KB |
Output is correct |
90 |
Correct |
7 ms |
9804 KB |
Output is correct |
91 |
Correct |
7 ms |
9804 KB |
Output is correct |
92 |
Correct |
7 ms |
9804 KB |
Output is correct |
93 |
Correct |
7 ms |
9804 KB |
Output is correct |
94 |
Correct |
7 ms |
9804 KB |
Output is correct |
95 |
Correct |
7 ms |
9804 KB |
Output is correct |
96 |
Correct |
7 ms |
9856 KB |
Output is correct |
97 |
Correct |
7 ms |
9764 KB |
Output is correct |
98 |
Correct |
7 ms |
9804 KB |
Output is correct |
99 |
Correct |
7 ms |
9804 KB |
Output is correct |
100 |
Correct |
7 ms |
9804 KB |
Output is correct |
101 |
Correct |
7 ms |
9832 KB |
Output is correct |
102 |
Correct |
7 ms |
9804 KB |
Output is correct |
103 |
Correct |
7 ms |
9804 KB |
Output is correct |
104 |
Correct |
7 ms |
9804 KB |
Output is correct |
105 |
Correct |
7 ms |
9932 KB |
Output is correct |
106 |
Correct |
7 ms |
9804 KB |
Output is correct |
107 |
Correct |
7 ms |
9804 KB |
Output is correct |
108 |
Correct |
7 ms |
9804 KB |
Output is correct |
109 |
Correct |
7 ms |
9776 KB |
Output is correct |
110 |
Correct |
7 ms |
9804 KB |
Output is correct |
111 |
Correct |
7 ms |
9804 KB |
Output is correct |
112 |
Correct |
10 ms |
10316 KB |
Output is correct |
113 |
Correct |
10 ms |
10444 KB |
Output is correct |
114 |
Correct |
10 ms |
10316 KB |
Output is correct |
115 |
Correct |
8 ms |
10068 KB |
Output is correct |
116 |
Correct |
9 ms |
10316 KB |
Output is correct |
117 |
Correct |
9 ms |
10188 KB |
Output is correct |
118 |
Correct |
49 ms |
15844 KB |
Output is correct |
119 |
Correct |
32 ms |
16572 KB |
Output is correct |
120 |
Correct |
51 ms |
17608 KB |
Output is correct |
121 |
Correct |
8 ms |
9804 KB |
Output is correct |
122 |
Correct |
8 ms |
9848 KB |
Output is correct |
123 |
Correct |
8 ms |
9804 KB |
Output is correct |
124 |
Correct |
8 ms |
9752 KB |
Output is correct |
125 |
Correct |
8 ms |
9804 KB |
Output is correct |
126 |
Correct |
11 ms |
10572 KB |
Output is correct |
127 |
Correct |
11 ms |
10572 KB |
Output is correct |
128 |
Correct |
11 ms |
10572 KB |
Output is correct |
129 |
Correct |
11 ms |
10572 KB |
Output is correct |
130 |
Correct |
11 ms |
10572 KB |
Output is correct |
131 |
Correct |
12 ms |
10580 KB |
Output is correct |
132 |
Correct |
62 ms |
18372 KB |
Output is correct |
133 |
Correct |
58 ms |
18288 KB |
Output is correct |
134 |
Correct |
57 ms |
18316 KB |
Output is correct |
135 |
Correct |
10 ms |
9932 KB |
Output is correct |
136 |
Correct |
137 ms |
9932 KB |
Output is correct |
137 |
Correct |
95 ms |
9932 KB |
Output is correct |
138 |
Correct |
81 ms |
9932 KB |
Output is correct |
139 |
Correct |
104 ms |
10064 KB |
Output is correct |
140 |
Correct |
62 ms |
10060 KB |
Output is correct |
141 |
Correct |
28 ms |
12988 KB |
Output is correct |
142 |
Correct |
29 ms |
13124 KB |
Output is correct |
143 |
Correct |
35 ms |
14000 KB |
Output is correct |
144 |
Correct |
26 ms |
12932 KB |
Output is correct |
145 |
Correct |
33 ms |
13508 KB |
Output is correct |
146 |
Correct |
24 ms |
12404 KB |
Output is correct |
147 |
Correct |
39 ms |
14932 KB |
Output is correct |
148 |
Correct |
13 ms |
10608 KB |
Output is correct |
149 |
Correct |
50 ms |
16328 KB |
Output is correct |
150 |
Correct |
12 ms |
10572 KB |
Output is correct |
151 |
Correct |
55 ms |
16708 KB |
Output is correct |
152 |
Correct |
19 ms |
10912 KB |
Output is correct |
153 |
Correct |
19 ms |
11032 KB |
Output is correct |
154 |
Correct |
19 ms |
11484 KB |
Output is correct |
155 |
Correct |
15 ms |
10956 KB |
Output is correct |
156 |
Correct |
18 ms |
11212 KB |
Output is correct |
157 |
Correct |
10 ms |
9872 KB |
Output is correct |
158 |
Correct |
189 ms |
10080 KB |
Output is correct |
159 |
Correct |
172 ms |
10080 KB |
Output is correct |
160 |
Correct |
152 ms |
10104 KB |
Output is correct |
161 |
Correct |
137 ms |
10124 KB |
Output is correct |
162 |
Correct |
122 ms |
10060 KB |
Output is correct |
163 |
Correct |
40 ms |
14548 KB |
Output is correct |
164 |
Correct |
40 ms |
14520 KB |
Output is correct |
165 |
Correct |
42 ms |
14468 KB |
Output is correct |
166 |
Correct |
40 ms |
14452 KB |
Output is correct |
167 |
Correct |
41 ms |
14436 KB |
Output is correct |
168 |
Correct |
41 ms |
14440 KB |
Output is correct |
169 |
Correct |
69 ms |
18588 KB |
Output is correct |
170 |
Correct |
17 ms |
11212 KB |
Output is correct |
171 |
Correct |
68 ms |
18652 KB |
Output is correct |
172 |
Correct |
18 ms |
11220 KB |
Output is correct |
173 |
Correct |
70 ms |
18608 KB |
Output is correct |
174 |
Correct |
18 ms |
11120 KB |
Output is correct |
175 |
Correct |
20 ms |
11816 KB |
Output is correct |
176 |
Correct |
21 ms |
11752 KB |
Output is correct |
177 |
Correct |
20 ms |
11640 KB |
Output is correct |
178 |
Correct |
20 ms |
11580 KB |
Output is correct |
179 |
Correct |
18 ms |
10316 KB |
Output is correct |
180 |
Correct |
366 ms |
10444 KB |
Output is correct |
181 |
Correct |
534 ms |
10512 KB |
Output is correct |
182 |
Correct |
707 ms |
10736 KB |
Output is correct |
183 |
Correct |
347 ms |
10496 KB |
Output is correct |
184 |
Correct |
280 ms |
10472 KB |
Output is correct |
185 |
Correct |
59 ms |
16304 KB |
Output is correct |
186 |
Correct |
44 ms |
15804 KB |
Output is correct |
187 |
Correct |
67 ms |
17568 KB |
Output is correct |
188 |
Correct |
68 ms |
16328 KB |
Output is correct |
189 |
Correct |
75 ms |
15556 KB |
Output is correct |
190 |
Correct |
83 ms |
18200 KB |
Output is correct |
191 |
Correct |
63 ms |
16216 KB |
Output is correct |
192 |
Correct |
53 ms |
15304 KB |
Output is correct |
193 |
Correct |
47 ms |
13932 KB |
Output is correct |
194 |
Correct |
25 ms |
10580 KB |
Output is correct |
195 |
Correct |
936 ms |
11104 KB |
Output is correct |
196 |
Correct |
840 ms |
10816 KB |
Output is correct |
197 |
Correct |
741 ms |
10700 KB |
Output is correct |
198 |
Correct |
629 ms |
10792 KB |
Output is correct |
199 |
Correct |
560 ms |
10828 KB |
Output is correct |
200 |
Correct |
122 ms |
26160 KB |
Output is correct |
201 |
Correct |
128 ms |
26356 KB |
Output is correct |
202 |
Correct |
128 ms |
26276 KB |
Output is correct |
203 |
Correct |
124 ms |
26192 KB |
Output is correct |
204 |
Correct |
124 ms |
26280 KB |
Output is correct |
205 |
Correct |
126 ms |
26204 KB |
Output is correct |
206 |
Correct |
129 ms |
23876 KB |
Output is correct |
207 |
Correct |
90 ms |
21528 KB |
Output is correct |
208 |
Correct |
127 ms |
23884 KB |
Output is correct |
209 |
Correct |
96 ms |
21456 KB |
Output is correct |
210 |
Correct |
124 ms |
23876 KB |
Output is correct |
211 |
Correct |
89 ms |
21492 KB |
Output is correct |
212 |
Correct |
97 ms |
23876 KB |
Output is correct |
213 |
Correct |
97 ms |
20684 KB |
Output is correct |
214 |
Correct |
98 ms |
20188 KB |
Output is correct |
215 |
Correct |
106 ms |
20672 KB |
Output is correct |