#include "beechtree.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=2e5+7;
vector<pair<int,int>>V[LIM], K[LIM];
vector<int>ans;
int ile[LIM];
void DFS(int x) {
ile[x]=1;
for(auto i : V[x]) {
DFS(i.nd);
ile[x]+=ile[i.nd];
K[x].pb({ile[i.nd], i.nd});
}
sort(all(K[x]));
reverse(all(K[x]));
for(int i=1; i<V[x].size(); ++i) if(V[x][i-1].st==V[x][i].st) ans[x]=0;
}
bool zawiera(int a, int b) {
if(V[a].size()>V[b].size()) return false;
int l=0;
rep(i, V[a].size()) {
while(l<V[b].size() && V[b][l].st!=V[a][i].st) ++l;
if(l==V[b].size()) return false;
if(ile[V[a][i].nd]>ile[V[b][l].nd]) return false;
}
return true;
}
bool dodaj(set<pair<int,int>>&S, pair<int,int>x) {
auto it=S.lower_bound(x);
if(it!=S.end()) {
auto p=*it;
if(!zawiera(x.nd, p.nd)) return false;
}
if(it!=S.begin()) {
--it;
auto p=*it;
if(!zawiera(p.nd, x.nd)) return false;
}
S.insert(x);
return true;
}
void DFS2(int x, set<pair<int,int>>&S) {
if(K[x].size()==0) {
S.insert({ile[x], x});
return;
}
DFS2(K[x][0].nd, S);
if(!ans[K[x][0].nd]) ans[x]=0;
if(!dodaj(S, {ile[x], x})) ans[x]=0;
for(int i=1; i<K[x].size(); ++i) {
set<pair<int,int>>tmp;
DFS2(K[x][i].nd, tmp);
if(!ans[K[x][i].nd]) ans[x]=0;
if(!ans[x]) continue;
for(auto j : tmp) if(!dodaj(S, j)) ans[x]=0;
}
}
vector<int>beechtree(int n, int m, vector<int>P, vector<int>C) {
rep(i, n-1) V[P[i+1]].pb({C[i+1], i+1});
rep(i, n) sort(all(V[i]));
rep(i, n) ans.pb(1);
DFS(0);
set<pair<int,int>>S;
DFS2(0, S);
return ans;
}
Compilation message
beechtree.cpp: In function 'void DFS(int)':
beechtree.cpp:22:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 | for(int i=1; i<V[x].size(); ++i) if(V[x][i-1].st==V[x][i].st) ans[x]=0;
| ~^~~~~~~~~~~~
beechtree.cpp: In function 'bool zawiera(int, int)':
beechtree.cpp:4:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
4 | #define rep(a, b) for(int a = 0; a < (b); ++a)
| ^
beechtree.cpp:27:3: note: in expansion of macro 'rep'
27 | rep(i, V[a].size()) {
| ^~~
beechtree.cpp:28:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
28 | while(l<V[b].size() && V[b][l].st!=V[a][i].st) ++l;
| ~^~~~~~~~~~~~
beechtree.cpp:29:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
29 | if(l==V[b].size()) return false;
| ~^~~~~~~~~~~~~
beechtree.cpp: In function 'void DFS2(int, std::set<std::pair<int, int> >&)':
beechtree.cpp:56:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
56 | for(int i=1; i<K[x].size(); ++i) {
| ~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10332 KB |
Output is correct |
2 |
Correct |
2 ms |
10332 KB |
Output is correct |
3 |
Correct |
3 ms |
10332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
10328 KB |
Output is correct |
2 |
Correct |
3 ms |
10332 KB |
Output is correct |
3 |
Correct |
2 ms |
10308 KB |
Output is correct |
4 |
Correct |
2 ms |
10328 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10332 KB |
Output is correct |
7 |
Correct |
2 ms |
10332 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
3 ms |
10332 KB |
Output is correct |
10 |
Correct |
2 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
3 ms |
10332 KB |
Output is correct |
14 |
Correct |
3 ms |
10332 KB |
Output is correct |
15 |
Correct |
3 ms |
10332 KB |
Output is correct |
16 |
Correct |
3 ms |
10332 KB |
Output is correct |
17 |
Correct |
3 ms |
10332 KB |
Output is correct |
18 |
Correct |
2 ms |
10332 KB |
Output is correct |
19 |
Correct |
3 ms |
10332 KB |
Output is correct |
20 |
Correct |
3 ms |
10332 KB |
Output is correct |
21 |
Correct |
3 ms |
10332 KB |
Output is correct |
22 |
Correct |
3 ms |
10332 KB |
Output is correct |
23 |
Correct |
4 ms |
10328 KB |
Output is correct |
24 |
Correct |
2 ms |
10332 KB |
Output is correct |
25 |
Correct |
2 ms |
10332 KB |
Output is correct |
26 |
Correct |
2 ms |
10332 KB |
Output is correct |
27 |
Correct |
2 ms |
10332 KB |
Output is correct |
28 |
Correct |
3 ms |
10328 KB |
Output is correct |
29 |
Correct |
2 ms |
10332 KB |
Output is correct |
30 |
Correct |
3 ms |
10332 KB |
Output is correct |
31 |
Correct |
3 ms |
10332 KB |
Output is correct |
32 |
Correct |
4 ms |
10484 KB |
Output is correct |
33 |
Correct |
2 ms |
10332 KB |
Output is correct |
34 |
Correct |
2 ms |
10332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
10328 KB |
Output is correct |
2 |
Correct |
3 ms |
10332 KB |
Output is correct |
3 |
Correct |
2 ms |
10308 KB |
Output is correct |
4 |
Correct |
2 ms |
10328 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10332 KB |
Output is correct |
7 |
Correct |
111 ms |
55888 KB |
Output is correct |
8 |
Correct |
101 ms |
58504 KB |
Output is correct |
9 |
Correct |
3 ms |
10332 KB |
Output is correct |
10 |
Correct |
3 ms |
10332 KB |
Output is correct |
11 |
Correct |
4 ms |
10332 KB |
Output is correct |
12 |
Correct |
4 ms |
10332 KB |
Output is correct |
13 |
Correct |
4 ms |
10840 KB |
Output is correct |
14 |
Correct |
4 ms |
10844 KB |
Output is correct |
15 |
Correct |
4 ms |
10844 KB |
Output is correct |
16 |
Correct |
3 ms |
10844 KB |
Output is correct |
17 |
Correct |
140 ms |
67528 KB |
Output is correct |
18 |
Correct |
137 ms |
67780 KB |
Output is correct |
19 |
Correct |
114 ms |
62152 KB |
Output is correct |
20 |
Correct |
99 ms |
58456 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10332 KB |
Output is correct |
2 |
Correct |
2 ms |
10332 KB |
Output is correct |
3 |
Correct |
3 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10424 KB |
Output is correct |
5 |
Correct |
4 ms |
10328 KB |
Output is correct |
6 |
Correct |
3 ms |
10332 KB |
Output is correct |
7 |
Correct |
3 ms |
10332 KB |
Output is correct |
8 |
Correct |
4 ms |
10328 KB |
Output is correct |
9 |
Correct |
3 ms |
10332 KB |
Output is correct |
10 |
Correct |
2 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
3 ms |
10332 KB |
Output is correct |
14 |
Correct |
3 ms |
10332 KB |
Output is correct |
15 |
Correct |
54 ms |
16352 KB |
Output is correct |
16 |
Correct |
51 ms |
15052 KB |
Output is correct |
17 |
Correct |
57 ms |
15056 KB |
Output is correct |
18 |
Correct |
70 ms |
19920 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
10328 KB |
Output is correct |
2 |
Correct |
3 ms |
10332 KB |
Output is correct |
3 |
Correct |
2 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10332 KB |
Output is correct |
5 |
Correct |
111 ms |
55888 KB |
Output is correct |
6 |
Correct |
101 ms |
58504 KB |
Output is correct |
7 |
Correct |
4 ms |
10328 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
5 ms |
10332 KB |
Output is correct |
10 |
Correct |
3 ms |
10332 KB |
Output is correct |
11 |
Correct |
120 ms |
25552 KB |
Output is correct |
12 |
Correct |
91 ms |
21768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10332 KB |
Output is correct |
2 |
Correct |
2 ms |
10332 KB |
Output is correct |
3 |
Correct |
3 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10328 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10308 KB |
Output is correct |
7 |
Correct |
2 ms |
10328 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
2 ms |
10332 KB |
Output is correct |
10 |
Correct |
2 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
2 ms |
10332 KB |
Output is correct |
14 |
Correct |
3 ms |
10332 KB |
Output is correct |
15 |
Correct |
3 ms |
10332 KB |
Output is correct |
16 |
Correct |
3 ms |
10332 KB |
Output is correct |
17 |
Correct |
3 ms |
10332 KB |
Output is correct |
18 |
Correct |
3 ms |
10332 KB |
Output is correct |
19 |
Correct |
3 ms |
10332 KB |
Output is correct |
20 |
Correct |
3 ms |
10332 KB |
Output is correct |
21 |
Correct |
2 ms |
10332 KB |
Output is correct |
22 |
Correct |
3 ms |
10332 KB |
Output is correct |
23 |
Correct |
3 ms |
10332 KB |
Output is correct |
24 |
Correct |
3 ms |
10332 KB |
Output is correct |
25 |
Correct |
3 ms |
10332 KB |
Output is correct |
26 |
Correct |
4 ms |
10328 KB |
Output is correct |
27 |
Correct |
2 ms |
10332 KB |
Output is correct |
28 |
Correct |
2 ms |
10332 KB |
Output is correct |
29 |
Correct |
2 ms |
10332 KB |
Output is correct |
30 |
Correct |
2 ms |
10332 KB |
Output is correct |
31 |
Correct |
3 ms |
10328 KB |
Output is correct |
32 |
Correct |
2 ms |
10332 KB |
Output is correct |
33 |
Correct |
3 ms |
10332 KB |
Output is correct |
34 |
Correct |
3 ms |
10332 KB |
Output is correct |
35 |
Correct |
4 ms |
10484 KB |
Output is correct |
36 |
Correct |
2 ms |
10332 KB |
Output is correct |
37 |
Correct |
2 ms |
10332 KB |
Output is correct |
38 |
Correct |
3 ms |
10332 KB |
Output is correct |
39 |
Correct |
3 ms |
10332 KB |
Output is correct |
40 |
Correct |
4 ms |
10332 KB |
Output is correct |
41 |
Correct |
4 ms |
10332 KB |
Output is correct |
42 |
Correct |
2 ms |
10332 KB |
Output is correct |
43 |
Correct |
2 ms |
10332 KB |
Output is correct |
44 |
Correct |
3 ms |
10332 KB |
Output is correct |
45 |
Correct |
3 ms |
10424 KB |
Output is correct |
46 |
Correct |
4 ms |
10328 KB |
Output is correct |
47 |
Correct |
3 ms |
10332 KB |
Output is correct |
48 |
Correct |
3 ms |
10332 KB |
Output is correct |
49 |
Correct |
4 ms |
10328 KB |
Output is correct |
50 |
Correct |
3 ms |
10332 KB |
Output is correct |
51 |
Correct |
2 ms |
10332 KB |
Output is correct |
52 |
Correct |
4 ms |
10328 KB |
Output is correct |
53 |
Correct |
3 ms |
10332 KB |
Output is correct |
54 |
Correct |
3 ms |
10328 KB |
Output is correct |
55 |
Correct |
3 ms |
10332 KB |
Output is correct |
56 |
Correct |
4 ms |
10332 KB |
Output is correct |
57 |
Correct |
3 ms |
10332 KB |
Output is correct |
58 |
Correct |
3 ms |
10328 KB |
Output is correct |
59 |
Correct |
2 ms |
10332 KB |
Output is correct |
60 |
Correct |
3 ms |
10332 KB |
Output is correct |
61 |
Correct |
3 ms |
10328 KB |
Output is correct |
62 |
Correct |
3 ms |
10332 KB |
Output is correct |
63 |
Correct |
4 ms |
10332 KB |
Output is correct |
64 |
Correct |
3 ms |
10332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
10328 KB |
Output is correct |
2 |
Correct |
3 ms |
10332 KB |
Output is correct |
3 |
Correct |
2 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10332 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10332 KB |
Output is correct |
7 |
Correct |
3 ms |
10332 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
3 ms |
10332 KB |
Output is correct |
10 |
Correct |
3 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
3 ms |
10332 KB |
Output is correct |
14 |
Correct |
2 ms |
10332 KB |
Output is correct |
15 |
Correct |
3 ms |
10332 KB |
Output is correct |
16 |
Correct |
3 ms |
10332 KB |
Output is correct |
17 |
Correct |
3 ms |
10332 KB |
Output is correct |
18 |
Correct |
3 ms |
10332 KB |
Output is correct |
19 |
Correct |
4 ms |
10328 KB |
Output is correct |
20 |
Correct |
2 ms |
10332 KB |
Output is correct |
21 |
Correct |
2 ms |
10332 KB |
Output is correct |
22 |
Correct |
2 ms |
10332 KB |
Output is correct |
23 |
Correct |
2 ms |
10332 KB |
Output is correct |
24 |
Correct |
3 ms |
10328 KB |
Output is correct |
25 |
Correct |
4 ms |
10844 KB |
Output is correct |
26 |
Correct |
4 ms |
10844 KB |
Output is correct |
27 |
Correct |
4 ms |
10844 KB |
Output is correct |
28 |
Correct |
4 ms |
10844 KB |
Output is correct |
29 |
Correct |
4 ms |
10964 KB |
Output is correct |
30 |
Correct |
4 ms |
10588 KB |
Output is correct |
31 |
Correct |
5 ms |
10588 KB |
Output is correct |
32 |
Correct |
4 ms |
10588 KB |
Output is correct |
33 |
Correct |
4 ms |
10332 KB |
Output is correct |
34 |
Correct |
5 ms |
10584 KB |
Output is correct |
35 |
Correct |
4 ms |
10584 KB |
Output is correct |
36 |
Correct |
4 ms |
10332 KB |
Output is correct |
37 |
Correct |
4 ms |
10588 KB |
Output is correct |
38 |
Correct |
3 ms |
10588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10332 KB |
Output is correct |
2 |
Correct |
2 ms |
10332 KB |
Output is correct |
3 |
Correct |
3 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10328 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10308 KB |
Output is correct |
7 |
Correct |
2 ms |
10328 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
2 ms |
10332 KB |
Output is correct |
10 |
Correct |
2 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
2 ms |
10332 KB |
Output is correct |
14 |
Correct |
3 ms |
10332 KB |
Output is correct |
15 |
Correct |
3 ms |
10332 KB |
Output is correct |
16 |
Correct |
3 ms |
10332 KB |
Output is correct |
17 |
Correct |
3 ms |
10332 KB |
Output is correct |
18 |
Correct |
3 ms |
10332 KB |
Output is correct |
19 |
Correct |
3 ms |
10332 KB |
Output is correct |
20 |
Correct |
3 ms |
10332 KB |
Output is correct |
21 |
Correct |
2 ms |
10332 KB |
Output is correct |
22 |
Correct |
3 ms |
10332 KB |
Output is correct |
23 |
Correct |
3 ms |
10332 KB |
Output is correct |
24 |
Correct |
3 ms |
10332 KB |
Output is correct |
25 |
Correct |
3 ms |
10332 KB |
Output is correct |
26 |
Correct |
4 ms |
10328 KB |
Output is correct |
27 |
Correct |
2 ms |
10332 KB |
Output is correct |
28 |
Correct |
2 ms |
10332 KB |
Output is correct |
29 |
Correct |
2 ms |
10332 KB |
Output is correct |
30 |
Correct |
2 ms |
10332 KB |
Output is correct |
31 |
Correct |
3 ms |
10328 KB |
Output is correct |
32 |
Correct |
2 ms |
10332 KB |
Output is correct |
33 |
Correct |
3 ms |
10332 KB |
Output is correct |
34 |
Correct |
3 ms |
10332 KB |
Output is correct |
35 |
Correct |
4 ms |
10484 KB |
Output is correct |
36 |
Correct |
2 ms |
10332 KB |
Output is correct |
37 |
Correct |
2 ms |
10332 KB |
Output is correct |
38 |
Correct |
3 ms |
10332 KB |
Output is correct |
39 |
Correct |
3 ms |
10332 KB |
Output is correct |
40 |
Correct |
4 ms |
10332 KB |
Output is correct |
41 |
Correct |
4 ms |
10332 KB |
Output is correct |
42 |
Correct |
4 ms |
10840 KB |
Output is correct |
43 |
Correct |
4 ms |
10844 KB |
Output is correct |
44 |
Correct |
4 ms |
10844 KB |
Output is correct |
45 |
Correct |
3 ms |
10844 KB |
Output is correct |
46 |
Correct |
2 ms |
10332 KB |
Output is correct |
47 |
Correct |
2 ms |
10332 KB |
Output is correct |
48 |
Correct |
3 ms |
10332 KB |
Output is correct |
49 |
Correct |
3 ms |
10424 KB |
Output is correct |
50 |
Correct |
4 ms |
10328 KB |
Output is correct |
51 |
Correct |
3 ms |
10332 KB |
Output is correct |
52 |
Correct |
3 ms |
10332 KB |
Output is correct |
53 |
Correct |
4 ms |
10328 KB |
Output is correct |
54 |
Correct |
3 ms |
10332 KB |
Output is correct |
55 |
Correct |
2 ms |
10332 KB |
Output is correct |
56 |
Correct |
3 ms |
10332 KB |
Output is correct |
57 |
Correct |
3 ms |
10332 KB |
Output is correct |
58 |
Correct |
3 ms |
10332 KB |
Output is correct |
59 |
Correct |
3 ms |
10332 KB |
Output is correct |
60 |
Correct |
4 ms |
10328 KB |
Output is correct |
61 |
Correct |
3 ms |
10332 KB |
Output is correct |
62 |
Correct |
5 ms |
10332 KB |
Output is correct |
63 |
Correct |
3 ms |
10332 KB |
Output is correct |
64 |
Correct |
3 ms |
10328 KB |
Output is correct |
65 |
Correct |
3 ms |
10332 KB |
Output is correct |
66 |
Correct |
4 ms |
10332 KB |
Output is correct |
67 |
Correct |
3 ms |
10332 KB |
Output is correct |
68 |
Correct |
3 ms |
10328 KB |
Output is correct |
69 |
Correct |
2 ms |
10332 KB |
Output is correct |
70 |
Correct |
3 ms |
10332 KB |
Output is correct |
71 |
Correct |
3 ms |
10328 KB |
Output is correct |
72 |
Correct |
3 ms |
10332 KB |
Output is correct |
73 |
Correct |
4 ms |
10332 KB |
Output is correct |
74 |
Correct |
3 ms |
10332 KB |
Output is correct |
75 |
Correct |
4 ms |
10844 KB |
Output is correct |
76 |
Correct |
4 ms |
10844 KB |
Output is correct |
77 |
Correct |
4 ms |
10844 KB |
Output is correct |
78 |
Correct |
4 ms |
10844 KB |
Output is correct |
79 |
Correct |
4 ms |
10964 KB |
Output is correct |
80 |
Correct |
4 ms |
10588 KB |
Output is correct |
81 |
Correct |
5 ms |
10588 KB |
Output is correct |
82 |
Correct |
4 ms |
10588 KB |
Output is correct |
83 |
Correct |
4 ms |
10332 KB |
Output is correct |
84 |
Correct |
5 ms |
10584 KB |
Output is correct |
85 |
Correct |
4 ms |
10584 KB |
Output is correct |
86 |
Correct |
4 ms |
10332 KB |
Output is correct |
87 |
Correct |
4 ms |
10588 KB |
Output is correct |
88 |
Correct |
3 ms |
10588 KB |
Output is correct |
89 |
Correct |
4 ms |
10844 KB |
Output is correct |
90 |
Correct |
4 ms |
10588 KB |
Output is correct |
91 |
Correct |
5 ms |
10636 KB |
Output is correct |
92 |
Correct |
4 ms |
10584 KB |
Output is correct |
93 |
Correct |
3 ms |
10588 KB |
Output is correct |
94 |
Correct |
4 ms |
10588 KB |
Output is correct |
95 |
Correct |
4 ms |
10332 KB |
Output is correct |
96 |
Correct |
4 ms |
10332 KB |
Output is correct |
97 |
Correct |
4 ms |
10584 KB |
Output is correct |
98 |
Correct |
3 ms |
10588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
10328 KB |
Output is correct |
2 |
Correct |
3 ms |
10332 KB |
Output is correct |
3 |
Correct |
2 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10332 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10332 KB |
Output is correct |
7 |
Correct |
3 ms |
10332 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
3 ms |
10332 KB |
Output is correct |
10 |
Correct |
3 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
3 ms |
10332 KB |
Output is correct |
14 |
Correct |
2 ms |
10332 KB |
Output is correct |
15 |
Correct |
3 ms |
10332 KB |
Output is correct |
16 |
Correct |
3 ms |
10332 KB |
Output is correct |
17 |
Correct |
3 ms |
10332 KB |
Output is correct |
18 |
Correct |
3 ms |
10332 KB |
Output is correct |
19 |
Correct |
4 ms |
10328 KB |
Output is correct |
20 |
Correct |
2 ms |
10332 KB |
Output is correct |
21 |
Correct |
2 ms |
10332 KB |
Output is correct |
22 |
Correct |
2 ms |
10332 KB |
Output is correct |
23 |
Correct |
2 ms |
10332 KB |
Output is correct |
24 |
Correct |
3 ms |
10328 KB |
Output is correct |
25 |
Correct |
4 ms |
10844 KB |
Output is correct |
26 |
Correct |
4 ms |
10844 KB |
Output is correct |
27 |
Correct |
4 ms |
10844 KB |
Output is correct |
28 |
Correct |
4 ms |
10844 KB |
Output is correct |
29 |
Correct |
4 ms |
10964 KB |
Output is correct |
30 |
Correct |
4 ms |
10588 KB |
Output is correct |
31 |
Correct |
5 ms |
10588 KB |
Output is correct |
32 |
Correct |
4 ms |
10588 KB |
Output is correct |
33 |
Correct |
4 ms |
10332 KB |
Output is correct |
34 |
Correct |
5 ms |
10584 KB |
Output is correct |
35 |
Correct |
4 ms |
10584 KB |
Output is correct |
36 |
Correct |
4 ms |
10332 KB |
Output is correct |
37 |
Correct |
4 ms |
10588 KB |
Output is correct |
38 |
Correct |
3 ms |
10588 KB |
Output is correct |
39 |
Correct |
134 ms |
65224 KB |
Output is correct |
40 |
Correct |
133 ms |
66992 KB |
Output is correct |
41 |
Correct |
129 ms |
65256 KB |
Output is correct |
42 |
Correct |
120 ms |
62148 KB |
Output is correct |
43 |
Correct |
140 ms |
57788 KB |
Output is correct |
44 |
Correct |
113 ms |
36248 KB |
Output is correct |
45 |
Correct |
411 ms |
37292 KB |
Output is correct |
46 |
Correct |
236 ms |
26884 KB |
Output is correct |
47 |
Correct |
179 ms |
25448 KB |
Output is correct |
48 |
Correct |
135 ms |
25368 KB |
Output is correct |
49 |
Correct |
96 ms |
25380 KB |
Output is correct |
50 |
Correct |
402 ms |
36044 KB |
Output is correct |
51 |
Correct |
268 ms |
25284 KB |
Output is correct |
52 |
Correct |
183 ms |
23496 KB |
Output is correct |
53 |
Correct |
130 ms |
23440 KB |
Output is correct |
54 |
Correct |
98 ms |
22992 KB |
Output is correct |
55 |
Correct |
98 ms |
38348 KB |
Output is correct |
56 |
Correct |
101 ms |
39116 KB |
Output is correct |
57 |
Correct |
91 ms |
25368 KB |
Output is correct |
58 |
Correct |
78 ms |
23612 KB |
Output is correct |
59 |
Correct |
76 ms |
23248 KB |
Output is correct |
60 |
Correct |
76 ms |
23248 KB |
Output is correct |
61 |
Correct |
83 ms |
23120 KB |
Output is correct |
62 |
Correct |
80 ms |
23228 KB |
Output is correct |
63 |
Correct |
148 ms |
43440 KB |
Output is correct |
64 |
Correct |
123 ms |
33984 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
10332 KB |
Output is correct |
2 |
Correct |
2 ms |
10332 KB |
Output is correct |
3 |
Correct |
3 ms |
10332 KB |
Output is correct |
4 |
Correct |
3 ms |
10328 KB |
Output is correct |
5 |
Correct |
3 ms |
10332 KB |
Output is correct |
6 |
Correct |
2 ms |
10308 KB |
Output is correct |
7 |
Correct |
2 ms |
10328 KB |
Output is correct |
8 |
Correct |
3 ms |
10332 KB |
Output is correct |
9 |
Correct |
2 ms |
10332 KB |
Output is correct |
10 |
Correct |
2 ms |
10332 KB |
Output is correct |
11 |
Correct |
3 ms |
10332 KB |
Output is correct |
12 |
Correct |
3 ms |
10332 KB |
Output is correct |
13 |
Correct |
2 ms |
10332 KB |
Output is correct |
14 |
Correct |
3 ms |
10332 KB |
Output is correct |
15 |
Correct |
3 ms |
10332 KB |
Output is correct |
16 |
Correct |
3 ms |
10332 KB |
Output is correct |
17 |
Correct |
3 ms |
10332 KB |
Output is correct |
18 |
Correct |
3 ms |
10332 KB |
Output is correct |
19 |
Correct |
3 ms |
10332 KB |
Output is correct |
20 |
Correct |
3 ms |
10332 KB |
Output is correct |
21 |
Correct |
2 ms |
10332 KB |
Output is correct |
22 |
Correct |
3 ms |
10332 KB |
Output is correct |
23 |
Correct |
3 ms |
10332 KB |
Output is correct |
24 |
Correct |
3 ms |
10332 KB |
Output is correct |
25 |
Correct |
3 ms |
10332 KB |
Output is correct |
26 |
Correct |
4 ms |
10328 KB |
Output is correct |
27 |
Correct |
2 ms |
10332 KB |
Output is correct |
28 |
Correct |
2 ms |
10332 KB |
Output is correct |
29 |
Correct |
2 ms |
10332 KB |
Output is correct |
30 |
Correct |
2 ms |
10332 KB |
Output is correct |
31 |
Correct |
3 ms |
10328 KB |
Output is correct |
32 |
Correct |
2 ms |
10332 KB |
Output is correct |
33 |
Correct |
3 ms |
10332 KB |
Output is correct |
34 |
Correct |
3 ms |
10332 KB |
Output is correct |
35 |
Correct |
4 ms |
10484 KB |
Output is correct |
36 |
Correct |
2 ms |
10332 KB |
Output is correct |
37 |
Correct |
2 ms |
10332 KB |
Output is correct |
38 |
Correct |
111 ms |
55888 KB |
Output is correct |
39 |
Correct |
101 ms |
58504 KB |
Output is correct |
40 |
Correct |
3 ms |
10332 KB |
Output is correct |
41 |
Correct |
3 ms |
10332 KB |
Output is correct |
42 |
Correct |
4 ms |
10332 KB |
Output is correct |
43 |
Correct |
4 ms |
10332 KB |
Output is correct |
44 |
Correct |
4 ms |
10840 KB |
Output is correct |
45 |
Correct |
4 ms |
10844 KB |
Output is correct |
46 |
Correct |
4 ms |
10844 KB |
Output is correct |
47 |
Correct |
3 ms |
10844 KB |
Output is correct |
48 |
Correct |
140 ms |
67528 KB |
Output is correct |
49 |
Correct |
137 ms |
67780 KB |
Output is correct |
50 |
Correct |
114 ms |
62152 KB |
Output is correct |
51 |
Correct |
99 ms |
58456 KB |
Output is correct |
52 |
Correct |
2 ms |
10332 KB |
Output is correct |
53 |
Correct |
2 ms |
10332 KB |
Output is correct |
54 |
Correct |
3 ms |
10332 KB |
Output is correct |
55 |
Correct |
3 ms |
10424 KB |
Output is correct |
56 |
Correct |
4 ms |
10328 KB |
Output is correct |
57 |
Correct |
3 ms |
10332 KB |
Output is correct |
58 |
Correct |
3 ms |
10332 KB |
Output is correct |
59 |
Correct |
4 ms |
10328 KB |
Output is correct |
60 |
Correct |
3 ms |
10332 KB |
Output is correct |
61 |
Correct |
2 ms |
10332 KB |
Output is correct |
62 |
Correct |
3 ms |
10332 KB |
Output is correct |
63 |
Correct |
3 ms |
10332 KB |
Output is correct |
64 |
Correct |
3 ms |
10332 KB |
Output is correct |
65 |
Correct |
3 ms |
10332 KB |
Output is correct |
66 |
Correct |
54 ms |
16352 KB |
Output is correct |
67 |
Correct |
51 ms |
15052 KB |
Output is correct |
68 |
Correct |
57 ms |
15056 KB |
Output is correct |
69 |
Correct |
70 ms |
19920 KB |
Output is correct |
70 |
Correct |
4 ms |
10328 KB |
Output is correct |
71 |
Correct |
3 ms |
10332 KB |
Output is correct |
72 |
Correct |
5 ms |
10332 KB |
Output is correct |
73 |
Correct |
3 ms |
10332 KB |
Output is correct |
74 |
Correct |
120 ms |
25552 KB |
Output is correct |
75 |
Correct |
91 ms |
21768 KB |
Output is correct |
76 |
Correct |
3 ms |
10328 KB |
Output is correct |
77 |
Correct |
3 ms |
10332 KB |
Output is correct |
78 |
Correct |
4 ms |
10332 KB |
Output is correct |
79 |
Correct |
3 ms |
10332 KB |
Output is correct |
80 |
Correct |
3 ms |
10328 KB |
Output is correct |
81 |
Correct |
2 ms |
10332 KB |
Output is correct |
82 |
Correct |
3 ms |
10332 KB |
Output is correct |
83 |
Correct |
3 ms |
10328 KB |
Output is correct |
84 |
Correct |
3 ms |
10332 KB |
Output is correct |
85 |
Correct |
4 ms |
10332 KB |
Output is correct |
86 |
Correct |
3 ms |
10332 KB |
Output is correct |
87 |
Correct |
4 ms |
10844 KB |
Output is correct |
88 |
Correct |
4 ms |
10844 KB |
Output is correct |
89 |
Correct |
4 ms |
10844 KB |
Output is correct |
90 |
Correct |
4 ms |
10844 KB |
Output is correct |
91 |
Correct |
4 ms |
10964 KB |
Output is correct |
92 |
Correct |
4 ms |
10588 KB |
Output is correct |
93 |
Correct |
5 ms |
10588 KB |
Output is correct |
94 |
Correct |
4 ms |
10588 KB |
Output is correct |
95 |
Correct |
4 ms |
10332 KB |
Output is correct |
96 |
Correct |
5 ms |
10584 KB |
Output is correct |
97 |
Correct |
4 ms |
10584 KB |
Output is correct |
98 |
Correct |
4 ms |
10332 KB |
Output is correct |
99 |
Correct |
4 ms |
10588 KB |
Output is correct |
100 |
Correct |
3 ms |
10588 KB |
Output is correct |
101 |
Correct |
4 ms |
10844 KB |
Output is correct |
102 |
Correct |
4 ms |
10588 KB |
Output is correct |
103 |
Correct |
5 ms |
10636 KB |
Output is correct |
104 |
Correct |
4 ms |
10584 KB |
Output is correct |
105 |
Correct |
3 ms |
10588 KB |
Output is correct |
106 |
Correct |
4 ms |
10588 KB |
Output is correct |
107 |
Correct |
4 ms |
10332 KB |
Output is correct |
108 |
Correct |
4 ms |
10332 KB |
Output is correct |
109 |
Correct |
4 ms |
10584 KB |
Output is correct |
110 |
Correct |
3 ms |
10588 KB |
Output is correct |
111 |
Correct |
134 ms |
65224 KB |
Output is correct |
112 |
Correct |
133 ms |
66992 KB |
Output is correct |
113 |
Correct |
129 ms |
65256 KB |
Output is correct |
114 |
Correct |
120 ms |
62148 KB |
Output is correct |
115 |
Correct |
140 ms |
57788 KB |
Output is correct |
116 |
Correct |
113 ms |
36248 KB |
Output is correct |
117 |
Correct |
411 ms |
37292 KB |
Output is correct |
118 |
Correct |
236 ms |
26884 KB |
Output is correct |
119 |
Correct |
179 ms |
25448 KB |
Output is correct |
120 |
Correct |
135 ms |
25368 KB |
Output is correct |
121 |
Correct |
96 ms |
25380 KB |
Output is correct |
122 |
Correct |
402 ms |
36044 KB |
Output is correct |
123 |
Correct |
268 ms |
25284 KB |
Output is correct |
124 |
Correct |
183 ms |
23496 KB |
Output is correct |
125 |
Correct |
130 ms |
23440 KB |
Output is correct |
126 |
Correct |
98 ms |
22992 KB |
Output is correct |
127 |
Correct |
98 ms |
38348 KB |
Output is correct |
128 |
Correct |
101 ms |
39116 KB |
Output is correct |
129 |
Correct |
91 ms |
25368 KB |
Output is correct |
130 |
Correct |
78 ms |
23612 KB |
Output is correct |
131 |
Correct |
76 ms |
23248 KB |
Output is correct |
132 |
Correct |
76 ms |
23248 KB |
Output is correct |
133 |
Correct |
83 ms |
23120 KB |
Output is correct |
134 |
Correct |
80 ms |
23228 KB |
Output is correct |
135 |
Correct |
148 ms |
43440 KB |
Output is correct |
136 |
Correct |
123 ms |
33984 KB |
Output is correct |
137 |
Correct |
150 ms |
52680 KB |
Output is correct |
138 |
Correct |
106 ms |
37576 KB |
Output is correct |
139 |
Correct |
330 ms |
36292 KB |
Output is correct |
140 |
Correct |
234 ms |
28228 KB |
Output is correct |
141 |
Correct |
155 ms |
26572 KB |
Output is correct |
142 |
Correct |
123 ms |
26564 KB |
Output is correct |
143 |
Correct |
90 ms |
26824 KB |
Output is correct |
144 |
Correct |
294 ms |
34000 KB |
Output is correct |
145 |
Correct |
231 ms |
24012 KB |
Output is correct |
146 |
Correct |
177 ms |
24264 KB |
Output is correct |
147 |
Correct |
130 ms |
24268 KB |
Output is correct |
148 |
Correct |
97 ms |
23632 KB |
Output is correct |
149 |
Correct |
100 ms |
38488 KB |
Output is correct |
150 |
Correct |
102 ms |
38624 KB |
Output is correct |
151 |
Correct |
85 ms |
26060 KB |
Output is correct |
152 |
Correct |
80 ms |
24432 KB |
Output is correct |
153 |
Correct |
78 ms |
24024 KB |
Output is correct |
154 |
Correct |
79 ms |
24008 KB |
Output is correct |
155 |
Correct |
78 ms |
24104 KB |
Output is correct |
156 |
Correct |
77 ms |
24144 KB |
Output is correct |
157 |
Correct |
154 ms |
44380 KB |
Output is correct |
158 |
Correct |
107 ms |
34756 KB |
Output is correct |