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 |
---|---|---|---|---|---|---|
1712 | Codeforces Round 813 (Div. 2) | FINISHED | False | 8100 | 71421899 | Aug. 13, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 24154 ) | A | Wonderful Permutation | PROGRAMMING | greedy implementation |
B'You are given a permutation p_1,p_2, ldots,p_n of length n and a positive integer k <= n . In one operation you can choose two indices i and j ( 1 <= i < j <= n ) and swap p_i with p_j . Find the minimum number of operations needed to make the sum p_1 + p_2 + ldots + p_k as small as possible. 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 the number of test cases t ( 1 <= t <= 100 ). Description of the test cases follows. The first line of each test case contains two integers n and k ( 1 <= k <= n <= 100 ). The second line of each test case contains n integers p_1,p_2, ldots,p_n ( 1 <= p_i <= n ). It is guaranteed that the given numbers form a permutation of length n . For each test case print one integer -- the minimum number of operations needed to make the sum p_1 + p_2 + ldots + p_k as small as possible. In the first test case, the value of p_1 + p_2 + ldots + p_k is initially equal to 2 , but the smallest possible value is 1 . You can achieve it by swapping p_1 with p_3 , resulting in the permutation [1, 3, 2] . In the second test case, the sum is already as small as possible, so the answer is 0 . '... |
Codeforces Round #813 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
168191888 | cibey | A | Aug. 13, 2022, 6:49 p.m. | OK | C# 10 | TESTS | 7 | 108 | 1126400 | ||
168191158 | j0nimost | A | Aug. 13, 2022, 6:43 p.m. | OK | C# 10 | TESTS | 7 | 140 | 409600 | ||
168212373 | arafamin | A | Aug. 14, 2022, 12:52 a.m. | OK | C# 8 | TESTS | 7 | 77 | 512000 | ||
168214306 | bluemegane | A | Aug. 14, 2022, 1:40 a.m. | OK | C# 8 | TESTS | 7 | 140 | 409600 | ||
168219076 | chunkimonki23 | A | Aug. 14, 2022, 3:21 a.m. | OK | Clang++20 Diagnostics | TESTS | 7 | 61 | 0 | ||
168185622 | shootoon | A | Aug. 13, 2022, 5:58 p.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168198891 | prj11137 | A | Aug. 13, 2022, 8:04 p.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168209000 | Ibrahim.M | A | Aug. 13, 2022, 11:13 p.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168211748 | date3k2 | A | Aug. 14, 2022, 12:34 a.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168217813 | evil_king | A | Aug. 14, 2022, 2:55 a.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168184187 | _Paradox_ | A | Aug. 13, 2022, 5:48 p.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168186997 | Sparsh_Gandhi | A | Aug. 13, 2022, 6:09 p.m. | OK | GNU C11 | TESTS | 7 | 15 | 0 | ||
168173797 | Adi_The_Coder | A | Aug. 13, 2022, 4:37 p.m. | OK | GNU C11 | TESTS | 7 | 31 | 0 | ||
168204395 | snidR | A | Aug. 13, 2022, 9:29 p.m. | OK | GNU C11 | TESTS | 7 | 31 | 0 | ||
168219109 | amit_rcciit | A | Aug. 14, 2022, 3:21 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168217190 | common-person | A | Aug. 14, 2022, 2:41 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168216664 | DeanDZF | A | Aug. 14, 2022, 2:30 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168216289 | wkhyyds | A | Aug. 14, 2022, 2:22 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168215928 | Mercy32101117 | A | Aug. 14, 2022, 2:14 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168214822 | lemon_one | A | Aug. 14, 2022, 1:52 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168225693 | pjccccc | A | Aug. 14, 2022, 5:19 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168223708 | zheng_di1132 | A | Aug. 14, 2022, 4:47 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168222161 | idonthatephy | A | Aug. 14, 2022, 4:19 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168220309 | akashranjan4356 | A | Aug. 14, 2022, 3:44 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | ||
168222141 | mehedihasan10 | A | Aug. 14, 2022, 4:18 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168225329 | kakarotay7 | A | Aug. 14, 2022, 5:13 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168226558 | awfy | A | Aug. 14, 2022, 5:32 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168227343 | jenish_09 | A | Aug. 14, 2022, 5:43 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168227532 | _harsh_upadhayay_ | A | Aug. 14, 2022, 5:45 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168228070 | aseElahi | A | Aug. 14, 2022, 5:53 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168224828 | ashu7166 | A | Aug. 14, 2022, 5:06 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168224793 | segmentfault | A | Aug. 14, 2022, 5:05 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168224459 | kakarotay7 | A | Aug. 14, 2022, 4:59 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168222944 | pryanshu31 | A | Aug. 14, 2022, 4:33 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | ||
168210560 | RetsaZC19 | A | Aug. 13, 2022, 11:58 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168226298 | _Heated_ | A | Aug. 14, 2022, 5:29 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168225661 | invincible_0 | A | Aug. 14, 2022, 5:19 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168223005 | WA_automata | A | Aug. 14, 2022, 4:34 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168222865 | Ahnaf_ | A | Aug. 14, 2022, 4:31 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168215492 | OTTFF | A | Aug. 14, 2022, 2:06 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168213779 | xhgua | A | Aug. 14, 2022, 1:27 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168206178 | Tobotis | A | Aug. 13, 2022, 10:02 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168203181 | Midoriya011 | A | Aug. 13, 2022, 9:09 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168200401 | mesbah19 | A | Aug. 13, 2022, 8:25 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | ||
168225259 | zef.shiron104 | A | Aug. 14, 2022, 5:12 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168225379 | proffl | A | Aug. 14, 2022, 5:14 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168225417 | shravni_code | A | Aug. 14, 2022, 5:15 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168226064 | Sam5 | A | Aug. 14, 2022, 5:25 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168226598 | x44x | A | Aug. 14, 2022, 5:33 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168226673 | BinaryBeast007 | A | Aug. 14, 2022, 5:34 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168226730 | fahimcp495 | A | Aug. 14, 2022, 5:35 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168227696 | nirjhorJU | A | Aug. 14, 2022, 5:48 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168228361 | gunjan_chaudhary | A | Aug. 14, 2022, 5:57 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168228510 | winterfire | A | Aug. 14, 2022, 5:59 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | ||
168219448 | rajneesh.osho | A | Aug. 14, 2022, 3:28 a.m. | OK | Java 11 | TESTS | 7 | 155 | 0 | ||
168216180 | Longgggggggg | A | Aug. 14, 2022, 2:20 a.m. | OK | Java 11 | TESTS | 7 | 155 | 0 | ||
168206732 | a_dev | A | Aug. 13, 2022, 10:14 p.m. | OK | Java 11 | TESTS | 7 | 155 | 0 | ||
168214541 | aditya2024 | A | Aug. 14, 2022, 1:46 a.m. | OK | Java 11 | TESTS | 7 | 156 | 0 | ||
168205867 | mcrash12 | A | Aug. 13, 2022, 9:56 p.m. | OK | Java 11 | TESTS | 7 | 156 | 0 | ||
168224933 | Prime369 | A | Aug. 14, 2022, 5:08 a.m. | OK | Java 11 | TESTS | 7 | 170 | 0 | ||
168228406 | LoudSilence | A | Aug. 14, 2022, 5:58 a.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
168200765 | yudi23 | A | Aug. 13, 2022, 8:30 p.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
168185635 | mcrash12 | A | Aug. 13, 2022, 5:58 p.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
168187509 | uros | A | Aug. 13, 2022, 6:13 p.m. | OK | Java 11 | TESTS | 7 | 186 | 0 | ||
168220697 | 17821147 | A | Aug. 14, 2022, 3:51 a.m. | OK | Java 17 | TESTS | 7 | 171 | 307200 | ||
168193813 | Vrutik_2809 | A | Aug. 13, 2022, 7:06 p.m. | OK | Java 17 | TESTS | 7 | 186 | 512000 | ||
168186506 | Vedant_trivedi | A | Aug. 13, 2022, 6:05 p.m. | OK | Java 17 | TESTS | 7 | 202 | 819200 | ||
168182459 | nurs13 | A | Aug. 13, 2022, 5:38 p.m. | OK | Java 17 | TESTS | 7 | 202 | 819200 | ||
168226341 | bkifhr7 | A | Aug. 14, 2022, 5:29 a.m. | OK | Java 17 | TESTS | 7 | 218 | 102400 | ||
168197645 | hsnalshrawyly56 | A | Aug. 13, 2022, 7:49 p.m. | OK | Java 17 | TESTS | 7 | 218 | 614400 | ||
168171449 | ASmoon_343 | A | Aug. 13, 2022, 4:30 p.m. | OK | Java 17 | TESTS | 7 | 233 | 409600 | ||
168197060 | Donatello2024 | A | Aug. 13, 2022, 7:42 p.m. | OK | Java 17 | TESTS | 7 | 233 | 512000 | ||
168199948 | Affan_007 | A | Aug. 13, 2022, 8:19 p.m. | OK | Java 17 | TESTS | 7 | 264 | 409600 | ||
168223434 | Mggg | A | Aug. 14, 2022, 4:41 a.m. | OK | Java 17 | TESTS | 7 | 295 | 307200 | ||
168211824 | mohamedhassan_c | A | Aug. 14, 2022, 12:36 a.m. | OK | Java 8 | TESTS | 7 | 77 | 0 | ||
168187304 | ak_ankit_ | A | Aug. 13, 2022, 6:11 p.m. | OK | Java 8 | TESTS | 7 | 78 | 0 | ||
168181927 | Mohamed308 | A | Aug. 13, 2022, 5:35 p.m. | OK | Java 8 | TESTS | 7 | 78 | 0 | ||
168197167 | adi_7861 | A | Aug. 13, 2022, 7:43 p.m. | OK | Java 8 | TESTS | 7 | 92 | 0 | ||
168228570 | akarshanand2810 | A | Aug. 14, 2022, 6 a.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | ||
168226329 | Atuer | A | Aug. 14, 2022, 5:29 a.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | ||
168219986 | Mrrahulrc | A | Aug. 14, 2022, 3:38 a.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | ||
168201930 | BishoEzzat | A | Aug. 13, 2022, 8:48 p.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | ||
168201578 | BishoEzzat | A | Aug. 13, 2022, 8:43 p.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | ||
168198936 | Yousef_Badr | A | Aug. 13, 2022, 8:05 p.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | ||
168193696 | Ahmed.Hany2727 | A | Aug. 13, 2022, 7:05 p.m. | OK | Kotlin 1.6 | TESTS | 7 | 156 | 0 | ||
168192515 | bhawani0910 | A | Aug. 13, 2022, 6:55 p.m. | OK | Kotlin 1.6 | TESTS | 7 | 202 | 0 | ||
168227363 | Svetoslav | A | Aug. 14, 2022, 5:43 a.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168207119 | meemZain | A | Aug. 13, 2022, 10:24 p.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168192482 | YoghurtPL | A | Aug. 13, 2022, 6:55 p.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168191468 | shashwat7761 | A | Aug. 13, 2022, 6:46 p.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168182449 | elina_lv | A | Aug. 13, 2022, 5:37 p.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168171838 | Metrakov | A | Aug. 13, 2022, 4:31 p.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168171837 | human_bean | A | Aug. 13, 2022, 4:31 p.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | ||
168216887 | lyqhh88 | A | Aug. 14, 2022, 2:35 a.m. | OK | MS C++ 2017 | TESTS | 7 | 31 | 0 | ||
168190920 | Mohamed_Ragab123321 | A | Aug. 13, 2022, 6:41 p.m. | OK | MS C++ 2017 | TESTS | 7 | 31 | 0 | ||
168185362 | WalrusRamen21 | A | Aug. 13, 2022, 5:56 p.m. | OK | PHP | TESTS | 7 | 31 | 0 | ||
168182254 | 1_2_3_4_5_9 | A | Aug. 13, 2022, 5:36 p.m. | OK | PyPy 2 | TESTS | 7 | 62 | 1024000 | ||
168225242 | hr2565 | A | Aug. 14, 2022, 5:12 a.m. | OK | PyPy 3 | TESTS | 7 | 77 | 1331200 | ||
168188991 | Daniiiiiil | A | Aug. 13, 2022, 6:23 p.m. | OK | PyPy 3 | TESTS | 7 | 77 | 1331200 | ||
168206948 | voicon | A | Aug. 13, 2022, 10:19 p.m. | OK | PyPy 3 | TESTS | 7 | 77 | 1433600 | ||
168185391 | macdod | A | Aug. 13, 2022, 5:57 p.m. | OK | PyPy 3 | TESTS | 7 | 77 | 1536000 | ||
168227558 | rajbunsha | A | Aug. 14, 2022, 5:46 a.m. | OK | PyPy 3 | TESTS | 7 | 93 | 1536000 | ||
168171973 | mrx_2006 | A | Aug. 13, 2022, 4:32 p.m. | OK | PyPy 3 | TESTS | 7 | 108 | 1433600 | ||
168190419 | shriom533 | A | Aug. 13, 2022, 6:36 p.m. | OK | PyPy 3 | TESTS | 7 | 109 | 1331200 | ||
168215872 | kraanzu | A | Aug. 14, 2022, 2:13 a.m. | OK | PyPy 3 | TESTS | 7 | 140 | 67686400 | ||
168228648 | rajeshpenugonda6 | A | Aug. 14, 2022, 6:01 a.m. | OK | PyPy 3 | TESTS | 7 | 249 | 75878400 | ||
168226918 | poornaTheja | A | Aug. 14, 2022, 5:38 a.m. | OK | PyPy 3-64 | TESTS | 7 | 61 | 1740800 | ||
168220834 | chnaveen | A | Aug. 14, 2022, 3:53 a.m. | OK | PyPy 3-64 | TESTS | 7 | 61 | 1740800 | ||
168202904 | edmundjr | A | Aug. 13, 2022, 9:04 p.m. | OK | PyPy 3-64 | TESTS | 7 | 61 | 1740800 | ||
168191890 | mearshnie | A | Aug. 13, 2022, 6:49 p.m. | OK | PyPy 3-64 | TESTS | 7 | 61 | 1843200 | ||
168196956 | abhu.krish59 | A | Aug. 13, 2022, 7:41 p.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 1638400 | ||
168182818 | Glad1ator | A | Aug. 13, 2022, 5:40 p.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 1638400 | ||
168181658 | BobChuckyJoe | A | Aug. 13, 2022, 5:33 p.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 1638400 | ||
168172342 | ayushguptaz | A | Aug. 13, 2022, 4:33 p.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 1638400 | ||
168210764 | blak_dragon | A | Aug. 14, 2022, 12:04 a.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 1740800 | ||
168201674 | Dromo | A | Aug. 13, 2022, 8:44 p.m. | OK | PyPy 3-64 | TESTS | 7 | 62 | 1740800 | ||
168223466 | Yansou | A | Aug. 14, 2022, 4:42 a.m. | OK | Python 3 | TESTS | 7 | 30 | 0 | ||
168198232 | 0.00 | A | Aug. 13, 2022, 7:57 p.m. | OK | Python 3 | TESTS | 7 | 30 | 0 | ||
168227530 | Abh1 | A | Aug. 14, 2022, 5:45 a.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168215180 | incosistent | A | Aug. 14, 2022, 1:59 a.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168205312 | FluFFka | A | Aug. 13, 2022, 9:47 p.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168205005 | elistark | A | Aug. 13, 2022, 9:40 p.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168203911 | pranav_63 | A | Aug. 13, 2022, 9:21 p.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168198634 | Ahmed.I_SundarSTEM | A | Aug. 13, 2022, 8:01 p.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168196472 | 2017331033 | A | Aug. 13, 2022, 7:35 p.m. | OK | Python 3 | TESTS | 7 | 31 | 0 | ||
168196229 | 2017331033 | A | Aug. 13, 2022, 7:32 p.m. | OK | Python 3 | TESTS | 7 | 31 | 0 |
Back to search problems