#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include "paint.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
using iii = tuple<int,int,int>;
const int inf = 2e9+1;
const int mod = 1e9+7;
const int maxn = 3e5+100;
template<typename X, typename Y> bool ckmin(X& x, const Y& y) { return (y < x) ? (x=y,1):0; }
template<typename X, typename Y> bool ckmax(X& x, const Y& y) { return (x < y) ? (x=y,1):0; }
vector<int>f[maxn];
int minimumInstructions(int N, int M, int K, vector<int> C,vector<int> A, vector<vector<int>> B) {
vector<int>w(M);
vector<bool>pode(N);
for(int i=0;i<M;++i){
for(auto x : B[i]){
f[x].pb(i);
}
}
int qntM = 0;
for(int i=0;i<N;++i){
if(i>=M){
for(auto x:f[C[i-M]]){
int idx = ((x-i)%M+M)%M;
if(w[idx]==M)--qntM;
w[idx]--;
}
}
for(auto x:f[C[i]]){
int idx = ((x-i)%M+M)%M;
w[idx]++;
if(w[idx]==M)++qntM;
}
pode[i] = (qntM!=0);
}
int ans = 1, ptr = N-2, current = N-1;
while(true){
int nxt = -1;
while(ptr!=-1&&ptr>=current-M){
if(pode[ptr])nxt = ptr;
ptr--;
}
if(pode[current]&¤t<M)break;
if(nxt==-1||pode[current]==0){
ans = -1;break;
}
current = nxt, ++ans;
}
return ans;
}
// int main() {
// int N, M, K;
// assert(3 == scanf("%d %d %d", &N, &M, &K));
// std::vector<int> C(N);
// for (int i = 0; i < N; ++i) {
// assert(1 == scanf("%d", &C[i]));
// }
// std::vector<int> A(M);
// std::vector<std::vector<int>> B(M);
// for (int i = 0; i < M; ++i) {
// assert(1 == scanf("%d", &A[i]));
// B[i].resize(A[i]);
// for (int j = 0; j < A[i]; ++j) {
// assert(1 == scanf("%d", &B[i][j]));
// }
// }
// int minimum_instructions = minimumInstructions(N, M, K, C, A, B);
// printf("%d\n", minimum_instructions);
// return 0;
// }
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7356 KB |
Output is correct |
3 |
Correct |
4 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7252 KB |
Output is correct |
5 |
Correct |
4 ms |
7348 KB |
Output is correct |
6 |
Correct |
5 ms |
7252 KB |
Output is correct |
7 |
Correct |
5 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7352 KB |
Output is correct |
9 |
Correct |
5 ms |
7356 KB |
Output is correct |
10 |
Correct |
5 ms |
7356 KB |
Output is correct |
11 |
Correct |
5 ms |
7252 KB |
Output is correct |
12 |
Correct |
5 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7352 KB |
Output is correct |
14 |
Correct |
5 ms |
7380 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
5 ms |
7380 KB |
Output is correct |
17 |
Correct |
5 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7308 KB |
Output is correct |
19 |
Correct |
6 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7356 KB |
Output is correct |
21 |
Correct |
6 ms |
7360 KB |
Output is correct |
22 |
Correct |
25 ms |
11788 KB |
Output is correct |
23 |
Correct |
22 ms |
11860 KB |
Output is correct |
24 |
Correct |
27 ms |
11904 KB |
Output is correct |
25 |
Correct |
7 ms |
7492 KB |
Output is correct |
26 |
Correct |
7 ms |
7508 KB |
Output is correct |
27 |
Correct |
7 ms |
7508 KB |
Output is correct |
28 |
Correct |
8 ms |
7488 KB |
Output is correct |
29 |
Correct |
7 ms |
7492 KB |
Output is correct |
30 |
Correct |
7 ms |
7468 KB |
Output is correct |
31 |
Correct |
14 ms |
8660 KB |
Output is correct |
32 |
Correct |
13 ms |
8660 KB |
Output is correct |
33 |
Correct |
13 ms |
8660 KB |
Output is correct |
34 |
Correct |
12 ms |
8636 KB |
Output is correct |
35 |
Correct |
14 ms |
8660 KB |
Output is correct |
36 |
Correct |
13 ms |
8644 KB |
Output is correct |
37 |
Correct |
31 ms |
12268 KB |
Output is correct |
38 |
Correct |
29 ms |
12236 KB |
Output is correct |
39 |
Correct |
31 ms |
12292 KB |
Output is correct |
40 |
Correct |
14 ms |
8148 KB |
Output is correct |
41 |
Correct |
10 ms |
7892 KB |
Output is correct |
42 |
Correct |
17 ms |
8276 KB |
Output is correct |
43 |
Correct |
13 ms |
7956 KB |
Output is correct |
44 |
Correct |
12 ms |
7892 KB |
Output is correct |
45 |
Correct |
18 ms |
8376 KB |
Output is correct |
46 |
Correct |
46 ms |
17600 KB |
Output is correct |
47 |
Correct |
30 ms |
13124 KB |
Output is correct |
48 |
Correct |
35 ms |
15752 KB |
Output is correct |
49 |
Correct |
47 ms |
16148 KB |
Output is correct |
50 |
Correct |
52 ms |
15708 KB |
Output is correct |
51 |
Correct |
39 ms |
13368 KB |
Output is correct |
52 |
Correct |
16 ms |
8276 KB |
Output is correct |
53 |
Correct |
16 ms |
8356 KB |
Output is correct |
54 |
Correct |
18 ms |
8336 KB |
Output is correct |
55 |
Correct |
17 ms |
8328 KB |
Output is correct |
56 |
Correct |
18 ms |
8276 KB |
Output is correct |
57 |
Correct |
17 ms |
8332 KB |
Output is correct |
58 |
Correct |
57 ms |
18480 KB |
Output is correct |
59 |
Correct |
59 ms |
18508 KB |
Output is correct |
60 |
Correct |
59 ms |
18468 KB |
Output is correct |
61 |
Correct |
52 ms |
18580 KB |
Output is correct |
62 |
Correct |
56 ms |
18520 KB |
Output is correct |
63 |
Correct |
60 ms |
18508 KB |
Output is correct |
64 |
Correct |
64 ms |
17716 KB |
Output is correct |
65 |
Correct |
59 ms |
17792 KB |
Output is correct |
66 |
Correct |
66 ms |
17712 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7356 KB |
Output is correct |
3 |
Correct |
4 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7252 KB |
Output is correct |
5 |
Correct |
4 ms |
7348 KB |
Output is correct |
6 |
Correct |
5 ms |
7252 KB |
Output is correct |
7 |
Correct |
5 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7352 KB |
Output is correct |
9 |
Correct |
5 ms |
7356 KB |
Output is correct |
10 |
Correct |
5 ms |
7356 KB |
Output is correct |
11 |
Correct |
5 ms |
7252 KB |
Output is correct |
12 |
Correct |
5 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7352 KB |
Output is correct |
14 |
Correct |
5 ms |
7380 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
5 ms |
7380 KB |
Output is correct |
17 |
Correct |
5 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7308 KB |
Output is correct |
19 |
Correct |
6 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7356 KB |
Output is correct |
21 |
Correct |
6 ms |
7360 KB |
Output is correct |
22 |
Correct |
4 ms |
7352 KB |
Output is correct |
23 |
Correct |
4 ms |
7256 KB |
Output is correct |
24 |
Correct |
4 ms |
7364 KB |
Output is correct |
25 |
Correct |
4 ms |
7252 KB |
Output is correct |
26 |
Correct |
4 ms |
7236 KB |
Output is correct |
27 |
Correct |
4 ms |
7252 KB |
Output is correct |
28 |
Correct |
5 ms |
7352 KB |
Output is correct |
29 |
Correct |
5 ms |
7252 KB |
Output is correct |
30 |
Correct |
4 ms |
7252 KB |
Output is correct |
31 |
Correct |
5 ms |
7252 KB |
Output is correct |
32 |
Correct |
5 ms |
7356 KB |
Output is correct |
33 |
Correct |
5 ms |
7352 KB |
Output is correct |
34 |
Correct |
5 ms |
7380 KB |
Output is correct |
35 |
Correct |
4 ms |
7356 KB |
Output is correct |
36 |
Correct |
4 ms |
7380 KB |
Output is correct |
37 |
Correct |
4 ms |
7380 KB |
Output is correct |
38 |
Correct |
5 ms |
7380 KB |
Output is correct |
39 |
Correct |
4 ms |
7252 KB |
Output is correct |
40 |
Correct |
4 ms |
7352 KB |
Output is correct |
41 |
Correct |
4 ms |
7252 KB |
Output is correct |
42 |
Correct |
4 ms |
7380 KB |
Output is correct |
43 |
Correct |
4 ms |
7356 KB |
Output is correct |
44 |
Correct |
5 ms |
7252 KB |
Output is correct |
45 |
Correct |
5 ms |
7252 KB |
Output is correct |
46 |
Correct |
5 ms |
7252 KB |
Output is correct |
47 |
Correct |
4 ms |
7252 KB |
Output is correct |
48 |
Correct |
4 ms |
7352 KB |
Output is correct |
49 |
Correct |
5 ms |
7252 KB |
Output is correct |
50 |
Correct |
5 ms |
7356 KB |
Output is correct |
51 |
Correct |
4 ms |
7400 KB |
Output is correct |
52 |
Correct |
4 ms |
7360 KB |
Output is correct |
53 |
Correct |
4 ms |
7384 KB |
Output is correct |
54 |
Correct |
4 ms |
7384 KB |
Output is correct |
55 |
Correct |
5 ms |
7380 KB |
Output is correct |
56 |
Correct |
5 ms |
7380 KB |
Output is correct |
57 |
Correct |
5 ms |
7380 KB |
Output is correct |
58 |
Correct |
5 ms |
7356 KB |
Output is correct |
59 |
Correct |
5 ms |
7356 KB |
Output is correct |
60 |
Correct |
5 ms |
7360 KB |
Output is correct |
61 |
Correct |
5 ms |
7380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7352 KB |
Output is correct |
2 |
Correct |
4 ms |
7256 KB |
Output is correct |
3 |
Correct |
4 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7356 KB |
Output is correct |
5 |
Correct |
4 ms |
7252 KB |
Output is correct |
6 |
Correct |
4 ms |
7252 KB |
Output is correct |
7 |
Correct |
4 ms |
7348 KB |
Output is correct |
8 |
Correct |
5 ms |
7252 KB |
Output is correct |
9 |
Correct |
5 ms |
7252 KB |
Output is correct |
10 |
Correct |
4 ms |
7352 KB |
Output is correct |
11 |
Correct |
5 ms |
7356 KB |
Output is correct |
12 |
Correct |
5 ms |
7356 KB |
Output is correct |
13 |
Correct |
5 ms |
7252 KB |
Output is correct |
14 |
Correct |
5 ms |
7252 KB |
Output is correct |
15 |
Correct |
4 ms |
7352 KB |
Output is correct |
16 |
Correct |
5 ms |
7380 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7380 KB |
Output is correct |
19 |
Correct |
5 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7308 KB |
Output is correct |
21 |
Correct |
6 ms |
7380 KB |
Output is correct |
22 |
Correct |
5 ms |
7356 KB |
Output is correct |
23 |
Correct |
6 ms |
7360 KB |
Output is correct |
24 |
Correct |
25 ms |
11788 KB |
Output is correct |
25 |
Correct |
22 ms |
11860 KB |
Output is correct |
26 |
Correct |
27 ms |
11904 KB |
Output is correct |
27 |
Correct |
4 ms |
7364 KB |
Output is correct |
28 |
Correct |
4 ms |
7252 KB |
Output is correct |
29 |
Correct |
4 ms |
7236 KB |
Output is correct |
30 |
Correct |
4 ms |
7252 KB |
Output is correct |
31 |
Correct |
5 ms |
7352 KB |
Output is correct |
32 |
Correct |
5 ms |
7252 KB |
Output is correct |
33 |
Correct |
4 ms |
7252 KB |
Output is correct |
34 |
Correct |
5 ms |
7252 KB |
Output is correct |
35 |
Correct |
5 ms |
7356 KB |
Output is correct |
36 |
Correct |
5 ms |
7352 KB |
Output is correct |
37 |
Correct |
5 ms |
7380 KB |
Output is correct |
38 |
Correct |
4 ms |
7356 KB |
Output is correct |
39 |
Correct |
4 ms |
7380 KB |
Output is correct |
40 |
Correct |
4 ms |
7380 KB |
Output is correct |
41 |
Correct |
5 ms |
7380 KB |
Output is correct |
42 |
Correct |
4 ms |
7252 KB |
Output is correct |
43 |
Correct |
4 ms |
7352 KB |
Output is correct |
44 |
Correct |
4 ms |
7252 KB |
Output is correct |
45 |
Correct |
4 ms |
7380 KB |
Output is correct |
46 |
Correct |
4 ms |
7356 KB |
Output is correct |
47 |
Correct |
5 ms |
7252 KB |
Output is correct |
48 |
Correct |
5 ms |
7252 KB |
Output is correct |
49 |
Correct |
5 ms |
7252 KB |
Output is correct |
50 |
Correct |
4 ms |
7252 KB |
Output is correct |
51 |
Correct |
4 ms |
7352 KB |
Output is correct |
52 |
Correct |
5 ms |
7252 KB |
Output is correct |
53 |
Correct |
5 ms |
7356 KB |
Output is correct |
54 |
Correct |
4 ms |
7400 KB |
Output is correct |
55 |
Correct |
4 ms |
7360 KB |
Output is correct |
56 |
Correct |
4 ms |
7384 KB |
Output is correct |
57 |
Correct |
4 ms |
7384 KB |
Output is correct |
58 |
Correct |
5 ms |
7380 KB |
Output is correct |
59 |
Correct |
5 ms |
7380 KB |
Output is correct |
60 |
Correct |
5 ms |
7380 KB |
Output is correct |
61 |
Correct |
5 ms |
7356 KB |
Output is correct |
62 |
Correct |
5 ms |
7356 KB |
Output is correct |
63 |
Correct |
5 ms |
7360 KB |
Output is correct |
64 |
Correct |
5 ms |
7380 KB |
Output is correct |
65 |
Correct |
5 ms |
7252 KB |
Output is correct |
66 |
Correct |
5 ms |
7252 KB |
Output is correct |
67 |
Correct |
5 ms |
7380 KB |
Output is correct |
68 |
Correct |
5 ms |
7252 KB |
Output is correct |
69 |
Correct |
5 ms |
7412 KB |
Output is correct |
70 |
Correct |
6 ms |
7492 KB |
Output is correct |
71 |
Correct |
7 ms |
7508 KB |
Output is correct |
72 |
Correct |
6 ms |
7508 KB |
Output is correct |
73 |
Correct |
5 ms |
7384 KB |
Output is correct |
74 |
Correct |
6 ms |
7512 KB |
Output is correct |
75 |
Correct |
6 ms |
7508 KB |
Output is correct |
76 |
Correct |
27 ms |
10576 KB |
Output is correct |
77 |
Correct |
22 ms |
11084 KB |
Output is correct |
78 |
Correct |
29 ms |
11596 KB |
Output is correct |
79 |
Correct |
7 ms |
7380 KB |
Output is correct |
80 |
Correct |
7 ms |
7480 KB |
Output is correct |
81 |
Correct |
7 ms |
7380 KB |
Output is correct |
82 |
Correct |
6 ms |
7380 KB |
Output is correct |
83 |
Correct |
7 ms |
7380 KB |
Output is correct |
84 |
Correct |
7 ms |
7616 KB |
Output is correct |
85 |
Correct |
7 ms |
7624 KB |
Output is correct |
86 |
Correct |
6 ms |
7636 KB |
Output is correct |
87 |
Correct |
7 ms |
7624 KB |
Output is correct |
88 |
Correct |
7 ms |
7572 KB |
Output is correct |
89 |
Correct |
7 ms |
7620 KB |
Output is correct |
90 |
Correct |
38 ms |
11904 KB |
Output is correct |
91 |
Correct |
36 ms |
11852 KB |
Output is correct |
92 |
Correct |
32 ms |
11936 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7352 KB |
Output is correct |
2 |
Correct |
4 ms |
7256 KB |
Output is correct |
3 |
Correct |
4 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7356 KB |
Output is correct |
5 |
Correct |
4 ms |
7252 KB |
Output is correct |
6 |
Correct |
4 ms |
7252 KB |
Output is correct |
7 |
Correct |
4 ms |
7348 KB |
Output is correct |
8 |
Correct |
5 ms |
7252 KB |
Output is correct |
9 |
Correct |
5 ms |
7252 KB |
Output is correct |
10 |
Correct |
4 ms |
7352 KB |
Output is correct |
11 |
Correct |
5 ms |
7356 KB |
Output is correct |
12 |
Correct |
5 ms |
7356 KB |
Output is correct |
13 |
Correct |
5 ms |
7252 KB |
Output is correct |
14 |
Correct |
5 ms |
7252 KB |
Output is correct |
15 |
Correct |
4 ms |
7352 KB |
Output is correct |
16 |
Correct |
5 ms |
7380 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7380 KB |
Output is correct |
19 |
Correct |
5 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7308 KB |
Output is correct |
21 |
Correct |
6 ms |
7380 KB |
Output is correct |
22 |
Correct |
5 ms |
7356 KB |
Output is correct |
23 |
Correct |
6 ms |
7360 KB |
Output is correct |
24 |
Correct |
25 ms |
11788 KB |
Output is correct |
25 |
Correct |
22 ms |
11860 KB |
Output is correct |
26 |
Correct |
27 ms |
11904 KB |
Output is correct |
27 |
Correct |
7 ms |
7492 KB |
Output is correct |
28 |
Correct |
7 ms |
7508 KB |
Output is correct |
29 |
Correct |
7 ms |
7508 KB |
Output is correct |
30 |
Correct |
8 ms |
7488 KB |
Output is correct |
31 |
Correct |
7 ms |
7492 KB |
Output is correct |
32 |
Correct |
7 ms |
7468 KB |
Output is correct |
33 |
Correct |
14 ms |
8660 KB |
Output is correct |
34 |
Correct |
13 ms |
8660 KB |
Output is correct |
35 |
Correct |
13 ms |
8660 KB |
Output is correct |
36 |
Correct |
12 ms |
8636 KB |
Output is correct |
37 |
Correct |
14 ms |
8660 KB |
Output is correct |
38 |
Correct |
13 ms |
8644 KB |
Output is correct |
39 |
Correct |
31 ms |
12268 KB |
Output is correct |
40 |
Correct |
29 ms |
12236 KB |
Output is correct |
41 |
Correct |
31 ms |
12292 KB |
Output is correct |
42 |
Correct |
4 ms |
7364 KB |
Output is correct |
43 |
Correct |
4 ms |
7252 KB |
Output is correct |
44 |
Correct |
4 ms |
7236 KB |
Output is correct |
45 |
Correct |
4 ms |
7252 KB |
Output is correct |
46 |
Correct |
5 ms |
7352 KB |
Output is correct |
47 |
Correct |
5 ms |
7252 KB |
Output is correct |
48 |
Correct |
4 ms |
7252 KB |
Output is correct |
49 |
Correct |
5 ms |
7252 KB |
Output is correct |
50 |
Correct |
5 ms |
7356 KB |
Output is correct |
51 |
Correct |
5 ms |
7352 KB |
Output is correct |
52 |
Correct |
5 ms |
7380 KB |
Output is correct |
53 |
Correct |
4 ms |
7356 KB |
Output is correct |
54 |
Correct |
4 ms |
7380 KB |
Output is correct |
55 |
Correct |
4 ms |
7380 KB |
Output is correct |
56 |
Correct |
5 ms |
7380 KB |
Output is correct |
57 |
Correct |
4 ms |
7252 KB |
Output is correct |
58 |
Correct |
4 ms |
7352 KB |
Output is correct |
59 |
Correct |
4 ms |
7252 KB |
Output is correct |
60 |
Correct |
4 ms |
7380 KB |
Output is correct |
61 |
Correct |
4 ms |
7356 KB |
Output is correct |
62 |
Correct |
5 ms |
7252 KB |
Output is correct |
63 |
Correct |
5 ms |
7252 KB |
Output is correct |
64 |
Correct |
5 ms |
7252 KB |
Output is correct |
65 |
Correct |
4 ms |
7252 KB |
Output is correct |
66 |
Correct |
4 ms |
7352 KB |
Output is correct |
67 |
Correct |
5 ms |
7252 KB |
Output is correct |
68 |
Correct |
5 ms |
7356 KB |
Output is correct |
69 |
Correct |
4 ms |
7400 KB |
Output is correct |
70 |
Correct |
4 ms |
7360 KB |
Output is correct |
71 |
Correct |
4 ms |
7384 KB |
Output is correct |
72 |
Correct |
4 ms |
7384 KB |
Output is correct |
73 |
Correct |
5 ms |
7380 KB |
Output is correct |
74 |
Correct |
5 ms |
7380 KB |
Output is correct |
75 |
Correct |
5 ms |
7380 KB |
Output is correct |
76 |
Correct |
5 ms |
7356 KB |
Output is correct |
77 |
Correct |
5 ms |
7356 KB |
Output is correct |
78 |
Correct |
5 ms |
7360 KB |
Output is correct |
79 |
Correct |
5 ms |
7380 KB |
Output is correct |
80 |
Correct |
5 ms |
7252 KB |
Output is correct |
81 |
Correct |
5 ms |
7252 KB |
Output is correct |
82 |
Correct |
5 ms |
7380 KB |
Output is correct |
83 |
Correct |
5 ms |
7252 KB |
Output is correct |
84 |
Correct |
5 ms |
7412 KB |
Output is correct |
85 |
Correct |
6 ms |
7492 KB |
Output is correct |
86 |
Correct |
7 ms |
7508 KB |
Output is correct |
87 |
Correct |
6 ms |
7508 KB |
Output is correct |
88 |
Correct |
5 ms |
7384 KB |
Output is correct |
89 |
Correct |
6 ms |
7512 KB |
Output is correct |
90 |
Correct |
6 ms |
7508 KB |
Output is correct |
91 |
Correct |
27 ms |
10576 KB |
Output is correct |
92 |
Correct |
22 ms |
11084 KB |
Output is correct |
93 |
Correct |
29 ms |
11596 KB |
Output is correct |
94 |
Correct |
7 ms |
7380 KB |
Output is correct |
95 |
Correct |
7 ms |
7480 KB |
Output is correct |
96 |
Correct |
7 ms |
7380 KB |
Output is correct |
97 |
Correct |
6 ms |
7380 KB |
Output is correct |
98 |
Correct |
7 ms |
7380 KB |
Output is correct |
99 |
Correct |
7 ms |
7616 KB |
Output is correct |
100 |
Correct |
7 ms |
7624 KB |
Output is correct |
101 |
Correct |
6 ms |
7636 KB |
Output is correct |
102 |
Correct |
7 ms |
7624 KB |
Output is correct |
103 |
Correct |
7 ms |
7572 KB |
Output is correct |
104 |
Correct |
7 ms |
7620 KB |
Output is correct |
105 |
Correct |
38 ms |
11904 KB |
Output is correct |
106 |
Correct |
36 ms |
11852 KB |
Output is correct |
107 |
Correct |
32 ms |
11936 KB |
Output is correct |
108 |
Correct |
8 ms |
7464 KB |
Output is correct |
109 |
Correct |
224 ms |
7628 KB |
Output is correct |
110 |
Correct |
126 ms |
7508 KB |
Output is correct |
111 |
Correct |
91 ms |
7536 KB |
Output is correct |
112 |
Correct |
110 ms |
7608 KB |
Output is correct |
113 |
Correct |
71 ms |
7572 KB |
Output is correct |
114 |
Correct |
18 ms |
8896 KB |
Output is correct |
115 |
Correct |
18 ms |
8820 KB |
Output is correct |
116 |
Correct |
21 ms |
9172 KB |
Output is correct |
117 |
Correct |
17 ms |
8912 KB |
Output is correct |
118 |
Correct |
19 ms |
9036 KB |
Output is correct |
119 |
Correct |
16 ms |
8660 KB |
Output is correct |
120 |
Correct |
26 ms |
10308 KB |
Output is correct |
121 |
Correct |
9 ms |
8148 KB |
Output is correct |
122 |
Correct |
31 ms |
10644 KB |
Output is correct |
123 |
Correct |
9 ms |
7828 KB |
Output is correct |
124 |
Correct |
33 ms |
11220 KB |
Output is correct |
125 |
Correct |
11 ms |
8148 KB |
Output is correct |
126 |
Correct |
12 ms |
8264 KB |
Output is correct |
127 |
Correct |
14 ms |
8556 KB |
Output is correct |
128 |
Correct |
11 ms |
8244 KB |
Output is correct |
129 |
Correct |
11 ms |
8272 KB |
Output is correct |
130 |
Correct |
7 ms |
7508 KB |
Output is correct |
131 |
Correct |
320 ms |
7636 KB |
Output is correct |
132 |
Correct |
231 ms |
7756 KB |
Output is correct |
133 |
Correct |
185 ms |
7648 KB |
Output is correct |
134 |
Correct |
161 ms |
7668 KB |
Output is correct |
135 |
Correct |
148 ms |
7636 KB |
Output is correct |
136 |
Correct |
25 ms |
9416 KB |
Output is correct |
137 |
Correct |
24 ms |
9420 KB |
Output is correct |
138 |
Correct |
23 ms |
9448 KB |
Output is correct |
139 |
Correct |
23 ms |
9500 KB |
Output is correct |
140 |
Correct |
23 ms |
9452 KB |
Output is correct |
141 |
Correct |
25 ms |
9412 KB |
Output is correct |
142 |
Correct |
48 ms |
12364 KB |
Output is correct |
143 |
Correct |
13 ms |
8348 KB |
Output is correct |
144 |
Correct |
40 ms |
12372 KB |
Output is correct |
145 |
Correct |
12 ms |
8388 KB |
Output is correct |
146 |
Correct |
39 ms |
12364 KB |
Output is correct |
147 |
Correct |
14 ms |
8344 KB |
Output is correct |
148 |
Correct |
16 ms |
8836 KB |
Output is correct |
149 |
Correct |
16 ms |
8712 KB |
Output is correct |
150 |
Correct |
16 ms |
8660 KB |
Output is correct |
151 |
Correct |
15 ms |
8660 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7352 KB |
Output is correct |
2 |
Correct |
4 ms |
7256 KB |
Output is correct |
3 |
Correct |
4 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7356 KB |
Output is correct |
5 |
Correct |
4 ms |
7252 KB |
Output is correct |
6 |
Correct |
4 ms |
7252 KB |
Output is correct |
7 |
Correct |
4 ms |
7348 KB |
Output is correct |
8 |
Correct |
5 ms |
7252 KB |
Output is correct |
9 |
Correct |
5 ms |
7252 KB |
Output is correct |
10 |
Correct |
4 ms |
7352 KB |
Output is correct |
11 |
Correct |
5 ms |
7356 KB |
Output is correct |
12 |
Correct |
5 ms |
7356 KB |
Output is correct |
13 |
Correct |
5 ms |
7252 KB |
Output is correct |
14 |
Correct |
5 ms |
7252 KB |
Output is correct |
15 |
Correct |
4 ms |
7352 KB |
Output is correct |
16 |
Correct |
5 ms |
7380 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7380 KB |
Output is correct |
19 |
Correct |
5 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7308 KB |
Output is correct |
21 |
Correct |
6 ms |
7380 KB |
Output is correct |
22 |
Correct |
5 ms |
7356 KB |
Output is correct |
23 |
Correct |
6 ms |
7360 KB |
Output is correct |
24 |
Correct |
25 ms |
11788 KB |
Output is correct |
25 |
Correct |
22 ms |
11860 KB |
Output is correct |
26 |
Correct |
27 ms |
11904 KB |
Output is correct |
27 |
Correct |
7 ms |
7492 KB |
Output is correct |
28 |
Correct |
7 ms |
7508 KB |
Output is correct |
29 |
Correct |
7 ms |
7508 KB |
Output is correct |
30 |
Correct |
8 ms |
7488 KB |
Output is correct |
31 |
Correct |
7 ms |
7492 KB |
Output is correct |
32 |
Correct |
7 ms |
7468 KB |
Output is correct |
33 |
Correct |
14 ms |
8660 KB |
Output is correct |
34 |
Correct |
13 ms |
8660 KB |
Output is correct |
35 |
Correct |
13 ms |
8660 KB |
Output is correct |
36 |
Correct |
12 ms |
8636 KB |
Output is correct |
37 |
Correct |
14 ms |
8660 KB |
Output is correct |
38 |
Correct |
13 ms |
8644 KB |
Output is correct |
39 |
Correct |
31 ms |
12268 KB |
Output is correct |
40 |
Correct |
29 ms |
12236 KB |
Output is correct |
41 |
Correct |
31 ms |
12292 KB |
Output is correct |
42 |
Correct |
14 ms |
8148 KB |
Output is correct |
43 |
Correct |
10 ms |
7892 KB |
Output is correct |
44 |
Correct |
17 ms |
8276 KB |
Output is correct |
45 |
Correct |
13 ms |
7956 KB |
Output is correct |
46 |
Correct |
12 ms |
7892 KB |
Output is correct |
47 |
Correct |
18 ms |
8376 KB |
Output is correct |
48 |
Correct |
46 ms |
17600 KB |
Output is correct |
49 |
Correct |
30 ms |
13124 KB |
Output is correct |
50 |
Correct |
35 ms |
15752 KB |
Output is correct |
51 |
Correct |
47 ms |
16148 KB |
Output is correct |
52 |
Correct |
52 ms |
15708 KB |
Output is correct |
53 |
Correct |
39 ms |
13368 KB |
Output is correct |
54 |
Correct |
16 ms |
8276 KB |
Output is correct |
55 |
Correct |
16 ms |
8356 KB |
Output is correct |
56 |
Correct |
18 ms |
8336 KB |
Output is correct |
57 |
Correct |
17 ms |
8328 KB |
Output is correct |
58 |
Correct |
18 ms |
8276 KB |
Output is correct |
59 |
Correct |
17 ms |
8332 KB |
Output is correct |
60 |
Correct |
57 ms |
18480 KB |
Output is correct |
61 |
Correct |
59 ms |
18508 KB |
Output is correct |
62 |
Correct |
59 ms |
18468 KB |
Output is correct |
63 |
Correct |
52 ms |
18580 KB |
Output is correct |
64 |
Correct |
56 ms |
18520 KB |
Output is correct |
65 |
Correct |
60 ms |
18508 KB |
Output is correct |
66 |
Correct |
64 ms |
17716 KB |
Output is correct |
67 |
Correct |
59 ms |
17792 KB |
Output is correct |
68 |
Correct |
66 ms |
17712 KB |
Output is correct |
69 |
Correct |
4 ms |
7364 KB |
Output is correct |
70 |
Correct |
4 ms |
7252 KB |
Output is correct |
71 |
Correct |
4 ms |
7236 KB |
Output is correct |
72 |
Correct |
4 ms |
7252 KB |
Output is correct |
73 |
Correct |
5 ms |
7352 KB |
Output is correct |
74 |
Correct |
5 ms |
7252 KB |
Output is correct |
75 |
Correct |
4 ms |
7252 KB |
Output is correct |
76 |
Correct |
5 ms |
7252 KB |
Output is correct |
77 |
Correct |
5 ms |
7356 KB |
Output is correct |
78 |
Correct |
5 ms |
7352 KB |
Output is correct |
79 |
Correct |
5 ms |
7380 KB |
Output is correct |
80 |
Correct |
4 ms |
7356 KB |
Output is correct |
81 |
Correct |
4 ms |
7380 KB |
Output is correct |
82 |
Correct |
4 ms |
7380 KB |
Output is correct |
83 |
Correct |
5 ms |
7380 KB |
Output is correct |
84 |
Correct |
4 ms |
7252 KB |
Output is correct |
85 |
Correct |
4 ms |
7352 KB |
Output is correct |
86 |
Correct |
4 ms |
7252 KB |
Output is correct |
87 |
Correct |
4 ms |
7380 KB |
Output is correct |
88 |
Correct |
4 ms |
7356 KB |
Output is correct |
89 |
Correct |
5 ms |
7252 KB |
Output is correct |
90 |
Correct |
5 ms |
7252 KB |
Output is correct |
91 |
Correct |
5 ms |
7252 KB |
Output is correct |
92 |
Correct |
4 ms |
7252 KB |
Output is correct |
93 |
Correct |
4 ms |
7352 KB |
Output is correct |
94 |
Correct |
5 ms |
7252 KB |
Output is correct |
95 |
Correct |
5 ms |
7356 KB |
Output is correct |
96 |
Correct |
4 ms |
7400 KB |
Output is correct |
97 |
Correct |
4 ms |
7360 KB |
Output is correct |
98 |
Correct |
4 ms |
7384 KB |
Output is correct |
99 |
Correct |
4 ms |
7384 KB |
Output is correct |
100 |
Correct |
5 ms |
7380 KB |
Output is correct |
101 |
Correct |
5 ms |
7380 KB |
Output is correct |
102 |
Correct |
5 ms |
7380 KB |
Output is correct |
103 |
Correct |
5 ms |
7356 KB |
Output is correct |
104 |
Correct |
5 ms |
7356 KB |
Output is correct |
105 |
Correct |
5 ms |
7360 KB |
Output is correct |
106 |
Correct |
5 ms |
7380 KB |
Output is correct |
107 |
Correct |
5 ms |
7252 KB |
Output is correct |
108 |
Correct |
5 ms |
7252 KB |
Output is correct |
109 |
Correct |
5 ms |
7380 KB |
Output is correct |
110 |
Correct |
5 ms |
7252 KB |
Output is correct |
111 |
Correct |
5 ms |
7412 KB |
Output is correct |
112 |
Correct |
6 ms |
7492 KB |
Output is correct |
113 |
Correct |
7 ms |
7508 KB |
Output is correct |
114 |
Correct |
6 ms |
7508 KB |
Output is correct |
115 |
Correct |
5 ms |
7384 KB |
Output is correct |
116 |
Correct |
6 ms |
7512 KB |
Output is correct |
117 |
Correct |
6 ms |
7508 KB |
Output is correct |
118 |
Correct |
27 ms |
10576 KB |
Output is correct |
119 |
Correct |
22 ms |
11084 KB |
Output is correct |
120 |
Correct |
29 ms |
11596 KB |
Output is correct |
121 |
Correct |
7 ms |
7380 KB |
Output is correct |
122 |
Correct |
7 ms |
7480 KB |
Output is correct |
123 |
Correct |
7 ms |
7380 KB |
Output is correct |
124 |
Correct |
6 ms |
7380 KB |
Output is correct |
125 |
Correct |
7 ms |
7380 KB |
Output is correct |
126 |
Correct |
7 ms |
7616 KB |
Output is correct |
127 |
Correct |
7 ms |
7624 KB |
Output is correct |
128 |
Correct |
6 ms |
7636 KB |
Output is correct |
129 |
Correct |
7 ms |
7624 KB |
Output is correct |
130 |
Correct |
7 ms |
7572 KB |
Output is correct |
131 |
Correct |
7 ms |
7620 KB |
Output is correct |
132 |
Correct |
38 ms |
11904 KB |
Output is correct |
133 |
Correct |
36 ms |
11852 KB |
Output is correct |
134 |
Correct |
32 ms |
11936 KB |
Output is correct |
135 |
Correct |
8 ms |
7464 KB |
Output is correct |
136 |
Correct |
224 ms |
7628 KB |
Output is correct |
137 |
Correct |
126 ms |
7508 KB |
Output is correct |
138 |
Correct |
91 ms |
7536 KB |
Output is correct |
139 |
Correct |
110 ms |
7608 KB |
Output is correct |
140 |
Correct |
71 ms |
7572 KB |
Output is correct |
141 |
Correct |
18 ms |
8896 KB |
Output is correct |
142 |
Correct |
18 ms |
8820 KB |
Output is correct |
143 |
Correct |
21 ms |
9172 KB |
Output is correct |
144 |
Correct |
17 ms |
8912 KB |
Output is correct |
145 |
Correct |
19 ms |
9036 KB |
Output is correct |
146 |
Correct |
16 ms |
8660 KB |
Output is correct |
147 |
Correct |
26 ms |
10308 KB |
Output is correct |
148 |
Correct |
9 ms |
8148 KB |
Output is correct |
149 |
Correct |
31 ms |
10644 KB |
Output is correct |
150 |
Correct |
9 ms |
7828 KB |
Output is correct |
151 |
Correct |
33 ms |
11220 KB |
Output is correct |
152 |
Correct |
11 ms |
8148 KB |
Output is correct |
153 |
Correct |
12 ms |
8264 KB |
Output is correct |
154 |
Correct |
14 ms |
8556 KB |
Output is correct |
155 |
Correct |
11 ms |
8244 KB |
Output is correct |
156 |
Correct |
11 ms |
8272 KB |
Output is correct |
157 |
Correct |
7 ms |
7508 KB |
Output is correct |
158 |
Correct |
320 ms |
7636 KB |
Output is correct |
159 |
Correct |
231 ms |
7756 KB |
Output is correct |
160 |
Correct |
185 ms |
7648 KB |
Output is correct |
161 |
Correct |
161 ms |
7668 KB |
Output is correct |
162 |
Correct |
148 ms |
7636 KB |
Output is correct |
163 |
Correct |
25 ms |
9416 KB |
Output is correct |
164 |
Correct |
24 ms |
9420 KB |
Output is correct |
165 |
Correct |
23 ms |
9448 KB |
Output is correct |
166 |
Correct |
23 ms |
9500 KB |
Output is correct |
167 |
Correct |
23 ms |
9452 KB |
Output is correct |
168 |
Correct |
25 ms |
9412 KB |
Output is correct |
169 |
Correct |
48 ms |
12364 KB |
Output is correct |
170 |
Correct |
13 ms |
8348 KB |
Output is correct |
171 |
Correct |
40 ms |
12372 KB |
Output is correct |
172 |
Correct |
12 ms |
8388 KB |
Output is correct |
173 |
Correct |
39 ms |
12364 KB |
Output is correct |
174 |
Correct |
14 ms |
8344 KB |
Output is correct |
175 |
Correct |
16 ms |
8836 KB |
Output is correct |
176 |
Correct |
16 ms |
8712 KB |
Output is correct |
177 |
Correct |
16 ms |
8660 KB |
Output is correct |
178 |
Correct |
15 ms |
8660 KB |
Output is correct |
179 |
Correct |
13 ms |
7892 KB |
Output is correct |
180 |
Correct |
672 ms |
7920 KB |
Output is correct |
181 |
Correct |
738 ms |
8188 KB |
Output is correct |
182 |
Correct |
927 ms |
8448 KB |
Output is correct |
183 |
Correct |
463 ms |
8268 KB |
Output is correct |
184 |
Correct |
390 ms |
8108 KB |
Output is correct |
185 |
Correct |
39 ms |
11520 KB |
Output is correct |
186 |
Correct |
35 ms |
13012 KB |
Output is correct |
187 |
Correct |
45 ms |
12320 KB |
Output is correct |
188 |
Correct |
49 ms |
11816 KB |
Output is correct |
189 |
Correct |
40 ms |
11724 KB |
Output is correct |
190 |
Correct |
52 ms |
13144 KB |
Output is correct |
191 |
Correct |
47 ms |
12528 KB |
Output is correct |
192 |
Correct |
35 ms |
11108 KB |
Output is correct |
193 |
Correct |
33 ms |
10512 KB |
Output is correct |
194 |
Correct |
18 ms |
8312 KB |
Output is correct |
195 |
Execution timed out |
1580 ms |
8388 KB |
Time limit exceeded |
196 |
Halted |
0 ms |
0 KB |
- |