Forethought Future Cup - Elimination Round

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
1146 Forethought Future Cup - Elimination Round FINISHED False 9000 176039699 April 20, 2019, 6:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1188 ) F Leaf Partition PROGRAMMING dp trees 2400

B'You are given a rooted tree with n nodes, labeled from 1 to n . The tree is rooted at node 1 . The parent of the i -th node is p_i . A leaf is node with no children. For a given set of leaves L , let f(L) denote the smallest connected subgraph that contains all leaves L . You would like to partition the leaves such that for any two different sets x, y of the partition, f(x) and f(y) are disjoint. Count the number of ways to partition the leaves, modulo 998244353 . Two ways are different if there are two leaves such that they are in the same set in one way but in different sets in the other. The first line contains an integer n ( 2 <= q n <= q 200 ,000 ) -- the number of nodes in the tree. The next line contains n-1 integers p_2, p_3, ldots, p_n ( 1 <= q p_i < i ). Print a single integer, the number of ways to partition the leaves, modulo 998244353 . In the first example, the leaf nodes are 2,3,4,5 . The ways to partition the leaves are in the following image In the second example, the only leaf is node 10 so there is only one partition. Note that node 1 is not a leaf. '...

Tutorials

66639

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
53066228 hos.lyric F April 20, 2019, 6:52 p.m. OK D TESTS 35 187 36659200 2400
60525972 _twilight F Sept. 14, 2019, 10:24 a.m. OK GNU C++11 TESTS 35 61 3379200 2400
53835780 luogu_bot4 F May 7, 2019, 2:39 a.m. OK GNU C++11 TESTS 35 61 4608000 2400
53835642 x_faraway_x F May 7, 2019, 2:30 a.m. OK GNU C++11 TESTS 35 61 4608000 2400
53121149 Rubbish12345 F April 22, 2019, 11:24 a.m. OK GNU C++11 TESTS 35 61 6246400 2400
54064470 vjudge3 F May 13, 2019, 12:46 p.m. OK GNU C++11 TESTS 35 61 8806400 2400
54085740 __23333 F May 14, 2019, 7:14 a.m. OK GNU C++11 TESTS 35 61 13721600 2400
57770931 ILoLy F July 26, 2019, 12:43 a.m. OK GNU C++11 TESTS 35 61 24166400 2400
55610360 ReaLNero1 F June 16, 2019, 5:17 a.m. OK GNU C++11 TESTS 35 62 6246400 2400
53115515 SylvanasS F April 22, 2019, 7:40 a.m. OK GNU C++11 TESTS 35 62 6246400 2400
55127220 stal_xy23z7b8 F June 5, 2019, 1:25 p.m. OK GNU C++11 TESTS 35 62 6451200 2400
53070626 natsugiri F April 20, 2019, 7:36 p.m. OK GNU C++14 TESTS 35 78 7168000 2400
53947663 mobu233 F May 10, 2019, 7:43 a.m. OK GNU C++14 TESTS 35 93 3379200 2400
57893702 wh_ZH F July 28, 2019, 12:45 p.m. OK GNU C++14 TESTS 35 93 4812800 2400
53068160 Um_nik F April 20, 2019, 7:09 p.m. OK GNU C++14 TESTS 35 93 5836800 2400
58212560 _Ash__ F Aug. 3, 2019, 9:21 a.m. OK GNU C++14 TESTS 35 93 7168000 2400
53123013 krijgertje F April 22, 2019, 12:24 p.m. OK GNU C++14 TESTS 35 93 7168000 2400
53102933 Gromah F April 21, 2019, 5:39 p.m. OK GNU C++14 TESTS 35 93 7168000 2400
53093991 denis2111 F April 21, 2019, 12:35 p.m. OK GNU C++14 TESTS 35 93 7168000 2400
53283489 MrDecomposition F April 25, 2019, 12:58 p.m. OK GNU C++14 TESTS 35 93 7987200 2400
53070632 Marcin_smu F April 20, 2019, 7:36 p.m. OK GNU C++14 TESTS 35 93 8601600 2400
53606630 CMXRYNP F May 1, 2019, 10:43 a.m. OK GNU C++17 TESTS 35 46 7372800 2400
53096706 bmerry F April 21, 2019, 1:56 p.m. OK GNU C++17 TESTS 35 78 7168000 2400
53077217 LucaSeri F April 20, 2019, 10:38 p.m. OK GNU C++17 TESTS 35 78 7168000 2400
53106569 ivan100sic F April 21, 2019, 8:31 p.m. OK GNU C++17 TESTS 35 78 7884800 2400
53561925 hyfzbtrs F April 30, 2019, 10:05 a.m. OK GNU C++17 TESTS 35 93 6451200 2400
53121634 czasem_tak_trzeba F April 22, 2019, 11:38 a.m. OK GNU C++17 TESTS 35 93 7168000 2400
53106967 sping128 F April 21, 2019, 8:54 p.m. OK GNU C++17 TESTS 35 93 7168000 2400
53072894 black_horse2014 F April 20, 2019, 8:08 p.m. OK GNU C++17 TESTS 35 93 8294400 2400
60741053 flashmt F Sept. 17, 2019, 8:07 p.m. OK GNU C++17 TESTS 35 93 8806400 2400
55734326 vjudge3 F June 19, 2019, 2:16 a.m. OK GNU C++17 TESTS 35 93 9523200 2400
53074462 ilyakor F April 20, 2019, 8:28 p.m. OK Java 8 TESTS 35 218 17408000 2400
54902146 happybelly F June 1, 2019, 7:10 a.m. OK Java 8 TESTS 35 248 18329600 2400
54901749 happybelly F June 1, 2019, 6:58 a.m. OK Java 8 TESTS 35 248 18329600 2400
54901591 happybelly F June 1, 2019, 6:53 a.m. OK Java 8 TESTS 35 249 18432000 2400
53071978 eatmore F April 20, 2019, 7:54 p.m. OK Java 8 TESTS 35 264 12902400 2400
53119914 StayAwayFromBitches F April 22, 2019, 10:42 a.m. OK Java 8 TESTS 35 264 18841600 2400
53257081 7dan F April 24, 2019, 5:19 p.m. OK Java 8 TESTS 35 264 27852800 2400
53690856 dalt F May 3, 2019, 4:48 a.m. OK Java 8 TESTS 35 265 18329600 2400
60656188 beginner1010 F Sept. 15, 2019, 11:51 p.m. OK Java 8 TESTS 35 280 18432000 2400
53070638 niyaznigmatul F April 20, 2019, 7:36 p.m. OK Java 8 TESTS 35 280 18534400 2400
53071548 Sergey.Bankevich F April 20, 2019, 7:49 p.m. OK Kotlin TESTS 35 405 20480000 2400
53430413 fatant F April 27, 2019, 3:57 p.m. OK MS C++ 2017 TESTS 35 140 9420800 2400
53374388 AlexandrBusse F April 26, 2019, 7:07 p.m. OK MS C++ 2017 TESTS 35 202 15564800 2400
53375736 AlexandrBusse F April 26, 2019, 7:35 p.m. OK MS C++ 2017 TESTS 35 265 9932800 2400
53098344 nwi F April 21, 2019, 2:52 p.m. OK Python 2 TESTS 35 701 28774400 2400
53297892 Helli.code F April 25, 2019, 6:28 p.m. OK Python 2 TESTS 35 717 28774400 2400
63127407 sansen F Oct. 22, 2019, 1:13 p.m. OK Rust TESTS 35 78 9932800 2400

remove filters

Back to search problems