Codeforces Round 598 (Div. 3)

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
1256 Codeforces Round 598 (Div. 3) FINISHED False 7200 158949899 Nov. 4, 2019, 1:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13134 ) B Minimize the Permutation PROGRAMMING greedy 1400

B"You are given a permutation of length n . Recall that the 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). You can perform at most n-1 operations with the given permutation (it is possible that you don't perform any operations at all). The i -th operation allows you to swap elements of the given permutation on positions i and i+1 . Each operation can be performed at most once. The operations can be performed in arbitrary order. Your task is to find the lexicographically minimum possible permutation obtained by performing some of the given operations in some order. You can see the definition of the lexicographical order in the notes section. You have to answer q independent test cases. For example, let's consider the permutation [5, 4, 1, 3, 2] . The minimum possible permutation we can obtain is [1, 5, 2, 4, 3] and we can do it in the following way: Another example is [1, 2, 4, 3] . The minimum possible permutation we can obtain is [1, 2, 3, 4] by performing the third operation (swap the third and the fourth elements). The first line of the input contains one integer q ( 1 <= q <= 100 ) -- the number of test cases. Then q test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 100 ) -- the number of elements in the permutation. The second line of the test case contains n distinct integers from 1 to n -- the given permutation. For each test case, print the answer on it -- the lexicograhically minimum possible permutation obtained by performing some of the given operations in some order. Recall that the permutation p of length n is lex"...

Tutorials

