Codeforces Round 263 (Div. 1)

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
461 Codeforces Round 263 (Div. 1) FINISHED False 7200 328550404 Aug. 26, 2014, 2 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5900 ) B Appleman and Tree PROGRAMMING dfs and similar dp trees 2200

B"Appleman has a tree with n vertices. Some of the vertices (at least one) are colored black and other vertices are colored white. Consider a set consisting of k (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89< xe2 x80 x89n) edges of Appleman's tree. If Appleman deletes these edges from the tree, then it will split into (k xe2 x80 x89+ xe2 x80 x891) parts. Note, that each part will be a tree with colored vertices. Now Appleman wonders, what is the number of sets splitting the tree in such a way that each resulting part will have exactly one black vertex? Find this number modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains an integer n (2 xe2 x80 x89 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of tree vertices. The second line contains the description of the tree: n xe2 x80 x89- xe2 x80 x891 integers p0, xe2 x80 x89p1, xe2 x80 x89..., xe2 x80 x89pn xe2 x80 x89- xe2 x80 x892 (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i). Where pi means that there is an edge connecting vertex (i xe2 x80 x89+ xe2 x80 x891) of the tree and vertex pi. Consider tree vertices are numbered from 0 to n xe2 x80 x89- xe2 x80 x891. The third line contains the description of the colors of the vertices: n integers x0, xe2 x80 x89x1, xe2 x80 x89..., xe2 x80 x89xn xe2 x80 x89- xe2 x80 x891 (xi is either 0 or 1). If xi is equal to 1, vertex i is colored black. Otherwise, vertex i is colored white. Output a single integer -- the number of ways to split the tree modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897)."...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
7592407 hos.lyric B Aug. 26, 2014, 3:20 p.m. OK D TESTS 23 61 14745600 2200
7587607 Gassa B Aug. 26, 2014, 2:39 p.m. OK D TESTS 23 109 8192000 2200
60389247 llbra9z B Sept. 11, 2019, 12:42 p.m. OK Delphi TESTS 23 46 3174400 2200
7592883 Frommi B Aug. 26, 2014, 3:24 p.m. OK Delphi TESTS 23 93 24883200 2200
7620874 sjj118 B Aug. 29, 2014, 11:38 a.m. OK FPC TESTS 23 31 3788800 2200
64869681 dblark B Nov. 14, 2019, 7:41 a.m. OK FPC TESTS 23 31 3891200 2200
7688024 vuonghy2442 B Sept. 5, 2014, 12:50 p.m. OK FPC TESTS 23 31 6144000 2200
7599743 WARenie B Aug. 26, 2014, 8:49 p.m. OK FPC TESTS 23 31 6451200 2200
8166873 giangpro93 B Oct. 10, 2014, 3:11 p.m. OK FPC TESTS 23 31 7168000 2200
11236527 chenjb B May 23, 2015, 10:05 a.m. OK FPC TESTS 23 31 7270400 2200
11196799 vjudge1 B May 22, 2015, 2:41 a.m. OK FPC TESTS 23 31 7270400 2200
7604774 igdor99 B Aug. 27, 2014, 11:41 a.m. OK FPC TESTS 23 31 7372800 2200
7599348 Fedosik B Aug. 26, 2014, 7:56 p.m. OK FPC TESTS 23 31 33996800 2200
9006168 greatsaiyanman B Dec. 7, 2014, 3:35 a.m. OK FPC TESTS 23 46 5836800 2200
18917484 TsReaper B July 6, 2016, 11:25 a.m. OK GNU C TESTS 23 46 11980800 2200
7590845 nvshen B Aug. 26, 2014, 3:05 p.m. OK GNU C TESTS 23 77 10137600 2200
13998904 hehe0625 B Nov. 1, 2015, 3:10 a.m. OK GNU C++ TESTS 23 15 2457600 2200
20401540 vjudge1 B Sept. 5, 2016, 2:07 p.m. OK GNU C++ TESTS 23 15 2662400 2200
31627599 linkfqy B Oct. 23, 2017, noon OK GNU C++ TESTS 23 15 12492800 2200
7587034 zyh B Aug. 26, 2014, 2:36 p.m. OK GNU C++ TESTS 23 15 12595200 2200
34663530 Sooke B Jan. 29, 2018, 1:52 p.m. OK GNU C++ TESTS 23 15 13516800 2200
25668760 lzx123 B March 20, 2017, 2:37 p.m. OK GNU C++ TESTS 23 15 14950400 2200
25873910 cbhcbh B March 28, 2017, 12:55 p.m. OK GNU C++ TESTS 23 15 15257600 2200
7600845 HIT_Attacker B Aug. 27, 2014, 1:39 a.m. OK GNU C++ TESTS 23 15 15769600 2200
33998693 cdh233 B Jan. 8, 2018, 7:32 a.m. OK GNU C++ TESTS 23 15 26112000 2200
7584143 Shapo B Aug. 26, 2014, 2:19 p.m. OK GNU C++ TESTS 23 30 1638400 2200
7589918 YYOne B Aug. 26, 2014, 2:57 p.m. OK GNU C++0x TESTS 23 30 13926400 2200
7596739 k0st1a B Aug. 26, 2014, 4:39 p.m. OK GNU C++0x TESTS 23 31 5427200 2200
7592742 DarthKnight B Aug. 26, 2014, 3:23 p.m. OK GNU C++0x TESTS 23 31 6860800 2200
7612452 MinakoKojima B Aug. 28, 2014, 9:32 a.m. OK GNU C++0x TESTS 23 31 8704000 2200
7613929 xtrome B Aug. 28, 2014, 12:54 p.m. OK GNU C++0x TESTS 23 31 9625600 2200
7606244 Kaban-5 B Aug. 27, 2014, 2:39 p.m. OK GNU C++0x TESTS 23 31 10342400 2200
7598922 GaryYe B Aug. 26, 2014, 6:54 p.m. OK GNU C++0x TESTS 23 31 10342400 2200
7596930 Dwylkz B Aug. 26, 2014, 4:44 p.m. OK GNU C++0x TESTS 23 31 10752000 2200
7594146 MinakoKojima B Aug. 26, 2014, 3:39 p.m. OK GNU C++0x TESTS 23 31 10956800 2200
7591683 sokian B Aug. 26, 2014, 3:12 p.m. OK GNU C++0x TESTS 23 31 13209600 2200
59863472 rainboy B Sept. 1, 2019, 4:12 p.m. OK GNU C11 TESTS 23 46 9728000 2200
24822959 qzqzzsh B Feb. 20, 2017, 1:23 p.m. OK GNU C++11 TESTS 23 15 4096000 2200
20767786 thwfhk B Sept. 20, 2016, 3:35 a.m. OK GNU C++11 TESTS 23 15 9216000 2200
18818721 qzqzgfy B June 30, 2016, 7:26 a.m. OK GNU C++11 TESTS 23 15 15769600 2200
13872067 fengsuiyan B Oct. 26, 2015, 12:40 p.m. OK GNU C++11 TESTS 23 31 1228800 2200
25465899 Sirivasv B March 14, 2017, 4:52 a.m. OK GNU C++11 TESTS 23 31 3891200 2200
17152251 freebsdx B April 4, 2016, 2:03 a.m. OK GNU C++11 TESTS 23 31 4403200 2200
44070955 Cyrill B Oct. 10, 2018, 11:35 a.m. OK GNU C++11 TESTS 23 31 4710400 2200
10930291 krijgertje B April 29, 2015, 2:56 p.m. OK GNU C++11 TESTS 23 31 4915200 2200
48676686 KING_LRL B Jan. 21, 2019, 11:47 a.m. OK GNU C++11 TESTS 23 31 6041600 2200
21813285 HeZiying B Oct. 27, 2016, 6:34 a.m. OK GNU C++11 TESTS 23 31 7372800 2200
66729177 wleung_bvg B Dec. 12, 2019, 4:57 p.m. OK GNU C++14 TESTS 23 31 12390400 2200
64664668 vjudge4 B Nov. 11, 2019, 12:44 a.m. OK GNU C++14 TESTS 23 31 25804800 2200
24729606 Bassel B Feb. 17, 2017, 1:48 a.m. OK GNU C++14 TESTS 23 46 6144000 2200
28323321 pa4o B July 6, 2017, 10:11 a.m. OK GNU C++14 TESTS 23 46 6963200 2200
21631180 Xin-Jie B Oct. 21, 2016, 1:42 a.m. OK GNU C++14 TESTS 23 46 7577600 2200
22835495 Indecchi B Dec. 9, 2016, 2:07 p.m. OK GNU C++14 TESTS 23 46 9113600 2200
66667045 wleung_bvg B Dec. 12, 2019, 7:37 a.m. OK GNU C++14 TESTS 23 46 9728000 2200
61116540 shivsharmastr B Sept. 23, 2019, 1:02 p.m. OK GNU C++14 TESTS 23 46 9932800 2200
64664391 XZJ B Nov. 11, 2019, 12:23 a.m. OK GNU C++14 TESTS 23 46 10035200 2200
47107732 WhitePaper B Dec. 16, 2018, 1:49 p.m. OK GNU C++14 TESTS 23 46 11673600 2200
53803575 majk B May 5, 2019, 9:13 p.m. OK GNU C++17 TESTS 23 46 4505600 2200
47831430 IIeJlMeHb B Jan. 2, 2019, 7:03 a.m. OK GNU C++17 TESTS 23 46 8806400 2200
57100902 fanqeixi B July 15, 2019, 1:44 p.m. OK GNU C++17 TESTS 23 46 9216000 2200
45226113 Fulisike B Nov. 3, 2018, 3:25 a.m. OK GNU C++17 TESTS 23 46 9216000 2200
58847214 aviroop123 B Aug. 15, 2019, 5:57 a.m. OK GNU C++17 TESTS 23 46 10035200 2200
44612264 vaibh1297 B Oct. 20, 2018, 8:47 p.m. OK GNU C++17 TESTS 23 46 10854400 2200
57541673 Phortox B July 22, 2019, 4:07 p.m. OK GNU C++17 TESTS 23 46 11161600 2200
53195831 OO_I_LOVE_YZQ__OO B April 23, 2019, 3:14 p.m. OK GNU C++17 TESTS 23 46 11161600 2200
67161540 Gareton B Dec. 18, 2019, 2:08 p.m. OK GNU C++17 TESTS 23 46 12185600 2200
60069363 kanishk779 B Sept. 5, 2019, 10:34 a.m. OK GNU C++17 TESTS 23 46 12492800 2200
26810600 brandonzhang B May 2, 2017, 11:51 p.m. OK Go TESTS 23 1793 65126400 2200
43500141 brianbok B Sept. 27, 2018, 4:43 p.m. OK Haskell TESTS 23 1075 68505600 2200
43499304 brianbok B Sept. 27, 2018, 4:21 p.m. OK Haskell TESTS 23 1138 67481600 2200
43499139 brianbok B Sept. 27, 2018, 4:16 p.m. OK Haskell TESTS 23 1231 65331200 2200
69587315 ZeyadKhattab B Jan. 26, 2020, 8:13 p.m. OK Java 11 TESTS 23 249 39833600 2200
7586929 Lewin B Aug. 26, 2014, 2:35 p.m. OK Java 6 TESTS 23 108 204800 2200
7611069 meijun B Aug. 28, 2014, 6:28 a.m. OK Java 6 TESTS 23 186 23859200 2200
7610938 meijun B Aug. 28, 2014, 5:59 a.m. OK Java 6 TESTS 23 187 14950400 2200
7610929 meijun B Aug. 28, 2014, 5:57 a.m. OK Java 6 TESTS 23 233 14950400 2200
7597733 tanzaku B Aug. 26, 2014, 5:20 p.m. OK Java 7 TESTS 23 78 0 2200
7584818 dnk B Aug. 26, 2014, 2:23 p.m. OK Java 7 TESTS 23 108 0 2200
7600993 ftiasch B Aug. 27, 2014, 2:06 a.m. OK Java 7 TESTS 23 124 0 2200
7592108 uwi B Aug. 26, 2014, 3:16 p.m. OK Java 7 TESTS 23 139 0 2200
7594227 hiukim B Aug. 26, 2014, 3:40 p.m. OK Java 7 TESTS 23 140 29696000 2200
9953482 PrakharJain B Feb. 21, 2015, 10:59 p.m. OK Java 7 TESTS 23 156 19968000 2200
7600000 edorundo B Aug. 26, 2014, 9:39 p.m. OK Java 7 TESTS 23 171 9420800 2200
8040111 mashinist B Sept. 30, 2014, 7:14 p.m. OK Java 7 TESTS 23 171 22732800 2200
7596713 phantom11 B Aug. 26, 2014, 4:38 p.m. OK Java 7 TESTS 23 171 24883200 2200
7585492 pashka B Aug. 26, 2014, 2:27 p.m. OK Java 7 TESTS 23 186 0 2200
60371314 7dan B Sept. 11, 2019, 2:13 a.m. OK Java 8 TESTS 23 140 0 2200
20402655 gyshgx868 B Sept. 5, 2016, 3:08 p.m. OK Java 8 TESTS 23 171 14336000 2200
31952529 guptautkarsh028 B Nov. 1, 2017, 2:01 p.m. OK Java 8 TESTS 23 171 20275200 2200
56597300 Ahmad_Elsagheer B July 5, 2019, 8:19 p.m. OK Java 8 TESTS 23 171 21913600 2200
40198605 Jeel_Vaishnav B July 11, 2018, 10:58 a.m. OK Java 8 TESTS 23 186 17408000 2200
38132665 Golmol B May 12, 2018, 8:29 a.m. OK Java 8 TESTS 23 186 39116800 2200
20402741 vjudge1 B Sept. 5, 2016, 3:13 p.m. OK Java 8 TESTS 23 187 14336000 2200
20671270 motivation_error B Sept. 17, 2016, 1:57 a.m. OK Java 8 TESTS 23 187 19046400 2200
48371625 Ahmad B Jan. 14, 2019, 4:49 a.m. OK Java 8 TESTS 23 202 5632000 2200
52615382 Hoda_Hisham B April 11, 2019, 6:09 p.m. OK Java 8 TESTS 23 202 22220800 2200
7616066 BogdanFlorea B Aug. 28, 2014, 6:48 p.m. OK Mono C# TESTS 23 140 35840000 2200
15986046 og.kostya B Feb. 13, 2016, 11:03 a.m. OK MS C# TESTS 23 62 11980800 2200
15985914 og.kostya B Feb. 13, 2016, 10:55 a.m. OK MS C# TESTS 23 77 11878400 2200
7596777 azukun B Aug. 26, 2014, 4:40 p.m. OK MS C# TESTS 23 124 28774400 2200
17069086 camypaper B March 31, 2016, 7:59 a.m. OK MS C# TESTS 23 155 51814400 2200
7592819 iamexist B Aug. 26, 2014, 3:24 p.m. OK MS C++ TESTS 23 31 3174400 2200
11873473 miagkov B June 30, 2015, 11:56 p.m. OK MS C++ TESTS 23 46 5017600 2200
48866396 vjudge1 B Jan. 24, 2019, 3:28 a.m. OK MS C++ TESTS 23 46 5427200 2200
7586202 White_Bear B Aug. 26, 2014, 2:31 p.m. OK MS C++ TESTS 23 46 6451200 2200
7809293 LVA007 B Sept. 16, 2014, 12:53 p.m. OK MS C++ TESTS 23 46 6860800 2200
7739501 bible B Sept. 11, 2014, 7:08 a.m. OK MS C++ TESTS 23 46 6860800 2200
26455402 vjudge3 B April 17, 2017, 1:05 p.m. OK MS C++ TESTS 23 46 7168000 2200
11009586 xiaoyu20123 B May 6, 2015, 12:41 a.m. OK MS C++ TESTS 23 46 7270400 2200
58700855 vjudge5 B Aug. 13, 2019, 7:46 a.m. OK MS C++ TESTS 23 46 7270400 2200
44251340 vjudge1 B Oct. 13, 2018, 10:39 a.m. OK MS C++ TESTS 23 46 7475200 2200
64320208 vjudge2 B Nov. 5, 2019, 3:24 p.m. OK MS C++ 2017 TESTS 23 77 6860800 2200
56261126 nhanloc B June 29, 2019, 8:07 a.m. OK MS C++ 2017 TESTS 23 156 11571200 2200
64486203 vjudge1 B Nov. 7, 2019, 5:53 p.m. OK MS C++ 2017 TESTS 23 187 10956800 2200
7684665 godmar B Sept. 4, 2014, 8:59 p.m. OK Python 2 TESTS 23 1185 13004800 2200
7589394 jasperH B Aug. 26, 2014, 2:53 p.m. OK Python 3 TESTS 23 343 14643200 2200
42126022 Mk_Python_v1 B Aug. 26, 2018, 3:14 p.m. OK Python 3 TESTS 23 951 26419200 2200

remove filters

Back to search problems