Bubble Cup 9 - Finals [Online Mirror]

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
717 Bubble Cup 9 - Finals [Online Mirror] FINISHED False 18000 302821223 Sept. 11, 2016, 9 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 181 ) B R3D3’s Summer Adventure PROGRAMMING dp greedy 3200

R3D3 spent some time on an internship in MDCS. After earning enough money, he decided to go on a holiday somewhere far, far away. He enjoyed suntanning, drinking alcohol-free cocktails and going to concerts of popular local bands. While listening to "The White Buttons" and their hit song "Dacan the Baker", he met another robot for whom he was sure is the love of his life. Well, his summer, at least. Anyway, R3D3 was too shy to approach his potential soulmate, so he decided to write her a love letter. However, he stumbled upon a problem. Due to a terrorist threat, the Intergalactic Space Police was monitoring all letters sent in the area. Thus, R3D3 decided to invent his own alphabet, for which he was sure his love would be able to decipher. There are n letters in R3D3’s alphabet, and he wants to represent each letter as a sequence of ' 0 ' and ' 1 ', so that no letter’s sequence is a prefix of another letter's sequence. Since the Intergalactic Space Communications Service has lately introduced a tax for invented alphabets, R3D3 must pay a certain amount of money for each bit in his alphabet’s code (check the sample test for clarifications). He is too lovestruck to think clearly, so he asked you for help. Given the costs c 0 and c 1 for each ' 0 ' and ' 1 ' in R3D3’s alphabet, respectively, you should come up with a coding for the alphabet (with properties as above) with minimum total cost. The first line of input contains three integers n ( 2 ≤ n ≤ 10 8 ), c 0 and c 1 ( 0 ≤ c 0 , c 1 ≤ 10 8 ) — the number of letters in the alphabet, and costs of ' 0 ' and ' 1 ', respectively. Output a single integer — minimum possible total a cost of the whole alphabet. There are 4 letters in the alphabet. The optimal encoding is " 00 ", " 01 ", " 10 ", " 11 ". There are 4 zeroes and 4 ones used, so the total cost is 4·1 + 4·2 = 12 .

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
21885180 vjudge1 B Oct. 30, 2016, 2:15 a.m. OK GNU C++ TESTS 85 15 0 3200
21885175 sy15 B Oct. 30, 2016, 2:15 a.m. OK GNU C++ TESTS 85 15 0 3200
20810301 Totoro B Sept. 22, 2016, 5:04 a.m. OK GNU C++ TESTS 85 15 0 3200
20599752 doraaki B Sept. 13, 2016, 8:55 p.m. OK GNU C++ TESTS 85 15 0 3200
20810026 Owaski B Sept. 22, 2016, 4:29 a.m. OK GNU C++ TESTS 85 30 0 3200
25164655 Dylans B March 3, 2017, 7:43 a.m. OK GNU C++ TESTS 85 31 2048000 3200
20968543 GentleSmile B Sept. 28, 2016, 1:41 p.m. OK GNU C++ TESTS 85 46 6451200 3200
27211906 rqgao2014 B May 19, 2017, 10 a.m. OK GNU C++11 TESTS 85 15 0 3200
22613481 vjudge5 B Nov. 30, 2016, 3:48 a.m. OK GNU C++11 TESTS 85 15 0 3200
20962796 cxaphoenix B Sept. 28, 2016, 8:36 a.m. OK GNU C++11 TESTS 85 15 0 3200
20772574 anta B Sept. 20, 2016, 10:08 a.m. OK GNU C++11 TESTS 85 15 0 3200
20620974 knightL B Sept. 14, 2016, 3:44 p.m. OK GNU C++11 TESTS 85 15 0 3200
20611284 shdut B Sept. 14, 2016, 10:21 a.m. OK GNU C++11 TESTS 85 15 0 3200
20544669 Lo_R_D B Sept. 12, 2016, 7:42 a.m. OK GNU C++11 TESTS 85 15 102400 3200
20544614 Lo_R_D B Sept. 12, 2016, 7:38 a.m. OK GNU C++11 TESTS 85 15 102400 3200
20531257 Um_nik B Sept. 11, 2016, 12:34 p.m. OK GNU C++11 TESTS 85 15 204800 3200
36224715 choutii B March 12, 2018, 1:04 p.m. OK GNU C++11 TESTS 85 15 2150400 3200
22925104 NiroBC B Dec. 13, 2016, 11:33 a.m. OK GNU C++14 TESTS 85 15 0 3200
20828906 Philipsweng B Sept. 23, 2016, 1:55 a.m. OK GNU C++14 TESTS 85 15 0 3200
27389323 Los_Angelos_Laycurse B May 27, 2017, 1:12 p.m. OK GNU C++14 TESTS 85 15 102400 3200
22613470 snowy_smile B Nov. 30, 2016, 3:47 a.m. OK GNU C++14 TESTS 85 15 204800 3200
20553119 chemthan B Sept. 12, 2016, 4:55 p.m. OK GNU C++14 TESTS 85 15 204800 3200
25088217 Vladyslav B Feb. 27, 2017, 8:43 p.m. OK GNU C++14 TESTS 85 15 1945600 3200
25088126 Vladyslav B Feb. 27, 2017, 8:37 p.m. OK GNU C++14 TESTS 85 15 1945600 3200
23378707 Ali.Pi B Dec. 28, 2016, 1:25 p.m. OK GNU C++14 TESTS 85 15 1945600 3200
28428128 MicGor B July 11, 2017, 2:06 p.m. OK GNU C++14 TESTS 85 15 2048000 3200
36269893 I_love_Palindromic_Tree B March 14, 2018, 9:26 a.m. OK GNU C++14 TESTS 85 15 2150400 3200
56998413 Benq B July 14, 2019, 1:31 a.m. OK GNU C++17 TESTS 85 31 0 3200
69955138 gongsuidashen B Feb. 1, 2020, 9:57 a.m. OK GNU C++17 TESTS 85 31 204800 3200
52549321 Rose_max B April 10, 2019, 2:14 a.m. OK GNU C++17 TESTS 85 31 204800 3200
20667272 uwi B Sept. 16, 2016, 7:08 p.m. OK Java 8 TESTS 85 124 0 3200
22005627 071-22042-08-Zharaskhan B Nov. 3, 2016, 3:52 a.m. OK Java 8 TESTS 85 139 0 3200
20528372 tourist VArtem B Sept. 11, 2016, 10:48 a.m. OK Java 8 TESTS 85 140 0 3200
20536244 Slamur B Sept. 11, 2016, 4:40 p.m. OK Java 8 TESTS 85 218 0 3200
29316090 --d B Aug. 10, 2017, 2:20 a.m. OK Python 3 TESTS 85 62 4608000 3200
29316084 --d B Aug. 10, 2017, 2:20 a.m. OK Python 3 TESTS 85 109 8601600 3200
42129207 Mk_Python_v1 B Aug. 26, 2018, 5:17 p.m. OK Python 3 TESTS 85 187 3584000 3200
29315992 --d B Aug. 10, 2017, 2:10 a.m. OK Python 3 TESTS 85 202 8601600 3200

remove filters

Back to search problems