Codeforces Round 740 (Div. 2, based on VK Cup 2021 - Final (Engine))

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
1561 Codeforces Round 740 (Div. 2, based on VK Cup 2021 - Final (Engine)) FINISHED False 9000 107450663 Aug. 24, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16646 ) A Simply Strange Sort PROGRAMMING brute force implementation sortings 800

B"You have a permutation: an array a = [a_1, a_2, ldots, a_n] of distinct integers from 1 to n . The length of the permutation n is odd. Consider the following algorithm of sorting the permutation in increasing order. A helper procedure of the algorithm, f(i) , takes a single argument i ( 1 <= i <= n-1 ) and does the following. If a_i > a_{i+1} , the values of a_i and a_{i+1} are exchanged. Otherwise, the permutation doesn't change. The algorithm consists of iterations, numbered with consecutive integers starting with 1 . On the i -th iteration, the algorithm does the following: It can be proven that after a finite number of iterations the permutation will be sorted in increasing order. After how many iterations will this happen for the first time? 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 a single integer n ( 3 <= n <= 999 ; n is odd) -- the length of the permutation. The second line contains n distinct integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- the permutation itself. It is guaranteed that the sum of n over all test cases does not exceed 999 . For each test case print the number of iterations after which the permutation will become sorted in increasing order for the first time. If the given permutation is already sorted, print 0 . In the first test case, the permutation will be changing as follows: In the second test case, the permutation will be changing as follows: In the third test case, the permutation is already sorted and the answer is 0 . "...

Tutorials

