#include "paint.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl
#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
//change less to less_equal for non distinct pbds, but erase will bug
struct node{
int s,e,m;
int val=1e9;
node *l,*r;
node (int _s,int _e){
s=_s,e=_e,m=s+e>>1;
if (s!=e){
l=new node(s,m);
r=new node(m+1,e);
}
}
void update(int i,int k){
val=min(val,k);
if (s==e) return;
else if (i<=m) l->update(i,k);
else r->update(i,k);
}
int query(int i,int j){
if (s==i && e==j) return val;
else if (j<=m) return l->query(i,j);
else if (m<i) return r->query(i,j);
else return min(l->query(i,m),r->query(m+1,j));
}
} *root=new node(0,100005);
int n,m;
vector<int> arr;
vector<int> worker[100005];
vector<int> col[100005];
int nums[50005];
int good=0;
int minimumInstructions(
int N, int M, int K, std::vector<int> C,
std::vector<int> A, std::vector<std::vector<int>> B) {
n=N,m=M;
arr=C;
rep(x,0,m){
for (auto &it:B[x]) col[it].push_back(x);
}
rep(x,0,n){
for (auto &it:col[arr[x]]) worker[x].push_back((x-it+m)%m);
//for (auto &it:worker[x]) cout<<it<<" "; cout<<endl;
}
root->update(0,0);
rep(x,0,n){
for (auto &it:worker[x]){
nums[it]++;
if (nums[it]==m) good++;
}
if (good){
//cout<<x<<endl;
root->update(x+1,root->query(x-m+1,x)+1);
}
if (x-m+1>=0) for (auto &it:worker[x-m+1]){
if (nums[it]==m) good--;
nums[it]--;
}
}
int ans=root->query(n,n);
if (ans>=1e9) return -1;
else return ans;
}
Compilation message
paint.cpp: In constructor 'node::node(int, int)':
paint.cpp:31:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
31 | s=_s,e=_e,m=s+e>>1;
| ~^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
14336 KB |
Output is correct |
2 |
Correct |
13 ms |
14336 KB |
Output is correct |
3 |
Correct |
13 ms |
14464 KB |
Output is correct |
4 |
Correct |
13 ms |
14464 KB |
Output is correct |
5 |
Correct |
13 ms |
14464 KB |
Output is correct |
6 |
Correct |
13 ms |
14464 KB |
Output is correct |
7 |
Correct |
14 ms |
14464 KB |
Output is correct |
8 |
Correct |
13 ms |
14368 KB |
Output is correct |
9 |
Correct |
13 ms |
14464 KB |
Output is correct |
10 |
Correct |
13 ms |
14464 KB |
Output is correct |
11 |
Correct |
15 ms |
14464 KB |
Output is correct |
12 |
Correct |
16 ms |
14464 KB |
Output is correct |
13 |
Correct |
13 ms |
14464 KB |
Output is correct |
14 |
Correct |
14 ms |
14464 KB |
Output is correct |
15 |
Correct |
14 ms |
14464 KB |
Output is correct |
16 |
Correct |
14 ms |
14464 KB |
Output is correct |
17 |
Correct |
14 ms |
14464 KB |
Output is correct |
18 |
Correct |
14 ms |
14464 KB |
Output is correct |
19 |
Correct |
14 ms |
14464 KB |
Output is correct |
20 |
Correct |
15 ms |
14464 KB |
Output is correct |
21 |
Correct |
15 ms |
14464 KB |
Output is correct |
22 |
Correct |
40 ms |
18296 KB |
Output is correct |
23 |
Correct |
42 ms |
18296 KB |
Output is correct |
24 |
Correct |
41 ms |
18296 KB |
Output is correct |
25 |
Correct |
20 ms |
15232 KB |
Output is correct |
26 |
Correct |
20 ms |
15232 KB |
Output is correct |
27 |
Correct |
19 ms |
15232 KB |
Output is correct |
28 |
Correct |
18 ms |
15232 KB |
Output is correct |
29 |
Correct |
18 ms |
15232 KB |
Output is correct |
30 |
Correct |
18 ms |
15232 KB |
Output is correct |
31 |
Correct |
31 ms |
16128 KB |
Output is correct |
32 |
Correct |
30 ms |
16128 KB |
Output is correct |
33 |
Correct |
30 ms |
16120 KB |
Output is correct |
34 |
Correct |
32 ms |
16248 KB |
Output is correct |
35 |
Correct |
29 ms |
16120 KB |
Output is correct |
36 |
Correct |
29 ms |
16128 KB |
Output is correct |
37 |
Correct |
50 ms |
19320 KB |
Output is correct |
38 |
Correct |
51 ms |
19320 KB |
Output is correct |
39 |
Correct |
50 ms |
19320 KB |
Output is correct |
40 |
Correct |
44 ms |
18300 KB |
Output is correct |
41 |
Correct |
32 ms |
16896 KB |
Output is correct |
42 |
Correct |
42 ms |
18688 KB |
Output is correct |
43 |
Correct |
28 ms |
17184 KB |
Output is correct |
44 |
Correct |
27 ms |
17024 KB |
Output is correct |
45 |
Correct |
33 ms |
18816 KB |
Output is correct |
46 |
Correct |
91 ms |
26488 KB |
Output is correct |
47 |
Correct |
61 ms |
21368 KB |
Output is correct |
48 |
Correct |
59 ms |
23928 KB |
Output is correct |
49 |
Correct |
83 ms |
24348 KB |
Output is correct |
50 |
Correct |
76 ms |
24312 KB |
Output is correct |
51 |
Correct |
64 ms |
22136 KB |
Output is correct |
52 |
Correct |
46 ms |
18680 KB |
Output is correct |
53 |
Correct |
47 ms |
18680 KB |
Output is correct |
54 |
Correct |
42 ms |
18688 KB |
Output is correct |
55 |
Correct |
36 ms |
18732 KB |
Output is correct |
56 |
Correct |
34 ms |
18684 KB |
Output is correct |
57 |
Correct |
34 ms |
18688 KB |
Output is correct |
58 |
Correct |
97 ms |
27768 KB |
Output is correct |
59 |
Correct |
99 ms |
27668 KB |
Output is correct |
60 |
Correct |
104 ms |
27700 KB |
Output is correct |
61 |
Correct |
96 ms |
27772 KB |
Output is correct |
62 |
Correct |
95 ms |
27768 KB |
Output is correct |
63 |
Correct |
97 ms |
27768 KB |
Output is correct |
64 |
Correct |
96 ms |
27256 KB |
Output is correct |
65 |
Correct |
95 ms |
27128 KB |
Output is correct |
66 |
Correct |
90 ms |
27128 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
14464 KB |
Output is correct |
2 |
Correct |
13 ms |
14336 KB |
Output is correct |
3 |
Correct |
13 ms |
14336 KB |
Output is correct |
4 |
Correct |
13 ms |
14336 KB |
Output is correct |
5 |
Correct |
13 ms |
14464 KB |
Output is correct |
6 |
Correct |
13 ms |
14464 KB |
Output is correct |
7 |
Correct |
13 ms |
14464 KB |
Output is correct |
8 |
Correct |
13 ms |
14464 KB |
Output is correct |
9 |
Correct |
14 ms |
14464 KB |
Output is correct |
10 |
Correct |
13 ms |
14368 KB |
Output is correct |
11 |
Correct |
13 ms |
14464 KB |
Output is correct |
12 |
Correct |
13 ms |
14464 KB |
Output is correct |
13 |
Correct |
15 ms |
14464 KB |
Output is correct |
14 |
Correct |
16 ms |
14464 KB |
Output is correct |
15 |
Correct |
13 ms |
14464 KB |
Output is correct |
16 |
Correct |
14 ms |
14464 KB |
Output is correct |
17 |
Correct |
14 ms |
14464 KB |
Output is correct |
18 |
Correct |
14 ms |
14464 KB |
Output is correct |
19 |
Correct |
14 ms |
14464 KB |
Output is correct |
20 |
Correct |
14 ms |
14464 KB |
Output is correct |
21 |
Correct |
14 ms |
14464 KB |
Output is correct |
22 |
Correct |
15 ms |
14464 KB |
Output is correct |
23 |
Correct |
15 ms |
14464 KB |
Output is correct |
24 |
Correct |
13 ms |
14464 KB |
Output is correct |
25 |
Correct |
13 ms |
14464 KB |
Output is correct |
26 |
Correct |
14 ms |
14464 KB |
Output is correct |
27 |
Correct |
14 ms |
14464 KB |
Output is correct |
28 |
Correct |
14 ms |
14464 KB |
Output is correct |
29 |
Correct |
13 ms |
14464 KB |
Output is correct |
30 |
Correct |
14 ms |
14464 KB |
Output is correct |
31 |
Correct |
13 ms |
14464 KB |
Output is correct |
32 |
Correct |
13 ms |
14464 KB |
Output is correct |
33 |
Correct |
13 ms |
14464 KB |
Output is correct |
34 |
Correct |
14 ms |
14464 KB |
Output is correct |
35 |
Correct |
14 ms |
14464 KB |
Output is correct |
36 |
Correct |
13 ms |
14464 KB |
Output is correct |
37 |
Correct |
14 ms |
14464 KB |
Output is correct |
38 |
Correct |
13 ms |
14464 KB |
Output is correct |
39 |
Correct |
15 ms |
14464 KB |
Output is correct |
40 |
Correct |
14 ms |
14464 KB |
Output is correct |
41 |
Correct |
15 ms |
14464 KB |
Output is correct |
42 |
Correct |
14 ms |
14464 KB |
Output is correct |
43 |
Correct |
14 ms |
14464 KB |
Output is correct |
44 |
Correct |
13 ms |
14464 KB |
Output is correct |
45 |
Correct |
14 ms |
14464 KB |
Output is correct |
46 |
Correct |
14 ms |
14464 KB |
Output is correct |
47 |
Correct |
14 ms |
14464 KB |
Output is correct |
48 |
Correct |
14 ms |
14464 KB |
Output is correct |
49 |
Correct |
14 ms |
14464 KB |
Output is correct |
50 |
Correct |
14 ms |
14464 KB |
Output is correct |
51 |
Correct |
14 ms |
14464 KB |
Output is correct |
52 |
Correct |
14 ms |
14464 KB |
Output is correct |
53 |
Correct |
15 ms |
14464 KB |
Output is correct |
54 |
Correct |
14 ms |
14592 KB |
Output is correct |
55 |
Correct |
14 ms |
14464 KB |
Output is correct |
56 |
Correct |
14 ms |
14464 KB |
Output is correct |
57 |
Correct |
14 ms |
14464 KB |
Output is correct |
58 |
Correct |
14 ms |
14464 KB |
Output is correct |
59 |
Correct |
14 ms |
14464 KB |
Output is correct |
60 |
Correct |
14 ms |
14464 KB |
Output is correct |
61 |
Correct |
14 ms |
14464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
14464 KB |
Output is correct |
2 |
Correct |
13 ms |
14336 KB |
Output is correct |
3 |
Correct |
13 ms |
14336 KB |
Output is correct |
4 |
Correct |
13 ms |
14336 KB |
Output is correct |
5 |
Correct |
13 ms |
14464 KB |
Output is correct |
6 |
Correct |
13 ms |
14464 KB |
Output is correct |
7 |
Correct |
13 ms |
14464 KB |
Output is correct |
8 |
Correct |
13 ms |
14464 KB |
Output is correct |
9 |
Correct |
14 ms |
14464 KB |
Output is correct |
10 |
Correct |
13 ms |
14368 KB |
Output is correct |
11 |
Correct |
13 ms |
14464 KB |
Output is correct |
12 |
Correct |
13 ms |
14464 KB |
Output is correct |
13 |
Correct |
15 ms |
14464 KB |
Output is correct |
14 |
Correct |
16 ms |
14464 KB |
Output is correct |
15 |
Correct |
13 ms |
14464 KB |
Output is correct |
16 |
Correct |
14 ms |
14464 KB |
Output is correct |
17 |
Correct |
14 ms |
14464 KB |
Output is correct |
18 |
Correct |
14 ms |
14464 KB |
Output is correct |
19 |
Correct |
14 ms |
14464 KB |
Output is correct |
20 |
Correct |
14 ms |
14464 KB |
Output is correct |
21 |
Correct |
14 ms |
14464 KB |
Output is correct |
22 |
Correct |
15 ms |
14464 KB |
Output is correct |
23 |
Correct |
15 ms |
14464 KB |
Output is correct |
24 |
Correct |
40 ms |
18296 KB |
Output is correct |
25 |
Correct |
42 ms |
18296 KB |
Output is correct |
26 |
Correct |
41 ms |
18296 KB |
Output is correct |
27 |
Correct |
13 ms |
14464 KB |
Output is correct |
28 |
Correct |
13 ms |
14464 KB |
Output is correct |
29 |
Correct |
14 ms |
14464 KB |
Output is correct |
30 |
Correct |
14 ms |
14464 KB |
Output is correct |
31 |
Correct |
14 ms |
14464 KB |
Output is correct |
32 |
Correct |
13 ms |
14464 KB |
Output is correct |
33 |
Correct |
14 ms |
14464 KB |
Output is correct |
34 |
Correct |
13 ms |
14464 KB |
Output is correct |
35 |
Correct |
13 ms |
14464 KB |
Output is correct |
36 |
Correct |
13 ms |
14464 KB |
Output is correct |
37 |
Correct |
14 ms |
14464 KB |
Output is correct |
38 |
Correct |
14 ms |
14464 KB |
Output is correct |
39 |
Correct |
13 ms |
14464 KB |
Output is correct |
40 |
Correct |
14 ms |
14464 KB |
Output is correct |
41 |
Correct |
13 ms |
14464 KB |
Output is correct |
42 |
Correct |
15 ms |
14464 KB |
Output is correct |
43 |
Correct |
14 ms |
14464 KB |
Output is correct |
44 |
Correct |
15 ms |
14464 KB |
Output is correct |
45 |
Correct |
14 ms |
14464 KB |
Output is correct |
46 |
Correct |
14 ms |
14464 KB |
Output is correct |
47 |
Correct |
13 ms |
14464 KB |
Output is correct |
48 |
Correct |
14 ms |
14464 KB |
Output is correct |
49 |
Correct |
14 ms |
14464 KB |
Output is correct |
50 |
Correct |
14 ms |
14464 KB |
Output is correct |
51 |
Correct |
14 ms |
14464 KB |
Output is correct |
52 |
Correct |
14 ms |
14464 KB |
Output is correct |
53 |
Correct |
14 ms |
14464 KB |
Output is correct |
54 |
Correct |
14 ms |
14464 KB |
Output is correct |
55 |
Correct |
14 ms |
14464 KB |
Output is correct |
56 |
Correct |
15 ms |
14464 KB |
Output is correct |
57 |
Correct |
14 ms |
14592 KB |
Output is correct |
58 |
Correct |
14 ms |
14464 KB |
Output is correct |
59 |
Correct |
14 ms |
14464 KB |
Output is correct |
60 |
Correct |
14 ms |
14464 KB |
Output is correct |
61 |
Correct |
14 ms |
14464 KB |
Output is correct |
62 |
Correct |
14 ms |
14464 KB |
Output is correct |
63 |
Correct |
14 ms |
14464 KB |
Output is correct |
64 |
Correct |
14 ms |
14464 KB |
Output is correct |
65 |
Correct |
14 ms |
14720 KB |
Output is correct |
66 |
Correct |
14 ms |
14592 KB |
Output is correct |
67 |
Correct |
15 ms |
14720 KB |
Output is correct |
68 |
Correct |
15 ms |
14720 KB |
Output is correct |
69 |
Correct |
15 ms |
14592 KB |
Output is correct |
70 |
Correct |
16 ms |
14720 KB |
Output is correct |
71 |
Correct |
17 ms |
14592 KB |
Output is correct |
72 |
Correct |
16 ms |
14592 KB |
Output is correct |
73 |
Correct |
15 ms |
14592 KB |
Output is correct |
74 |
Correct |
16 ms |
14592 KB |
Output is correct |
75 |
Correct |
16 ms |
14592 KB |
Output is correct |
76 |
Correct |
41 ms |
17016 KB |
Output is correct |
77 |
Correct |
38 ms |
17528 KB |
Output is correct |
78 |
Correct |
49 ms |
17912 KB |
Output is correct |
79 |
Correct |
15 ms |
14976 KB |
Output is correct |
80 |
Correct |
17 ms |
14976 KB |
Output is correct |
81 |
Correct |
16 ms |
14976 KB |
Output is correct |
82 |
Correct |
16 ms |
14968 KB |
Output is correct |
83 |
Correct |
16 ms |
14976 KB |
Output is correct |
84 |
Correct |
16 ms |
14720 KB |
Output is correct |
85 |
Correct |
19 ms |
14736 KB |
Output is correct |
86 |
Correct |
17 ms |
14720 KB |
Output is correct |
87 |
Correct |
16 ms |
14720 KB |
Output is correct |
88 |
Correct |
17 ms |
14720 KB |
Output is correct |
89 |
Correct |
16 ms |
14720 KB |
Output is correct |
90 |
Correct |
59 ms |
18168 KB |
Output is correct |
91 |
Correct |
55 ms |
18232 KB |
Output is correct |
92 |
Correct |
57 ms |
18168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
14464 KB |
Output is correct |
2 |
Correct |
13 ms |
14336 KB |
Output is correct |
3 |
Correct |
13 ms |
14336 KB |
Output is correct |
4 |
Correct |
13 ms |
14336 KB |
Output is correct |
5 |
Correct |
13 ms |
14464 KB |
Output is correct |
6 |
Correct |
13 ms |
14464 KB |
Output is correct |
7 |
Correct |
13 ms |
14464 KB |
Output is correct |
8 |
Correct |
13 ms |
14464 KB |
Output is correct |
9 |
Correct |
14 ms |
14464 KB |
Output is correct |
10 |
Correct |
13 ms |
14368 KB |
Output is correct |
11 |
Correct |
13 ms |
14464 KB |
Output is correct |
12 |
Correct |
13 ms |
14464 KB |
Output is correct |
13 |
Correct |
15 ms |
14464 KB |
Output is correct |
14 |
Correct |
16 ms |
14464 KB |
Output is correct |
15 |
Correct |
13 ms |
14464 KB |
Output is correct |
16 |
Correct |
14 ms |
14464 KB |
Output is correct |
17 |
Correct |
14 ms |
14464 KB |
Output is correct |
18 |
Correct |
14 ms |
14464 KB |
Output is correct |
19 |
Correct |
14 ms |
14464 KB |
Output is correct |
20 |
Correct |
14 ms |
14464 KB |
Output is correct |
21 |
Correct |
14 ms |
14464 KB |
Output is correct |
22 |
Correct |
15 ms |
14464 KB |
Output is correct |
23 |
Correct |
15 ms |
14464 KB |
Output is correct |
24 |
Correct |
40 ms |
18296 KB |
Output is correct |
25 |
Correct |
42 ms |
18296 KB |
Output is correct |
26 |
Correct |
41 ms |
18296 KB |
Output is correct |
27 |
Correct |
20 ms |
15232 KB |
Output is correct |
28 |
Correct |
20 ms |
15232 KB |
Output is correct |
29 |
Correct |
19 ms |
15232 KB |
Output is correct |
30 |
Correct |
18 ms |
15232 KB |
Output is correct |
31 |
Correct |
18 ms |
15232 KB |
Output is correct |
32 |
Correct |
18 ms |
15232 KB |
Output is correct |
33 |
Correct |
31 ms |
16128 KB |
Output is correct |
34 |
Correct |
30 ms |
16128 KB |
Output is correct |
35 |
Correct |
30 ms |
16120 KB |
Output is correct |
36 |
Correct |
32 ms |
16248 KB |
Output is correct |
37 |
Correct |
29 ms |
16120 KB |
Output is correct |
38 |
Correct |
29 ms |
16128 KB |
Output is correct |
39 |
Correct |
50 ms |
19320 KB |
Output is correct |
40 |
Correct |
51 ms |
19320 KB |
Output is correct |
41 |
Correct |
50 ms |
19320 KB |
Output is correct |
42 |
Correct |
13 ms |
14464 KB |
Output is correct |
43 |
Correct |
13 ms |
14464 KB |
Output is correct |
44 |
Correct |
14 ms |
14464 KB |
Output is correct |
45 |
Correct |
14 ms |
14464 KB |
Output is correct |
46 |
Correct |
14 ms |
14464 KB |
Output is correct |
47 |
Correct |
13 ms |
14464 KB |
Output is correct |
48 |
Correct |
14 ms |
14464 KB |
Output is correct |
49 |
Correct |
13 ms |
14464 KB |
Output is correct |
50 |
Correct |
13 ms |
14464 KB |
Output is correct |
51 |
Correct |
13 ms |
14464 KB |
Output is correct |
52 |
Correct |
14 ms |
14464 KB |
Output is correct |
53 |
Correct |
14 ms |
14464 KB |
Output is correct |
54 |
Correct |
13 ms |
14464 KB |
Output is correct |
55 |
Correct |
14 ms |
14464 KB |
Output is correct |
56 |
Correct |
13 ms |
14464 KB |
Output is correct |
57 |
Correct |
15 ms |
14464 KB |
Output is correct |
58 |
Correct |
14 ms |
14464 KB |
Output is correct |
59 |
Correct |
15 ms |
14464 KB |
Output is correct |
60 |
Correct |
14 ms |
14464 KB |
Output is correct |
61 |
Correct |
14 ms |
14464 KB |
Output is correct |
62 |
Correct |
13 ms |
14464 KB |
Output is correct |
63 |
Correct |
14 ms |
14464 KB |
Output is correct |
64 |
Correct |
14 ms |
14464 KB |
Output is correct |
65 |
Correct |
14 ms |
14464 KB |
Output is correct |
66 |
Correct |
14 ms |
14464 KB |
Output is correct |
67 |
Correct |
14 ms |
14464 KB |
Output is correct |
68 |
Correct |
14 ms |
14464 KB |
Output is correct |
69 |
Correct |
14 ms |
14464 KB |
Output is correct |
70 |
Correct |
14 ms |
14464 KB |
Output is correct |
71 |
Correct |
15 ms |
14464 KB |
Output is correct |
72 |
Correct |
14 ms |
14592 KB |
Output is correct |
73 |
Correct |
14 ms |
14464 KB |
Output is correct |
74 |
Correct |
14 ms |
14464 KB |
Output is correct |
75 |
Correct |
14 ms |
14464 KB |
Output is correct |
76 |
Correct |
14 ms |
14464 KB |
Output is correct |
77 |
Correct |
14 ms |
14464 KB |
Output is correct |
78 |
Correct |
14 ms |
14464 KB |
Output is correct |
79 |
Correct |
14 ms |
14464 KB |
Output is correct |
80 |
Correct |
14 ms |
14720 KB |
Output is correct |
81 |
Correct |
14 ms |
14592 KB |
Output is correct |
82 |
Correct |
15 ms |
14720 KB |
Output is correct |
83 |
Correct |
15 ms |
14720 KB |
Output is correct |
84 |
Correct |
15 ms |
14592 KB |
Output is correct |
85 |
Correct |
16 ms |
14720 KB |
Output is correct |
86 |
Correct |
17 ms |
14592 KB |
Output is correct |
87 |
Correct |
16 ms |
14592 KB |
Output is correct |
88 |
Correct |
15 ms |
14592 KB |
Output is correct |
89 |
Correct |
16 ms |
14592 KB |
Output is correct |
90 |
Correct |
16 ms |
14592 KB |
Output is correct |
91 |
Correct |
41 ms |
17016 KB |
Output is correct |
92 |
Correct |
38 ms |
17528 KB |
Output is correct |
93 |
Correct |
49 ms |
17912 KB |
Output is correct |
94 |
Correct |
15 ms |
14976 KB |
Output is correct |
95 |
Correct |
17 ms |
14976 KB |
Output is correct |
96 |
Correct |
16 ms |
14976 KB |
Output is correct |
97 |
Correct |
16 ms |
14968 KB |
Output is correct |
98 |
Correct |
16 ms |
14976 KB |
Output is correct |
99 |
Correct |
16 ms |
14720 KB |
Output is correct |
100 |
Correct |
19 ms |
14736 KB |
Output is correct |
101 |
Correct |
17 ms |
14720 KB |
Output is correct |
102 |
Correct |
16 ms |
14720 KB |
Output is correct |
103 |
Correct |
17 ms |
14720 KB |
Output is correct |
104 |
Correct |
16 ms |
14720 KB |
Output is correct |
105 |
Correct |
59 ms |
18168 KB |
Output is correct |
106 |
Correct |
55 ms |
18232 KB |
Output is correct |
107 |
Correct |
57 ms |
18168 KB |
Output is correct |
108 |
Correct |
21 ms |
15232 KB |
Output is correct |
109 |
Correct |
194 ms |
73080 KB |
Output is correct |
110 |
Correct |
107 ms |
39416 KB |
Output is correct |
111 |
Correct |
91 ms |
37880 KB |
Output is correct |
112 |
Correct |
107 ms |
45688 KB |
Output is correct |
113 |
Correct |
71 ms |
29824 KB |
Output is correct |
114 |
Correct |
35 ms |
16128 KB |
Output is correct |
115 |
Correct |
34 ms |
15992 KB |
Output is correct |
116 |
Correct |
43 ms |
16376 KB |
Output is correct |
117 |
Correct |
34 ms |
16120 KB |
Output is correct |
118 |
Correct |
37 ms |
16248 KB |
Output is correct |
119 |
Correct |
33 ms |
15864 KB |
Output is correct |
120 |
Correct |
42 ms |
17144 KB |
Output is correct |
121 |
Correct |
23 ms |
15360 KB |
Output is correct |
122 |
Correct |
47 ms |
17400 KB |
Output is correct |
123 |
Correct |
23 ms |
15224 KB |
Output is correct |
124 |
Correct |
54 ms |
18040 KB |
Output is correct |
125 |
Correct |
29 ms |
15736 KB |
Output is correct |
126 |
Correct |
27 ms |
15744 KB |
Output is correct |
127 |
Correct |
29 ms |
15992 KB |
Output is correct |
128 |
Correct |
23 ms |
15744 KB |
Output is correct |
129 |
Correct |
24 ms |
15616 KB |
Output is correct |
130 |
Correct |
22 ms |
15232 KB |
Output is correct |
131 |
Correct |
266 ms |
95224 KB |
Output is correct |
132 |
Correct |
178 ms |
55096 KB |
Output is correct |
133 |
Correct |
157 ms |
55160 KB |
Output is correct |
134 |
Correct |
144 ms |
55160 KB |
Output is correct |
135 |
Correct |
134 ms |
51448 KB |
Output is correct |
136 |
Correct |
47 ms |
16760 KB |
Output is correct |
137 |
Correct |
50 ms |
16632 KB |
Output is correct |
138 |
Correct |
46 ms |
16632 KB |
Output is correct |
139 |
Correct |
45 ms |
16696 KB |
Output is correct |
140 |
Correct |
46 ms |
16760 KB |
Output is correct |
141 |
Correct |
46 ms |
16632 KB |
Output is correct |
142 |
Correct |
65 ms |
19064 KB |
Output is correct |
143 |
Correct |
31 ms |
15992 KB |
Output is correct |
144 |
Correct |
65 ms |
19064 KB |
Output is correct |
145 |
Correct |
31 ms |
15992 KB |
Output is correct |
146 |
Correct |
65 ms |
19064 KB |
Output is correct |
147 |
Correct |
30 ms |
15992 KB |
Output is correct |
148 |
Correct |
29 ms |
16248 KB |
Output is correct |
149 |
Correct |
29 ms |
16248 KB |
Output is correct |
150 |
Correct |
28 ms |
16124 KB |
Output is correct |
151 |
Correct |
30 ms |
16128 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
14464 KB |
Output is correct |
2 |
Correct |
13 ms |
14336 KB |
Output is correct |
3 |
Correct |
13 ms |
14336 KB |
Output is correct |
4 |
Correct |
13 ms |
14336 KB |
Output is correct |
5 |
Correct |
13 ms |
14464 KB |
Output is correct |
6 |
Correct |
13 ms |
14464 KB |
Output is correct |
7 |
Correct |
13 ms |
14464 KB |
Output is correct |
8 |
Correct |
13 ms |
14464 KB |
Output is correct |
9 |
Correct |
14 ms |
14464 KB |
Output is correct |
10 |
Correct |
13 ms |
14368 KB |
Output is correct |
11 |
Correct |
13 ms |
14464 KB |
Output is correct |
12 |
Correct |
13 ms |
14464 KB |
Output is correct |
13 |
Correct |
15 ms |
14464 KB |
Output is correct |
14 |
Correct |
16 ms |
14464 KB |
Output is correct |
15 |
Correct |
13 ms |
14464 KB |
Output is correct |
16 |
Correct |
14 ms |
14464 KB |
Output is correct |
17 |
Correct |
14 ms |
14464 KB |
Output is correct |
18 |
Correct |
14 ms |
14464 KB |
Output is correct |
19 |
Correct |
14 ms |
14464 KB |
Output is correct |
20 |
Correct |
14 ms |
14464 KB |
Output is correct |
21 |
Correct |
14 ms |
14464 KB |
Output is correct |
22 |
Correct |
15 ms |
14464 KB |
Output is correct |
23 |
Correct |
15 ms |
14464 KB |
Output is correct |
24 |
Correct |
40 ms |
18296 KB |
Output is correct |
25 |
Correct |
42 ms |
18296 KB |
Output is correct |
26 |
Correct |
41 ms |
18296 KB |
Output is correct |
27 |
Correct |
20 ms |
15232 KB |
Output is correct |
28 |
Correct |
20 ms |
15232 KB |
Output is correct |
29 |
Correct |
19 ms |
15232 KB |
Output is correct |
30 |
Correct |
18 ms |
15232 KB |
Output is correct |
31 |
Correct |
18 ms |
15232 KB |
Output is correct |
32 |
Correct |
18 ms |
15232 KB |
Output is correct |
33 |
Correct |
31 ms |
16128 KB |
Output is correct |
34 |
Correct |
30 ms |
16128 KB |
Output is correct |
35 |
Correct |
30 ms |
16120 KB |
Output is correct |
36 |
Correct |
32 ms |
16248 KB |
Output is correct |
37 |
Correct |
29 ms |
16120 KB |
Output is correct |
38 |
Correct |
29 ms |
16128 KB |
Output is correct |
39 |
Correct |
50 ms |
19320 KB |
Output is correct |
40 |
Correct |
51 ms |
19320 KB |
Output is correct |
41 |
Correct |
50 ms |
19320 KB |
Output is correct |
42 |
Correct |
44 ms |
18300 KB |
Output is correct |
43 |
Correct |
32 ms |
16896 KB |
Output is correct |
44 |
Correct |
42 ms |
18688 KB |
Output is correct |
45 |
Correct |
28 ms |
17184 KB |
Output is correct |
46 |
Correct |
27 ms |
17024 KB |
Output is correct |
47 |
Correct |
33 ms |
18816 KB |
Output is correct |
48 |
Correct |
91 ms |
26488 KB |
Output is correct |
49 |
Correct |
61 ms |
21368 KB |
Output is correct |
50 |
Correct |
59 ms |
23928 KB |
Output is correct |
51 |
Correct |
83 ms |
24348 KB |
Output is correct |
52 |
Correct |
76 ms |
24312 KB |
Output is correct |
53 |
Correct |
64 ms |
22136 KB |
Output is correct |
54 |
Correct |
46 ms |
18680 KB |
Output is correct |
55 |
Correct |
47 ms |
18680 KB |
Output is correct |
56 |
Correct |
42 ms |
18688 KB |
Output is correct |
57 |
Correct |
36 ms |
18732 KB |
Output is correct |
58 |
Correct |
34 ms |
18684 KB |
Output is correct |
59 |
Correct |
34 ms |
18688 KB |
Output is correct |
60 |
Correct |
97 ms |
27768 KB |
Output is correct |
61 |
Correct |
99 ms |
27668 KB |
Output is correct |
62 |
Correct |
104 ms |
27700 KB |
Output is correct |
63 |
Correct |
96 ms |
27772 KB |
Output is correct |
64 |
Correct |
95 ms |
27768 KB |
Output is correct |
65 |
Correct |
97 ms |
27768 KB |
Output is correct |
66 |
Correct |
96 ms |
27256 KB |
Output is correct |
67 |
Correct |
95 ms |
27128 KB |
Output is correct |
68 |
Correct |
90 ms |
27128 KB |
Output is correct |
69 |
Correct |
13 ms |
14464 KB |
Output is correct |
70 |
Correct |
13 ms |
14464 KB |
Output is correct |
71 |
Correct |
14 ms |
14464 KB |
Output is correct |
72 |
Correct |
14 ms |
14464 KB |
Output is correct |
73 |
Correct |
14 ms |
14464 KB |
Output is correct |
74 |
Correct |
13 ms |
14464 KB |
Output is correct |
75 |
Correct |
14 ms |
14464 KB |
Output is correct |
76 |
Correct |
13 ms |
14464 KB |
Output is correct |
77 |
Correct |
13 ms |
14464 KB |
Output is correct |
78 |
Correct |
13 ms |
14464 KB |
Output is correct |
79 |
Correct |
14 ms |
14464 KB |
Output is correct |
80 |
Correct |
14 ms |
14464 KB |
Output is correct |
81 |
Correct |
13 ms |
14464 KB |
Output is correct |
82 |
Correct |
14 ms |
14464 KB |
Output is correct |
83 |
Correct |
13 ms |
14464 KB |
Output is correct |
84 |
Correct |
15 ms |
14464 KB |
Output is correct |
85 |
Correct |
14 ms |
14464 KB |
Output is correct |
86 |
Correct |
15 ms |
14464 KB |
Output is correct |
87 |
Correct |
14 ms |
14464 KB |
Output is correct |
88 |
Correct |
14 ms |
14464 KB |
Output is correct |
89 |
Correct |
13 ms |
14464 KB |
Output is correct |
90 |
Correct |
14 ms |
14464 KB |
Output is correct |
91 |
Correct |
14 ms |
14464 KB |
Output is correct |
92 |
Correct |
14 ms |
14464 KB |
Output is correct |
93 |
Correct |
14 ms |
14464 KB |
Output is correct |
94 |
Correct |
14 ms |
14464 KB |
Output is correct |
95 |
Correct |
14 ms |
14464 KB |
Output is correct |
96 |
Correct |
14 ms |
14464 KB |
Output is correct |
97 |
Correct |
14 ms |
14464 KB |
Output is correct |
98 |
Correct |
15 ms |
14464 KB |
Output is correct |
99 |
Correct |
14 ms |
14592 KB |
Output is correct |
100 |
Correct |
14 ms |
14464 KB |
Output is correct |
101 |
Correct |
14 ms |
14464 KB |
Output is correct |
102 |
Correct |
14 ms |
14464 KB |
Output is correct |
103 |
Correct |
14 ms |
14464 KB |
Output is correct |
104 |
Correct |
14 ms |
14464 KB |
Output is correct |
105 |
Correct |
14 ms |
14464 KB |
Output is correct |
106 |
Correct |
14 ms |
14464 KB |
Output is correct |
107 |
Correct |
14 ms |
14720 KB |
Output is correct |
108 |
Correct |
14 ms |
14592 KB |
Output is correct |
109 |
Correct |
15 ms |
14720 KB |
Output is correct |
110 |
Correct |
15 ms |
14720 KB |
Output is correct |
111 |
Correct |
15 ms |
14592 KB |
Output is correct |
112 |
Correct |
16 ms |
14720 KB |
Output is correct |
113 |
Correct |
17 ms |
14592 KB |
Output is correct |
114 |
Correct |
16 ms |
14592 KB |
Output is correct |
115 |
Correct |
15 ms |
14592 KB |
Output is correct |
116 |
Correct |
16 ms |
14592 KB |
Output is correct |
117 |
Correct |
16 ms |
14592 KB |
Output is correct |
118 |
Correct |
41 ms |
17016 KB |
Output is correct |
119 |
Correct |
38 ms |
17528 KB |
Output is correct |
120 |
Correct |
49 ms |
17912 KB |
Output is correct |
121 |
Correct |
15 ms |
14976 KB |
Output is correct |
122 |
Correct |
17 ms |
14976 KB |
Output is correct |
123 |
Correct |
16 ms |
14976 KB |
Output is correct |
124 |
Correct |
16 ms |
14968 KB |
Output is correct |
125 |
Correct |
16 ms |
14976 KB |
Output is correct |
126 |
Correct |
16 ms |
14720 KB |
Output is correct |
127 |
Correct |
19 ms |
14736 KB |
Output is correct |
128 |
Correct |
17 ms |
14720 KB |
Output is correct |
129 |
Correct |
16 ms |
14720 KB |
Output is correct |
130 |
Correct |
17 ms |
14720 KB |
Output is correct |
131 |
Correct |
16 ms |
14720 KB |
Output is correct |
132 |
Correct |
59 ms |
18168 KB |
Output is correct |
133 |
Correct |
55 ms |
18232 KB |
Output is correct |
134 |
Correct |
57 ms |
18168 KB |
Output is correct |
135 |
Correct |
21 ms |
15232 KB |
Output is correct |
136 |
Correct |
194 ms |
73080 KB |
Output is correct |
137 |
Correct |
107 ms |
39416 KB |
Output is correct |
138 |
Correct |
91 ms |
37880 KB |
Output is correct |
139 |
Correct |
107 ms |
45688 KB |
Output is correct |
140 |
Correct |
71 ms |
29824 KB |
Output is correct |
141 |
Correct |
35 ms |
16128 KB |
Output is correct |
142 |
Correct |
34 ms |
15992 KB |
Output is correct |
143 |
Correct |
43 ms |
16376 KB |
Output is correct |
144 |
Correct |
34 ms |
16120 KB |
Output is correct |
145 |
Correct |
37 ms |
16248 KB |
Output is correct |
146 |
Correct |
33 ms |
15864 KB |
Output is correct |
147 |
Correct |
42 ms |
17144 KB |
Output is correct |
148 |
Correct |
23 ms |
15360 KB |
Output is correct |
149 |
Correct |
47 ms |
17400 KB |
Output is correct |
150 |
Correct |
23 ms |
15224 KB |
Output is correct |
151 |
Correct |
54 ms |
18040 KB |
Output is correct |
152 |
Correct |
29 ms |
15736 KB |
Output is correct |
153 |
Correct |
27 ms |
15744 KB |
Output is correct |
154 |
Correct |
29 ms |
15992 KB |
Output is correct |
155 |
Correct |
23 ms |
15744 KB |
Output is correct |
156 |
Correct |
24 ms |
15616 KB |
Output is correct |
157 |
Correct |
22 ms |
15232 KB |
Output is correct |
158 |
Correct |
266 ms |
95224 KB |
Output is correct |
159 |
Correct |
178 ms |
55096 KB |
Output is correct |
160 |
Correct |
157 ms |
55160 KB |
Output is correct |
161 |
Correct |
144 ms |
55160 KB |
Output is correct |
162 |
Correct |
134 ms |
51448 KB |
Output is correct |
163 |
Correct |
47 ms |
16760 KB |
Output is correct |
164 |
Correct |
50 ms |
16632 KB |
Output is correct |
165 |
Correct |
46 ms |
16632 KB |
Output is correct |
166 |
Correct |
45 ms |
16696 KB |
Output is correct |
167 |
Correct |
46 ms |
16760 KB |
Output is correct |
168 |
Correct |
46 ms |
16632 KB |
Output is correct |
169 |
Correct |
65 ms |
19064 KB |
Output is correct |
170 |
Correct |
31 ms |
15992 KB |
Output is correct |
171 |
Correct |
65 ms |
19064 KB |
Output is correct |
172 |
Correct |
31 ms |
15992 KB |
Output is correct |
173 |
Correct |
65 ms |
19064 KB |
Output is correct |
174 |
Correct |
30 ms |
15992 KB |
Output is correct |
175 |
Correct |
29 ms |
16248 KB |
Output is correct |
176 |
Correct |
29 ms |
16248 KB |
Output is correct |
177 |
Correct |
28 ms |
16124 KB |
Output is correct |
178 |
Correct |
30 ms |
16128 KB |
Output is correct |
179 |
Correct |
37 ms |
17016 KB |
Output is correct |
180 |
Correct |
455 ms |
120184 KB |
Output is correct |
181 |
Correct |
524 ms |
167416 KB |
Output is correct |
182 |
Correct |
657 ms |
215928 KB |
Output is correct |
183 |
Correct |
348 ms |
113912 KB |
Output is correct |
184 |
Correct |
279 ms |
78968 KB |
Output is correct |
185 |
Correct |
70 ms |
19576 KB |
Output is correct |
186 |
Correct |
65 ms |
21496 KB |
Output is correct |
187 |
Correct |
86 ms |
20472 KB |
Output is correct |
188 |
Correct |
73 ms |
20472 KB |
Output is correct |
189 |
Correct |
95 ms |
20988 KB |
Output is correct |
190 |
Correct |
79 ms |
21496 KB |
Output is correct |
191 |
Correct |
85 ms |
21496 KB |
Output is correct |
192 |
Correct |
62 ms |
19068 KB |
Output is correct |
193 |
Correct |
73 ms |
19196 KB |
Output is correct |
194 |
Correct |
52 ms |
18680 KB |
Output is correct |
195 |
Correct |
1192 ms |
418168 KB |
Output is correct |
196 |
Correct |
776 ms |
217848 KB |
Output is correct |
197 |
Correct |
676 ms |
217756 KB |
Output is correct |
198 |
Correct |
625 ms |
217768 KB |
Output is correct |
199 |
Correct |
566 ms |
197752 KB |
Output is correct |
200 |
Correct |
136 ms |
27768 KB |
Output is correct |
201 |
Correct |
138 ms |
27768 KB |
Output is correct |
202 |
Correct |
132 ms |
27768 KB |
Output is correct |
203 |
Correct |
132 ms |
27768 KB |
Output is correct |
204 |
Correct |
136 ms |
27768 KB |
Output is correct |
205 |
Correct |
134 ms |
27768 KB |
Output is correct |
206 |
Correct |
116 ms |
26488 KB |
Output is correct |
207 |
Correct |
112 ms |
26748 KB |
Output is correct |
208 |
Correct |
117 ms |
26488 KB |
Output is correct |
209 |
Correct |
109 ms |
26744 KB |
Output is correct |
210 |
Correct |
113 ms |
26488 KB |
Output is correct |
211 |
Correct |
114 ms |
26788 KB |
Output is correct |
212 |
Correct |
105 ms |
27768 KB |
Output is correct |
213 |
Correct |
102 ms |
24824 KB |
Output is correct |
214 |
Correct |
94 ms |
24440 KB |
Output is correct |
215 |
Correct |
114 ms |
24184 KB |
Output is correct |