Educational Codeforces Round 142 (Rated for Div. 2)

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
1792 Educational Codeforces Round 142 (Rated for Div. 2) FINISHED False 7200 57252299 Jan. 24, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14288 ) C Min Max Sort PROGRAMMING binary search brute force greedy math

B"You are given a permutation p of length n (a permutation of length n is an array of length n in which each integer from 1 to n occurs exactly once). You can perform the following operation any number of times (possibly zero): For example, if p = [1, 5, 4, 2, 3] and we want to apply the operation to the elements 3 and 5 , then after the first step of the operation, the permutation becomes p = [1, 4, 2] ; and after we insert the elements, it becomes p = [3, 1, 4, 2, 5] . Your task is to calculate the minimum number of operations described above to sort the permutation p in ascending order (i. xe2 x80 x89e. transform p so that p_1 < p_2 < ... < p_n ). The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of the test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- 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 p . The sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case, output a single integer -- the minimum number of operations described above to sort the array p in ascending order. In the first example, you can proceed as follows: "...

Tutorials

111835

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
190421561 ksandr1v C Jan. 24, 2023, 7:13 p.m. OK C# 10 TESTS 8 108 38092800
190408585 NYYYa C Jan. 24, 2023, 5:21 p.m. OK C# 10 TESTS 8 124 16486400
190403085 cyrus_msk C Jan. 24, 2023, 4:49 p.m. OK D TESTS 8 233 14233600
190428573 wackyIndian C Jan. 24, 2023, 8:55 p.m. OK GNU C11 TESTS 8 62 819200
190396580 eternalDiamond C Jan. 24, 2023, 4:30 p.m. OK GNU C11 TESTS 8 62 1638400
190445855 Smallorange C Jan. 25, 2023, 4:37 a.m. OK GNU C11 TESTS 8 78 819200
190434081 omeganot C Jan. 24, 2023, 11:15 p.m. OK GNU C++14 TESTS 8 31 1638400
190441261 StkOvflow C Jan. 25, 2023, 3:04 a.m. OK GNU C++14 TESTS 8 46 819200
190438693 mohen C Jan. 25, 2023, 1:57 a.m. OK GNU C++14 TESTS 8 46 819200
190438395 yu_lingyu C Jan. 25, 2023, 1:49 a.m. OK GNU C++14 TESTS 8 46 819200
190425318 gabriel88766 C Jan. 24, 2023, 8 p.m. OK GNU C++14 TESTS 8 46 819200
190422586 tonmoy197 C Jan. 24, 2023, 7:24 p.m. OK GNU C++14 TESTS 8 46 819200
190417279 KJJD C Jan. 24, 2023, 6:29 p.m. OK GNU C++14 TESTS 8 46 819200
190449011 Njaso C Jan. 25, 2023, 5:27 a.m. OK GNU C++14 TESTS 8 46 819200
190450868 Njaso C Jan. 25, 2023, 5:52 a.m. OK GNU C++14 TESTS 8 46 819200
190451138 ujala_2110 C Jan. 25, 2023, 5:56 a.m. OK GNU C++14 TESTS 8 46 819200
190449174 willwin4sure C Jan. 25, 2023, 5:29 a.m. OK GNU C++17 TESTS 8 46 819200
190443762 sk0822 C Jan. 25, 2023, 3:59 a.m. OK GNU C++17 TESTS 8 46 819200
190440238 Tawes C Jan. 25, 2023, 2:38 a.m. OK GNU C++17 TESTS 8 46 819200
190436755 phoebe.yeji C Jan. 25, 2023, 12:55 a.m. OK GNU C++17 TESTS 8 46 819200
190435409 0-jij-0 C Jan. 25, 2023, 12:06 a.m. OK GNU C++17 TESTS 8 46 819200
190435382 0-jij-0 C Jan. 25, 2023, 12:05 a.m. OK GNU C++17 TESTS 8 46 819200
190434530 MesSimonFallon19 C Jan. 24, 2023, 11:33 p.m. OK GNU C++17 TESTS 8 46 819200
190448822 VijaySue C Jan. 25, 2023, 5:24 a.m. OK GNU C++17 TESTS 8 46 819200
190450650 admirerider C Jan. 25, 2023, 5:49 a.m. OK GNU C++17 TESTS 8 46 819200
190450447 Entropy_Reducer C Jan. 25, 2023, 5:47 a.m. OK GNU C++17 TESTS 8 46 819200
190406209 xyl1234 C Jan. 24, 2023, 5:05 p.m. OK GNU C++17 (64) TESTS 8 15 1638400
190436585 Hytidel C Jan. 25, 2023, 12:49 a.m. OK GNU C++17 (64) TESTS 8 31 819200
190437969 Hytidel C Jan. 25, 2023, 1:37 a.m. OK GNU C++17 (64) TESTS 8 31 819200
190437021 Hytidel C Jan. 25, 2023, 1:04 a.m. OK GNU C++17 (64) TESTS 8 31 819200
190436763 Hytidel C Jan. 25, 2023, 12:55 a.m. OK GNU C++17 (64) TESTS 8 31 819200
190444017 linxd C Jan. 25, 2023, 4:05 a.m. OK GNU C++17 (64) TESTS 8 31 1638400
190431157 Mohit. C Jan. 24, 2023, 9:48 p.m. OK GNU C++17 (64) TESTS 8 31 1638400
190437827 iamone C Jan. 25, 2023, 1:32 a.m. OK GNU C++17 (64) TESTS 8 31 1638400
190414162 Huntik_03 C Jan. 24, 2023, 6:02 p.m. OK GNU C++17 (64) TESTS 8 31 1638400
190446671 Alphx C Jan. 25, 2023, 4:50 a.m. OK GNU C++17 (64) TESTS 8 31 1638400
190443460 whale666 C Jan. 25, 2023, 3:54 a.m. OK GNU C++20 (64) TESTS 8 15 1638400
190399052 threethreetwothree C Jan. 24, 2023, 4:34 p.m. OK GNU C++20 (64) TESTS 8 15 11571200
190400971 _andyli C Jan. 24, 2023, 4:39 p.m. OK GNU C++20 (64) TESTS 8 15 18636800
190396094 Insane_110 C Jan. 24, 2023, 4:29 p.m. OK GNU C++20 (64) TESTS 8 30 1638400
190407189 vasu52 C Jan. 24, 2023, 5:12 p.m. OK GNU C++20 (64) TESTS 8 30 1638400
190445607 ayush567 C Jan. 25, 2023, 4:33 a.m. OK GNU C++20 (64) TESTS 8 31 819200
190449451 p-nerd C Jan. 25, 2023, 5:33 a.m. OK GNU C++20 (64) TESTS 8 31 819200
190448584 SAHAL01 C Jan. 25, 2023, 5:20 a.m. OK GNU C++20 (64) TESTS 8 31 819200
190448554 wangjunchao C Jan. 25, 2023, 5:20 a.m. OK GNU C++20 (64) TESTS 8 31 819200
190447570 jaygaur99 C Jan. 25, 2023, 5:05 a.m. OK GNU C++20 (64) TESTS 8 31 819200
190427425 PrincessParsley C Jan. 24, 2023, 8:35 p.m. OK Java 11 TESTS 8 186 0
190447828 __Serendipity C Jan. 25, 2023, 5:09 a.m. OK Java 11 TESTS 8 202 0
190431362 IanISam C Jan. 24, 2023, 9:54 p.m. OK Java 11 TESTS 8 202 0
190417691 vijender_8601 C Jan. 24, 2023, 6:33 p.m. OK Java 11 TESTS 8 202 0
190426260 kritikmodi C Jan. 24, 2023, 8:16 p.m. OK Java 11 TESTS 8 218 0
190397152 D4D5C4 C Jan. 24, 2023, 4:31 p.m. OK Java 11 TESTS 8 218 0
190410922 kasiru_69 C Jan. 24, 2023, 5:38 p.m. OK Java 11 TESTS 8 249 0
190401207 kasiru_69 C Jan. 24, 2023, 4:40 p.m. OK Java 11 TESTS 8 264 0
190419826 gk_cool C Jan. 24, 2023, 6:54 p.m. OK Java 11 TESTS 8 295 17612800
190430411 creativegiant C Jan. 24, 2023, 9:30 p.m. OK Java 11 TESTS 8 358 34508800
190397858 sid234890 C Jan. 24, 2023, 4:32 p.m. OK Java 17 TESTS 8 187 0
190405721 frey4 C Jan. 24, 2023, 5:03 p.m. OK Java 17 TESTS 8 218 307200
190396721 john9999911 C Jan. 24, 2023, 4:30 p.m. OK Java 17 TESTS 8 233 0
190431610 Mustela_Erminea C Jan. 24, 2023, 10 p.m. OK Java 17 TESTS 8 233 102400
190401942 not_just_rr C Jan. 24, 2023, 4:43 p.m. OK Java 17 TESTS 8 280 2150400
190396326 FloatingOcean C Jan. 24, 2023, 4:29 p.m. OK Java 17 TESTS 8 436 0
190398302 Rahulraghav358 C Jan. 24, 2023, 4:33 p.m. OK Java 17 TESTS 8 483 0
190406790 mdmehedihqssqn C Jan. 24, 2023, 5:09 p.m. OK Java 17 TESTS 8 499 409600
190427023 Anu_Jha C Jan. 24, 2023, 8:29 p.m. OK Java 17 TESTS 8 1091 14131200
190447438 sarthak5184 C Jan. 25, 2023, 5:03 a.m. OK Java 17 TESTS 8 1279 18739200
190440498 n0obie C Jan. 25, 2023, 2:45 a.m. OK Java 8 TESTS 8 124 0
190420569 Mohamed_Ahmed C Jan. 24, 2023, 7:02 p.m. OK Java 8 TESTS 8 124 1843200
190408073 UniversalAdmin C Jan. 24, 2023, 5:17 p.m. OK Java 8 TESTS 8 124 1843200
190410324 aryamanhello C Jan. 24, 2023, 5:33 p.m. OK Java 8 TESTS 8 124 2969600
190443076 HMETAO C Jan. 25, 2023, 3:44 a.m. OK Java 8 TESTS 8 842 12697600
190450346 Yychen C Jan. 25, 2023, 5:46 a.m. OK MS C++ 2017 TESTS 8 124 1638400
190404175 KemPi C Jan. 24, 2023, 4:54 p.m. OK MS C++ 2017 TESTS 8 217 7270400
190437044 payday3 C Jan. 25, 2023, 1:05 a.m. OK MS C++ 2017 TESTS 8 218 9728000
190400264 maxK99 C Jan. 24, 2023, 4:36 p.m. OK MS C++ 2017 TESTS 8 218 13721600
190398740 alsrb0504 C Jan. 24, 2023, 4:33 p.m. OK Node.js TESTS 8 155 31744000
190419788 ankurkayal C Jan. 24, 2023, 6:53 p.m. OK Node.js TESTS 8 639 52121600
190419400 ankurkayal C Jan. 24, 2023, 6:49 p.m. OK Node.js TESTS 8 701 77926400
190409470 AadiS C Jan. 24, 2023, 5:27 p.m. OK PyPy 3 TESTS 8 202 23244800
190396799 ikoma C Jan. 24, 2023, 4:30 p.m. OK PyPy 3 TESTS 8 218 16076800
190420994 bboo_123 C Jan. 24, 2023, 7:07 p.m. OK PyPy 3 TESTS 8 421 23347200
190439540 mohak_k C Jan. 25, 2023, 2:20 a.m. OK PyPy 3 TESTS 8 436 16486400
190440044 mohak_k C Jan. 25, 2023, 2:32 a.m. OK PyPy 3 TESTS 8 467 16691200
190397881 abhay_codes C Jan. 24, 2023, 4:32 p.m. OK PyPy 3 TESTS 8 483 19148800
190427360 AhsanHabib C Jan. 24, 2023, 8:34 p.m. OK PyPy 3 TESTS 8 499 17305600
190398268 rishuk1.iitr C Jan. 24, 2023, 4:32 p.m. OK PyPy 3 TESTS 8 560 28262400
190432051 Nanouklol C Jan. 24, 2023, 10:11 p.m. OK PyPy 3-64 TESTS 8 109 18022400
190441527 SophieHatter C Jan. 25, 2023, 3:10 a.m. OK PyPy 3-64 TESTS 8 109 23859200
190407863 rmr C Jan. 24, 2023, 5:16 p.m. OK PyPy 3-64 TESTS 8 124 18022400
190425151 Omar.Gawdat C Jan. 24, 2023, 7:58 p.m. OK PyPy 3-64 TESTS 8 124 20787200
190443775 alex391a C Jan. 25, 2023, 4 a.m. OK PyPy 3-64 TESTS 8 124 20889600
190396719 aviral311 C Jan. 24, 2023, 4:30 p.m. OK PyPy 3-64 TESTS 8 139 20172800
190429108 RobinFromTheHood C Jan. 24, 2023, 9:05 p.m. OK PyPy 3-64 TESTS 8 139 20992000
190401759 albertyangyhm C Jan. 24, 2023, 4:42 p.m. OK PyPy 3-64 TESTS 8 139 21606400
190425493 Triump_0112 C Jan. 24, 2023, 8:03 p.m. OK PyPy 3-64 TESTS 8 139 32256000
190408137 rmr C Jan. 24, 2023, 5:18 p.m. OK PyPy 3-64 TESTS 8 140 18022400
190439331 underdog_1 C Jan. 25, 2023, 2:14 a.m. OK Python 3 TESTS 8 186 13926400
190438409 sabbirahmeds877 C Jan. 25, 2023, 1:49 a.m. OK Python 3 TESTS 8 202 14233600
190401362 Rishank19 C Jan. 24, 2023, 4:40 p.m. OK Python 3 TESTS 8 233 14336000
190408407 skander.soussou C Jan. 24, 2023, 5:20 p.m. OK Python 3 TESTS 8 265 14233600
190397907 prabal10 C Jan. 24, 2023, 4:32 p.m. OK Python 3 TESTS 8 451 13312000
190439183 sravansainath7980 C Jan. 25, 2023, 2:11 a.m. OK Python 3 TESTS 8 857 14438400
190441557 Muhammad.Daniyal C Jan. 25, 2023, 3:11 a.m. OK Python 3 TESTS 8 1060 14233600
190441563 Muhammad.Daniyal C Jan. 25, 2023, 3:11 a.m. OK Python 3 TESTS 8 1075 14233600
190420712 amarbudhiraja C Jan. 24, 2023, 7:04 p.m. OK Python 3 TESTS 8 1232 14233600
190398326 Humesh123 C Jan. 24, 2023, 4:33 p.m. OK Ruby 3 TESTS 8 420 15769600
190425862 Felerius C Jan. 24, 2023, 8:09 p.m. OK Rust 2021 TESTS 8 15 3174400
190410554 cottoncotton C Jan. 24, 2023, 5:35 p.m. OK Rust 2021 TESTS 8 31 70451200
190420258 D4nnyLee C Jan. 24, 2023, 6:58 p.m. OK Rust 2021 TESTS 8 93 13107200

remove filters

Back to search problems