Codeforces Round 275 (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
482 Codeforces Round 275 (Div. 1) FINISHED False 7800 323355623 Oct. 24, 2014, 5 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 543 ) D Random Function and Tree PROGRAMMING combinatorics dp trees 2600

B"You have a rooted tree consisting of n vertices. Let's number them with integers from 1 to n inclusive. The root of the tree is the vertex 1. For each i xe2 x80 x89> xe2 x80 x891 direct parent of the vertex i is pi. We say that vertex i is child for its direct parent pi. You have initially painted all the vertices with red color. You like to repaint some vertices of the tree. To perform painting you use the function paint that you call with the root of the tree as an argument. Here is the pseudocode of this function: As a result of this function, some vertices may change their colors to white or black and some of them may remain red. Your task is to determine the number of distinct possible colorings of the vertices of the tree. We will assume that the coloring is possible if there is a nonzero probability to get this coloring with a single call of paint(1). We assume that the colorings are different if there is a pair of vertices that are painted with different colors in these colorings. Since the required number may be very large, find its remainder of division by 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains a single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of vertexes in the tree. The second line contains n xe2 x80 x89- xe2 x80 x891 integers p2, xe2 x80 x89p3, xe2 x80 x89..., xe2 x80 x89pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89< xe2 x80 x89i). Number pi is the parent of vertex i. Print a single integer -- the answer to the problem modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897) All possible coloring patterns of the first sample are given below."...

Tutorials

