Codeforces Round 893 (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
1858 Codeforces Round 893 (Div. 2) FINISHED False 7200 39713099 Aug. 15, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23259 ) C Yet Another Permutation Problem PROGRAMMING constructive algorithms math number theory 1000

B'Alex got a new game called "GCD permutations" as a birthday present. Each round of this game proceeds as follows: Alex has already played several rounds so he decided to find a permutation a_1, a_2, ldots, a_n such that its score is as large as possible. Recall that gcd(x, y) denotes the greatest common divisor (GCD) of numbers x and y , and x bmod y denotes the remainder of dividing x by y . ^{ dagger} A permutation of length n 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). The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case consists of one line containing a single integer n ( 2 <= n <= 10^5 ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case print n distinct integers a_{1},a_{2}, ldots,a_{n} ( 1 <= a_i <= n ) -- the permutation with the largest possible score. If there are several permutations with the maximum possible score, you can print any one of them. In the first test case, Alex wants to find a permutation of integers from 1 to 5 . For the permutation a=[1,2,4,3,5] , the array d is equal to [1,2,1,1,1] . It contains 2 distinct integers. It can be shown that there is no permutation of length 5 with a higher score. In the second test case, Alex wants to find a permutation of integers from 1 to 2 . There are only two such permutations: a=[1,2] and a=[2,1] . In both cases, the array d is equal to [1,1] , so both permutations are correct. In the third test case, Alex wants to find a permutation of in'...

Tutorials

