Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1491 | Codeforces Global Round 13 | FINISHED | False | 10800 | 122833511 | Feb. 28, 2021, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2196 ) | E | Fib-tree | PROGRAMMING | brute force divide and conquer trees |
B'Let F_k denote the k -th term of Fibonacci sequence, defined as below: You are given a tree with n vertices. Recall that a tree is a connected undirected graph without cycles. We call a tree a Fib-tree, if its number of vertices equals F_k for some k , and at least one of the following conditions holds: Determine whether the given tree is a Fib-tree or not. The first line of the input contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of vertices in the tree. Then n-1 lines follow, each of which contains two integers u and v ( 1 <= q u,v <= q n , u neq v ), representing an edge between vertices u and v . It 's guaranteed that given edges form a tree. Print "YES" if the given tree is a Fib-tree, or "NO" otherwise. You can print your answer in any case. For example, if the answer is "YES", then the output "Yes" or "yeS" will also be considered as correct answer. In the first sample, we can cut the edge (1, 2) , and the tree will be split into 2 trees of sizes 1 and 2 correspondently. Any tree of size 2 is a Fib-tree, as it can be split into 2 trees of size 1 . In the second sample, no matter what edge we cut, the tree will be split into 2 trees of sizes 1 and 4 . As 4 isn 't F_k for any k , it 's not Fib-tree. In the third sample, here is one possible order of cutting the edges so that all the trees in the process are Fib-trees: (1, 3), (1, 2), (4, 5), (3, 4) . '... |
Codeforces Global Round 13 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
108762709 | jzp | E | March 1, 2021, 12:58 a.m. | OK | GNU C++11 | TESTS | 25 | 108 | 6144000 | ||
108763463 | jxm2001 | E | March 1, 2021, 1:34 a.m. | OK | GNU C++11 | TESTS | 25 | 124 | 7065600 | ||
108763751 | froggyzhang | E | March 1, 2021, 1:46 a.m. | OK | GNU C++11 | TESTS | 25 | 155 | 7680000 | ||
108761957 | chrtxdy | E | March 1, 2021, 12:17 a.m. | OK | GNU C++11 | TESTS | 24 | 156 | 14848000 | ||
108762764 | thu2022yz | E | March 1, 2021, 1:01 a.m. | OK | GNU C++11 | TESTS | 25 | 171 | 21299200 | ||
108762243 | Tommyr7 | E | March 1, 2021, 12:32 a.m. | OK | GNU C++11 | TESTS | 24 | 186 | 7577600 | ||
108747821 | Darko1227 | E | Feb. 28, 2021, 5:36 p.m. | OK | GNU C++11 | TESTS | 24 | 187 | 6348800 | ||
108763359 | little_brush | E | March 1, 2021, 1:28 a.m. | OK | GNU C++11 | TESTS | 25 | 187 | 7168000 | ||
108761734 | WDCnew | E | March 1, 2021, 12:02 a.m. | OK | GNU C++11 | TESTS | 24 | 202 | 5324800 | ||
108746130 | 2919805063 | E | Feb. 28, 2021, 5:20 p.m. | OK | GNU C++11 | TESTS | 24 | 202 | 8601600 |
Back to search problems