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 |
---|---|---|---|---|---|---|
1646 | Codeforces Round 774 (Div. 2) | FINISHED | False | 7200 | 90771863 | March 4, 2022, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 14751 ) | C | Factorials and Powers of Two | PROGRAMMING | bitmasks brute force constructive algorithms math | 1500 |
B'A number is called powerful if it is a power of two or a factorial. In other words, the number m is powerful if there exists a non-negative integer d such that m=2^d or m=d! , where d!=1 cdot 2 cdot ldots cdot d (in particular, 0! = 1 ). For example 1 , 4 , and 6 are powerful numbers, because 1=1! , 4=2^2 , and 6=3! but 7 , 10 , or 18 are not. You are given a positive integer n . Find the minimum number k such that n can be represented as the sum of k distinct powerful numbers, or say that there is no such k . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). Description of the test cases follows. A test case consists of only one line, containing one integer n ( 1 <= n <= 10^{12} ). For each test case print the answer on a separate line. If n can not be represented as the sum of distinct powerful numbers, print -1 . Otherwise, print a single positive integer -- the minimum possible value of k . In the first test case, 7 can be represented as 7=1+6 , where 1 and 6 are powerful numbers. Because 7 is not a powerful number, we know that the minimum possible value of k in this case is k=2 . In the second test case, a possible way to represent 11 as the sum of three powerful numbers is 11=1+4+6 . We can show that there is no way to represent 11 as the sum of two or less powerful numbers. In the third test case, 240 can be represented as 240=24+32+64+120 . Observe that 240=120+120 is not a valid representation, because the powerful numbers have to be distinct. In the fourth test case, 17179869184=2^{34} , so 17179869184 is a powerful number and the minimum k in this case is k=1 . '... |
Codeforces Round #774 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
148377426 | _ManaV_ | C | March 4, 2022, 5:22 p.m. | OK | GNU C++14 | TESTS | 46 | 15 | 0 | 1500 | |
148414705 | tarun_kishore | C | March 5, 2022, 4:09 a.m. | OK | GNU C++14 | TESTS | 46 | 15 | 0 | 1500 | |
148405978 | soleil_ | C | March 5, 2022, 1:21 a.m. | OK | GNU C++14 | TESTS | 46 | 15 | 0 | 1500 | |
148390398 | akshat87001 | C | March 4, 2022, 6:59 p.m. | OK | GNU C++14 | TESTS | 46 | 15 | 0 | 1500 | |
148379506 | killer_queen4804 | C | March 4, 2022, 5:27 p.m. | OK | GNU C++14 | TESTS | 46 | 15 | 204800 | 1500 | |
148422848 | Sadid_005 | C | March 5, 2022, 5:46 a.m. | OK | GNU C++14 | TESTS | 46 | 15 | 204800 | 1500 | |
148414581 | therehello | C | March 5, 2022, 4:07 a.m. | OK | GNU C++14 | TESTS | 46 | 15 | 204800 | 1500 | |
148388672 | hackerakhil | C | March 4, 2022, 6:43 p.m. | OK | GNU C++14 | TESTS | 46 | 15 | 307200 | 1500 | |
148390809 | HariCharan_1010 | C | March 4, 2022, 7:03 p.m. | OK | GNU C++14 | TESTS | 46 | 15 | 409600 | 1500 | |
148401399 | mukuldixit2782 | C | March 4, 2022, 10:05 p.m. | OK | GNU C++14 | TESTS | 46 | 15 | 512000 | 1500 | |
148377116 | freeDog__wy | C | March 4, 2022, 5:21 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148401646 | MohamedTaha | C | March 4, 2022, 10:13 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148399194 | ayushgaba71 | C | March 4, 2022, 9:09 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148395967 | Lightning_McQueen13 | C | March 4, 2022, 8:09 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148395910 | Anandabhi04 | C | March 4, 2022, 8:08 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148395311 | natanvent | C | March 4, 2022, 7:59 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148388781 | garvitvirmani | C | March 4, 2022, 6:44 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148386775 | FranciS1111 | C | March 4, 2022, 6:31 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148386585 | _Bucky | C | March 4, 2022, 6:29 p.m. | OK | GNU C++17 | TESTS | 46 | 15 | 0 | 1500 | |
148418004 | Mr.Gautam | C | March 5, 2022, 4:52 a.m. | OK | GNU C++17 | TESTS | 46 | 15 | 102400 | 1500 | |
148406021 | niao_v | C | March 5, 2022, 1:22 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148416665 | asawa.harsh | C | March 5, 2022, 4:36 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148395601 | sweetpotato2 | C | March 4, 2022, 8:03 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 102400 | 1500 | |
148385835 | jakao | C | March 4, 2022, 6:24 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 102400 | 1500 | |
148398764 | Shivansh0809 | C | March 4, 2022, 8:59 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 102400 | 1500 | |
148423539 | GudeGude | C | March 5, 2022, 5:52 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 307200 | 1500 | |
148396413 | llc5pg | C | March 4, 2022, 8:17 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 512000 | 1500 | |
148389212 | jb_2402 | C | March 4, 2022, 6:48 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 512000 | 1500 | |
148388277 | prasantkpatel | C | March 4, 2022, 6:40 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 512000 | 1500 | |
148410482 | codeknight_33 | C | March 5, 2022, 2:55 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 15 | 1126400 | 1500 | |
148401121 | Abugozah | C | March 4, 2022, 9:57 p.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148394285 | Adhom | C | March 4, 2022, 7:46 p.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148389054 | karan_ug | C | March 4, 2022, 6:47 p.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148417073 | navneetk0897 | C | March 5, 2022, 4:41 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148415669 | Ashish_Coder6 | C | March 5, 2022, 4:23 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148413409 | wumbus | C | March 5, 2022, 3:47 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148410895 | um_op | C | March 5, 2022, 3:03 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148407779 | generic_placeholder_name | C | March 5, 2022, 2:02 a.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148403068 | codificador10 | C | March 4, 2022, 11:25 p.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148401868 | bernborgess | C | March 4, 2022, 10:20 p.m. | OK | GNU C++20 (64) | TESTS | 46 | 15 | 0 | 1500 | |
148402120 | koqo | C | March 4, 2022, 10:29 p.m. | OK | Go | TESTS | 46 | 109 | 4710400 | 1500 | |
148401926 | koqo | C | March 4, 2022, 10:22 p.m. | OK | Go | TESTS | 46 | 155 | 4710400 | 1500 | |
148411938 | gawsfbet | C | March 5, 2022, 3:22 a.m. | OK | Java 11 | TESTS | 46 | 186 | 0 | 1500 | |
148424337 | Shady_X | C | March 5, 2022, 6 a.m. | OK | Java 11 | TESTS | 46 | 202 | 0 | 1500 | |
148387403 | vermadv2000 | C | March 4, 2022, 6:35 p.m. | OK | Java 11 | TESTS | 46 | 202 | 0 | 1500 | |
148398683 | tataopop | C | March 4, 2022, 8:58 p.m. | OK | Java 11 | TESTS | 46 | 218 | 0 | 1500 | |
148412439 | Wuya | C | March 5, 2022, 3:29 a.m. | OK | Java 11 | TESTS | 46 | 218 | 0 | 1500 | |
148411106 | sahilsinghzx77 | C | March 5, 2022, 3:07 a.m. | OK | Java 11 | TESTS | 46 | 218 | 0 | 1500 | |
148421223 | meteoLdrago | C | March 5, 2022, 5:29 a.m. | OK | Java 11 | TESTS | 46 | 249 | 0 | 1500 | |
148387329 | eshan18.09 | C | March 4, 2022, 6:34 p.m. | OK | Java 11 | TESTS | 46 | 280 | 0 | 1500 | |
148421131 | __Serendipity | C | March 5, 2022, 5:28 a.m. | OK | Java 11 | TESTS | 46 | 311 | 0 | 1500 | |
148421523 | __Serendipity | C | March 5, 2022, 5:32 a.m. | OK | Java 11 | TESTS | 46 | 327 | 0 | 1500 | |
148388951 | ak_ankit | C | March 4, 2022, 6:46 p.m. | OK | Java 8 | TESTS | 46 | 108 | 0 | 1500 | |
148398755 | adi_daredevil | C | March 4, 2022, 8:59 p.m. | OK | Java 8 | TESTS | 46 | 155 | 0 | 1500 | |
148420133 | Swapniltri | C | March 5, 2022, 5:17 a.m. | OK | Java 8 | TESTS | 46 | 171 | 0 | 1500 | |
148383095 | cuzynot | C | March 4, 2022, 5:34 p.m. | OK | Java 8 | TESTS | 46 | 171 | 0 | 1500 | |
148404524 | sreeprasad | C | March 5, 2022, 12:32 a.m. | OK | Java 8 | TESTS | 46 | 186 | 0 | 1500 | |
148421728 | kishan963 | C | March 5, 2022, 5:34 a.m. | OK | Java 8 | TESTS | 46 | 233 | 4812800 | 1500 | |
148411514 | KingOfLiu | C | March 5, 2022, 3:14 a.m. | OK | Java 8 | TESTS | 46 | 249 | 0 | 1500 | |
148404593 | sreeprasad | C | March 5, 2022, 12:35 a.m. | OK | Java 8 | TESTS | 46 | 327 | 0 | 1500 | |
148415972 | fyseus | C | March 5, 2022, 4:27 a.m. | OK | Java 8 | TESTS | 46 | 342 | 0 | 1500 | |
148420893 | SainiAayush | C | March 5, 2022, 5:26 a.m. | OK | Java 8 | TESTS | 46 | 343 | 0 | 1500 | |
148393868 | PavelChadnov | C | March 4, 2022, 7:41 p.m. | OK | Kotlin 1.4 | TESTS | 46 | 1762 | 0 | 1500 | |
148422951 | 996007 | C | March 5, 2022, 5:47 a.m. | OK | MS C++ 2017 | TESTS | 46 | 109 | 0 | 1500 | |
148382711 | dandb | C | March 4, 2022, 5:33 p.m. | OK | MS C++ 2017 | TESTS | 46 | 390 | 0 | 1500 | |
148423946 | shuitishashou | C | March 5, 2022, 5:56 a.m. | OK | MS C++ 2017 | TESTS | 46 | 1029 | 0 | 1500 | |
148390065 | Weylyn | C | March 4, 2022, 6:55 p.m. | OK | .NET Core C# | TESTS | 46 | 93 | 0 | 1500 | |
148388071 | fme | C | March 4, 2022, 6:39 p.m. | OK | PyPy 2 | TESTS | 46 | 748 | 8192000 | 1500 | |
148409846 | NIU_MA | C | March 5, 2022, 2:42 a.m. | OK | PyPy 3 | TESTS | 46 | 451 | 3686400 | 1500 | |
148409793 | NIU_MA2.0 | C | March 5, 2022, 2:41 a.m. | OK | PyPy 3 | TESTS | 46 | 451 | 3686400 | 1500 | |
148376537 | sw_enthusiast | C | March 4, 2022, 5:19 p.m. | OK | PyPy 3 | TESTS | 46 | 451 | 70553600 | 1500 | |
148423193 | JIRAIYA_Sama | C | March 5, 2022, 5:49 a.m. | OK | PyPy 3 | TESTS | 46 | 468 | 13619200 | 1500 | |
148397079 | GuptaSir | C | March 4, 2022, 8:28 p.m. | OK | PyPy 3 | TESTS | 46 | 483 | 6348800 | 1500 | |
148386531 | binarybeast880 | C | March 4, 2022, 6:29 p.m. | OK | PyPy 3 | TESTS | 46 | 623 | 5017600 | 1500 | |
148415724 | ambs_ | C | March 5, 2022, 4:24 a.m. | OK | PyPy 3 | TESTS | 46 | 935 | 10752000 | 1500 | |
148416077 | ambs_ | C | March 5, 2022, 4:29 a.m. | OK | PyPy 3 | TESTS | 46 | 936 | 10752000 | 1500 | |
148401956 | kazamasmile | C | March 4, 2022, 10:23 p.m. | OK | PyPy 3 | TESTS | 46 | 1076 | 9420800 | 1500 | |
148378028 | kazamasmile | C | March 4, 2022, 5:23 p.m. | OK | PyPy 3 | TESTS | 46 | 1153 | 10956800 | 1500 | |
148385674 | IkshitG | C | March 4, 2022, 6:24 p.m. | OK | PyPy 3-64 | TESTS | 46 | 124 | 4608000 | 1500 | |
148424380 | echoeureka | C | March 5, 2022, 6 a.m. | OK | PyPy 3-64 | TESTS | 46 | 233 | 5632000 | 1500 | |
148379375 | hydthemoon | C | March 4, 2022, 5:26 p.m. | OK | PyPy 3-64 | TESTS | 46 | 265 | 9625600 | 1500 | |
148376848 | Invinc3 | C | March 4, 2022, 5:20 p.m. | OK | PyPy 3-64 | TESTS | 46 | 358 | 7884800 | 1500 | |
148381877 | vilhelmthorsson | C | March 4, 2022, 5:32 p.m. | OK | PyPy 3-64 | TESTS | 46 | 373 | 7680000 | 1500 | |
148395959 | _icy_ | C | March 4, 2022, 8:09 p.m. | OK | PyPy 3-64 | TESTS | 46 | 374 | 4608000 | 1500 | |
148423398 | thevaibhavdixit | C | March 5, 2022, 5:51 a.m. | OK | PyPy 3-64 | TESTS | 46 | 374 | 20684800 | 1500 | |
148413976 | H-T-J | C | March 5, 2022, 3:57 a.m. | OK | PyPy 3-64 | TESTS | 46 | 436 | 5632000 | 1500 | |
148394633 | bpdolson | C | March 4, 2022, 7:51 p.m. | OK | PyPy 3-64 | TESTS | 46 | 483 | 12390400 | 1500 | |
148396618 | neofetch | C | March 4, 2022, 8:20 p.m. | OK | PyPy 3-64 | TESTS | 46 | 514 | 8908800 | 1500 | |
148386130 | Jimanbanashi | C | March 4, 2022, 6:27 p.m. | OK | Python 2 | TESTS | 46 | 467 | 0 | 1500 | |
148401467 | NenadDapic | C | March 4, 2022, 10:08 p.m. | OK | Python 3 | TESTS | 46 | 592 | 102400 | 1500 | |
148395664 | Viper35 | C | March 4, 2022, 8:04 p.m. | OK | Python 3 | TESTS | 46 | 1840 | 204800 | 1500 | |
148379536 | AktanTursunbaev | C | March 4, 2022, 5:27 p.m. | OK | Python 3 | TESTS | 46 | 2323 | 921600 | 1500 | |
148385683 | amarbudhiraja | C | March 4, 2022, 6:24 p.m. | OK | Python 3 | TESTS | 46 | 2558 | 3993600 | 1500 | |
148379617 | SirJackSparrow | C | March 4, 2022, 5:27 p.m. | OK | Python 3 | TESTS | 46 | 2713 | 204800 | 1500 | |
148423152 | woodsman | C | March 5, 2022, 5:48 a.m. | OK | Python 3 | TESTS | 46 | 2776 | 0 | 1500 | |
148396511 | Anton.Rykachevskiy | C | March 4, 2022, 8:18 p.m. | OK | Python 3 | TESTS | 46 | 2823 | 0 | 1500 |
Back to search problems