Codeforces Round 432 (Div. 1, based on IndiaHacks Final Round 2017)

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
850 Codeforces Round 432 (Div. 1, based on IndiaHacks Final Round 2017) FINISHED False 9000 227287499 Sept. 4, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 669 ) F Rainbow Balls PROGRAMMING math #bags with balls codeforces 2800

B'You have a bag of balls of n different colors. You have ai balls of the i-th color. While there are at least two different colored balls in the bag, perform the following steps: Let M xe2 x80 x89= xe2 x80 x89109 xe2 x80 x89+ xe2 x80 x897. It can be proven that the expected amount of time needed before you stop can be represented as a rational number , where P and Q are coprime integers and where Q is not divisible by M. Return the value . The first line of input will contain a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xe2 x80 x89500) -- the number of colors. The next line of input will contain n space separated integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of balls of each color. Print a single integer, the answer to the problem. In the first sample, no matter what happens, the balls will become the same color after one step. For the second sample, we have 6 balls. Let xe2 x80 x99s label the balls from 1 to 6, and without loss of generality, let xe2 x80 x99s say balls 1,2,3 are initially color 1, balls 4,5 are color 2, and ball 6 are color 3. Here is an example of how these steps can go: It can be shown that the answer to this case is . '...

Tutorials

Codeforces Round #432 editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
31098580 kmxyvb F Oct. 7, 2017, 4:01 a.m. OK GNU C++ TESTS 30 46 1024000 2800
30078210 oipotato F Sept. 4, 2017, 4:47 p.m. OK GNU C++ TESTS 30 61 614400 2800
30609345 black_horse2014 F Sept. 22, 2017, 8:31 a.m. OK GNU C++ TESTS 30 62 0 2800
32543860 jizhixiaowangzi F Nov. 22, 2017, 8:10 a.m. OK GNU C++ TESTS 30 62 1126400 2800
30079821 MemS F Sept. 4, 2017, 5:01 p.m. OK GNU C++ TESTS 30 62 1331200 2800
30120254 UsedToBe F Sept. 6, 2017, 12:47 a.m. OK GNU C++ TESTS 30 62 1740800 2800
30080101 chenjb F Sept. 4, 2017, 5:03 p.m. OK GNU C++ TESTS 30 62 3993600 2800
36874420 vjudge2 F April 2, 2018, 9:52 a.m. OK GNU C++ TESTS 30 62 4300800 2800
39796531 diamond_duke F June 30, 2018, 11:48 a.m. OK GNU C++ TESTS 30 78 614400 2800
30486252 riverwalk7 F Sept. 19, 2017, 1:09 a.m. OK GNU C++ TESTS 30 187 1638400 2800
56476238 _twilight F July 3, 2019, 1:16 p.m. OK GNU C++11 TESTS 30 46 409600 2800
54150158 ffffxk F May 14, 2019, 10:56 p.m. OK GNU C++11 TESTS 30 46 409600 2800
51997357 dushaolong F March 30, 2019, 3:29 a.m. OK GNU C++11 TESTS 30 46 614400 2800
58650084 hyjhyj F Aug. 12, 2019, 7:11 a.m. OK GNU C++11 TESTS 30 61 409600 2800
66157680 luogu_bot3 F Dec. 2, 2019, 12:56 a.m. OK GNU C++11 TESTS 30 61 614400 2800
49240069 DreamLolita F Jan. 31, 2019, 9:53 a.m. OK GNU C++11 TESTS 30 61 819200 2800
30170578 rqgao2014 F Sept. 7, 2017, 2:50 a.m. OK GNU C++11 TESTS 30 61 921600 2800
52230136 ytc020306 F April 2, 2019, 11:34 a.m. OK GNU C++11 TESTS 30 62 204800 2800
69196437 luogu_bot3 F Jan. 20, 2020, 3:04 p.m. OK GNU C++11 TESTS 30 62 409600 2800
68316190 Big_black_jujube F Jan. 6, 2020, 1:18 p.m. OK GNU C++11 TESTS 30 62 409600 2800
40979976 ReaLNero1 F July 30, 2018, 5:19 p.m. OK GNU C++14 TESTS 30 46 819200 2800
30126785 joyfun F Sept. 6, 2017, 9:03 a.m. OK GNU C++14 TESTS 30 46 819200 2800
30093773 apiadu F Sept. 5, 2017, 7:55 a.m. OK GNU C++14 TESTS 30 46 819200 2800
30089565 Vercingetorix F Sept. 5, 2017, 3:38 a.m. OK GNU C++14 TESTS 30 46 819200 2800
30083303 Shik F Sept. 4, 2017, 7:39 p.m. OK GNU C++14 TESTS 30 46 819200 2800
30071271 sd0061 F Sept. 4, 2017, 3:52 p.m. OK GNU C++14 TESTS 30 61 819200 2800
69498157 Cyanic F Jan. 25, 2020, 5:22 a.m. OK GNU C++14 TESTS 30 61 1024000 2800
30075755 mnbvmar F Sept. 4, 2017, 4:27 p.m. OK GNU C++14 TESTS 30 61 1638400 2800
33279535 ztk F Dec. 16, 2017, 2:09 a.m. OK GNU C++14 TESTS 30 61 2457600 2800
30079413 Phronesis F Sept. 4, 2017, 4:58 p.m. OK GNU C++14 TESTS 30 62 409600 2800
68464239 icecuber F Jan. 9, 2020, 7:26 p.m. OK GNU C++17 TESTS 30 46 409600 2800
53538089 neal F April 30, 2019, 4:25 a.m. OK GNU C++17 TESTS 30 46 409600 2800
60161647 xgcxgc F Sept. 6, 2019, 9:13 a.m. OK GNU C++17 TESTS 30 61 409600 2800
69399602 hjk1030 F Jan. 23, 2020, 7:56 a.m. OK GNU C++17 TESTS 30 62 409600 2800
55648154 hjk1030 F June 16, 2019, 1:13 p.m. OK GNU C++17 TESTS 30 62 409600 2800
47723603 Shayan.P F Dec. 30, 2018, 12:54 p.m. OK GNU C++17 TESTS 30 62 819200 2800
66793375 justfocusplease F Dec. 13, 2019, 4:06 p.m. OK GNU C++17 TESTS 30 62 1638400 2800
47021608 ShichengXiao F Dec. 15, 2018, 2:53 a.m. OK GNU C++17 TESTS 30 78 409600 2800
47848004 Benq F Jan. 2, 2019, 3:54 p.m. OK GNU C++17 TESTS 30 93 409600 2800
60196557 Rose_max F Sept. 7, 2019, 2:13 a.m. OK GNU C++17 TESTS 30 108 819200 2800
30205867 mmaxio F Sept. 8, 2017, 3:27 p.m. OK Java 8 TESTS 30 171 0 2800
30127071 fetetriste F Sept. 6, 2017, 9:16 a.m. OK Java 8 TESTS 30 280 0 2800
42418502 2158090 F Sept. 3, 2018, 8:46 a.m. OK Java 8 TESTS 30 296 0 2800

remove filters

Back to search problems