Codeforces Round #740 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
126953473 MrNZW A Aug. 25, 2021, 9:04 a.m. OK Clang++17 Diagnostics TESTS 27 61 280064000 800
126953680 Guptaji19 A Aug. 25, 2021, 9:07 a.m. OK Clang++17 Diagnostics TESTS 27 93 286310400 800
126927129 minhnhatmn16 A Aug. 25, 2021, 2:50 a.m. OK FPC TESTS 27 31 3481600 800
127004245 Joker1010123 A Aug. 25, 2021, 9:53 p.m. OK GNU C11 TESTS 27 15 3686400 800
127007079 Kulido A Aug. 26, 2021, 12:30 a.m. OK GNU C11 TESTS 27 15 3686400 800
126954951 abhinavchowdary A Aug. 25, 2021, 9:23 a.m. OK GNU C11 TESTS 27 30 3686400 800
126968005 Youarenotgood A Aug. 25, 2021, 12:27 p.m. OK GNU C11 TESTS 27 31 3686400 800
126965913 milan_s1 A Aug. 25, 2021, 11:58 a.m. OK GNU C11 TESTS 27 31 3686400 800
126972490 sahand_es A Aug. 25, 2021, 1:29 p.m. OK GNU C11 TESTS 27 31 3686400 800
126921870 jy._.1107 A Aug. 25, 2021, 12:27 a.m. OK GNU C11 TESTS 27 31 3686400 800
126921514 HenrySo0127 A Aug. 25, 2021, 12:12 a.m. OK GNU C++14 TESTS 27 15 3686400 800
126939131 767hemant.raj A Aug. 25, 2021, 6:10 a.m. OK GNU C++14 TESTS 27 15 3686400 800
127006232 EdisonBa A Aug. 25, 2021, 11:44 p.m. OK GNU C++14 TESTS 27 15 3788800 800
127007818 ZJH111111 A Aug. 26, 2021, 1:04 a.m. OK GNU C++14 TESTS 27 15 3788800 800
127007315 woshishabiye A Aug. 26, 2021, 12:41 a.m. OK GNU C++14 TESTS 27 15 3788800 800
127006296 Alkaid_Star A Aug. 25, 2021, 11:48 p.m. OK GNU C++14 TESTS 27 15 3788800 800
127004764 nitishkumar12c A Aug. 25, 2021, 10:19 p.m. OK GNU C++14 TESTS 27 15 3788800 800
126987225 sarojshiva9936 A Aug. 25, 2021, 4:22 p.m. OK GNU C++14 TESTS 27 15 3788800 800
126985492 Sharat-Bhat A Aug. 25, 2021, 4 p.m. OK GNU C++14 TESTS 27 15 3788800 800
126978286 kerolosibrahim A Aug. 25, 2021, 2:39 p.m. OK GNU C++14 TESTS 27 15 3788800 800
126991912 binay671 A Aug. 25, 2021, 5:29 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126988476 Abdullah_Omar A Aug. 25, 2021, 4:38 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126993135 hardikpandey23 A Aug. 25, 2021, 5:49 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126988313 gopi_ldce A Aug. 25, 2021, 4:36 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126995397 Nakeeb A Aug. 25, 2021, 6:25 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126997681 p3rfect A Aug. 25, 2021, 7:06 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126999794 furiousluck A Aug. 25, 2021, 7:48 p.m. OK GNU C++17 TESTS 27 15 3788800 800
127008018 govind9532pandey A Aug. 26, 2021, 1:13 a.m. OK GNU C++17 TESTS 27 15 3788800 800
127008030 AKUSACO A Aug. 26, 2021, 1:13 a.m. OK GNU C++17 TESTS 27 15 3788800 800
126986046 swayameron A Aug. 25, 2021, 4:07 p.m. OK GNU C++17 TESTS 27 15 3788800 800
126927017 jansenkenpegrasio A Aug. 25, 2021, 2:47 a.m. OK GNU C++17 (64) TESTS 27 15 4198400 800
126958212 simply_hooman A Aug. 25, 2021, 10:07 a.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
127001842 Mohamed_5aied A Aug. 25, 2021, 8:34 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
127001673 pd_codes A Aug. 25, 2021, 8:32 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126986163 chctxdy68 A Aug. 25, 2021, 4:08 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126985623 jainmilind A Aug. 25, 2021, 4:02 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126985414 rajkumar19084 A Aug. 25, 2021, 3:59 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126983879 lbm364dl A Aug. 25, 2021, 3:42 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126980228 albertxwz A Aug. 25, 2021, 3 p.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126953908 rajkumar19084 A Aug. 25, 2021, 9:10 a.m. OK GNU C++17 (64) TESTS 27 15 4300800 800
126943130 Jepbar_Asgarov A Aug. 25, 2021, 7 a.m. OK Go TESTS 27 31 10649600 800
126949674 SnacksTime A Aug. 25, 2021, 8:18 a.m. OK Go TESTS 27 31 10649600 800
126929815 huangxuepeng A Aug. 25, 2021, 3:42 a.m. OK Go TESTS 27 46 10649600 800
126923996 Kariem.Taha A Aug. 25, 2021, 1:38 a.m. OK Haskell TESTS 27 46 12697600 800
126924112 Kariem.Taha A Aug. 25, 2021, 1:41 a.m. OK Haskell TESTS 27 46 12697600 800
126915059 GhoulvsTitan A Aug. 24, 2021, 8 p.m. OK Java 11 TESTS 27 171 24268800 800
126913308 solo07 A Aug. 24, 2021, 7:22 p.m. OK Java 11 TESTS 27 171 24371200 800
126908864 alpha__18 A Aug. 24, 2021, 6:13 p.m. OK Java 11 TESTS 27 186 24268800 800
126978363 _revenant A Aug. 25, 2021, 2:40 p.m. OK Java 11 TESTS 27 186 24268800 800
126972463 sharma05 A Aug. 25, 2021, 1:29 p.m. OK Java 11 TESTS 27 186 24268800 800
126964351 Aman_dixit A Aug. 25, 2021, 11:37 a.m. OK Java 11 TESTS 27 186 24268800 800
126940538 shashank19107 A Aug. 25, 2021, 6:29 a.m. OK Java 11 TESTS 27 186 24268800 800
126944752 MishkaGrig A Aug. 25, 2021, 7:19 a.m. OK Java 11 TESTS 27 186 24371200 800
126911520 mr_white07 A Aug. 24, 2021, 6:50 p.m. OK Java 11 TESTS 27 187 24166400 800
126975994 KarMa_ A Aug. 25, 2021, 2:12 p.m. OK Java 11 TESTS 27 187 24268800 800
126977764 thisisujjawal A Aug. 25, 2021, 2:33 p.m. OK Java 8 TESTS 27 109 20889600 800
126975910 Sina_5 A Aug. 25, 2021, 2:10 p.m. OK Java 8 TESTS 27 109 20889600 800
126941744 priyam_anand A Aug. 25, 2021, 6:45 a.m. OK Java 8 TESTS 27 109 20889600 800
126931718 C_P_T_N A Aug. 25, 2021, 4:16 a.m. OK Java 8 TESTS 27 109 20889600 800
126939273 tusharahuja A Aug. 25, 2021, 6:12 a.m. OK Java 8 TESTS 27 109 20889600 800
126909735 bubnov A Aug. 24, 2021, 6:24 p.m. OK Java 8 TESTS 27 109 20889600 800
126996241 yashhingwe A Aug. 25, 2021, 6:39 p.m. OK Java 8 TESTS 27 109 20889600 800
126949879 gautamvashishtha23 A Aug. 25, 2021, 8:21 a.m. OK Java 8 TESTS 27 109 20992000 800
126991771 RonWonWon A Aug. 25, 2021, 5:27 p.m. OK Java 8 TESTS 27 124 20889600 800
127001640 osa.ayman A Aug. 25, 2021, 8:31 p.m. OK Java 8 TESTS 27 124 20889600 800
126926712 Gompu123 A Aug. 25, 2021, 2:41 a.m. OK Kotlin TESTS 27 202 24064000 800
126919812 d3l3t3_my_l1f3 A Aug. 24, 2021, 10:38 p.m. OK MS C++ 2017 TESTS 27 15 3788800 800
126946600 bkifhr8 A Aug. 25, 2021, 7:40 a.m. OK MS C++ 2017 TESTS 27 30 4505600 800
126931587 qiaoqiaodaima A Aug. 25, 2021, 4:14 a.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126939166 _chaopaonansheng A Aug. 25, 2021, 6:11 a.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126931708 navin_yadav A Aug. 25, 2021, 4:16 a.m. OK MS C++ 2017 TESTS 27 31 3788800 800
127005622 xing_sang1 A Aug. 25, 2021, 11:06 p.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126998630 Serlthree A Aug. 25, 2021, 7:24 p.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126985429 lhcalphaA A Aug. 25, 2021, 4 p.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126978462 h_chen A Aug. 25, 2021, 2:41 p.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126951687 bkifhr6 A Aug. 25, 2021, 8:42 a.m. OK MS C++ 2017 TESTS 27 31 3788800 800
126929595 azukun A Aug. 25, 2021, 3:37 a.m. OK .NET Core C# TESTS 27 109 11673600 800
126971049 Nidz05 A Aug. 25, 2021, 1:10 p.m. OK .NET Core C# TESTS 27 124 14848000 800
126996105 GarikUnit A Aug. 25, 2021, 6:37 p.m. OK PascalABC.NET TESTS 27 311 26009600 800
126946678 MadinaN A Aug. 25, 2021, 7:41 a.m. OK PHP TESTS 27 109 6041600 800
126959383 hogrider A Aug. 25, 2021, 10:25 a.m. OK PyPy 3 TESTS 27 93 21708800 800
126942130 neel0086 A Aug. 25, 2021, 6:49 a.m. OK PyPy 3 TESTS 27 93 21708800 800
126998536 Code_100 A Aug. 25, 2021, 7:22 p.m. OK PyPy 3 TESTS 27 108 21913600 800
126975276 anshul_129 A Aug. 25, 2021, 2:03 p.m. OK PyPy 3 TESTS 27 108 22016000 800
126912338 lemurr A Aug. 24, 2021, 7:04 p.m. OK PyPy 3 TESTS 27 108 22323200 800
126915030 mik_shakin A Aug. 24, 2021, 7:59 p.m. OK PyPy 3 TESTS 27 109 21606400 800
126935660 hvbird A Aug. 25, 2021, 5:22 a.m. OK PyPy 3 TESTS 27 109 21708800 800
126934084 VN.Kiet A Aug. 25, 2021, 4:59 a.m. OK PyPy 3 TESTS 27 109 21708800 800
126966791 kavbhat A Aug. 25, 2021, 12:11 p.m. OK PyPy 3 TESTS 27 109 21913600 800
126912046 dhruvs A Aug. 24, 2021, 6:59 p.m. OK PyPy 3 TESTS 27 109 22016000 800
126915321 elistark A Aug. 24, 2021, 8:06 p.m. OK Python 2 TESTS 27 233 6553600 800
126908604 sukriti A Aug. 24, 2021, 6:10 p.m. OK Python 2 TESTS 27 280 6553600 800
126932767 M0u1ea5 A Aug. 25, 2021, 4:36 a.m. OK Python 3 TESTS 27 187 7168000 800
126935216 Land_oF_cOdErS A Aug. 25, 2021, 5:16 a.m. OK Python 3 TESTS 27 202 7372800 800
126934569 prathamnagaria A Aug. 25, 2021, 5:07 a.m. OK Python 3 TESTS 27 218 6963200 800
126943213 Pranav-26 A Aug. 25, 2021, 7:01 a.m. OK Python 3 TESTS 27 264 6963200 800
126943113 Pranav-26 A Aug. 25, 2021, 7 a.m. OK Python 3 TESTS 27 264 6963200 800
126909313 vyas_samarth11 A Aug. 24, 2021, 6:18 p.m. OK Python 3 TESTS 27 264 6963200 800
126992010 alfa_mike A Aug. 25, 2021, 5:31 p.m. OK Python 3 TESTS 27 265 6963200 800
126975172 Lalayants A Aug. 25, 2021, 2:02 p.m. OK Python 3 TESTS 27 265 6963200 800
126985132 yujiawei364557 A Aug. 25, 2021, 3:56 p.m. OK Python 3 TESTS 27 280 6963200 800
126983969 WiseAristocrat A Aug. 25, 2021, 3:44 p.m. OK Python 3 TESTS 27 280 6963200 800
126911985 apilat A Aug. 24, 2021, 6:58 p.m. OK Rust TESTS 27 31 3788800 800
126977610 XLor A Aug. 25, 2021, 2:31 p.m. OK Rust TESTS 27 31 3788800 800
126940560 DMCoder A Aug. 25, 2021, 6:29 a.m. OK Rust TESTS 27 31 3788800 800
126915365 IvanDyachenko A Aug. 24, 2021, 8:07 p.m. OK Scala TESTS 27 467 40140800 800

remove filters

Back to search problems