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 |
---|---|---|---|---|---|---|
1593 | Codeforces Round 748 (Div. 3) | FINISHED | False | 8100 | 97687499 | Oct. 13, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 27638 ) | B | Make it Divisible by 25 | PROGRAMMING | dp greedy math math |
B"It is given a positive integer n . In 1 move, one can select any single digit and remove it (i.e. one selects some position in the number and removes the digit located at this position). The operation cannot be performed if only one digit remains. If the resulting number contains leading zeroes, they are automatically removed. E.g. if one removes from the number 32925 the 3 -rd digit, the resulting number will be 3225 . If one removes from the number 20099050 the first digit, the resulting number will be 99050 (the 2 zeroes going next to the first digit are automatically removed). What is the minimum number of steps to get a number such that it is divisible by 25 and positive? It is guaranteed that, for each n occurring in the input, the answer exists. It is guaranteed that the number n has no leading zeros. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. Each test case consists of one line containing one integer n ( 25 <= n <= 10^{18} ). It is guaranteed that, for each n occurring in the input, the answer exists. It is guaranteed that the number n has no leading zeros. For each test case output on a separate line an integer k ( k ge 0 ) -- the minimum number of steps to get a number such that it is divisible by 25 and positive. In the first test case, it is already given a number divisible by 25 . In the second test case, we can remove the digits 1 , 3 , and 4 to get the number 75 . In the third test case, it's enough to remove the last digit to get the number 325 . In the fourth test case, we can remove the three last digits to get the number 50 . In the fifth test case, it's enough to remove the digits 4 and 7 . "... |
Editorial for Codeforces Round #748 (Div.3) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
131954635 | Arxzoo | B | Oct. 14, 2021, 3:31 p.m. | OK | GNU C11 | TESTS | 3 | 15 | 0 | ||
131966375 | KSUB01 | B | Oct. 14, 2021, 5:43 p.m. | OK | GNU C11 | TESTS | 3 | 46 | 0 | ||
131913186 | H_a_c_kcode_gaurav | B | Oct. 14, 2021, 8:53 a.m. | OK | GNU C11 | TESTS | 3 | 46 | 204800 | ||
131928065 | Lawl | B | Oct. 14, 2021, 11:24 a.m. | OK | GNU C11 | TESTS | 3 | 61 | 0 | ||
131932943 | urvish_pujara | B | Oct. 14, 2021, 12:09 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 0 | ||
131965452 | yogeshiitm | B | Oct. 14, 2021, 5:32 p.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131955194 | janhavi555 | B | Oct. 14, 2021, 3:36 p.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131992972 | Maverick_Spirit | B | Oct. 15, 2021, 4:48 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131951876 | belalelshafei10 | B | Oct. 14, 2021, 3 p.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131951401 | freakin23 | B | Oct. 14, 2021, 2:54 p.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131995697 | predator4hack | B | Oct. 15, 2021, 5:43 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131992158 | SuJiTh_CoDeR | B | Oct. 15, 2021, 4:30 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131985021 | 0wuming0 | B | Oct. 15, 2021, 1:23 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131984837 | Hunkihas | B | Oct. 15, 2021, 1:16 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131982978 | Kiribati233 | B | Oct. 14, 2021, 11:58 p.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
131976690 | aymanr2710 | B | Oct. 14, 2021, 8:29 p.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131973331 | Verman | B | Oct. 14, 2021, 7:25 p.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131970386 | iraklisula | B | Oct. 14, 2021, 6:37 p.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131970336 | ashutosh_0011 | B | Oct. 14, 2021, 6:37 p.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131967130 | NO__IQ | B | Oct. 14, 2021, 5:53 p.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131996486 | Gamma70 | B | Oct. 15, 2021, 5:56 a.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131990862 | Ajdevilliers | B | Oct. 15, 2021, 4:01 a.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131989136 | jainam_sogani | B | Oct. 15, 2021, 3:18 a.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131988872 | PiercingFalcon | B | Oct. 15, 2021, 3:12 a.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131980511 | S_Samchenko | B | Oct. 14, 2021, 10:15 p.m. | OK | GNU C++17 | TESTS | 3 | 0 | 0 | ||
131954727 | raman.js | B | Oct. 14, 2021, 3:32 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131984607 | maxcruickshanks | B | Oct. 15, 2021, 1:08 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131976177 | Ahmadsm2005 | B | Oct. 14, 2021, 8:18 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131971503 | igorfardoc | B | Oct. 14, 2021, 6:54 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131966504 | Bl_dem | B | Oct. 14, 2021, 5:45 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131963044 | Tirth_suthar | B | Oct. 14, 2021, 5:05 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131960178 | MtSaka | B | Oct. 14, 2021, 4:30 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131956496 | kitsune | B | Oct. 14, 2021, 3:50 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131948952 | vikassnwl | B | Oct. 14, 2021, 2:29 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131948928 | aryan57 | B | Oct. 14, 2021, 2:29 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
131913296 | Jepbar_Asgarov | B | Oct. 14, 2021, 8:54 a.m. | OK | Go | TESTS | 3 | 46 | 102400 | ||
131984935 | huangxuepeng | B | Oct. 15, 2021, 1:20 a.m. | OK | Go | TESTS | 3 | 561 | 0 | ||
131922487 | kirndy | B | Oct. 14, 2021, 10:32 a.m. | OK | Haskell | TESTS | 3 | 62 | 0 | ||
131911477 | BestEveryman | B | Oct. 14, 2021, 8:32 a.m. | OK | Java 11 | TESTS | 3 | 171 | 0 | ||
131908855 | vjudge3 | B | Oct. 14, 2021, 8:03 a.m. | OK | Java 11 | TESTS | 3 | 171 | 0 | ||
131908193 | Luminous_ | B | Oct. 14, 2021, 7:56 a.m. | OK | Java 11 | TESTS | 3 | 171 | 0 | ||
131927521 | akshatj07 | B | Oct. 14, 2021, 11:19 a.m. | OK | Java 11 | TESTS | 3 | 202 | 0 | ||
131926112 | ak6494285 | B | Oct. 14, 2021, 11:06 a.m. | OK | Java 11 | TESTS | 3 | 202 | 19046400 | ||
131950388 | sarthakbhatia1061 | B | Oct. 14, 2021, 2:43 p.m. | OK | Java 11 | TESTS | 3 | 217 | 0 | ||
131949565 | sarthakbhatia1061 | B | Oct. 14, 2021, 2:35 p.m. | OK | Java 11 | TESTS | 3 | 217 | 0 | ||
131939700 | Blade9674 | B | Oct. 14, 2021, 1:06 p.m. | OK | Java 11 | TESTS | 3 | 218 | 0 | ||
131964272 | nitin23329 | B | Oct. 14, 2021, 5:20 p.m. | OK | Java 11 | TESTS | 3 | 218 | 0 | ||
131907000 | Sejs16 | B | Oct. 14, 2021, 7:44 a.m. | OK | Java 11 | TESTS | 3 | 234 | 0 | ||
131914729 | Srikanth1777 | B | Oct. 14, 2021, 9:11 a.m. | OK | Java 8 | TESTS | 3 | 78 | 0 | ||
131990659 | suyash.211.sn | B | Oct. 15, 2021, 3:57 a.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131953096 | rohithorchu13 | B | Oct. 14, 2021, 3:14 p.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131949884 | rerererere | B | Oct. 14, 2021, 2:38 p.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131938354 | 201502010200 | B | Oct. 14, 2021, 12:56 p.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131917660 | PRIYANSH_TOMAR | B | Oct. 14, 2021, 9:41 a.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131914762 | Srikanth1777 | B | Oct. 14, 2021, 9:11 a.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131912636 | Srikanth1777 | B | Oct. 14, 2021, 8:48 a.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
131994592 | jaykania | B | Oct. 15, 2021, 5:23 a.m. | OK | Java 8 | TESTS | 3 | 155 | 0 | ||
131936127 | Ad-007 | B | Oct. 14, 2021, 12:37 p.m. | OK | Java 8 | TESTS | 3 | 171 | 0 | ||
131930870 | vjudge4 | B | Oct. 14, 2021, 11:50 a.m. | OK | MS C++ 2017 | TESTS | 3 | 15 | 0 | ||
131960098 | Jonah_Lan | B | Oct. 14, 2021, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 3 | 30 | 0 | ||
131930659 | kirill2000 | B | Oct. 14, 2021, 11:48 a.m. | OK | MS C++ 2017 | TESTS | 3 | 30 | 0 | ||
131928031 | vjudge1 | B | Oct. 14, 2021, 11:23 a.m. | OK | MS C++ 2017 | TESTS | 3 | 31 | 0 | ||
131973862 | Damirca | B | Oct. 14, 2021, 7:35 p.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 0 | ||
131950982 | sasha4 | B | Oct. 14, 2021, 2:49 p.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 0 | ||
131941957 | Wu_Hongyu | B | Oct. 14, 2021, 1:26 p.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 0 | ||
131915542 | didadida | B | Oct. 14, 2021, 9:19 a.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 0 | ||
131945016 | Marchde | B | Oct. 14, 2021, 1:53 p.m. | OK | MS C++ 2017 | TESTS | 3 | 61 | 0 | ||
131904408 | miraitowa2021 | B | Oct. 14, 2021, 7:20 a.m. | OK | MS C++ 2017 | TESTS | 3 | 61 | 0 | ||
131918705 | 1_2_3_4_5_9 | B | Oct. 14, 2021, 9:52 a.m. | OK | PyPy 2 | TESTS | 3 | 139 | 3993600 | ||
131921863 | ShashankZobb | B | Oct. 14, 2021, 10:26 a.m. | OK | PyPy 2 | TESTS | 3 | 140 | 5427200 | ||
131960475 | nhipata | B | Oct. 14, 2021, 4:33 p.m. | OK | PyPy 2 | TESTS | 3 | 264 | 8806400 | ||
131942022 | PhilTheFish | B | Oct. 14, 2021, 1:26 p.m. | OK | PyPy 3 | TESTS | 3 | 140 | 6656000 | ||
131916581 | iimmortal | B | Oct. 14, 2021, 9:29 a.m. | OK | PyPy 3 | TESTS | 3 | 155 | 7475200 | ||
131946722 | lemiao12 | B | Oct. 14, 2021, 2:08 p.m. | OK | PyPy 3 | TESTS | 3 | 156 | 5734400 | ||
131941391 | dutt_shouvik | B | Oct. 14, 2021, 1:21 p.m. | OK | PyPy 3 | TESTS | 3 | 170 | 72294400 | ||
131966402 | VN.Kiet | B | Oct. 14, 2021, 5:44 p.m. | OK | PyPy 3 | TESTS | 3 | 218 | 3788800 | ||
131971870 | AzizFr | B | Oct. 14, 2021, 7 p.m. | OK | PyPy 3 | TESTS | 3 | 233 | 8704000 | ||
131970494 | DimSigi | B | Oct. 14, 2021, 6:39 p.m. | OK | PyPy 3 | TESTS | 3 | 249 | 4915200 | ||
131915260 | raidevashish | B | Oct. 14, 2021, 9:16 a.m. | OK | PyPy 3 | TESTS | 3 | 249 | 9932800 | ||
131978374 | Utkarsh_9 | B | Oct. 14, 2021, 9:10 p.m. | OK | PyPy 3 | TESTS | 3 | 265 | 5324800 | ||
131934497 | mrng | B | Oct. 14, 2021, 12:23 p.m. | OK | PyPy 3 | TESTS | 3 | 280 | 6246400 | ||
131959337 | eugalt | B | Oct. 14, 2021, 4:20 p.m. | OK | Python 3 | TESTS | 3 | 77 | 512000 | ||
131959046 | eugalt | B | Oct. 14, 2021, 4:17 p.m. | OK | Python 3 | TESTS | 3 | 93 | 512000 | ||
131991768 | azu2e12 | B | Oct. 15, 2021, 4:21 a.m. | OK | Python 3 | TESTS | 3 | 124 | 0 | ||
131981982 | Simeon_Gor | B | Oct. 14, 2021, 11:09 p.m. | OK | Python 3 | TESTS | 3 | 124 | 0 | ||
131961294 | Amit26aug | B | Oct. 14, 2021, 4:43 p.m. | OK | Python 3 | TESTS | 3 | 139 | 0 | ||
131951854 | Nandu1234 | B | Oct. 14, 2021, 3 p.m. | OK | Python 3 | TESTS | 3 | 139 | 0 | ||
131961074 | Abhay_-_-_-kumar | B | Oct. 14, 2021, 4:40 p.m. | OK | Python 3 | TESTS | 3 | 155 | 0 | ||
131948960 | slskrish1998 | B | Oct. 14, 2021, 2:29 p.m. | OK | Python 3 | TESTS | 3 | 155 | 0 | ||
131929703 | soumya_16_09 | B | Oct. 14, 2021, 11:39 a.m. | OK | Python 3 | TESTS | 3 | 171 | 0 | ||
131924619 | alexb007 | B | Oct. 14, 2021, 10:53 a.m. | OK | Python 3 | TESTS | 3 | 171 | 0 | ||
131925505 | Spheniscine | B | Oct. 14, 2021, 11:01 a.m. | OK | Rust | TESTS | 3 | 15 | 102400 | ||
131915203 | Swordelf | B | Oct. 14, 2021, 9:16 a.m. | OK | Rust | TESTS | 3 | 31 | 0 |
Back to search problems