Codeforces Round 641 (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
1349 Codeforces Round 641 (Div. 1) FINISHED False 9000 148065911 May 12, 2020, 12:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 931 ) D Slime and Biscuits PROGRAMMING math probabilities 3200

B'Slime and his n friends are at a party. Slime has designed a game for his friends to play. At the beginning of the game, the i -th player has a_i biscuits. At each second, Slime will choose a biscuit randomly uniformly among all a_1 + a_2 + ldots + a_n biscuits, and the owner of this biscuit will give it to a random uniform player among n-1 players except himself. The game stops when one person will have all the biscuits. As the host of the party, Slime wants to know the expected value of the time that the game will last, to hold the next activity on time. For convenience, as the answer can be represented as a rational number frac{p}{q} for coprime p and q , you need to find the value of (p cdot q^{-1}) mod 998 ,244 ,353 . You can prove that q mod 998 ,244 ,353 neq 0 . The first line contains one integer n (2 <= n <= 100 ,000) : the number of people playing the game. The second line contains n non-negative integers a_1,a_2, ... ,a_n (1 <= a_1+a_2+ ... +a_n <= 300 ,000) , where a_i represents the number of biscuits the i -th person own at the beginning. Print one integer: the expected value of the time that the game will last, modulo 998 ,244 ,353 . For the first example, in the first second, the probability that player 1 will give the player 2 a biscuit is frac{1}{2} , and the probability that player 2 will give the player 1 a biscuit is frac{1}{2} . But anyway, the game will stop after exactly 1 second because only one player will occupy all biscuits after 1 second, so the answer is 1 . '...

Tutorials

