#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cerr.tie(0)
#define mp make_pair
#define xx first
#define yy second
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(x) x.begin(),x.end()
#define ff(i,a,b) for (int i = a; i < b; i++)
#define fff(i,a,b) for (int i = a; i <= b; i++)
#define bff(i,a,b) for (int i = b-1; i >= a; i--)
#define bfff(i,a,b) for (int i = b; i >= a; i--)
using namespace std;
long double typedef ld;
unsigned int typedef ui;
long long int typedef li;
pair<int,int> typedef pii;
pair<li,li> typedef pli;
pair<ld,ld> typedef pld;
vector<vector<int>> typedef graph;
unsigned long long int typedef ull;
//const int mod = 998244353;
const int mod = 1000000007;
//Note to self: Check for overflow
#include "paint.h"
int upizdi(int i, int n)
{
i%=n;
if (i<0) i+=n;
return i;
}
vector<int> koji[100005]; //koji kontraktori sadrze ovu boju, svkk su indexirani
vector<int> poz[100005]; //reindeksirane kontrakcije
bool chiba[100005]; //da li siba, na osnovu toga racuna minimalan broj poteza
int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b)
{
ff(i,0,m) for (auto it : b[i]) koji[it].pb(i);
ff(i,0,n) for (auto kont : koji[c[i]]) poz[upizdi(kont-i,m)].pb(i);
ff(i,0,m)
{
int uzo=1;
if (uzo>=m) chiba[poz[i][0]-m+1]=1;
ff(j,1,(int)poz[i].size())
{
if (poz[i][j]-poz[i][j-1]==1) uzo++;
else uzo=1;
if (uzo>=m) chiba[poz[i][j]-m+1]=1;
}
}
int poslednji=-mod,snaga=0,ans=0;
ff(i,0,n)
{
if (chiba[i]) poslednji=i;
if (snaga<=0)
{
if (i>=poslednji+m) return -1;
snaga=poslednji+m-i,ans++;
}
snaga--;
}
return ans;
}
//Note to self: Check for overflow
/*
8 3 5
3 3 1 3 4 4 2 2
3 0 1 2
2 2 3
2 3 4
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
3 ms |
4948 KB |
Output is correct |
15 |
Correct |
3 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
3 ms |
4948 KB |
Output is correct |
22 |
Correct |
19 ms |
8916 KB |
Output is correct |
23 |
Correct |
18 ms |
8888 KB |
Output is correct |
24 |
Correct |
18 ms |
8852 KB |
Output is correct |
25 |
Correct |
4 ms |
5332 KB |
Output is correct |
26 |
Correct |
5 ms |
5388 KB |
Output is correct |
27 |
Correct |
5 ms |
5332 KB |
Output is correct |
28 |
Correct |
5 ms |
5204 KB |
Output is correct |
29 |
Correct |
5 ms |
5208 KB |
Output is correct |
30 |
Correct |
5 ms |
5204 KB |
Output is correct |
31 |
Correct |
11 ms |
6228 KB |
Output is correct |
32 |
Correct |
9 ms |
6232 KB |
Output is correct |
33 |
Correct |
10 ms |
6300 KB |
Output is correct |
34 |
Correct |
11 ms |
6228 KB |
Output is correct |
35 |
Correct |
11 ms |
6312 KB |
Output is correct |
36 |
Correct |
11 ms |
6228 KB |
Output is correct |
37 |
Correct |
23 ms |
9328 KB |
Output is correct |
38 |
Correct |
25 ms |
9428 KB |
Output is correct |
39 |
Correct |
25 ms |
9396 KB |
Output is correct |
40 |
Correct |
12 ms |
6264 KB |
Output is correct |
41 |
Correct |
12 ms |
5756 KB |
Output is correct |
42 |
Correct |
13 ms |
6440 KB |
Output is correct |
43 |
Correct |
9 ms |
5916 KB |
Output is correct |
44 |
Correct |
9 ms |
5820 KB |
Output is correct |
45 |
Correct |
13 ms |
6484 KB |
Output is correct |
46 |
Correct |
40 ms |
14648 KB |
Output is correct |
47 |
Correct |
25 ms |
10368 KB |
Output is correct |
48 |
Correct |
31 ms |
12880 KB |
Output is correct |
49 |
Correct |
42 ms |
13644 KB |
Output is correct |
50 |
Correct |
47 ms |
13220 KB |
Output is correct |
51 |
Correct |
40 ms |
10836 KB |
Output is correct |
52 |
Correct |
12 ms |
6352 KB |
Output is correct |
53 |
Correct |
11 ms |
6352 KB |
Output is correct |
54 |
Correct |
15 ms |
6316 KB |
Output is correct |
55 |
Correct |
14 ms |
6484 KB |
Output is correct |
56 |
Correct |
13 ms |
6380 KB |
Output is correct |
57 |
Correct |
13 ms |
6556 KB |
Output is correct |
58 |
Correct |
47 ms |
15380 KB |
Output is correct |
59 |
Correct |
49 ms |
15404 KB |
Output is correct |
60 |
Correct |
46 ms |
15308 KB |
Output is correct |
61 |
Correct |
49 ms |
15352 KB |
Output is correct |
62 |
Correct |
46 ms |
15396 KB |
Output is correct |
63 |
Correct |
48 ms |
15380 KB |
Output is correct |
64 |
Correct |
67 ms |
15244 KB |
Output is correct |
65 |
Correct |
57 ms |
15176 KB |
Output is correct |
66 |
Correct |
64 ms |
15268 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
3 ms |
4948 KB |
Output is correct |
15 |
Correct |
3 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
3 ms |
4948 KB |
Output is correct |
22 |
Correct |
3 ms |
4948 KB |
Output is correct |
23 |
Correct |
3 ms |
4948 KB |
Output is correct |
24 |
Correct |
3 ms |
4948 KB |
Output is correct |
25 |
Correct |
3 ms |
4948 KB |
Output is correct |
26 |
Correct |
3 ms |
4960 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
3 ms |
5076 KB |
Output is correct |
29 |
Correct |
3 ms |
4948 KB |
Output is correct |
30 |
Correct |
3 ms |
4948 KB |
Output is correct |
31 |
Correct |
3 ms |
4948 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
4948 KB |
Output is correct |
35 |
Correct |
3 ms |
4948 KB |
Output is correct |
36 |
Correct |
3 ms |
4948 KB |
Output is correct |
37 |
Correct |
4 ms |
4948 KB |
Output is correct |
38 |
Correct |
3 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
3 ms |
4948 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
4948 KB |
Output is correct |
45 |
Correct |
3 ms |
5076 KB |
Output is correct |
46 |
Correct |
4 ms |
5076 KB |
Output is correct |
47 |
Correct |
3 ms |
5076 KB |
Output is correct |
48 |
Correct |
3 ms |
5076 KB |
Output is correct |
49 |
Correct |
3 ms |
4948 KB |
Output is correct |
50 |
Correct |
3 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
3 ms |
4948 KB |
Output is correct |
53 |
Correct |
3 ms |
4948 KB |
Output is correct |
54 |
Correct |
3 ms |
4948 KB |
Output is correct |
55 |
Correct |
3 ms |
4948 KB |
Output is correct |
56 |
Correct |
3 ms |
4948 KB |
Output is correct |
57 |
Correct |
3 ms |
4948 KB |
Output is correct |
58 |
Correct |
3 ms |
4948 KB |
Output is correct |
59 |
Correct |
3 ms |
4948 KB |
Output is correct |
60 |
Correct |
3 ms |
4948 KB |
Output is correct |
61 |
Correct |
3 ms |
4948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
4948 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
3 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
4948 KB |
Output is correct |
21 |
Correct |
3 ms |
4948 KB |
Output is correct |
22 |
Correct |
3 ms |
5076 KB |
Output is correct |
23 |
Correct |
3 ms |
4948 KB |
Output is correct |
24 |
Correct |
19 ms |
8916 KB |
Output is correct |
25 |
Correct |
18 ms |
8888 KB |
Output is correct |
26 |
Correct |
18 ms |
8852 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
3 ms |
4948 KB |
Output is correct |
29 |
Correct |
3 ms |
4960 KB |
Output is correct |
30 |
Correct |
3 ms |
4948 KB |
Output is correct |
31 |
Correct |
3 ms |
5076 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
4948 KB |
Output is correct |
35 |
Correct |
3 ms |
4948 KB |
Output is correct |
36 |
Correct |
3 ms |
4948 KB |
Output is correct |
37 |
Correct |
3 ms |
4948 KB |
Output is correct |
38 |
Correct |
3 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
4 ms |
4948 KB |
Output is correct |
41 |
Correct |
3 ms |
4948 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
4948 KB |
Output is correct |
45 |
Correct |
3 ms |
4948 KB |
Output is correct |
46 |
Correct |
3 ms |
4948 KB |
Output is correct |
47 |
Correct |
3 ms |
4948 KB |
Output is correct |
48 |
Correct |
3 ms |
5076 KB |
Output is correct |
49 |
Correct |
4 ms |
5076 KB |
Output is correct |
50 |
Correct |
3 ms |
5076 KB |
Output is correct |
51 |
Correct |
3 ms |
5076 KB |
Output is correct |
52 |
Correct |
3 ms |
4948 KB |
Output is correct |
53 |
Correct |
3 ms |
4948 KB |
Output is correct |
54 |
Correct |
3 ms |
4948 KB |
Output is correct |
55 |
Correct |
3 ms |
4948 KB |
Output is correct |
56 |
Correct |
3 ms |
4948 KB |
Output is correct |
57 |
Correct |
3 ms |
4948 KB |
Output is correct |
58 |
Correct |
3 ms |
4948 KB |
Output is correct |
59 |
Correct |
3 ms |
4948 KB |
Output is correct |
60 |
Correct |
3 ms |
4948 KB |
Output is correct |
61 |
Correct |
3 ms |
4948 KB |
Output is correct |
62 |
Correct |
3 ms |
4948 KB |
Output is correct |
63 |
Correct |
3 ms |
4948 KB |
Output is correct |
64 |
Correct |
3 ms |
4948 KB |
Output is correct |
65 |
Correct |
3 ms |
5204 KB |
Output is correct |
66 |
Correct |
3 ms |
5076 KB |
Output is correct |
67 |
Correct |
4 ms |
5204 KB |
Output is correct |
68 |
Correct |
3 ms |
5204 KB |
Output is correct |
69 |
Correct |
3 ms |
5204 KB |
Output is correct |
70 |
Correct |
4 ms |
5204 KB |
Output is correct |
71 |
Correct |
4 ms |
5152 KB |
Output is correct |
72 |
Correct |
4 ms |
5224 KB |
Output is correct |
73 |
Correct |
4 ms |
5136 KB |
Output is correct |
74 |
Correct |
4 ms |
5204 KB |
Output is correct |
75 |
Correct |
4 ms |
5204 KB |
Output is correct |
76 |
Correct |
20 ms |
7632 KB |
Output is correct |
77 |
Correct |
18 ms |
7996 KB |
Output is correct |
78 |
Correct |
24 ms |
8404 KB |
Output is correct |
79 |
Correct |
4 ms |
5332 KB |
Output is correct |
80 |
Correct |
5 ms |
5460 KB |
Output is correct |
81 |
Correct |
5 ms |
5460 KB |
Output is correct |
82 |
Correct |
4 ms |
5352 KB |
Output is correct |
83 |
Correct |
4 ms |
5452 KB |
Output is correct |
84 |
Correct |
5 ms |
5204 KB |
Output is correct |
85 |
Correct |
5 ms |
5204 KB |
Output is correct |
86 |
Correct |
5 ms |
5204 KB |
Output is correct |
87 |
Correct |
5 ms |
5204 KB |
Output is correct |
88 |
Correct |
5 ms |
5204 KB |
Output is correct |
89 |
Correct |
4 ms |
5204 KB |
Output is correct |
90 |
Correct |
32 ms |
8696 KB |
Output is correct |
91 |
Correct |
34 ms |
8628 KB |
Output is correct |
92 |
Correct |
32 ms |
8748 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
4948 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
3 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
4948 KB |
Output is correct |
21 |
Correct |
3 ms |
4948 KB |
Output is correct |
22 |
Correct |
3 ms |
5076 KB |
Output is correct |
23 |
Correct |
3 ms |
4948 KB |
Output is correct |
24 |
Correct |
19 ms |
8916 KB |
Output is correct |
25 |
Correct |
18 ms |
8888 KB |
Output is correct |
26 |
Correct |
18 ms |
8852 KB |
Output is correct |
27 |
Correct |
4 ms |
5332 KB |
Output is correct |
28 |
Correct |
5 ms |
5388 KB |
Output is correct |
29 |
Correct |
5 ms |
5332 KB |
Output is correct |
30 |
Correct |
5 ms |
5204 KB |
Output is correct |
31 |
Correct |
5 ms |
5208 KB |
Output is correct |
32 |
Correct |
5 ms |
5204 KB |
Output is correct |
33 |
Correct |
11 ms |
6228 KB |
Output is correct |
34 |
Correct |
9 ms |
6232 KB |
Output is correct |
35 |
Correct |
10 ms |
6300 KB |
Output is correct |
36 |
Correct |
11 ms |
6228 KB |
Output is correct |
37 |
Correct |
11 ms |
6312 KB |
Output is correct |
38 |
Correct |
11 ms |
6228 KB |
Output is correct |
39 |
Correct |
23 ms |
9328 KB |
Output is correct |
40 |
Correct |
25 ms |
9428 KB |
Output is correct |
41 |
Correct |
25 ms |
9396 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
4960 KB |
Output is correct |
45 |
Correct |
3 ms |
4948 KB |
Output is correct |
46 |
Correct |
3 ms |
5076 KB |
Output is correct |
47 |
Correct |
3 ms |
4948 KB |
Output is correct |
48 |
Correct |
3 ms |
4948 KB |
Output is correct |
49 |
Correct |
3 ms |
4948 KB |
Output is correct |
50 |
Correct |
3 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
3 ms |
4948 KB |
Output is correct |
53 |
Correct |
3 ms |
4948 KB |
Output is correct |
54 |
Correct |
3 ms |
4948 KB |
Output is correct |
55 |
Correct |
4 ms |
4948 KB |
Output is correct |
56 |
Correct |
3 ms |
4948 KB |
Output is correct |
57 |
Correct |
3 ms |
4948 KB |
Output is correct |
58 |
Correct |
3 ms |
4948 KB |
Output is correct |
59 |
Correct |
3 ms |
4948 KB |
Output is correct |
60 |
Correct |
3 ms |
4948 KB |
Output is correct |
61 |
Correct |
3 ms |
4948 KB |
Output is correct |
62 |
Correct |
3 ms |
4948 KB |
Output is correct |
63 |
Correct |
3 ms |
5076 KB |
Output is correct |
64 |
Correct |
4 ms |
5076 KB |
Output is correct |
65 |
Correct |
3 ms |
5076 KB |
Output is correct |
66 |
Correct |
3 ms |
5076 KB |
Output is correct |
67 |
Correct |
3 ms |
4948 KB |
Output is correct |
68 |
Correct |
3 ms |
4948 KB |
Output is correct |
69 |
Correct |
3 ms |
4948 KB |
Output is correct |
70 |
Correct |
3 ms |
4948 KB |
Output is correct |
71 |
Correct |
3 ms |
4948 KB |
Output is correct |
72 |
Correct |
3 ms |
4948 KB |
Output is correct |
73 |
Correct |
3 ms |
4948 KB |
Output is correct |
74 |
Correct |
3 ms |
4948 KB |
Output is correct |
75 |
Correct |
3 ms |
4948 KB |
Output is correct |
76 |
Correct |
3 ms |
4948 KB |
Output is correct |
77 |
Correct |
3 ms |
4948 KB |
Output is correct |
78 |
Correct |
3 ms |
4948 KB |
Output is correct |
79 |
Correct |
3 ms |
4948 KB |
Output is correct |
80 |
Correct |
3 ms |
5204 KB |
Output is correct |
81 |
Correct |
3 ms |
5076 KB |
Output is correct |
82 |
Correct |
4 ms |
5204 KB |
Output is correct |
83 |
Correct |
3 ms |
5204 KB |
Output is correct |
84 |
Correct |
3 ms |
5204 KB |
Output is correct |
85 |
Correct |
4 ms |
5204 KB |
Output is correct |
86 |
Correct |
4 ms |
5152 KB |
Output is correct |
87 |
Correct |
4 ms |
5224 KB |
Output is correct |
88 |
Correct |
4 ms |
5136 KB |
Output is correct |
89 |
Correct |
4 ms |
5204 KB |
Output is correct |
90 |
Correct |
4 ms |
5204 KB |
Output is correct |
91 |
Correct |
20 ms |
7632 KB |
Output is correct |
92 |
Correct |
18 ms |
7996 KB |
Output is correct |
93 |
Correct |
24 ms |
8404 KB |
Output is correct |
94 |
Correct |
4 ms |
5332 KB |
Output is correct |
95 |
Correct |
5 ms |
5460 KB |
Output is correct |
96 |
Correct |
5 ms |
5460 KB |
Output is correct |
97 |
Correct |
4 ms |
5352 KB |
Output is correct |
98 |
Correct |
4 ms |
5452 KB |
Output is correct |
99 |
Correct |
5 ms |
5204 KB |
Output is correct |
100 |
Correct |
5 ms |
5204 KB |
Output is correct |
101 |
Correct |
5 ms |
5204 KB |
Output is correct |
102 |
Correct |
5 ms |
5204 KB |
Output is correct |
103 |
Correct |
5 ms |
5204 KB |
Output is correct |
104 |
Correct |
4 ms |
5204 KB |
Output is correct |
105 |
Correct |
32 ms |
8696 KB |
Output is correct |
106 |
Correct |
34 ms |
8628 KB |
Output is correct |
107 |
Correct |
32 ms |
8748 KB |
Output is correct |
108 |
Correct |
5 ms |
5460 KB |
Output is correct |
109 |
Correct |
144 ms |
44336 KB |
Output is correct |
110 |
Correct |
74 ms |
27720 KB |
Output is correct |
111 |
Correct |
56 ms |
26036 KB |
Output is correct |
112 |
Correct |
67 ms |
28568 KB |
Output is correct |
113 |
Correct |
44 ms |
21476 KB |
Output is correct |
114 |
Correct |
14 ms |
6880 KB |
Output is correct |
115 |
Correct |
14 ms |
6868 KB |
Output is correct |
116 |
Correct |
16 ms |
7224 KB |
Output is correct |
117 |
Correct |
13 ms |
6820 KB |
Output is correct |
118 |
Correct |
15 ms |
7104 KB |
Output is correct |
119 |
Correct |
12 ms |
6476 KB |
Output is correct |
120 |
Correct |
19 ms |
8196 KB |
Output is correct |
121 |
Correct |
7 ms |
5792 KB |
Output is correct |
122 |
Correct |
22 ms |
8448 KB |
Output is correct |
123 |
Correct |
7 ms |
5716 KB |
Output is correct |
124 |
Correct |
25 ms |
9116 KB |
Output is correct |
125 |
Correct |
8 ms |
6100 KB |
Output is correct |
126 |
Correct |
11 ms |
6196 KB |
Output is correct |
127 |
Correct |
11 ms |
6452 KB |
Output is correct |
128 |
Correct |
9 ms |
5940 KB |
Output is correct |
129 |
Correct |
10 ms |
6064 KB |
Output is correct |
130 |
Correct |
5 ms |
5460 KB |
Output is correct |
131 |
Correct |
206 ms |
71948 KB |
Output is correct |
132 |
Correct |
130 ms |
54288 KB |
Output is correct |
133 |
Correct |
104 ms |
37452 KB |
Output is correct |
134 |
Correct |
92 ms |
38452 KB |
Output is correct |
135 |
Correct |
86 ms |
38272 KB |
Output is correct |
136 |
Correct |
20 ms |
7596 KB |
Output is correct |
137 |
Correct |
18 ms |
7444 KB |
Output is correct |
138 |
Correct |
19 ms |
7444 KB |
Output is correct |
139 |
Correct |
19 ms |
7492 KB |
Output is correct |
140 |
Correct |
21 ms |
7608 KB |
Output is correct |
141 |
Correct |
20 ms |
7500 KB |
Output is correct |
142 |
Correct |
35 ms |
10244 KB |
Output is correct |
143 |
Correct |
10 ms |
6356 KB |
Output is correct |
144 |
Correct |
34 ms |
10280 KB |
Output is correct |
145 |
Correct |
10 ms |
6344 KB |
Output is correct |
146 |
Correct |
33 ms |
10272 KB |
Output is correct |
147 |
Correct |
10 ms |
6300 KB |
Output is correct |
148 |
Correct |
11 ms |
6532 KB |
Output is correct |
149 |
Correct |
13 ms |
6540 KB |
Output is correct |
150 |
Correct |
11 ms |
6528 KB |
Output is correct |
151 |
Correct |
12 ms |
6552 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
4948 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
4948 KB |
Output is correct |
15 |
Correct |
3 ms |
4948 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
4948 KB |
Output is correct |
21 |
Correct |
3 ms |
4948 KB |
Output is correct |
22 |
Correct |
3 ms |
5076 KB |
Output is correct |
23 |
Correct |
3 ms |
4948 KB |
Output is correct |
24 |
Correct |
19 ms |
8916 KB |
Output is correct |
25 |
Correct |
18 ms |
8888 KB |
Output is correct |
26 |
Correct |
18 ms |
8852 KB |
Output is correct |
27 |
Correct |
4 ms |
5332 KB |
Output is correct |
28 |
Correct |
5 ms |
5388 KB |
Output is correct |
29 |
Correct |
5 ms |
5332 KB |
Output is correct |
30 |
Correct |
5 ms |
5204 KB |
Output is correct |
31 |
Correct |
5 ms |
5208 KB |
Output is correct |
32 |
Correct |
5 ms |
5204 KB |
Output is correct |
33 |
Correct |
11 ms |
6228 KB |
Output is correct |
34 |
Correct |
9 ms |
6232 KB |
Output is correct |
35 |
Correct |
10 ms |
6300 KB |
Output is correct |
36 |
Correct |
11 ms |
6228 KB |
Output is correct |
37 |
Correct |
11 ms |
6312 KB |
Output is correct |
38 |
Correct |
11 ms |
6228 KB |
Output is correct |
39 |
Correct |
23 ms |
9328 KB |
Output is correct |
40 |
Correct |
25 ms |
9428 KB |
Output is correct |
41 |
Correct |
25 ms |
9396 KB |
Output is correct |
42 |
Correct |
12 ms |
6264 KB |
Output is correct |
43 |
Correct |
12 ms |
5756 KB |
Output is correct |
44 |
Correct |
13 ms |
6440 KB |
Output is correct |
45 |
Correct |
9 ms |
5916 KB |
Output is correct |
46 |
Correct |
9 ms |
5820 KB |
Output is correct |
47 |
Correct |
13 ms |
6484 KB |
Output is correct |
48 |
Correct |
40 ms |
14648 KB |
Output is correct |
49 |
Correct |
25 ms |
10368 KB |
Output is correct |
50 |
Correct |
31 ms |
12880 KB |
Output is correct |
51 |
Correct |
42 ms |
13644 KB |
Output is correct |
52 |
Correct |
47 ms |
13220 KB |
Output is correct |
53 |
Correct |
40 ms |
10836 KB |
Output is correct |
54 |
Correct |
12 ms |
6352 KB |
Output is correct |
55 |
Correct |
11 ms |
6352 KB |
Output is correct |
56 |
Correct |
15 ms |
6316 KB |
Output is correct |
57 |
Correct |
14 ms |
6484 KB |
Output is correct |
58 |
Correct |
13 ms |
6380 KB |
Output is correct |
59 |
Correct |
13 ms |
6556 KB |
Output is correct |
60 |
Correct |
47 ms |
15380 KB |
Output is correct |
61 |
Correct |
49 ms |
15404 KB |
Output is correct |
62 |
Correct |
46 ms |
15308 KB |
Output is correct |
63 |
Correct |
49 ms |
15352 KB |
Output is correct |
64 |
Correct |
46 ms |
15396 KB |
Output is correct |
65 |
Correct |
48 ms |
15380 KB |
Output is correct |
66 |
Correct |
67 ms |
15244 KB |
Output is correct |
67 |
Correct |
57 ms |
15176 KB |
Output is correct |
68 |
Correct |
64 ms |
15268 KB |
Output is correct |
69 |
Correct |
3 ms |
4948 KB |
Output is correct |
70 |
Correct |
3 ms |
4948 KB |
Output is correct |
71 |
Correct |
3 ms |
4960 KB |
Output is correct |
72 |
Correct |
3 ms |
4948 KB |
Output is correct |
73 |
Correct |
3 ms |
5076 KB |
Output is correct |
74 |
Correct |
3 ms |
4948 KB |
Output is correct |
75 |
Correct |
3 ms |
4948 KB |
Output is correct |
76 |
Correct |
3 ms |
4948 KB |
Output is correct |
77 |
Correct |
3 ms |
4948 KB |
Output is correct |
78 |
Correct |
3 ms |
4948 KB |
Output is correct |
79 |
Correct |
3 ms |
4948 KB |
Output is correct |
80 |
Correct |
3 ms |
4948 KB |
Output is correct |
81 |
Correct |
3 ms |
4948 KB |
Output is correct |
82 |
Correct |
4 ms |
4948 KB |
Output is correct |
83 |
Correct |
3 ms |
4948 KB |
Output is correct |
84 |
Correct |
3 ms |
4948 KB |
Output is correct |
85 |
Correct |
3 ms |
4948 KB |
Output is correct |
86 |
Correct |
3 ms |
4948 KB |
Output is correct |
87 |
Correct |
3 ms |
4948 KB |
Output is correct |
88 |
Correct |
3 ms |
4948 KB |
Output is correct |
89 |
Correct |
3 ms |
4948 KB |
Output is correct |
90 |
Correct |
3 ms |
5076 KB |
Output is correct |
91 |
Correct |
4 ms |
5076 KB |
Output is correct |
92 |
Correct |
3 ms |
5076 KB |
Output is correct |
93 |
Correct |
3 ms |
5076 KB |
Output is correct |
94 |
Correct |
3 ms |
4948 KB |
Output is correct |
95 |
Correct |
3 ms |
4948 KB |
Output is correct |
96 |
Correct |
3 ms |
4948 KB |
Output is correct |
97 |
Correct |
3 ms |
4948 KB |
Output is correct |
98 |
Correct |
3 ms |
4948 KB |
Output is correct |
99 |
Correct |
3 ms |
4948 KB |
Output is correct |
100 |
Correct |
3 ms |
4948 KB |
Output is correct |
101 |
Correct |
3 ms |
4948 KB |
Output is correct |
102 |
Correct |
3 ms |
4948 KB |
Output is correct |
103 |
Correct |
3 ms |
4948 KB |
Output is correct |
104 |
Correct |
3 ms |
4948 KB |
Output is correct |
105 |
Correct |
3 ms |
4948 KB |
Output is correct |
106 |
Correct |
3 ms |
4948 KB |
Output is correct |
107 |
Correct |
3 ms |
5204 KB |
Output is correct |
108 |
Correct |
3 ms |
5076 KB |
Output is correct |
109 |
Correct |
4 ms |
5204 KB |
Output is correct |
110 |
Correct |
3 ms |
5204 KB |
Output is correct |
111 |
Correct |
3 ms |
5204 KB |
Output is correct |
112 |
Correct |
4 ms |
5204 KB |
Output is correct |
113 |
Correct |
4 ms |
5152 KB |
Output is correct |
114 |
Correct |
4 ms |
5224 KB |
Output is correct |
115 |
Correct |
4 ms |
5136 KB |
Output is correct |
116 |
Correct |
4 ms |
5204 KB |
Output is correct |
117 |
Correct |
4 ms |
5204 KB |
Output is correct |
118 |
Correct |
20 ms |
7632 KB |
Output is correct |
119 |
Correct |
18 ms |
7996 KB |
Output is correct |
120 |
Correct |
24 ms |
8404 KB |
Output is correct |
121 |
Correct |
4 ms |
5332 KB |
Output is correct |
122 |
Correct |
5 ms |
5460 KB |
Output is correct |
123 |
Correct |
5 ms |
5460 KB |
Output is correct |
124 |
Correct |
4 ms |
5352 KB |
Output is correct |
125 |
Correct |
4 ms |
5452 KB |
Output is correct |
126 |
Correct |
5 ms |
5204 KB |
Output is correct |
127 |
Correct |
5 ms |
5204 KB |
Output is correct |
128 |
Correct |
5 ms |
5204 KB |
Output is correct |
129 |
Correct |
5 ms |
5204 KB |
Output is correct |
130 |
Correct |
5 ms |
5204 KB |
Output is correct |
131 |
Correct |
4 ms |
5204 KB |
Output is correct |
132 |
Correct |
32 ms |
8696 KB |
Output is correct |
133 |
Correct |
34 ms |
8628 KB |
Output is correct |
134 |
Correct |
32 ms |
8748 KB |
Output is correct |
135 |
Correct |
5 ms |
5460 KB |
Output is correct |
136 |
Correct |
144 ms |
44336 KB |
Output is correct |
137 |
Correct |
74 ms |
27720 KB |
Output is correct |
138 |
Correct |
56 ms |
26036 KB |
Output is correct |
139 |
Correct |
67 ms |
28568 KB |
Output is correct |
140 |
Correct |
44 ms |
21476 KB |
Output is correct |
141 |
Correct |
14 ms |
6880 KB |
Output is correct |
142 |
Correct |
14 ms |
6868 KB |
Output is correct |
143 |
Correct |
16 ms |
7224 KB |
Output is correct |
144 |
Correct |
13 ms |
6820 KB |
Output is correct |
145 |
Correct |
15 ms |
7104 KB |
Output is correct |
146 |
Correct |
12 ms |
6476 KB |
Output is correct |
147 |
Correct |
19 ms |
8196 KB |
Output is correct |
148 |
Correct |
7 ms |
5792 KB |
Output is correct |
149 |
Correct |
22 ms |
8448 KB |
Output is correct |
150 |
Correct |
7 ms |
5716 KB |
Output is correct |
151 |
Correct |
25 ms |
9116 KB |
Output is correct |
152 |
Correct |
8 ms |
6100 KB |
Output is correct |
153 |
Correct |
11 ms |
6196 KB |
Output is correct |
154 |
Correct |
11 ms |
6452 KB |
Output is correct |
155 |
Correct |
9 ms |
5940 KB |
Output is correct |
156 |
Correct |
10 ms |
6064 KB |
Output is correct |
157 |
Correct |
5 ms |
5460 KB |
Output is correct |
158 |
Correct |
206 ms |
71948 KB |
Output is correct |
159 |
Correct |
130 ms |
54288 KB |
Output is correct |
160 |
Correct |
104 ms |
37452 KB |
Output is correct |
161 |
Correct |
92 ms |
38452 KB |
Output is correct |
162 |
Correct |
86 ms |
38272 KB |
Output is correct |
163 |
Correct |
20 ms |
7596 KB |
Output is correct |
164 |
Correct |
18 ms |
7444 KB |
Output is correct |
165 |
Correct |
19 ms |
7444 KB |
Output is correct |
166 |
Correct |
19 ms |
7492 KB |
Output is correct |
167 |
Correct |
21 ms |
7608 KB |
Output is correct |
168 |
Correct |
20 ms |
7500 KB |
Output is correct |
169 |
Correct |
35 ms |
10244 KB |
Output is correct |
170 |
Correct |
10 ms |
6356 KB |
Output is correct |
171 |
Correct |
34 ms |
10280 KB |
Output is correct |
172 |
Correct |
10 ms |
6344 KB |
Output is correct |
173 |
Correct |
33 ms |
10272 KB |
Output is correct |
174 |
Correct |
10 ms |
6300 KB |
Output is correct |
175 |
Correct |
11 ms |
6532 KB |
Output is correct |
176 |
Correct |
13 ms |
6540 KB |
Output is correct |
177 |
Correct |
11 ms |
6528 KB |
Output is correct |
178 |
Correct |
12 ms |
6552 KB |
Output is correct |
179 |
Correct |
11 ms |
6480 KB |
Output is correct |
180 |
Correct |
420 ms |
112688 KB |
Output is correct |
181 |
Correct |
440 ms |
145340 KB |
Output is correct |
182 |
Correct |
532 ms |
179336 KB |
Output is correct |
183 |
Correct |
262 ms |
104008 KB |
Output is correct |
184 |
Correct |
217 ms |
78732 KB |
Output is correct |
185 |
Correct |
29 ms |
9676 KB |
Output is correct |
186 |
Correct |
32 ms |
11012 KB |
Output is correct |
187 |
Correct |
33 ms |
10604 KB |
Output is correct |
188 |
Correct |
36 ms |
10344 KB |
Output is correct |
189 |
Correct |
36 ms |
10364 KB |
Output is correct |
190 |
Correct |
47 ms |
11980 KB |
Output is correct |
191 |
Correct |
36 ms |
11272 KB |
Output is correct |
192 |
Correct |
29 ms |
9228 KB |
Output is correct |
193 |
Correct |
25 ms |
9096 KB |
Output is correct |
194 |
Correct |
13 ms |
6996 KB |
Output is correct |
195 |
Correct |
1057 ms |
266888 KB |
Output is correct |
196 |
Correct |
644 ms |
206968 KB |
Output is correct |
197 |
Correct |
565 ms |
194328 KB |
Output is correct |
198 |
Correct |
457 ms |
160808 KB |
Output is correct |
199 |
Correct |
435 ms |
164472 KB |
Output is correct |
200 |
Correct |
71 ms |
17584 KB |
Output is correct |
201 |
Correct |
65 ms |
17660 KB |
Output is correct |
202 |
Correct |
70 ms |
17608 KB |
Output is correct |
203 |
Correct |
69 ms |
17644 KB |
Output is correct |
204 |
Correct |
62 ms |
17700 KB |
Output is correct |
205 |
Correct |
66 ms |
17692 KB |
Output is correct |
206 |
Correct |
75 ms |
17168 KB |
Output is correct |
207 |
Correct |
62 ms |
16636 KB |
Output is correct |
208 |
Correct |
76 ms |
17216 KB |
Output is correct |
209 |
Correct |
60 ms |
16664 KB |
Output is correct |
210 |
Correct |
70 ms |
17276 KB |
Output is correct |
211 |
Correct |
58 ms |
16632 KB |
Output is correct |
212 |
Correct |
58 ms |
17036 KB |
Output is correct |
213 |
Correct |
52 ms |
14108 KB |
Output is correct |
214 |
Correct |
51 ms |
13628 KB |
Output is correct |
215 |
Correct |
53 ms |
13492 KB |
Output is correct |