Codeforces Round 152 (Div. 2)

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
248 Codeforces Round 152 (Div. 2) FINISHED False 8100 422548223 Nov. 25, 2012, 3:30 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 639 ) E Piglet's Birthday PROGRAMMING dp math probabilities 2700

Piglet has got a birthday today. His friend Winnie the Pooh wants to make the best present for him — a honey pot. Of course Winnie realizes that he won't manage to get the full pot to Piglet. In fact, he is likely to eat all the honey from the pot. And as soon as Winnie planned a snack on is way, the pot should initially have as much honey as possible. The day before Winnie the Pooh replenished his honey stocks. Winnie-the-Pooh has n shelves at home, each shelf contains some, perhaps zero number of honey pots. During the day Winnie came to the honey shelves q times; on the i -th time he came to some shelf u i , took from it some pots k i , tasted the honey from each pot and put all those pots on some shelf v i . As Winnie chose the pots, he followed his intuition. And that means that among all sets of k i pots on shelf u i , he equiprobably chooses one. Now Winnie remembers all actions he performed with the honey pots. He wants to take to the party the pot he didn't try the day before. For that he must know the mathematical expectation of the number m of shelves that don't have a single untasted pot . To evaluate his chances better, Winnie-the-Pooh wants to know the value m after each action he performs. Your task is to write a program that will find those values for him. The first line of the input contains a single number n ( 1 ≤ n ≤ 10 5 ) — the number of shelves at Winnie's place. The second line contains n integers a i ( 1 ≤ i ≤ n , 0 ≤ a i ≤ 100 ) — the number of honey pots on a shelf number i . The next line contains integer q ( 1 ≤ q ≤ 10 5 ) — the number of actions Winnie did the day before. Then follow q lines, the i -th of them describes an event that follows chronologically; the line contains three integers u i , v i and k i ( 1 ≤ u i , v i ≤ n , 1 ≤ k i ≤ 5 ) — the number of the shelf from which Winnie took pots, the number of the shelf on which Winnie put the pots after he tasted each of them, and the number of the pots Winnie tasted, corresp

Tutorials