Codeforces Round #893 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
219003543 cppc C Aug. 15, 2023, 5:13 p.m. OK C# 10 TESTS 13 312 8396800 1000
219004737 Baga_Boom C Aug. 15, 2023, 5:19 p.m. OK C# 10 TESTS 13 1154 8499200 1000
219017084 Pos_E1 C Aug. 15, 2023, 7:13 p.m. OK Clang++17 Diagnostics TESTS 13 77 0 1000
219060303 xuntiandao C Aug. 16, 2023, 5:51 a.m. OK Clang++17 Diagnostics TESTS 13 280 819200 1000
219060112 Sharif080 C Aug. 16, 2023, 5:49 a.m. OK Clang++17 Diagnostics TESTS 13 358 0 1000
219021981 astrodigger C Aug. 15, 2023, 8:14 p.m. OK Clang++20 Diagnostics TESTS 13 343 11571200 1000
219006622 eugalt C Aug. 15, 2023, 5:33 p.m. OK GNU C11 TESTS 13 46 0 1000
219005119 jmawa1163 C Aug. 15, 2023, 5:22 p.m. OK GNU C11 TESTS 13 420 409600 1000
219033856 Leasier C Aug. 16, 2023, 12:42 a.m. OK GNU C11 TESTS 13 421 102400 1000
218998008 frrounok2021 C Aug. 15, 2023, 4:32 p.m. OK GNU C11 TESTS 13 421 819200 1000
219003682 iffatul_anon C Aug. 15, 2023, 5:13 p.m. OK GNU C11 TESTS 13 436 409600 1000
219010924 chowdhuryshashwoto C Aug. 15, 2023, 6:08 p.m. OK GNU C11 TESTS 13 436 819200 1000
219004035 venkatesh1729 C Aug. 15, 2023, 5:15 p.m. OK GNU C11 TESTS 13 452 0 1000
219056656 wwwyq07 C Aug. 16, 2023, 5:10 a.m. OK GNU C++14 TESTS 13 15 0 1000
219046474 QZJ114514 C Aug. 16, 2023, 3:02 a.m. OK GNU C++14 TESTS 13 15 0 1000
218999032 storybehind C Aug. 15, 2023, 4:34 p.m. OK GNU C++14 TESTS 13 15 102400 1000
218994671 qwerty5109 C Aug. 15, 2023, 4:26 p.m. OK GNU C++14 TESTS 13 15 102400 1000
219012244 Straight_line C Aug. 15, 2023, 6:20 p.m. OK GNU C++14 TESTS 13 15 409600 1000
219047883 accgj C Aug. 16, 2023, 3:18 a.m. OK GNU C++14 TESTS 13 15 5017600 1000
219022601 nurul_islam_opu C Aug. 15, 2023, 8:24 p.m. OK GNU C++14 TESTS 13 30 0 1000
219047294 Aaron_wch C Aug. 16, 2023, 3:11 a.m. OK GNU C++14 TESTS 13 30 0 1000
219048961 QDK_Storm C Aug. 16, 2023, 3:31 a.m. OK GNU C++14 TESTS 13 30 102400 1000
219056692 ashutosh2218 C Aug. 16, 2023, 5:10 a.m. OK GNU C++14 TESTS 13 30 409600 1000
219003311 kaiichen C Aug. 15, 2023, 5:12 p.m. OK GNU C++17 TESTS 13 15 0 1000
218996074 brute_forceCE C Aug. 15, 2023, 4:29 p.m. OK GNU C++17 TESTS 13 15 102400 1000
218998769 BC396 C Aug. 15, 2023, 4:33 p.m. OK GNU C++17 TESTS 13 15 102400 1000
219004078 jainaditya8464 C Aug. 15, 2023, 5:15 p.m. OK GNU C++17 TESTS 13 15 409600 1000
219002009 RakibJoy C Aug. 15, 2023, 5:06 p.m. OK GNU C++17 TESTS 13 15 409600 1000
219009842 neo11235 C Aug. 15, 2023, 5:59 p.m. OK GNU C++17 TESTS 13 15 409600 1000
219003813 ahmedyoussefg C Aug. 15, 2023, 5:14 p.m. OK GNU C++17 TESTS 13 15 409600 1000
219011080 Bassel_Alhomsi55 C Aug. 15, 2023, 6:09 p.m. OK GNU C++17 TESTS 13 15 819200 1000
219049032 CSHwang C Aug. 16, 2023, 3:32 a.m. OK GNU C++17 TESTS 13 15 1536000 1000
219055954 mr.phoenix C Aug. 16, 2023, 5:02 a.m. OK GNU C++17 TESTS 13 30 0 1000
219011004 shuvocoder2025 C Aug. 15, 2023, 6:09 p.m. OK GNU C++17 (64) TESTS 13 15 0 1000
219060515 Alfa C Aug. 16, 2023, 5:53 a.m. OK GNU C++17 (64) TESTS 13 15 0 1000
219052659 nanoblob C Aug. 16, 2023, 4:19 a.m. OK GNU C++17 (64) TESTS 13 15 0 1000
219044425 imsuck12 C Aug. 16, 2023, 2:45 a.m. OK GNU C++17 (64) TESTS 13 15 0 1000
219032849 ATRII C Aug. 16, 2023, 12:21 a.m. OK GNU C++17 (64) TESTS 13 15 0 1000
219004536 lazymystic C Aug. 15, 2023, 5:18 p.m. OK GNU C++17 (64) TESTS 13 15 0 1000
219053998 BoaHancock C Aug. 16, 2023, 4:38 a.m. OK GNU C++17 (64) TESTS 13 15 102400 1000
219002273 rakib2624 C Aug. 15, 2023, 5:07 p.m. OK GNU C++17 (64) TESTS 13 15 1126400 1000
218995583 druidream C Aug. 15, 2023, 4:28 p.m. OK GNU C++17 (64) TESTS 13 15 1433600 1000
219041404 vegeone C Aug. 16, 2023, 2:22 a.m. OK GNU C++17 (64) TESTS 13 15 1638400 1000
219023480 timecomplexity C Aug. 15, 2023, 8:37 p.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219023197 Ahmed_sensei C Aug. 15, 2023, 8:33 p.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219019579 syrlybai056 C Aug. 15, 2023, 7:42 p.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219046596 gagandeep.singh C Aug. 16, 2023, 3:03 a.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219052562 Pratyogi_7 C Aug. 16, 2023, 4:18 a.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219059684 ProgramMastergg C Aug. 16, 2023, 5:44 a.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219040511 Aicu C Aug. 16, 2023, 2:14 a.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219024780 serifefedartar C Aug. 15, 2023, 9 p.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219023878 lavawolfiee C Aug. 15, 2023, 8:43 p.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219023772 antoniomsah C Aug. 15, 2023, 8:41 p.m. OK GNU C++20 (64) TESTS 13 15 0 1000
219011046 drdilyor C Aug. 15, 2023, 6:09 p.m. OK Haskell TESTS 13 78 3174400 1000
219008546 WORTH C Aug. 15, 2023, 5:47 p.m. OK Java 11 TESTS 13 187 0 1000
219002061 habib_48 C Aug. 15, 2023, 5:06 p.m. OK Java 11 TESTS 13 202 0 1000
219028867 ApprenticeOfCode C Aug. 15, 2023, 10:33 p.m. OK Java 11 TESTS 13 233 0 1000
219047844 InfinitePath C Aug. 16, 2023, 3:18 a.m. OK Java 11 TESTS 13 233 40345600 1000
218996262 ujjwal_a0001 C Aug. 15, 2023, 4:29 p.m. OK Java 11 TESTS 13 249 4403200 1000
219006912 Harwinvanak C Aug. 15, 2023, 5:35 p.m. OK Java 11 TESTS 13 264 1843200 1000
219023422 dzhi C Aug. 15, 2023, 8:36 p.m. OK Java 11 TESTS 13 343 36864000 1000
219004303 Harwinvanak C Aug. 15, 2023, 5:17 p.m. OK Java 11 TESTS 13 389 1536000 1000
219048592 lihanyu C Aug. 16, 2023, 3:27 a.m. OK Java 11 TESTS 13 546 0 1000
219055434 jinx_vi C Aug. 16, 2023, 4:56 a.m. OK Java 11 TESTS 13 561 0 1000
219021489 raito3z C Aug. 15, 2023, 8:08 p.m. OK Java 17 TESTS 13 218 204800 1000
219012633 swatishivam23 C Aug. 15, 2023, 6:24 p.m. OK Java 17 TESTS 13 218 921600 1000
219002506 Abdelrahman.M.3 C Aug. 15, 2023, 5:07 p.m. OK Java 17 TESTS 13 233 512000 1000
219046699 Ligh0x74 C Aug. 16, 2023, 3:04 a.m. OK Java 17 TESTS 13 233 819200 1000
219047242 Sheikh_NM C Aug. 16, 2023, 3:10 a.m. OK Java 17 TESTS 13 233 6246400 1000
219015393 Swilled7 C Aug. 15, 2023, 6:54 p.m. OK Java 17 TESTS 13 264 819200 1000
219005987 ahmed.elbakly C Aug. 15, 2023, 5:28 p.m. OK Java 17 TESTS 13 264 6246400 1000
219060379 goalboy C Aug. 16, 2023, 5:52 a.m. OK Java 17 TESTS 13 311 6656000 1000
219022138 vikash_45 C Aug. 15, 2023, 8:17 p.m. OK Java 17 TESTS 13 499 0 1000
219036313 Jatinydv17 C Aug. 16, 2023, 1:24 a.m. OK Java 17 TESTS 13 530 204800 1000
219030154 ZXF_521mua C Aug. 15, 2023, 11:12 p.m. OK Java 8 TESTS 13 124 0 1000
219030123 ZXF_521mua C Aug. 15, 2023, 11:10 p.m. OK Java 8 TESTS 13 124 0 1000
219013257 RonWonWon C Aug. 15, 2023, 6:30 p.m. OK Java 8 TESTS 13 124 0 1000
219050002 bleach__ C Aug. 16, 2023, 3:44 a.m. OK Java 8 TESTS 13 186 46284800 1000
219002504 formidablechief_27 C Aug. 15, 2023, 5:07 p.m. OK Java 8 TESTS 13 233 0 1000
219060230 aniket27 C Aug. 16, 2023, 5:50 a.m. OK Java 8 TESTS 13 436 0 1000
219003711 hamossa C Aug. 15, 2023, 5:13 p.m. OK Java 8 TESTS 13 452 0 1000
219034492 lemma_Forever C Aug. 16, 2023, 12:55 a.m. OK Java 8 TESTS 13 468 0 1000
219024885 jitu7033 C Aug. 15, 2023, 9:02 p.m. OK Java 8 TESTS 13 483 0 1000
219015261 alokrajpd C Aug. 15, 2023, 6:53 p.m. OK Java 8 TESTS 13 483 0 1000
219008729 arssmol1029 C Aug. 15, 2023, 5:49 p.m. OK MS C++ 2017 TESTS 13 78 0 1000
219002464 1_shivam C Aug. 15, 2023, 5:07 p.m. OK MS C++ 2017 TESTS 13 78 0 1000
219046754 Tokai_Teio. C Aug. 16, 2023, 3:04 a.m. OK MS C++ 2017 TESTS 13 93 409600 1000
219017352 KuriyamaShiro C Aug. 15, 2023, 7:16 p.m. OK MS C++ 2017 TESTS 13 93 1433600 1000
218995143 Shivaprasad47 C Aug. 15, 2023, 4:27 p.m. OK MS C++ 2017 TESTS 13 108 409600 1000
218997470 Gaurav1 C Aug. 15, 2023, 4:31 p.m. OK PyPy 2 TESTS 13 171 7782400 1000
219046729 ramab C Aug. 16, 2023, 3:04 a.m. OK PyPy 3 TESTS 13 170 9420800 1000
219025963 herrungesund C Aug. 15, 2023, 9:22 p.m. OK PyPy 3 TESTS 13 202 9113600 1000
219021684 random__person C Aug. 15, 2023, 8:11 p.m. OK PyPy 3 TESTS 13 202 13721600 1000
218996032 iCat C Aug. 15, 2023, 4:28 p.m. OK PyPy 3 TESTS 13 218 7680000 1000
219046861 ramab C Aug. 16, 2023, 3:05 a.m. OK PyPy 3 TESTS 13 233 9523200 1000
219006324 Bishwanath C Aug. 15, 2023, 5:30 p.m. OK PyPy 3 TESTS 13 311 9113600 1000
219042990 Yeaish_Turj C Aug. 16, 2023, 2:32 a.m. OK PyPy 3 TESTS 13 327 9523200 1000
219046352 ramab C Aug. 16, 2023, 3:01 a.m. OK PyPy 3 TESTS 13 1668 9523200 1000
218995094 rajn5181 C Aug. 15, 2023, 4:27 p.m. OK PyPy 3 TESTS 13 1731 8499200 1000
219018175 plevande C Aug. 15, 2023, 7:25 p.m. OK PyPy 3-64 TESTS 13 93 9011200 1000
219024911 randombernie C Aug. 15, 2023, 9:03 p.m. OK PyPy 3-64 TESTS 13 108 13721600 1000
219053840 udayan8 C Aug. 16, 2023, 4:36 a.m. OK PyPy 3-64 TESTS 13 108 13926400 1000
218996865 pizet C Aug. 15, 2023, 4:30 p.m. OK PyPy 3-64 TESTS 13 109 10137600 1000
219058945 ProCoder12 C Aug. 16, 2023, 5:36 a.m. OK PyPy 3-64 TESTS 13 109 10240000 1000
219052442 marathedhiraj486 C Aug. 16, 2023, 4:16 a.m. OK PyPy 3-64 TESTS 13 124 10035200 1000
219012008 hvbird C Aug. 15, 2023, 6:17 p.m. OK PyPy 3-64 TESTS 13 124 10240000 1000
219056043 harrylfoppa C Aug. 16, 2023, 5:03 a.m. OK PyPy 3-64 TESTS 13 124 10547200 1000
219049385 Youarenotgood C Aug. 16, 2023, 3:36 a.m. OK PyPy 3-64 TESTS 13 124 10547200 1000
219020224 iron_nicko C Aug. 15, 2023, 7:51 p.m. OK PyPy 3-64 TESTS 13 124 12492800 1000
219022552 elistark C Aug. 15, 2023, 8:23 p.m. OK Python 3 TESTS 13 109 17715200 1000
219003510 Harish-S C Aug. 15, 2023, 5:13 p.m. OK Python 3 TESTS 13 140 12902400 1000
219044924 21wh1a0211 C Aug. 16, 2023, 2:49 a.m. OK Python 3 TESTS 13 155 307200 1000
218996841 sgn_UG C Aug. 15, 2023, 4:30 p.m. OK Python 3 TESTS 13 155 11980800 1000
219004268 eugalt C Aug. 15, 2023, 5:16 p.m. OK Python 3 TESTS 13 171 307200 1000
219059256 kkk0 C Aug. 16, 2023, 5:39 a.m. OK Python 3 TESTS 13 171 5632000 1000
218998014 VioletVal C Aug. 15, 2023, 4:32 p.m. OK Python 3 TESTS 13 171 9318400 1000
219009156 JasonMendoza2008 C Aug. 15, 2023, 5:53 p.m. OK Python 3 TESTS 13 171 10240000 1000
219005016 hanbro0112 C Aug. 15, 2023, 5:21 p.m. OK Python 3 TESTS 13 186 5836800 1000
219039472 Navigato C Aug. 16, 2023, 2:04 a.m. OK Python 3 TESTS 13 186 6451200 1000
218995356 gmm_tea C Aug. 15, 2023, 4:27 p.m. OK Ruby 3 TESTS 13 327 2560000 1000
219037395 Spheniscine C Aug. 16, 2023, 1:39 a.m. OK Rust 2021 TESTS 13 15 3072000 1000
218995969 Sarievo C Aug. 15, 2023, 4:28 p.m. OK Rust 2021 TESTS 13 30 2457600 1000

remove filters

Back to search problems