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 |
---|---|---|---|---|---|---|
1097 | Hello 2019 | FINISHED | False | 10800 | 190912524 | Jan. 4, 2019, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 825 ) | G | Vladislav and a Great Legend | PROGRAMMING | combinatorics dp trees | 2900 |
B"A great legend used to be here, but some troll hacked Codeforces and erased it. Too bad for us, but in the troll society he earned a title of an ultimate-greatest-over troll. At least for them, it's something good. And maybe a formal statement will be even better for us? You are given a tree T with n vertices numbered from 1 to n . For every non-empty subset X of vertices of T , let f(X) be the minimum number of edges in the smallest connected subtree of T which contains every vertex from X . You're also given an integer k . You need to compute the sum of (f(X))^k among all non-empty subsets of vertices, that is: sum limits_{X subseteq {1, 2, : ... :, n }, , X neq varnothing} (f(X))^k. As the result might be very large, output it modulo 10^9 + 7 . The first line contains two integers n and k ( 2 <= q n <= q 10^5 , 1 <= q k <= q 200 ) -- the size of the tree and the exponent in the sum above. Each of the following n - 1 lines contains two integers a_i and b_i ( 1 <= q a_i,b_i <= q n ) -- the indices of the vertices connected by the corresponding edge. It is guaranteed, that the edges form a tree. Print a single integer -- the requested sum modulo 10^9 + 7 . In the first two examples, the values of f are as follows: f( {1 }) = 0 f( {2 }) = 0 f( {1, 2 }) = 1 f( {3 }) = 0 f( {1, 3 }) = 2 f( {2, 3 }) = 1 f( {1, 2, 3 }) = 2 f( {4 }) = 0 f( {1, 4 }) = 2 f( {2, 4 }) = 1 f( {1, 2, 4 }) = 2 f( {3, 4 }) = 2 f( {1, 3, 4 }) = 3 f( {2, 3, 4 }) = 2 f( {1, 2, 3, 4 }) = 3 "... |
64310 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
54402027 | luogu_bot1 | G | May 20, 2019, 1:47 a.m. | OK | GNU C++11 | TESTS | 38 | 311 | 96870400 | 2900 | |
48049110 | newbiegcz | G | Jan. 7, 2019, 7:18 a.m. | OK | GNU C++11 | TESTS | 38 | 327 | 95744000 | 2900 | |
53006771 | liji | G | April 19, 2019, 9:59 a.m. | OK | GNU C++11 | TESTS | 38 | 342 | 90214400 | 2900 | |
69422449 | vjudge2 | G | Jan. 23, 2020, 2:48 p.m. | OK | GNU C++11 | TESTS | 38 | 342 | 95744000 | 2900 | |
49909630 | Mr_Spade | G | Feb. 14, 2019, 1:35 p.m. | OK | GNU C++11 | TESTS | 38 | 358 | 94924800 | 2900 | |
57867484 | lopare | G | July 27, 2019, 10:17 p.m. | OK | GNU C++11 | TESTS | 38 | 374 | 97689600 | 2900 | |
57734309 | py_ultron | G | July 25, 2019, 9:29 a.m. | OK | GNU C++11 | TESTS | 38 | 374 | 97689600 | 2900 | |
59595461 | duality | G | Aug. 28, 2019, 1:11 a.m. | OK | GNU C++11 | TESTS | 38 | 389 | 93696000 | 2900 | |
58174705 | AcFunction | G | Aug. 2, 2019, 12:37 p.m. | OK | GNU C++11 | TESTS | 38 | 389 | 95744000 | 2900 | |
58173026 | AcFunction | G | Aug. 2, 2019, 12:05 p.m. | OK | GNU C++11 | TESTS | 38 | 389 | 95744000 | 2900 | |
48654370 | ReaLNero1 | G | Jan. 21, 2019, 1:30 a.m. | OK | GNU C++14 | TESTS | 38 | 342 | 95027200 | 2900 | |
48062754 | Hayashimo | G | Jan. 7, 2019, 4:18 p.m. | OK | GNU C++14 | TESTS | 38 | 358 | 91238400 | 2900 | |
47957747 | 177013 | G | Jan. 5, 2019, 7:24 a.m. | OK | GNU C++14 | TESTS | 38 | 358 | 95232000 | 2900 | |
53031584 | cloudsky01 | G | April 20, 2019, 1:19 a.m. | OK | GNU C++14 | TESTS | 38 | 358 | 97689600 | 2900 | |
51220745 | bestFy | G | March 12, 2019, 12:22 p.m. | OK | GNU C++14 | TESTS | 38 | 358 | 97689600 | 2900 | |
49186081 | Toxel | G | Jan. 30, 2019, 6:06 a.m. | OK | GNU C++14 | TESTS | 38 | 373 | 96870400 | 2900 | |
51473313 | jerome_wei | G | March 19, 2019, 7:56 a.m. | OK | GNU C++14 | TESTS | 38 | 373 | 168038400 | 2900 | |
50480566 | liouzhou_101 | G | Feb. 25, 2019, 8:45 a.m. | OK | GNU C++14 | TESTS | 38 | 373 | 182272000 | 2900 | |
50479650 | liouzhou_101 | G | Feb. 25, 2019, 8:14 a.m. | OK | GNU C++14 | TESTS | 38 | 373 | 182272000 | 2900 | |
47929543 | ecnerwala | G | Jan. 4, 2019, 3:59 p.m. | OK | GNU C++14 | TESTS | 38 | 374 | 108748800 | 2900 | |
47931763 | Errichto | G | Jan. 4, 2019, 4:11 p.m. | OK | GNU C++17 | TESTS | 38 | 374 | 98304000 | 2900 | |
60674797 | xgcxgc | G | Sept. 16, 2019, 12:03 p.m. | OK | GNU C++17 | TESTS | 38 | 405 | 93286400 | 2900 | |
69883497 | vjudge5 | G | Jan. 31, 2020, 7:17 a.m. | OK | GNU C++17 | TESTS | 38 | 421 | 101068800 | 2900 | |
48060977 | BaconLi | G | Jan. 7, 2019, 3:10 p.m. | OK | GNU C++17 | TESTS | 38 | 421 | 177868800 | 2900 | |
48475804 | zhongyuwei | G | Jan. 17, 2019, 2:24 a.m. | OK | GNU C++17 | TESTS | 38 | 436 | 92467200 | 2900 | |
47936099 | _Happy_New_Year_ | G | Jan. 4, 2019, 4:41 p.m. | OK | GNU C++17 | TESTS | 38 | 436 | 93696000 | 2900 | |
48311969 | kczno1 | G | Jan. 13, 2019, 3:06 a.m. | OK | GNU C++17 | TESTS | 38 | 436 | 174694400 | 2900 | |
47954604 | Elegia | G | Jan. 5, 2019, 5:02 a.m. | OK | GNU C++17 | TESTS | 38 | 452 | 180224000 | 2900 | |
48047204 | Elegia | G | Jan. 7, 2019, 5:01 a.m. | OK | GNU C++17 | TESTS | 38 | 467 | 180224000 | 2900 | |
47949563 | Benq | G | Jan. 4, 2019, 10:30 p.m. | OK | GNU C++17 | TESTS | 38 | 498 | 179097600 | 2900 | |
47930496 | Petr | G | Jan. 4, 2019, 4:04 p.m. | OK | Java 8 | TESTS | 38 | 1653 | 180428800 | 2900 | |
61750918 | vjudge2 | G | Oct. 3, 2019, 3:15 a.m. | OK | MS C++ | TESTS | 38 | 1169 | 90624000 | 2900 | |
61774362 | yst_ | G | Oct. 3, 2019, 11:15 a.m. | OK | MS C++ | TESTS | 38 | 2043 | 362905600 | 2900 |
Back to search problems