Разбор задач Codeforces Round #152

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
10818247 ljz E April 22, 2015, 2:41 a.m. OK FPC TESTS 92 1684 87347200 2700
2650386 kawatea E Nov. 25, 2012, 6:53 p.m. OK GNU C TESTS 92 703 81715200 2700
2926857 cherudim E Jan. 15, 2013, 12:08 p.m. OK GNU C++ TESTS 92 265 81408000 2700
2770752 alberist E Dec. 15, 2012, 4:46 p.m. OK GNU C++ TESTS 92 281 88576000 2700
32048723 sshockwave E Nov. 4, 2017, 10:07 a.m. OK GNU C++ TESTS 92 310 88985600 2700
3854185 qwdqkh1 E June 10, 2013, 1:50 p.m. OK GNU C++ TESTS 92 312 88985600 2700
3325606 chlxyd E March 16, 2013, 12:10 p.m. OK GNU C++ TESTS 92 327 97894400 2700
3171054 vjudge1 E Feb. 22, 2013, 7:42 a.m. OK GNU C++ TESTS 92 328 97894400 2700
2806402 hogloid E Dec. 22, 2012, 10:56 a.m. OK GNU C++ TESTS 92 328 165171200 2700
8446800 wwx E Oct. 28, 2014, 7:02 a.m. OK GNU C++ TESTS 92 342 84992000 2700
3002684 satashun E Jan. 24, 2013, 1:22 p.m. OK GNU C++ TESTS 92 359 137113600 2700
8445889 hta E Oct. 28, 2014, 4:11 a.m. OK GNU C++ TESTS 92 372 83353600 2700
8981638 equation314 E Dec. 4, 2014, 1:25 p.m. OK GNU C++0x TESTS 92 466 84992000 2700
8809306 zshi E Nov. 23, 2014, 6:59 a.m. OK GNU C++0x TESTS 92 1310 193228800 2700
47892217 vjudge2 E Jan. 4, 2019, 7:37 a.m. OK GNU C++11 TESTS 92 280 97177600 2700
47892173 M_sea E Jan. 4, 2019, 7:34 a.m. OK GNU C++11 TESTS 92 280 97177600 2700
63635277 Dream-chasing_Juvenile E Oct. 28, 2019, 8 a.m. OK GNU C++11 TESTS 92 280 97996800 2700
63634953 Dream-chasing_Juvenile E Oct. 28, 2019, 7:52 a.m. OK GNU C++11 TESTS 92 280 97996800 2700
60721325 luogu_bot3 E Sept. 17, 2019, 12:28 p.m. OK GNU C++11 TESTS 92 280 97996800 2700
53725152 luogu_bot5 E May 4, 2019, 3:38 a.m. OK GNU C++11 TESTS 92 280 97996800 2700
47891961 M_sea E Jan. 4, 2019, 7:23 a.m. OK GNU C++11 TESTS 92 280 97996800 2700
47891941 M_sea E Jan. 4, 2019, 7:22 a.m. OK GNU C++11 TESTS 92 280 97996800 2700
63634846 Dream-chasing_Juvenile E Oct. 28, 2019, 7:50 a.m. OK GNU C++11 TESTS 92 310 97996800 2700
62190426 hkmj E Oct. 9, 2019, 9:32 a.m. OK GNU C++11 TESTS 92 310 97996800 2700
67957360 mota_haathi E Dec. 30, 2019, 10:10 a.m. OK GNU C++14 TESTS 92 498 85196800 2700
42876994 SYCstudio E Sept. 15, 2018, 2:24 a.m. OK GNU C++14 TESTS 92 498 97996800 2700
50461146 bhargav_0085 E Feb. 24, 2019, 5:39 p.m. OK GNU C++14 TESTS 92 528 84992000 2700
42876985 SYCstudio E Sept. 15, 2018, 2:23 a.m. OK GNU C++14 TESTS 92 590 97996800 2700
24108710 fshp971 E Jan. 25, 2017, 9:57 a.m. OK GNU C++14 TESTS 92 654 86528000 2700
44409259 zbww E Oct. 16, 2018, 4:05 p.m. OK GNU C++14 TESTS 92 684 200806400 2700
56417275 NotNight E July 2, 2019, 5:28 a.m. OK GNU C++14 TESTS 92 746 172339200 2700
23662140 Ali.Pi E Jan. 9, 2017, 7:59 a.m. OK GNU C++14 TESTS 92 778 86835200 2700
22835185 jasonvictoryan E Dec. 9, 2016, 1:53 p.m. OK GNU C++14 TESTS 92 842 127078400 2700
23261687 InvUsr E Dec. 24, 2016, 2:11 a.m. OK GNU C++14 TESTS 92 872 86937600 2700
51149294 ruo E March 11, 2019, 6:31 a.m. OK GNU C++17 TESTS 92 466 84992000 2700
64458712 hjk1030 E Nov. 7, 2019, 9:34 a.m. OK GNU C++17 TESTS 92 686 176742400 2700
62190751 vjudge5 E Oct. 9, 2019, 9:37 a.m. OK GNU C++17 TESTS 92 716 91033600 2700
50982400 josdas E March 7, 2019, 6:16 p.m. OK GNU C++17 TESTS 92 780 91033600 2700
50700674 Anachor E March 2, 2019, 9:09 p.m. OK GNU C++17 TESTS 92 1122 111820800 2700
58568153 vjudge5 E Aug. 11, 2019, 8:53 a.m. OK GNU C++17 TESTS 92 1372 173158400 2700
68331061 dnkywin E Jan. 6, 2020, 6:49 p.m. OK GNU C++17 TESTS 92 1622 89395200 2700
66083992 tap_tapii E Dec. 1, 2019, 3:01 a.m. OK GNU C++17 TESTS 92 1996 87449600 2700
2666777 uwi E Nov. 27, 2012, 7:39 a.m. OK Java 6 TESTS 92 1015 55603200 2700
2905633 bsrkaditya E Jan. 11, 2013, 4:36 p.m. OK Java 6 TESTS 92 1562 122163200 2700
2823216 aste E Dec. 24, 2012, 5:30 p.m. OK Java 7 TESTS 92 1359 144998400 2700
2681882 islam-al-aarag E Nov. 30, 2012, 6:42 p.m. OK Java 7 TESTS 92 1453 266035200 2700
2656452 seen E Nov. 26, 2012, 7:15 a.m. OK MS C++ TESTS 92 312 86528000 2700
2861259 Gzs_iceberg E Dec. 31, 2012, 1:49 p.m. OK MS C++ TESTS 92 390 81817600 2700
2789625 daidailanlan E Dec. 18, 2012, 5:49 a.m. OK MS C++ TESTS 92 593 162713600 2700
2695432 Seyaua E Dec. 4, 2012, 8:33 p.m. OK MS C++ TESTS 92 812 82534400 2700
48082770 vjudge5 E Jan. 8, 2019, 9:06 a.m. OK MS C++ TESTS 92 904 88985600 2700
2861306 Gzs_iceberg E Dec. 31, 2012, 2:04 p.m. OK MS C++ TESTS 92 1046 129843200 2700
2861284 Gzs_iceberg E Dec. 31, 2012, 1:59 p.m. OK MS C++ TESTS 92 1078 86630400 2700
3967343 dronov E June 27, 2013, 1:25 p.m. OK MS C++ TESTS 92 1453 85401600 2700
12298867 sister_what_hate_most E Aug. 1, 2015, 4:29 a.m. OK MS C++ TESTS 92 1870 92160000 2700
12287993 vjudge5 E July 31, 2015, 7:24 a.m. OK MS C++ TESTS 92 1902 92160000 2700

remove filters

Back to search problems