Codeforces Round #641 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
79903119 hos.lyric D May 12, 2020, 4:38 p.m. OK D TESTS 55 234 18227200 3200
79983060 Mr_Wu D May 13, 2020, 1:18 p.m. OK GNU C++11 TESTS 55 46 7577600 3200
79932694 Backseat-Stargazer D May 13, 2020, 1:29 a.m. OK GNU C++11 TESTS 55 46 8806400 3200
80077198 SuperFF D May 14, 2020, 2:10 p.m. OK GNU C++11 TESTS 55 46 13516800 3200
80295455 No268435 D May 16, 2020, 8:38 a.m. OK GNU C++11 TESTS 55 46 144179200 3200
80073294 mmmod_lqs D May 14, 2020, 1:24 p.m. OK GNU C++11 TESTS 55 61 8704000 3200
79930244 Isonan D May 13, 2020, 12:24 a.m. OK GNU C++11 TESTS 55 61 9932800 3200
80004218 ProgrammerStrange D May 13, 2020, 5:02 p.m. OK GNU C++11 TESTS 55 61 11366400 3200
80663241 luogu_bot4 D May 19, 2020, 7:10 a.m. OK GNU C++11 TESTS 55 62 6451200 3200
79982745 Mr_Wu D May 13, 2020, 1:15 p.m. OK GNU C++11 TESTS 55 62 7577600 3200
80224862 mobu233 D May 15, 2020, 12:30 p.m. OK GNU C++11 TESTS 55 62 9932800 3200
79975199 Rubblsh12345 D May 13, 2020, 11:44 a.m. OK GNU C++14 TESTS 55 46 10035200 3200
79909316 yan-zp D May 12, 2020, 5:37 p.m. OK GNU C++14 TESTS 55 93 6553600 3200
79982396 alexander86 D May 13, 2020, 1:10 p.m. OK GNU C++14 TESTS 55 93 18944000 3200
79874857 caoyue D May 12, 2020, 2:21 p.m. OK GNU C++14 TESTS 55 93 30412800 3200
79961882 Hansuzu D May 13, 2020, 9:09 a.m. OK GNU C++14 TESTS 55 124 19763200 3200
79958167 bzh D May 13, 2020, 8:25 a.m. OK GNU C++14 TESTS 55 139 11161600 3200
80691598 sshwyR D May 19, 2020, 1:23 p.m. OK GNU C++14 TESTS 55 155 2457600 3200
80967592 Motarack D May 22, 2020, 8:06 p.m. OK GNU C++14 TESTS 55 156 1638400 3200
80673249 DinnerHunt D May 19, 2020, 9:31 a.m. OK GNU C++14 TESTS 55 156 4812800 3200
79973618 Weeeee D May 13, 2020, 11:27 a.m. OK GNU C++14 TESTS 55 156 5324800 3200
80856776 xz153531 D May 21, 2020, 1:35 p.m. OK GNU C++17 TESTS 55 46 3072000 3200
80165470 bhaiya_bhosdika D May 14, 2020, 6:21 p.m. OK GNU C++17 TESTS 55 61 14643200 3200
80663199 efyjef D May 19, 2020, 7:09 a.m. OK GNU C++17 TESTS 55 62 6656000 3200
79941811 jiangly D May 13, 2020, 4:47 a.m. OK GNU C++17 TESTS 55 62 7680000 3200
79921321 fdironia D May 12, 2020, 8:19 p.m. OK GNU C++17 TESTS 55 62 7680000 3200
79872081 kriii D May 12, 2020, 2:14 p.m. OK GNU C++17 TESTS 55 62 8908800 3200
79941781 kimoyami D May 13, 2020, 4:47 a.m. OK GNU C++17 TESTS 55 62 9728000 3200
80224875 Anachor D May 15, 2020, 12:30 p.m. OK GNU C++17 TESTS 55 62 10956800 3200
81517439 chaudharyrobin199 D May 26, 2020, 3:27 p.m. OK GNU C++17 TESTS 55 62 11161600 3200
80945527 Shadow_Dani D May 22, 2020, 3:04 p.m. OK GNU C++17 TESTS 55 62 11161600 3200
81573261 cjy2003 D May 27, 2020, 2:07 a.m. OK GNU C++17 (64) TESTS 55 31 4812800 3200
79900620 jiangly D May 12, 2020, 4:17 p.m. OK GNU C++17 (64) TESTS 55 46 8294400 3200
79958865 suncongbo D May 13, 2020, 8:33 a.m. OK GNU C++17 (64) TESTS 55 46 11571200 3200
80644130 FlowerOfSorrow D May 18, 2020, 11:20 p.m. OK GNU C++17 (64) TESTS 55 62 2764800 3200
81003214 RiverHamster D May 23, 2020, 9:58 a.m. OK GNU C++17 (64) TESTS 55 62 6656000 3200
79951597 liouzhou_101 D May 13, 2020, 7:01 a.m. OK GNU C++17 (64) TESTS 55 62 8806400 3200
80138527 Xellos D May 14, 2020, 3:55 p.m. OK GNU C++17 (64) TESTS 55 62 14336000 3200
80019578 Marckess D May 13, 2020, 10:28 p.m. OK GNU C++17 (64) TESTS 55 77 16384000 3200
79903193 MiFaFaOvO D May 12, 2020, 4:39 p.m. OK GNU C++17 (64) TESTS 55 78 15257600 3200
80019560 Marckess D May 13, 2020, 10:28 p.m. OK GNU C++17 (64) TESTS 55 78 44544000 3200
80644763 walking D May 18, 2020, 11:49 p.m. OK Java 11 TESTS 55 498 0 3200
79928898 Xylenox D May 12, 2020, 11:35 p.m. OK Java 8 TESTS 55 373 20582400 3200
80775829 koboshi D May 20, 2020, 1:20 p.m. OK Kotlin TESTS 55 998 18022400 3200
80308604 EmilSardaryan D May 16, 2020, 11:19 a.m. OK MS C++ 2017 TESTS 55 234 6963200 3200
79999085 pajenegod D May 13, 2020, 4:01 p.m. OK PyPy 2 TESTS 55 888 44851200 3200
79987955 mkawa2 D May 13, 2020, 2:11 p.m. OK PyPy 3 TESTS 55 670 67584000 3200
81457384 zhr2010 D May 26, 2020, 9:51 a.m. OK PyPy 3 TESTS 55 811 51609600 3200
79947090 conqueror_of_tourist D May 13, 2020, 6:06 a.m. OK PyPy 3 TESTS 55 826 41472000 3200
80684510 sansen D May 19, 2020, 11:59 a.m. OK Rust TESTS 55 717 4505600 3200

remove filters

Back to search problems