Codeforces Round #275 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
13921006 130705009 D Oct. 28, 2015, 6:26 p.m. OK GNU C++ TESTS 90 31 10240000 2600
11961269 syc1999 D July 7, 2015, 2:40 p.m. OK GNU C++ TESTS 90 31 11980800 2600
27964839 dogET D June 22, 2017, 12:22 p.m. OK GNU C++ TESTS 90 31 16896000 2600
8534682 shenkedaa D Nov. 3, 2014, 11:41 a.m. OK GNU C++ TESTS 90 31 17408000 2600
8420310 function348 D Oct. 26, 2014, 12:50 p.m. OK GNU C++ TESTS 90 46 3174400 2600
10348801 wwt15 D March 19, 2015, 12:46 p.m. OK GNU C++ TESTS 90 46 3993600 2600
11627557 gerw D June 18, 2015, 3:57 a.m. OK GNU C++ TESTS 90 46 4403200 2600
10639041 Mambacrose D April 9, 2015, 11:10 a.m. OK GNU C++ TESTS 90 46 4403200 2600
8397801 kmjp D Oct. 25, 2014, 4:22 a.m. OK GNU C++ TESTS 90 46 4608000 2600
11591709 RNS D June 15, 2015, 8:10 a.m. OK GNU C++ TESTS 90 46 6041600 2600
9533665 eolv D Jan. 24, 2015, 3:56 a.m. OK GNU C++0x TESTS 90 46 2764800 2600
8397435 johnchen902 D Oct. 25, 2014, 3:13 a.m. OK GNU C++0x TESTS 90 46 5222400 2600
8757842 sysulby D Nov. 19, 2014, 5:41 p.m. OK GNU C++0x TESTS 90 46 13414400 2600
8675086 mruxim D Nov. 12, 2014, 6:37 p.m. OK GNU C++0x TESTS 90 46 16588800 2600
9364523 I_love_Hoang_Yen D Jan. 5, 2015, 8:51 a.m. OK GNU C++0x TESTS 90 46 17408000 2600
8755626 Swistakk D Nov. 19, 2014, 1:42 p.m. OK GNU C++0x TESTS 90 46 18124800 2600
8446514 zlzmsrhak D Oct. 28, 2014, 6:16 a.m. OK GNU C++0x TESTS 90 61 17305600 2600
8388934 DPR-pavlin D Oct. 24, 2014, 6:21 p.m. OK GNU C++0x TESTS 90 62 4198400 2600
8389261 Rivx D Oct. 24, 2014, 6:25 p.m. OK GNU C++0x TESTS 90 62 5427200 2600
8390299 ifsmirnov D Oct. 24, 2014, 6:37 p.m. OK GNU C++0x TESTS 90 62 14131200 2600
20793147 wwyyxx D Sept. 21, 2016, 11:28 a.m. OK GNU C++11 TESTS 90 31 7065600 2600
24910520 King_George D Feb. 23, 2017, 7:31 a.m. OK GNU C++11 TESTS 90 46 6963200 2600
20187209 vjudge5 D Aug. 27, 2016, 4:04 a.m. OK GNU C++11 TESTS 90 46 8908800 2600
17159028 freebsdx D April 4, 2016, 2:18 p.m. OK GNU C++11 TESTS 90 46 12492800 2600
55708334 ysy20021208 D June 18, 2019, 8:53 a.m. OK GNU C++11 TESTS 90 46 13004800 2600
57873465 tyler178 D July 28, 2019, 3:35 a.m. OK GNU C++11 TESTS 90 46 15667200 2600
18374097 065583 D June 11, 2016, 12:06 p.m. OK GNU C++11 TESTS 90 46 19251200 2600
54511342 xielinhan D May 23, 2019, 7:18 a.m. OK GNU C++11 TESTS 90 61 3584000 2600
66104054 mlby D Dec. 1, 2019, 8:42 a.m. OK GNU C++11 TESTS 90 62 4403200 2600
20259310 hahaschool D Aug. 29, 2016, 4:58 p.m. OK GNU C++11 TESTS 90 62 4812800 2600
34047712 giorgi D Jan. 9, 2018, 12:03 p.m. OK GNU C++14 TESTS 90 46 6041600 2600
23724036 natsugiri D Jan. 11, 2017, 6:34 p.m. OK GNU C++14 TESTS 90 61 6144000 2600
49198556 LODB---D D Jan. 30, 2019, 11:33 a.m. OK GNU C++14 TESTS 90 61 11468800 2600
49207329 LODB---D D Jan. 30, 2019, 2:19 p.m. OK GNU C++14 TESTS 90 61 11776000 2600
33103003 NormalCoder D Dec. 11, 2017, 1:32 p.m. OK GNU C++14 TESTS 90 61 14848000 2600
49841256 vjudge4 D Feb. 12, 2019, 6:33 p.m. OK GNU C++14 TESTS 90 61 17408000 2600
38703182 erfan._.m D May 28, 2018, 7:30 p.m. OK GNU C++14 TESTS 90 61 17408000 2600
34743540 omidazadi D Jan. 31, 2018, 1:17 p.m. OK GNU C++14 TESTS 90 61 22425600 2600
32996229 Flash-boy D Dec. 7, 2017, 9 a.m. OK GNU C++14 TESTS 90 62 5632000 2600
56737318 Scut82 D July 9, 2019, 6:02 a.m. OK GNU C++14 TESTS 90 62 7475200 2600
57864714 AliShahali1382 D July 27, 2019, 8:08 p.m. OK GNU C++17 TESTS 90 61 16179200 2600
65439134 hjk1030 D Nov. 20, 2019, 1:48 p.m. OK GNU C++17 TESTS 90 62 3788800 2600
61081767 ruo D Sept. 22, 2019, 4:39 p.m. OK GNU C++17 TESTS 90 62 3788800 2600
49495459 vjudge4 D Feb. 5, 2019, 12:36 p.m. OK GNU C++17 TESTS 90 62 11468800 2600
47505499 kefaa2 D Dec. 25, 2018, 10:39 p.m. OK GNU C++17 TESTS 90 62 11776000 2600
53849438 Atreus D May 7, 2019, 12:44 p.m. OK GNU C++17 TESTS 90 62 13414400 2600
49281883 Balerion D Jan. 31, 2019, 4:40 p.m. OK GNU C++17 TESTS 90 62 15462400 2600
49281587 vjudge4 D Jan. 31, 2019, 4:25 p.m. OK GNU C++17 TESTS 90 62 15462400 2600
49283347 vjudge1 D Jan. 31, 2019, 5:08 p.m. OK GNU C++17 TESTS 90 62 16588800 2600
60502095 RUSH_D_CAT D Sept. 13, 2019, 7:14 p.m. OK GNU C++17 TESTS 90 62 17715200 2600
8390174 uwi D Oct. 24, 2014, 6:36 p.m. OK Java 7 TESTS 90 140 204800 2600
12088890 IgorKoval D July 16, 2015, 10:04 p.m. OK Java 8 TESTS 90 171 26521600 2600
12088883 IgorKoval D July 16, 2015, 10:02 p.m. OK Java 8 TESTS 90 171 26521600 2600
12088911 IgorKoval D July 16, 2015, 10:07 p.m. OK Java 8 TESTS 90 186 28057600 2600
12088915 IgorKoval D July 16, 2015, 10:08 p.m. OK Java 8 TESTS 90 187 28057600 2600
12088903 IgorKoval D July 16, 2015, 10:06 p.m. OK Java 8 TESTS 90 187 28057600 2600
12088922 IgorKoval D July 16, 2015, 10:10 p.m. OK Java 8 TESTS 90 202 28057600 2600
12088908 IgorKoval D July 16, 2015, 10:07 p.m. OK Java 8 TESTS 90 217 40652800 2600
8387269 Petr D Oct. 24, 2014, 6:02 p.m. OK Java 8 TESTS 90 249 614400 2600
8390640 niyaznigmatul D Oct. 24, 2014, 6:41 p.m. OK Java 8 TESTS 90 467 3993600 2600
8391352 mmaxio D Oct. 24, 2014, 6:50 p.m. OK Java 8 TESTS 90 530 13209600 2600
8497822 AleksanderBalobanov D Oct. 31, 2014, 1:18 p.m. OK MS C++ TESTS 90 62 27648000 2600
8497485 lych123 D Oct. 31, 2014, 12:49 p.m. OK MS C++ TESTS 90 78 7987200 2600
8476174 Xiaodongdong D Oct. 30, 2014, 6:02 a.m. OK MS C++ TESTS 90 78 20070400 2600
8470401 Toshik D Oct. 29, 2014, 2:48 p.m. OK MS C++ TESTS 90 124 17612800 2600
15081042 forhayley D Dec. 29, 2015, 7:46 a.m. OK PyPy 2 TESTS 90 296 19558400 2600
15081038 forhayley D Dec. 29, 2015, 7:45 a.m. OK Python 2 TESTS 90 530 18944000 2600
8398546 nwi D Oct. 25, 2014, 6:16 a.m. OK Python 2 TESTS 90 530 18944000 2600
8519467 WuDiWu D Nov. 2, 2014, 3:20 a.m. OK Python 2 TESTS 90 717 18636800 2600

remove filters

Back to search problems