Codeforces Round #598 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66308066 carbocation B Dec. 5, 2019, 10:17 a.m. OK Clang++17 Diagnostics TESTS 6 61 0 1400
65743561 rahul5720 B Nov. 26, 2019, 11:20 a.m. OK Clang++17 Diagnostics TESTS 6 93 1024000 1400
64728976 tarun_da19 B Nov. 12, 2019, 7:37 a.m. OK Clang++17 Diagnostics TESTS 6 109 1024000 1400
68491748 ruban B Jan. 10, 2020, 11:57 a.m. OK Delphi TESTS 6 31 27443200 1400
65742123 dfxgfdh B Nov. 26, 2019, 10:44 a.m. OK FPC TESTS 6 46 0 1400
65579376 p3rfect B Nov. 23, 2019, 10:30 a.m. OK FPC TESTS 6 46 0 1400
68491765 ruban B Jan. 10, 2020, 11:57 a.m. OK FPC TESTS 6 46 27443200 1400
65429559 Galina2019Baik B Nov. 20, 2019, 11:40 a.m. OK FPC TESTS 6 61 0 1400
65297494 simoncatcity B Nov. 18, 2019, 12:04 p.m. OK FPC TESTS 6 61 0 1400
65282995 jagdinsky B Nov. 18, 2019, 6:55 a.m. OK GNU C11 TESTS 6 31 0 1400
64538579 jschr B Nov. 8, 2019, 5:47 p.m. OK GNU C11 TESTS 6 31 0 1400
66149212 God_particle B Dec. 1, 2019, 6:06 p.m. OK GNU C11 TESTS 6 46 0 1400
66651697 haitrinh B Dec. 11, 2019, 7:28 p.m. OK GNU C11 TESTS 6 46 0 1400
66663552 RajMaheshwari B Dec. 12, 2019, 5:58 a.m. OK GNU C11 TESTS 6 46 0 1400
66986761 dineshg B Dec. 15, 2019, 6:25 p.m. OK GNU C11 TESTS 6 46 0 1400
67314291 abcd227 B Dec. 21, 2019, 5:08 a.m. OK GNU C11 TESTS 6 46 0 1400
68161144 satya_chaitanya B Jan. 4, 2020, 10:54 a.m. OK GNU C11 TESTS 6 46 0 1400
65734764 -Griffin- B Nov. 26, 2019, 7:12 a.m. OK GNU C11 TESTS 6 46 0 1400
66149095 shaantanu B Dec. 1, 2019, 6:03 p.m. OK GNU C11 TESTS 6 46 0 1400
69939354 vjudge3 B Feb. 1, 2020, 5:33 a.m. OK GNU C++11 TESTS 6 15 0 1400
69840059 sunchuangyu B Jan. 30, 2020, 12:55 p.m. OK GNU C++11 TESTS 6 15 0 1400
69276035 switchpiggy B Jan. 22, 2020, 2:10 a.m. OK GNU C++11 TESTS 6 15 0 1400
69251943 cornivores B Jan. 21, 2020, 2:32 p.m. OK GNU C++11 TESTS 6 15 0 1400
69101898 luogu_bot2 B Jan. 19, 2020, 1:43 p.m. OK GNU C++11 TESTS 6 15 0 1400
69079387 vainprade B Jan. 19, 2020, 5:37 a.m. OK GNU C++11 TESTS 6 15 0 1400
69034855 vjudge5 B Jan. 18, 2020, 8:50 a.m. OK GNU C++11 TESTS 6 15 0 1400
69032205 vjudge3 B Jan. 18, 2020, 8:21 a.m. OK GNU C++11 TESTS 6 15 0 1400
68707289 shixiangyu B Jan. 13, 2020, 11:47 a.m. OK GNU C++11 TESTS 6 15 0 1400
68113837 luogu_bot4 B Jan. 3, 2020, 10:39 a.m. OK GNU C++11 TESTS 6 15 0 1400
69231740 Cannoli B Jan. 21, 2020, 9:46 a.m. OK GNU C++14 TESTS 6 15 0 1400
69651314 AKJ0811 B Jan. 28, 2020, 5:23 a.m. OK GNU C++14 TESTS 6 15 0 1400
69628070 dlz666 B Jan. 27, 2020, 4:23 p.m. OK GNU C++14 TESTS 6 15 0 1400
69534359 ayush_g977 B Jan. 25, 2020, 6:15 p.m. OK GNU C++14 TESTS 6 15 0 1400
69477620 utkarsh7kar B Jan. 24, 2020, 4:41 p.m. OK GNU C++14 TESTS 6 15 0 1400
69268990 AbdelrhmanRafaat B Jan. 21, 2020, 7:54 p.m. OK GNU C++14 TESTS 6 15 0 1400
69197292 akshit B Jan. 20, 2020, 3:20 p.m. OK GNU C++14 TESTS 6 15 0 1400
69195973 pratyush_1605 B Jan. 20, 2020, 2:55 p.m. OK GNU C++14 TESTS 6 15 0 1400
68706293 SMILEJING B Jan. 13, 2020, 11:25 a.m. OK GNU C++14 TESTS 6 15 0 1400
68411000 KhaledFarhat B Jan. 8, 2020, 4:59 p.m. OK GNU C++14 TESTS 6 15 0 1400
69202476 Expert.YashSingh B Jan. 20, 2020, 5 p.m. OK GNU C++17 TESTS 6 15 0 1400
69245648 rsd511 B Jan. 21, 2020, 12:49 p.m. OK GNU C++17 TESTS 6 15 0 1400
69275032 CandidateNextYear B Jan. 22, 2020, 1:15 a.m. OK GNU C++17 TESTS 6 15 0 1400
69729064 Gats B Jan. 29, 2020, 1:04 p.m. OK GNU C++17 TESTS 6 15 0 1400
69796645 sal2 B Jan. 29, 2020, 8:23 p.m. OK GNU C++17 TESTS 6 15 0 1400
69864507 ToooooT B Jan. 30, 2020, 7:48 p.m. OK GNU C++17 TESTS 6 15 0 1400
69918025 felipovysk B Jan. 31, 2020, 5:29 p.m. OK GNU C++17 TESTS 6 15 0 1400
69923892 laron B Jan. 31, 2020, 7:28 p.m. OK GNU C++17 TESTS 6 15 0 1400
69943803 vjudge1 B Feb. 1, 2020, 6:58 a.m. OK GNU C++17 TESTS 6 15 0 1400
69945380 vjudge4 B Feb. 1, 2020, 7:26 a.m. OK GNU C++17 TESTS 6 15 0 1400
66569449 sighduck B Dec. 10, 2019, 2:57 a.m. OK Go TESTS 6 15 0 1400
69275434 amarjeetanand B Jan. 22, 2020, 1:39 a.m. OK Go TESTS 6 31 0 1400
64346511 MiohitoKiri5474 B Nov. 6, 2019, 6:34 a.m. OK Go TESTS 6 62 0 1400
65234943 davisrollman B Nov. 17, 2019, 6:49 a.m. OK Java 11 TESTS 6 156 0 1400
66654705 DATVN B Dec. 11, 2019, 9:27 p.m. OK Java 11 TESTS 6 171 0 1400
68041166 MaxHeap B Jan. 1, 2020, 2:23 p.m. OK Java 11 TESTS 6 186 0 1400
66654151 TheSawan B Dec. 11, 2019, 9:02 p.m. OK Java 11 TESTS 6 186 0 1400
67772440 kukreja-vlk B Dec. 28, 2019, 7:25 a.m. OK Java 11 TESTS 6 187 0 1400
65681794 adityagupta1089 B Nov. 24, 2019, 8:30 p.m. OK Java 11 TESTS 6 187 0 1400
67967716 machhra B Dec. 30, 2019, 1:54 p.m. OK Java 11 TESTS 6 202 0 1400
67791403 ragnar7 B Dec. 28, 2019, 2:49 p.m. OK Java 11 TESTS 6 202 0 1400
66869626 enricogi B Dec. 14, 2019, 1:05 p.m. OK Java 11 TESTS 6 202 0 1400
64324671 IslamTalipovTop B Nov. 5, 2019, 4:51 p.m. OK Java 11 TESTS 6 202 0 1400
64526045 YJq B Nov. 8, 2019, 1:50 p.m. OK Java 8 TESTS 6 93 0 1400
64334652 Amrragab B Nov. 5, 2019, 9:03 p.m. OK Java 8 TESTS 6 93 0 1400
64340120 XsLel B Nov. 6, 2019, 1:54 a.m. OK Java 8 TESTS 6 108 0 1400
68681385 minaezzat B Jan. 12, 2020, 10:33 p.m. OK Java 8 TESTS 6 108 0 1400
66536947 mennafadali B Dec. 9, 2019, 9:59 a.m. OK Java 8 TESTS 6 108 0 1400
64854701 LemonPudding B Nov. 13, 2019, 9:45 p.m. OK Java 8 TESTS 6 108 0 1400
64578269 MubtasimShahriar B Nov. 9, 2019, 11:22 a.m. OK Java 8 TESTS 6 108 0 1400
64509391 sameer_hack B Nov. 8, 2019, 8:15 a.m. OK Java 8 TESTS 6 108 0 1400
64472147 1NVAL1D B Nov. 7, 2019, 1:22 p.m. OK Java 8 TESTS 6 108 0 1400
64315663 sarthakmanna B Nov. 5, 2019, 2:02 p.m. OK Java 8 TESTS 6 108 0 1400
64323666 Spheniscine B Nov. 5, 2019, 4:31 p.m. OK Kotlin TESTS 6 124 512000 1400
64340316 Spheniscine B Nov. 6, 2019, 2:05 a.m. OK Kotlin TESTS 6 140 512000 1400
66019625 Bringoff B Nov. 30, 2019, 6:52 a.m. OK Kotlin TESTS 6 155 204800 1400
64787579 Black_Fregat B Nov. 13, 2019, 9:45 a.m. OK Kotlin TESTS 6 171 1433600 1400
64878164 hloya B Nov. 14, 2019, 10:39 a.m. OK Mono C# TESTS 6 62 1126400 1400
65311758 tomomo2b2 B Nov. 18, 2019, 3:36 p.m. OK Mono C# TESTS 6 62 4710400 1400
65030008 ansergeyg B Nov. 15, 2019, 9:27 a.m. OK Mono C# TESTS 6 77 1024000 1400
64901510 Dimon2305 B Nov. 14, 2019, 7:09 p.m. OK Mono C# TESTS 6 77 5120000 1400
65812731 vjudge4 B Nov. 27, 2019, 9:01 a.m. OK MS C++ TESTS 6 15 0 1400
69945422 vjudge2 B Feb. 1, 2020, 7:27 a.m. OK MS C++ TESTS 6 15 0 1400
65805651 vjudge3 B Nov. 27, 2019, 8:48 a.m. OK MS C++ TESTS 6 15 0 1400
65749238 baoboo B Nov. 26, 2019, 1:24 p.m. OK MS C++ TESTS 6 15 0 1400
64908927 vjudge5 B Nov. 15, 2019, 1:20 a.m. OK MS C++ TESTS 6 15 0 1400
64670332 vjudge1 B Nov. 11, 2019, 5:30 a.m. OK MS C++ TESTS 6 15 0 1400
69250490 vjudge5 B Jan. 21, 2020, 2:07 p.m. OK MS C++ TESTS 6 15 0 1400
69474810 tarattata1 B Jan. 24, 2020, 3:46 p.m. OK MS C++ TESTS 6 15 0 1400
69885122 vjudge2 B Jan. 31, 2020, 7:55 a.m. OK MS C++ TESTS 6 15 0 1400
69937753 vjudge2 B Feb. 1, 2020, 4:52 a.m. OK MS C++ TESTS 6 15 0 1400
65504998 spindisamas B Nov. 21, 2019, 9:32 p.m. OK MS C++ 2017 TESTS 6 15 0 1400
69671407 vjudge3 B Jan. 28, 2020, 1:06 p.m. OK MS C++ 2017 TESTS 6 15 0 1400
66085306 Hokage. B Dec. 1, 2019, 4:07 a.m. OK MS C++ 2017 TESTS 6 15 0 1400
65821280 Max1Mcg B Nov. 27, 2019, 10:39 a.m. OK MS C++ 2017 TESTS 6 15 0 1400
65424808 Daniikk1012 B Nov. 20, 2019, 10:20 a.m. OK MS C++ 2017 TESTS 6 15 0 1400
65418117 YoshinariYoh B Nov. 20, 2019, 7:49 a.m. OK MS C++ 2017 TESTS 6 15 0 1400
64851372 kara4ik B Nov. 13, 2019, 7:47 p.m. OK MS C++ 2017 TESTS 6 15 0 1400
64553329 vjudge3 B Nov. 9, 2019, 1:40 a.m. OK MS C++ 2017 TESTS 6 15 0 1400
64363313 dgtm777 B Nov. 6, 2019, 12:20 p.m. OK MS C++ 2017 TESTS 6 15 0 1400
64311769 2018030402032 B Nov. 5, 2019, 12:58 p.m. OK MS C++ 2017 TESTS 6 15 0 1400
64904486 Tomasz43 B Nov. 14, 2019, 8:44 p.m. OK Node.js TESTS 6 140 4505600 1400
64710128 shivam1420 B Nov. 11, 2019, 6:17 p.m. OK Node.js TESTS 6 155 4096000 1400
64905172 Tomasz43 B Nov. 14, 2019, 9:13 p.m. OK Node.js TESTS 6 156 3993600 1400
64904059 Tomasz43 B Nov. 14, 2019, 8:29 p.m. OK Node.js TESTS 6 171 3993600 1400
66139549 VladimirDes B Dec. 1, 2019, 1:46 p.m. OK PascalABC.NET TESTS 6 373 0 1400
64848296 kiwo B Nov. 13, 2019, 6:26 p.m. OK PyPy 2 TESTS 6 139 819200 1400
64644966 a11b11c11 B Nov. 10, 2019, 2:36 p.m. OK PyPy 2 TESTS 6 249 1433600 1400
65508793 le_michael B Nov. 22, 2019, 1:52 a.m. OK PyPy 2 TESTS 6 280 921600 1400
66249127 Echizen123 B Dec. 3, 2019, 11:21 p.m. OK PyPy 3 TESTS 6 139 2150400 1400
64326541 ayshiff B Nov. 5, 2019, 5:32 p.m. OK PyPy 3 TESTS 6 140 1843200 1400
68299445 nealzane B Jan. 6, 2020, 5:39 a.m. OK PyPy 3 TESTS 6 140 1945600 1400
64899645 kit.shiron B Nov. 14, 2019, 6:16 p.m. OK PyPy 3 TESTS 6 140 1945600 1400
65996118 r_dmv B Nov. 29, 2019, 5:39 p.m. OK PyPy 3 TESTS 6 140 2150400 1400
64848139 kiwo B Nov. 13, 2019, 6:22 p.m. OK PyPy 3 TESTS 6 155 1945600 1400
64847839 kiwo B Nov. 13, 2019, 6:14 p.m. OK PyPy 3 TESTS 6 155 1945600 1400
64665238 renjied B Nov. 11, 2019, 1:27 a.m. OK PyPy 3 TESTS 6 155 1945600 1400
64438602 timothyhorsc B Nov. 7, 2019, 2:54 a.m. OK PyPy 3 TESTS 6 155 2048000 1400
64678226 loalkota B Nov. 11, 2019, 8:56 a.m. OK PyPy 3 TESTS 6 155 2252800 1400
65159724 ngterzis B Nov. 16, 2019, 10:51 a.m. OK Python 3 TESTS 6 93 307200 1400
64729043 Daviddd B Nov. 12, 2019, 7:39 a.m. OK Python 3 TESTS 6 108 0 1400
64716163 blinkRS B Nov. 11, 2019, 10:14 p.m. OK Python 3 TESTS 6 108 0 1400
64662795 Kokoster B Nov. 10, 2019, 10:25 p.m. OK Python 3 TESTS 6 108 0 1400
64320816 Wannagrow B Nov. 5, 2019, 3:35 p.m. OK Python 3 TESTS 6 108 0 1400
64781195 Daviddd B Nov. 13, 2019, 7:11 a.m. OK Python 3 TESTS 6 108 307200 1400
64431621 vitoshacademy B Nov. 6, 2019, 9:39 p.m. OK Python 3 TESTS 6 108 307200 1400
67632141 _deep_m_ B Dec. 26, 2019, 4:45 a.m. OK Python 3 TESTS 6 109 0 1400
65422945 kctong529 B Nov. 20, 2019, 9:38 a.m. OK Python 3 TESTS 6 109 0 1400
64767716 dabeliutee1 B Nov. 12, 2019, 9:41 p.m. OK Python 3 TESTS 6 109 0 1400
64320451 super_hook_girl_lover B Nov. 5, 2019, 3:28 p.m. OK Ruby TESTS 6 61 204800 1400
64428459 super_hook_girl_lover B Nov. 6, 2019, 8:08 p.m. OK Ruby TESTS 6 62 204800 1400
64320157 super_hook_girl_lover B Nov. 5, 2019, 3:23 p.m. OK Ruby TESTS 6 62 204800 1400
64566325 kobae964 B Nov. 9, 2019, 7:48 a.m. OK Rust TESTS 6 30 307200 1400
64782924 Pijus B Nov. 13, 2019, 8:01 a.m. OK Rust TESTS 6 31 0 1400
65905505 yuya178 B Nov. 28, 2019, 10:43 a.m. OK Rust TESTS 6 31 204800 1400
65044589 ikazuya0201 B Nov. 15, 2019, 1:29 p.m. OK Rust TESTS 6 31 204800 1400
64663837 ten- B Nov. 10, 2019, 11:36 p.m. OK Rust TESTS 6 46 102400 1400
65620333 ichyo B Nov. 24, 2019, 5:58 a.m. OK Rust TESTS 6 61 614400 1400
65155909 techaddict B Nov. 16, 2019, 9:19 a.m. OK Scala TESTS 6 467 0 1400
66413323 j31d0 B Dec. 6, 2019, 4:06 p.m. OK Scala TESTS 6 482 0 1400
64715697 tadus21 B Nov. 11, 2019, 9:47 p.m. OK Scala TESTS 6 686 0 1400

remove filters

Back to search problems