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 |
---|---|---|---|---|---|---|
679 | Codeforces Round 356 (Div. 1) | FINISHED | False | 7200 | 266419499 | June 8, 2016, 4:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2152 ) | B | Bear and Tower of Cubes | PROGRAMMING | binary search dp greedy | 2300 |
B"Limak is a little polar bear. He plays by building towers from blocks. Every block is a cube with positive integer length of side. Limak has infinitely many blocks of each side length. A block with side a has volume a3. A tower consisting of blocks with sides a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89ak has the total volume a13 xe2 x80 x89+ xe2 x80 x89a23 xe2 x80 x89+ xe2 x80 x89... xe2 x80 x89+ xe2 x80 x89ak3. Limak is going to build a tower. First, he asks you to tell him a positive integer X -- the required total volume of the tower. Then, Limak adds new blocks greedily, one by one. Each time he adds the biggest block such that the total volume doesn't exceed X. Limak asks you to choose X not greater than m. Also, he wants to maximize the number of blocks in the tower at the end (however, he still behaves greedily). Secondarily, he wants to maximize X. Can you help Limak? Find the maximum number of blocks his tower can have and the maximum X xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m that results this number of blocks. The only line of the input contains one integer m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891015), meaning that Limak wants you to choose X between 1 and m, inclusive. Print two integers -- the maximum number of blocks in the tower and the maximum required total volume X, resulting in the maximum number of blocks. In the first sample test, there will be 9 blocks if you choose X xe2 x80 x89= xe2 x80 x8923 or X xe2 x80 x89= xe2 x80 x8942. Limak wants to maximize X secondarily so you should choose 42. In more detail, after choosing X xe2 x80 x89= xe2 x80 x8942 the process of building a tower is: So, there are 9 blocks in the tower. The total volume is is 33 xe2 x80 x89+ xe2 x80 x8923 xe2 x80 x89+ xe2 x80 x897 xc2 xb713 xe2 x80 x89= xe2 x80 x8927 xe2 x80 x89+ xe2 x80 x898 xe2 x80 x89+ xe2 x80 x897 xe2 x80 x89= xe2 x80 x8942. "... |
Codeforces Round #356 — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
18312312 | Gassa | B | June 8, 2016, 5:10 p.m. | OK | D | TESTS | 45 | 15 | 7168000 | 2300 | |
21888849 | myx12345 | B | Oct. 30, 2016, 8:30 a.m. | OK | FPC | TESTS | 45 | 15 | 819200 | 2300 | |
18486470 | LossABike | B | June 15, 2016, 3:16 a.m. | OK | FPC | TESTS | 45 | 15 | 1740800 | 2300 | |
18490624 | darkwind52 | B | June 15, 2016, 7:36 a.m. | OK | FPC | TESTS | 45 | 15 | 1945600 | 2300 | |
31702803 | vjudge2 | B | Oct. 25, 2017, 8:23 a.m. | OK | FPC | TESTS | 45 | 30 | 0 | 2300 | |
18360786 | ndkhaivn | B | June 10, 2016, 3:14 p.m. | OK | FPC | TESTS | 45 | 30 | 1740800 | 2300 | |
60246276 | vjudge5 | B | Sept. 8, 2019, 2:55 a.m. | OK | FPC | TESTS | 45 | 31 | 0 | 2300 | |
42145914 | chaorenhaha | B | Aug. 27, 2018, 8:49 a.m. | OK | FPC | TESTS | 45 | 31 | 0 | 2300 | |
18509761 | EternaLEnVy | B | June 16, 2016, 1:23 a.m. | OK | FPC | TESTS | 45 | 31 | 0 | 2300 | |
60246310 | vjudge1 | B | Sept. 8, 2019, 2:57 a.m. | OK | FPC | TESTS | 45 | 31 | 0 | 2300 | |
19878097 | sanhlike | B | Aug. 15, 2016, 12:55 a.m. | OK | FPC | TESTS | 45 | 31 | 1638400 | 2300 | |
22076608 | nir123 | B | Nov. 6, 2016, 2:01 p.m. | OK | GNU C | TESTS | 45 | 15 | 0 | 2300 | |
18317969 | Phoenix_Galaxy | B | June 8, 2016, 5:35 p.m. | OK | GNU C | TESTS | 45 | 15 | 5120000 | 2300 | |
18384648 | gogateiiit | B | June 12, 2016, 5:15 a.m. | OK | GNU C | TESTS | 45 | 30 | 2048000 | 2300 | |
22373109 | rainboy | B | Nov. 20, 2016, 9:02 p.m. | OK | GNU C | TESTS | 45 | 31 | 819200 | 2300 | |
31697361 | vjudge3 | B | Oct. 25, 2017, 2:50 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
27697867 | Scut82 | B | June 10, 2017, 12:08 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
27548463 | dogET | B | June 3, 2017, 4:08 p.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
27538243 | zhan8855 | B | June 3, 2017, 7:18 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
27478543 | vjudge2 | B | June 1, 2017, 6:16 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
22426273 | opt012 | B | Nov. 23, 2016, 3:18 p.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
22186448 | CHNZYX | B | Nov. 13, 2016, 3:21 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
22186436 | CHNZYX | B | Nov. 13, 2016, 3:20 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
21958399 | FHW_SO_WALL | B | Nov. 1, 2016, 6:23 a.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
21827627 | Fire_man | B | Oct. 27, 2016, 3:24 p.m. | OK | GNU C++ | TESTS | 45 | 15 | 0 | 2300 | |
18348909 | bertho_coder | B | June 9, 2016, 9:42 p.m. | OK | GNU C11 | TESTS | 45 | 31 | 2867200 | 2300 | |
20825421 | daksh.anand born2rule | B | Sept. 22, 2016, 7:25 p.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
39737590 | N_TriumphOfD | B | June 28, 2018, 9:01 a.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
27001433 | xietutu | B | May 10, 2017, 6:16 p.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
27000277 | XJT | B | May 10, 2017, 4:56 p.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
26991402 | liyang21 | B | May 10, 2017, 7:20 a.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
22195749 | srinu37 | B | Nov. 13, 2016, 3:46 p.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
20924080 | BackendDeveloper | B | Sept. 26, 2016, 11:40 a.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
20801869 | r_j | B | Sept. 21, 2016, 5:07 p.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
20479172 | elch10 | B | Sept. 9, 2016, 1:31 p.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
20455461 | Hasan | B | Sept. 8, 2016, 9:56 a.m. | OK | GNU C++11 | TESTS | 45 | 15 | 0 | 2300 | |
38604671 | Toxel | B | May 25, 2018, 9:12 a.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
31813936 | kill_em_all | B | Oct. 27, 2017, 5:21 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
30486300 | waynetuinfor | B | Sept. 19, 2017, 1:16 a.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
30039189 | ug17 | B | Sept. 3, 2017, 4:03 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
29849102 | danya.smelskiy | B | Aug. 28, 2017, 3:36 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
29621863 | zoombee | B | Aug. 20, 2017, 1:13 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
27287560 | spj_29 | B | May 22, 2017, 4:04 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
27121035 | knayam_sharma | B | May 15, 2017, 12:15 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
22586824 | mylyanyk.ivan | B | Nov. 28, 2016, 9:50 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
32536815 | ujjwal9895 | B | Nov. 21, 2017, 10:11 p.m. | OK | GNU C++14 | TESTS | 45 | 15 | 0 | 2300 | |
55104321 | chongryong | B | June 5, 2019, 12:19 a.m. | OK | GNU C++17 | TESTS | 45 | 30 | 0 | 2300 | |
50469422 | Abdelrhman_Akram | B | Feb. 24, 2019, 10:32 p.m. | OK | GNU C++17 | TESTS | 45 | 30 | 0 | 2300 | |
39738009 | ValeriiaHryhoriants | B | June 28, 2018, 9:18 a.m. | OK | GNU C++17 | TESTS | 45 | 30 | 0 | 2300 | |
55104525 | chongryong | B | June 5, 2019, 12:37 a.m. | OK | GNU C++17 | TESTS | 45 | 30 | 0 | 2300 | |
60377069 | Lrztxdy | B | Sept. 11, 2019, 7:10 a.m. | OK | GNU C++17 | TESTS | 45 | 31 | 0 | 2300 | |
69221455 | aki167yuuki | B | Jan. 21, 2020, 4:56 a.m. | OK | GNU C++17 | TESTS | 45 | 31 | 0 | 2300 | |
66052930 | Boaba | B | Nov. 30, 2019, 6:09 p.m. | OK | GNU C++17 | TESTS | 45 | 31 | 0 | 2300 | |
64479456 | user202729_ | B | Nov. 7, 2019, 3:26 p.m. | OK | GNU C++17 | TESTS | 45 | 31 | 0 | 2300 | |
61020865 | pit4h | B | Sept. 21, 2019, 2:33 p.m. | OK | GNU C++17 | TESTS | 45 | 31 | 0 | 2300 | |
60750931 | viethuy99 | B | Sept. 18, 2019, 6:14 a.m. | OK | GNU C++17 | TESTS | 45 | 31 | 0 | 2300 | |
18352717 | daiict | B | June 10, 2016, 5:57 a.m. | OK | Java 7 | TESTS | 45 | 109 | 39424000 | 2300 | |
19595356 | lehar | B | Aug. 3, 2016, 10:04 a.m. | OK | Java 7 | TESTS | 45 | 155 | 0 | 2300 | |
18329742 | amtematem | B | June 8, 2016, 7:52 p.m. | OK | Java 7 | TESTS | 45 | 452 | 49971200 | 2300 | |
67485613 | Nutella3000 | B | Dec. 23, 2019, 5:21 p.m. | OK | Java 8 | TESTS | 45 | 109 | 0 | 2300 | |
21978872 | pitfall | B | Nov. 1, 2016, 10:06 p.m. | OK | Java 8 | TESTS | 45 | 124 | 0 | 2300 | |
18358986 | webstorms | B | June 10, 2016, 1:10 p.m. | OK | Java 8 | TESTS | 45 | 124 | 20377600 | 2300 | |
18349416 | ankeet | B | June 9, 2016, 10:36 p.m. | OK | Java 8 | TESTS | 45 | 124 | 20582400 | 2300 | |
18342406 | jetblack20 | B | June 9, 2016, 1:48 p.m. | OK | Java 8 | TESTS | 45 | 124 | 20582400 | 2300 | |
36506707 | Golmol | B | March 22, 2018, 2:45 p.m. | OK | Java 8 | TESTS | 45 | 124 | 20684800 | 2300 | |
18398038 | Scarlet-FF3300 | B | June 12, 2016, 6:42 p.m. | OK | Java 8 | TESTS | 45 | 124 | 20684800 | 2300 | |
18353652 | cold5r | B | June 10, 2016, 7:09 a.m. | OK | Java 8 | TESTS | 45 | 124 | 20684800 | 2300 | |
18338157 | fnch | B | June 9, 2016, 8:49 a.m. | OK | Java 8 | TESTS | 45 | 124 | 20684800 | 2300 | |
18322899 | Dos | B | June 8, 2016, 6:05 p.m. | OK | Java 8 | TESTS | 45 | 124 | 20684800 | 2300 | |
18330813 | camypaper | B | June 8, 2016, 8:57 p.m. | OK | MS C# | TESTS | 45 | 62 | 9932800 | 2300 | |
24008890 | og.kostya | B | Jan. 21, 2017, 10:42 a.m. | OK | MS C# | TESTS | 45 | 234 | 9113600 | 2300 | |
18319236 | azukun | B | June 8, 2016, 5:42 p.m. | OK | MS C# | TESTS | 45 | 327 | 115302400 | 2300 | |
21669077 | irain | B | Oct. 22, 2016, 2:14 p.m. | OK | MS C++ | TESTS | 45 | 15 | 0 | 2300 | |
19369460 | dimdem | B | July 23, 2016, 5:30 p.m. | OK | MS C++ | TESTS | 45 | 15 | 0 | 2300 | |
19045707 | vjudge4 | B | July 12, 2016, 8:10 a.m. | OK | MS C++ | TESTS | 45 | 15 | 0 | 2300 | |
18918084 | jk_qq | B | July 6, 2016, noon | OK | MS C++ | TESTS | 45 | 15 | 0 | 2300 | |
18892646 | vjudge3 | B | July 5, 2016, 4:06 a.m. | OK | MS C++ | TESTS | 45 | 15 | 0 | 2300 | |
18891071 | abc651279230 | B | July 5, 2016, 1:04 a.m. | OK | MS C++ | TESTS | 45 | 15 | 0 | 2300 | |
18492880 | ferc | B | June 15, 2016, 9:21 a.m. | OK | MS C++ | TESTS | 45 | 15 | 2252800 | 2300 | |
18344546 | Michael | B | June 9, 2016, 4:04 p.m. | OK | MS C++ | TESTS | 45 | 15 | 2252800 | 2300 | |
18335523 | rkm0959 | B | June 9, 2016, 5:22 a.m. | OK | MS C++ | TESTS | 45 | 15 | 2252800 | 2300 | |
18326053 | Krainov_Dmitry | B | June 8, 2016, 6:27 p.m. | OK | MS C++ | TESTS | 45 | 15 | 2252800 | 2300 | |
34246703 | tushutripathi | B | Jan. 17, 2018, 9:56 a.m. | OK | PyPy 2 | TESTS | 45 | 156 | 29184000 | 2300 | |
18328637 | hellman_ | B | June 8, 2016, 7:15 p.m. | OK | PyPy 2 | TESTS | 45 | 217 | 36966400 | 2300 | |
18344867 | llllllll | B | June 9, 2016, 4:34 p.m. | OK | PyPy 2 | TESTS | 45 | 234 | 25088000 | 2300 | |
34245002 | tushutripathi | B | Jan. 17, 2018, 9:25 a.m. | OK | PyPy 2 | TESTS | 45 | 436 | 29081600 | 2300 | |
19856554 | haku | B | Aug. 13, 2016, 6:46 p.m. | OK | PyPy 3 | TESTS | 45 | 186 | 28569600 | 2300 | |
19147749 | guangfnian | B | July 15, 2016, 8:26 a.m. | OK | PyPy 3 | TESTS | 45 | 217 | 1945600 | 2300 | |
19173177 | guangfnian | B | July 16, 2016, 12:27 p.m. | OK | PyPy 3 | TESTS | 45 | 217 | 2150400 | 2300 | |
61309416 | kopok2 | B | Sept. 26, 2019, 8:40 a.m. | OK | PyPy 3 | TESTS | 45 | 233 | 2560000 | 2300 | |
19856522 | haku | B | Aug. 13, 2016, 6:44 p.m. | OK | PyPy 3 | TESTS | 45 | 233 | 28262400 | 2300 | |
18312974 | kevinsogo | B | June 8, 2016, 5:12 p.m. | OK | Python 2 | TESTS | 45 | 61 | 4812800 | 2300 | |
18443416 | crazypursuer | B | June 14, 2016, 5:11 a.m. | OK | Python 2 | TESTS | 45 | 62 | 4812800 | 2300 | |
18339004 | ccdd4211 | B | June 9, 2016, 9:47 a.m. | OK | Python 2 | TESTS | 45 | 124 | 4812800 | 2300 | |
18343054 | dpforest | B | June 9, 2016, 2:26 p.m. | OK | Python 2 | TESTS | 45 | 156 | 4812800 | 2300 | |
18365133 | uberwach | B | June 10, 2016, 8:48 p.m. | OK | Python 2 | TESTS | 45 | 171 | 4812800 | 2300 | |
18343139 | dpforest | B | June 9, 2016, 2:31 p.m. | OK | Python 2 | TESTS | 45 | 186 | 8806400 | 2300 | |
18321970 | nwi | B | June 8, 2016, 5:59 p.m. | OK | Python 2 | TESTS | 45 | 265 | 4812800 | 2300 | |
19145964 | meret | B | July 15, 2016, 7:19 a.m. | OK | Python 2 | TESTS | 45 | 389 | 0 | 2300 | |
18665110 | orailly | B | June 23, 2016, 2:11 p.m. | OK | Python 3 | TESTS | 45 | 77 | 0 | 2300 | |
21582260 | xqxm | B | Oct. 19, 2016, 4:41 a.m. | OK | Python 3 | TESTS | 45 | 77 | 4608000 | 2300 | |
18355482 | SerVasilich | B | June 10, 2016, 9:18 a.m. | OK | Python 3 | TESTS | 45 | 77 | 5120000 | 2300 | |
32833658 | yugle7 | B | Dec. 1, 2017, 3:18 p.m. | OK | Python 3 | TESTS | 45 | 78 | 5529600 | 2300 | |
45544097 | Tparsa | B | Nov. 10, 2018, 9:51 p.m. | OK | Python 3 | TESTS | 45 | 124 | 0 | 2300 | |
19047837 | vjudge1 | B | July 12, 2016, 9:46 a.m. | OK | Python 3 | TESTS | 45 | 124 | 0 | 2300 | |
18967495 | mplaton | B | July 8, 2016, 10:35 a.m. | OK | Python 3 | TESTS | 45 | 124 | 0 | 2300 | |
18331904 | ch_egor | B | June 8, 2016, 10:38 p.m. | OK | Python 3 | TESTS | 45 | 139 | 5120000 | 2300 | |
18329705 | Nysh | B | June 8, 2016, 7:50 p.m. | OK | Python 3 | TESTS | 45 | 139 | 5120000 | 2300 | |
19173151 | guangfnian | B | July 16, 2016, 12:26 p.m. | OK | Python 3 | TESTS | 45 | 140 | 0 | 2300 |
Back to search problems