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 |
---|---|---|---|---|---|---|
1617 | Codeforces Round 761 (Div. 2) | FINISHED | False | 7200 | 97604663 | Dec. 16, 2021, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 15220 ) | C | Paprika and Permutation | PROGRAMMING | greedy math |
B'Paprika loves permutations. She has an array a_1, a_2, ... , a_n . She wants to make the array a permutation of integers 1 to n . In order to achieve this goal, she can perform operations on the array. In each operation she can choose two integers i ( 1 <= i <= n ) and x ( x > 0 ), then perform a_i := a_i bmod x (that is, replace a_i by the remainder of a_i divided by x ). In different operations, the chosen i and x can be different. Determine the minimum number of operations needed to make the array a permutation of integers 1 to n . If it is impossible, output -1 . A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array) and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains an integer n ( 1 <= n <= 10^5 ). The second line of each test case contains n integers a_1, a_2, ... , a_n . ( 1 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output the minimum number of operations needed to make the array a permutation of integers 1 to n , or -1 if it is impossible. For the first test, the only possible sequence of operations which minimizes the number of operations is: For the second test, it is impossible to obtain a permutation of integers from 1 to n . '... |
Editorial for Codeforces Round #761 (Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
139567169 | gxlois | C | Dec. 16, 2021, 6:34 p.m. | OK | D | TESTS | 35 | 78 | 4198400 | ||
139600867 | Mrgglock | C | Dec. 17, 2021, 5:22 a.m. | OK | GNU C11 | TESTS | 35 | 77 | 512000 | ||
139550317 | Zollo757347 | C | Dec. 16, 2021, 4:06 p.m. | OK | GNU C11 | TESTS | 35 | 78 | 1228800 | ||
139592584 | anixai | C | Dec. 17, 2021, 2:39 a.m. | OK | GNU C++14 | TESTS | 35 | 62 | 409600 | ||
139559051 | TempHas | C | Dec. 16, 2021, 5:07 p.m. | OK | GNU C++14 | TESTS | 35 | 62 | 716800 | ||
139598725 | _Fake4Fun | C | Dec. 17, 2021, 4:48 a.m. | OK | GNU C++14 | TESTS | 35 | 62 | 716800 | ||
139593644 | Echoyyy | C | Dec. 17, 2021, 3:06 a.m. | OK | GNU C++14 | TESTS | 35 | 62 | 921600 | ||
139558092 | TempHas | C | Dec. 16, 2021, 4:59 p.m. | OK | GNU C++14 | TESTS | 35 | 62 | 1228800 | ||
139601232 | ManharGupta | C | Dec. 17, 2021, 5:28 a.m. | OK | GNU C++14 | TESTS | 35 | 62 | 1331200 | ||
139557019 | Electron | C | Dec. 16, 2021, 4:49 p.m. | OK | GNU C++14 | TESTS | 35 | 62 | 1331200 | ||
139601113 | kunalbabbar2843 | C | Dec. 17, 2021, 5:26 a.m. | OK | GNU C++14 | TESTS | 35 | 62 | 2048000 | ||
139600148 | Truro07 | C | Dec. 17, 2021, 5:11 a.m. | OK | GNU C++14 | TESTS | 35 | 62 | 2560000 | ||
139558915 | TempHas | C | Dec. 16, 2021, 5:06 p.m. | OK | GNU C++14 | TESTS | 35 | 77 | 614400 | ||
139549888 | guytan | C | Dec. 16, 2021, 4:04 p.m. | OK | GNU C++17 | TESTS | 35 | 62 | 409600 | ||
139559581 | _Tima___ | C | Dec. 16, 2021, 5:12 p.m. | OK | GNU C++17 | TESTS | 35 | 62 | 614400 | ||
139558402 | phthuCL | C | Dec. 16, 2021, 5:01 p.m. | OK | GNU C++17 | TESTS | 35 | 62 | 614400 | ||
139594013 | tanvir03 | C | Dec. 17, 2021, 3:15 a.m. | OK | GNU C++17 | TESTS | 35 | 62 | 614400 | ||
139595912 | Longqiang | C | Dec. 17, 2021, 3:57 a.m. | OK | GNU C++17 | TESTS | 35 | 62 | 614400 | ||
139593328 | emofunc | C | Dec. 17, 2021, 2:59 a.m. | OK | GNU C++17 | TESTS | 35 | 62 | 819200 | ||
139568218 | rupam66 | C | Dec. 16, 2021, 6:47 p.m. | OK | GNU C++17 | TESTS | 35 | 62 | 921600 | ||
139568962 | abaabaxxx | C | Dec. 16, 2021, 6:57 p.m. | OK | GNU C++17 | TESTS | 35 | 62 | 921600 | ||
139575547 | Esraa_Taha309 | C | Dec. 16, 2021, 8:41 p.m. | OK | GNU C++17 | TESTS | 35 | 62 | 921600 | ||
139595751 | engager | C | Dec. 17, 2021, 3:54 a.m. | OK | GNU C++17 | TESTS | 35 | 62 | 1024000 | ||
139551300 | AndreyPoyarkov | C | Dec. 16, 2021, 4:10 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 614400 | ||
139562380 | AbdalrhmanEssam | C | Dec. 16, 2021, 5:41 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 819200 | ||
139575167 | mesbah19 | C | Dec. 16, 2021, 8:34 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 1024000 | ||
139601740 | jigsaw_20 | C | Dec. 17, 2021, 5:36 a.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 1331200 | ||
139554843 | samcpp | C | Dec. 16, 2021, 4:32 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 1638400 | ||
139579117 | BrayanD | C | Dec. 16, 2021, 10:16 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 1638400 | ||
139575825 | jt.cheng26_orz | C | Dec. 16, 2021, 8:48 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 46 | 2764800 | ||
139601545 | Ripiaun | C | Dec. 17, 2021, 5:34 a.m. | OK | GNU C++17 (64) | TESTS | 35 | 61 | 819200 | ||
139591914 | froggyzhang | C | Dec. 17, 2021, 2:21 a.m. | OK | GNU C++17 (64) | TESTS | 35 | 61 | 921600 | ||
139557218 | Porag_2742 | C | Dec. 16, 2021, 4:50 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 61 | 1024000 | ||
139551682 | Rom_Bog | C | Dec. 16, 2021, 4:13 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 31 | 1228800 | ||
139552059 | generic_placeholder_name | C | Dec. 16, 2021, 4:15 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 31 | 1228800 | ||
139559919 | TempHas | C | Dec. 16, 2021, 5:16 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 614400 | ||
139559584 | TempHas | C | Dec. 16, 2021, 5:12 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 614400 | ||
139574836 | Hamed5001 | C | Dec. 16, 2021, 8:27 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 614400 | ||
139574820 | Hamed5001 | C | Dec. 16, 2021, 8:27 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 614400 | ||
139569911 | Mahdi_ | C | Dec. 16, 2021, 7:11 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 716800 | ||
139589499 | BaoJiaoPisu | C | Dec. 17, 2021, 1:01 a.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 819200 | ||
139551514 | DreamingLeaf | C | Dec. 16, 2021, 4:12 p.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 921600 | ||
139600526 | Demotivated | C | Dec. 17, 2021, 5:17 a.m. | OK | GNU C++20 (64) | TESTS | 35 | 46 | 921600 | ||
139547759 | theanmolsharma | C | Dec. 16, 2021, 3:34 p.m. | OK | Java 11 | TESTS | 35 | 217 | 0 | ||
139563208 | suhas5979 | C | Dec. 16, 2021, 5:50 p.m. | OK | Java 11 | TESTS | 35 | 249 | 0 | ||
139554523 | Tourist_ka_baap777 | C | Dec. 16, 2021, 4:30 p.m. | OK | Java 11 | TESTS | 35 | 265 | 0 | ||
139551730 | sumitchavan | C | Dec. 16, 2021, 4:13 p.m. | OK | Java 11 | TESTS | 35 | 265 | 0 | ||
139602832 | yaminote | C | Dec. 17, 2021, 5:52 a.m. | OK | Java 11 | TESTS | 35 | 280 | 0 | ||
139551392 | sumitchavan | C | Dec. 16, 2021, 4:11 p.m. | OK | Java 11 | TESTS | 35 | 280 | 0 | ||
139554561 | the_unseen | C | Dec. 16, 2021, 4:31 p.m. | OK | Java 11 | TESTS | 35 | 295 | 0 | ||
139566559 | tushar19280 | C | Dec. 16, 2021, 6:27 p.m. | OK | Java 11 | TESTS | 35 | 296 | 409600 | ||
139549560 | KANUDO | C | Dec. 16, 2021, 4:03 p.m. | OK | Java 11 | TESTS | 35 | 311 | 0 | ||
139589319 | Satyaa | C | Dec. 17, 2021, 12:55 a.m. | OK | Java 11 | TESTS | 35 | 311 | 102400 | ||
139594328 | 201502010200 | C | Dec. 17, 2021, 3:22 a.m. | OK | Java 8 | TESTS | 35 | 171 | 0 | ||
139562640 | tanishq044 | C | Dec. 16, 2021, 5:44 p.m. | OK | Java 8 | TESTS | 35 | 202 | 3584000 | ||
139566575 | guru1603 | C | Dec. 16, 2021, 6:27 p.m. | OK | Java 8 | TESTS | 35 | 218 | 0 | ||
139558348 | sanjayram21 | C | Dec. 16, 2021, 5:01 p.m. | OK | Java 8 | TESTS | 35 | 233 | 0 | ||
139551744 | 666kevin666 | C | Dec. 16, 2021, 4:13 p.m. | OK | Java 8 | TESTS | 35 | 233 | 614400 | ||
139562581 | golions | C | Dec. 16, 2021, 5:43 p.m. | OK | Java 8 | TESTS | 35 | 249 | 0 | ||
139562601 | C_P_T_N | C | Dec. 16, 2021, 5:43 p.m. | OK | Java 8 | TESTS | 35 | 264 | 921600 | ||
139551539 | huhansan | C | Dec. 16, 2021, 4:12 p.m. | OK | Java 8 | TESTS | 35 | 311 | 307200 | ||
139546462 | Swapniltri | C | Dec. 16, 2021, 3:33 p.m. | OK | Java 8 | TESTS | 35 | 312 | 6758400 | ||
139602937 | solo07 | C | Dec. 17, 2021, 5:54 a.m. | OK | Java 8 | TESTS | 35 | 327 | 3072000 | ||
139549825 | wuchaojie1097 | C | Dec. 16, 2021, 4:04 p.m. | OK | Kotlin 1.4 | TESTS | 35 | 561 | 10444800 | ||
139549515 | BruteForcee | C | Dec. 16, 2021, 4:03 p.m. | OK | Kotlin 1.5 | TESTS | 35 | 404 | 5939200 | ||
139589417 | Shuai. | C | Dec. 17, 2021, 12:58 a.m. | OK | MS C++ 2017 | TESTS | 35 | 171 | 921600 | ||
139574387 | 13coder | C | Dec. 16, 2021, 8:19 p.m. | OK | MS C++ 2017 | TESTS | 35 | 186 | 819200 | ||
139549591 | no_ac_no_sleep | C | Dec. 16, 2021, 4:03 p.m. | OK | MS C++ 2017 | TESTS | 35 | 202 | 1228800 | ||
139592912 | XianztsZhong | C | Dec. 17, 2021, 2:48 a.m. | OK | MS C++ 2017 | TESTS | 35 | 202 | 1638400 | ||
139549342 | sgly33 | C | Dec. 16, 2021, 4:02 p.m. | OK | MS C++ 2017 | TESTS | 35 | 202 | 2457600 | ||
139593648 | A_Pier | C | Dec. 17, 2021, 3:06 a.m. | OK | MS C++ 2017 | TESTS | 35 | 233 | 2150400 | ||
139578053 | IvanRozb | C | Dec. 16, 2021, 9:42 p.m. | OK | MS C++ 2017 | TESTS | 35 | 280 | 4300800 | ||
139560320 | Tangerine | C | Dec. 16, 2021, 5:19 p.m. | OK | MS C++ 2017 | TESTS | 35 | 296 | 6860800 | ||
139563475 | aman_xoxo | C | Dec. 16, 2021, 5:53 p.m. | OK | PyPy 3 | TESTS | 35 | 170 | 14950400 | ||
139575534 | KanishkGoel | C | Dec. 16, 2021, 8:41 p.m. | OK | PyPy 3 | TESTS | 35 | 171 | 14643200 | ||
139549617 | charizard07 | C | Dec. 16, 2021, 4:03 p.m. | OK | PyPy 3 | TESTS | 35 | 218 | 14131200 | ||
139551397 | MILOY | C | Dec. 16, 2021, 4:11 p.m. | OK | PyPy 3 | TESTS | 35 | 296 | 21299200 | ||
139558385 | nezzd | C | Dec. 16, 2021, 5:01 p.m. | OK | PyPy 3 | TESTS | 35 | 311 | 16896000 | ||
139553679 | Bambam_Shivam | C | Dec. 16, 2021, 4:25 p.m. | OK | PyPy 3 | TESTS | 35 | 358 | 18739200 | ||
139555459 | KA_Rma | C | Dec. 16, 2021, 4:36 p.m. | OK | PyPy 3 | TESTS | 35 | 358 | 26726400 | ||
139590197 | ps_12 | C | Dec. 17, 2021, 1:27 a.m. | OK | PyPy 3 | TESTS | 35 | 374 | 16486400 | ||
139545221 | hash1023 | C | Dec. 16, 2021, 3:31 p.m. | OK | PyPy 3 | TESTS | 35 | 374 | 22630400 | ||
139546833 | anubhabcodes | C | Dec. 16, 2021, 3:33 p.m. | OK | PyPy 3 | TESTS | 35 | 483 | 18329600 | ||
139566690 | bjy | C | Dec. 16, 2021, 6:29 p.m. | OK | PyPy 3-64 | TESTS | 35 | 249 | 19353600 | ||
139603106 | p_r_a_n_a_v | C | Dec. 17, 2021, 5:56 a.m. | OK | PyPy 3-64 | TESTS | 35 | 249 | 24064000 | ||
139562965 | ossau_guildo | C | Dec. 16, 2021, 5:47 p.m. | OK | PyPy 3-64 | TESTS | 35 | 264 | 15974400 | ||
139565978 | bjy | C | Dec. 16, 2021, 6:21 p.m. | OK | PyPy 3-64 | TESTS | 35 | 265 | 16076800 | ||
139556762 | bjy | C | Dec. 16, 2021, 4:47 p.m. | OK | PyPy 3-64 | TESTS | 35 | 296 | 19148800 | ||
139558692 | mesa3993 | C | Dec. 16, 2021, 5:04 p.m. | OK | PyPy 3-64 | TESTS | 35 | 343 | 17408000 | ||
139552651 | pedastrian57 | C | Dec. 16, 2021, 4:18 p.m. | OK | PyPy 3-64 | TESTS | 35 | 358 | 146329600 | ||
139573956 | fixe.fun | C | Dec. 16, 2021, 8:11 p.m. | OK | PyPy 3-64 | TESTS | 35 | 436 | 22118400 | ||
139550925 | sarthak_bharadwaj_ | C | Dec. 16, 2021, 4:09 p.m. | OK | PyPy 3-64 | TESTS | 35 | 436 | 23552000 | ||
139565702 | asady529 | C | Dec. 16, 2021, 6:18 p.m. | OK | PyPy 3-64 | TESTS | 35 | 436 | 24985600 | ||
139558148 | NS3081992 | C | Dec. 16, 2021, 4:59 p.m. | OK | Python 3 | TESTS | 35 | 265 | 10444800 | ||
139576139 | Liberator187 | C | Dec. 16, 2021, 8:55 p.m. | OK | Python 3 | TESTS | 35 | 265 | 11571200 | ||
139556290 | NS3081992 | C | Dec. 16, 2021, 4:43 p.m. | OK | Python 3 | TESTS | 35 | 280 | 11366400 | ||
139559974 | juliusnovachrono | C | Dec. 16, 2021, 5:16 p.m. | OK | Python 3 | TESTS | 35 | 280 | 12800000 | ||
139549729 | Yusif | C | Dec. 16, 2021, 4:03 p.m. | OK | Python 3 | TESTS | 35 | 296 | 10956800 | ||
139593392 | pragati_1111 | C | Dec. 17, 2021, 3:01 a.m. | OK | Python 3 | TESTS | 35 | 311 | 11366400 | ||
139563197 | ravi_RAVI-123 | C | Dec. 16, 2021, 5:49 p.m. | OK | Python 3 | TESTS | 35 | 311 | 15052800 | ||
139556017 | NS3081992 | C | Dec. 16, 2021, 4:41 p.m. | OK | Python 3 | TESTS | 35 | 327 | 12185600 | ||
139601116 | Ratree | C | Dec. 17, 2021, 5:26 a.m. | OK | Python 3 | TESTS | 35 | 390 | 10137600 | ||
139564371 | mihir111p | C | Dec. 16, 2021, 6:03 p.m. | OK | Python 3 | TESTS | 35 | 420 | 15462400 | ||
139553158 | apilat | C | Dec. 16, 2021, 4:21 p.m. | OK | Rust 2021 | TESTS | 35 | 109 | 5017600 |
Back to search problems