Hello, Can u guys help me with the following two problems.
https://www.hackerrank.com/challenges/even-tree
http://www.codechef.com/problems/ADIGIT
Thanks in advance.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Hello, Can u guys help me with the following two problems.
https://www.hackerrank.com/challenges/even-tree
http://www.codechef.com/problems/ADIGIT
Thanks in advance.
Name |
---|
Two blog posts :D
Even tree: notice that you can't remove any edges connecting the leaves to the rest of the tree, so merge the leaves into their parents (for each parent, say that if it "contained x vertices", then it'll "contains x + 1 vertices" from now on, starting with x = 1) and you get another tree, in which you can again decide for each "leaf" whether the edge from it should be removed or not based on parity of x.
ADIGIT: think how the solution will look for K=1,2,3.
Hey, Can you elaborate more on how to code it!!
Codechef problems have editorials and I think Hackerrank has, too. Try reading the editorial, or actually thinking about what I said and trying to make your own solution based on it.