Codeforces Round 728 (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
1541 Codeforces Round 728 (Div. 2) FINISHED False 8100 112544663 June 25, 2021, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 29666 ) A Pretty Permutations PROGRAMMING constructive algorithms greedy implementation

B'There are n cats in a line, labeled from 1 to n , with the i -th cat at position i . They are bored of gyrating in the same spot all day, so they want to reorder themselves such that no cat is in the same place as before. They are also lazy, so they want to minimize the total distance they move. Help them decide what cat should be at each location after the reordering. For example, if there are 3 cats, this is a valid reordering: [3, 1, 2] . No cat is in its original position. The total distance the cats move is 1 + 1 + 2 = 4 as cat 1 moves one place to the right, cat 2 moves one place to the right, and cat 3 moves two places to the left. The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. Then t test cases follow. The first and only line of each test case contains one integer n ( 2 <= q n <= q 100 ) -- the number of cats. It can be proven that under the constraints of the problem, an answer always exist. Output t answers, one for each test case. Each answer consists of n integers -- a permutation with the minimum total distance. If there are multiple answers, print any. For the first test case, there is only one possible permutation that satisfies the conditions: [2, 1] . The second test case was described in the statement. Another possible answer is [2, 3, 1] . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
120635048 lcy0026 A June 26, 2021, 4:50 a.m. OK Clang++17 Diagnostics TESTS 2 30 0
120626449 fpc_coder A June 26, 2021, 1:14 a.m. OK FPC TESTS 2 15 0
120606915 rk_23112k A June 25, 2021, 5:42 p.m. OK GNU C11 TESTS 2 0 0
120623320 AyushKumar2610 A June 25, 2021, 10:28 p.m. OK GNU C11 TESTS 2 15 0
120627187 sabyasachi.sahu13 A June 26, 2021, 1:44 a.m. OK GNU C11 TESTS 2 15 0
120629479 max0123 A June 26, 2021, 2:57 a.m. OK GNU C11 TESTS 2 15 0
120602275 akshara_14 A June 25, 2021, 5:27 p.m. OK GNU C11 TESTS 2 15 0
120605365 Adithya_mudumbai A June 25, 2021, 5:37 p.m. OK GNU C11 TESTS 2 15 0
120607653 sardaar_coders A June 25, 2021, 5:45 p.m. OK GNU C11 TESTS 2 15 0
120604835 shagor1 A June 25, 2021, 5:35 p.m. OK GNU C11 TESTS 2 15 0
120601234 CodeNinja_00 A June 25, 2021, 5:24 p.m. OK GNU C11 TESTS 2 15 0
120639637 wyxchn A June 26, 2021, 6 a.m. OK GNU C11 TESTS 2 30 0
120629542 Mars_Coder A June 26, 2021, 2:59 a.m. OK GNU C++11 TESTS 2 0 0
120629157 luogu_bot3 A June 26, 2021, 2:49 a.m. OK GNU C++11 TESTS 2 0 0
120629076 Dyuan A June 26, 2021, 2:47 a.m. OK GNU C++11 TESTS 2 0 0
120626934 dcmfqw A June 26, 2021, 1:33 a.m. OK GNU C++11 TESTS 2 0 0
120639786 Jsss A June 26, 2021, 6:02 a.m. OK GNU C++11 TESTS 2 0 0
120634615 Dewar-Deewana A June 26, 2021, 4:42 a.m. OK GNU C++11 TESTS 2 0 0
120634415 I_do_not_know A June 26, 2021, 4:39 a.m. OK GNU C++11 TESTS 2 0 0
120632326 DEAD_POOL2001 A June 26, 2021, 4:01 a.m. OK GNU C++11 TESTS 2 0 0
120631797 frog007 A June 26, 2021, 3:49 a.m. OK GNU C++11 TESTS 2 0 0
120630560 WHY2020 A June 26, 2021, 3:22 a.m. OK GNU C++11 TESTS 2 0 0
120637217 Lakshay452000 A June 26, 2021, 5:25 a.m. OK GNU C++14 TESTS 2 0 0
120638978 fucku2020 A June 26, 2021, 5:51 a.m. OK GNU C++14 TESTS 2 0 0
120639154 priyansh4900 A June 26, 2021, 5:53 a.m. OK GNU C++14 TESTS 2 0 0
120639204 hkdass001 A June 26, 2021, 5:54 a.m. OK GNU C++14 TESTS 2 0 0
120638633 gauravjain78200 A June 26, 2021, 5:46 a.m. OK GNU C++14 TESTS 2 0 0
120638440 Nishant_45 A June 26, 2021, 5:43 a.m. OK GNU C++14 TESTS 2 0 0
120638310 Saurabh_mahto A June 26, 2021, 5:41 a.m. OK GNU C++14 TESTS 2 0 0
120637929 srinidhinadendla A June 26, 2021, 5:36 a.m. OK GNU C++14 TESTS 2 0 0
120637724 shaikat0088 A June 26, 2021, 5:33 a.m. OK GNU C++14 TESTS 2 0 0
120637571 lokeshrekha2001 A June 26, 2021, 5:31 a.m. OK GNU C++14 TESTS 2 0 0
120638547 harshbajaj20292 A June 26, 2021, 5:45 a.m. OK GNU C++17 TESTS 2 0 0
120639631 1880akshay A June 26, 2021, 6 a.m. OK GNU C++17 TESTS 2 0 0
120639445 vish_wa A June 26, 2021, 5:57 a.m. OK GNU C++17 TESTS 2 0 0
120638848 Muhammad_mhs A June 26, 2021, 5:49 a.m. OK GNU C++17 TESTS 2 0 0
120638662 Samayra A June 26, 2021, 5:47 a.m. OK GNU C++17 TESTS 2 0 0
120638528 kary_ A June 26, 2021, 5:45 a.m. OK GNU C++17 TESTS 2 0 0
120638275 invinsible_sid A June 26, 2021, 5:40 a.m. OK GNU C++17 TESTS 2 0 0
120637919 sajib_shayan A June 26, 2021, 5:35 a.m. OK GNU C++17 TESTS 2 0 0
120637820 cinderella_5 A June 26, 2021, 5:34 a.m. OK GNU C++17 TESTS 2 0 0
120637429 AnandprakashDK A June 26, 2021, 5:28 a.m. OK GNU C++17 TESTS 2 0 0
120621847 EVTrainer A June 25, 2021, 9:31 p.m. OK GNU C++17 (64) TESTS 2 0 0
120622317 cloudcloud A June 25, 2021, 9:48 p.m. OK GNU C++17 (64) TESTS 2 0 0
120622444 Maksim1744 A June 25, 2021, 9:53 p.m. OK GNU C++17 (64) TESTS 2 0 0
120624331 oil20 A June 25, 2021, 11:23 p.m. OK GNU C++17 (64) TESTS 2 0 0
120626126 akdon1198 A June 26, 2021, 1 a.m. OK GNU C++17 (64) TESTS 2 0 0
120629256 Dragon_Emperor A June 26, 2021, 2:51 a.m. OK GNU C++17 (64) TESTS 2 0 0
120632337 Asterix_29 A June 26, 2021, 4:01 a.m. OK GNU C++17 (64) TESTS 2 0 0
120634339 Hasnaine_ A June 26, 2021, 4:37 a.m. OK GNU C++17 (64) TESTS 2 0 0
120637932 marcos_999 A June 26, 2021, 5:36 a.m. OK GNU C++17 (64) TESTS 2 0 0
120639459 Bob15324 A June 26, 2021, 5:57 a.m. OK GNU C++17 (64) TESTS 2 0 0
120630797 nguyenkimphuongtrang A June 26, 2021, 3:27 a.m. OK Haskell TESTS 2 15 0
120607339 cheese-cracker A June 25, 2021, 5:43 p.m. OK Haskell TESTS 2 15 102400
120610714 future_me A June 25, 2021, 6:15 p.m. OK Java 11 TESTS 2 155 0
120614112 zenilharia26 A June 25, 2021, 6:48 p.m. OK Java 11 TESTS 2 155 0
120613125 ak_ankit A June 25, 2021, 6:37 p.m. OK Java 11 TESTS 2 170 0
120612230 SaberXpro A June 25, 2021, 6:27 p.m. OK Java 11 TESTS 2 171 0
120631563 adarsh_goku A June 26, 2021, 3:44 a.m. OK Java 11 TESTS 2 171 0
120618645 sarthakmanna A June 25, 2021, 8:05 p.m. OK Java 11 TESTS 2 171 0
120612864 wizwilzo A June 25, 2021, 6:34 p.m. OK Java 11 TESTS 2 171 0
120632567 Tan_G56 A June 26, 2021, 4:06 a.m. OK Java 11 TESTS 2 186 0
120634693 ramuked A June 26, 2021, 4:44 a.m. OK Java 11 TESTS 2 186 0
120615596 maharishi1 A June 25, 2021, 7:09 p.m. OK Java 11 TESTS 2 186 0
120639207 lcheeme1 A June 26, 2021, 5:54 a.m. OK Java 8 TESTS 2 62 0
120626938 FLNA A June 26, 2021, 1:34 a.m. OK Java 8 TESTS 2 78 0
120614584 vicky_gupta A June 25, 2021, 6:54 p.m. OK Java 8 TESTS 2 93 0
120639234 sankcan55 A June 26, 2021, 5:54 a.m. OK Java 8 TESTS 2 93 0
120638595 jainmilind A June 26, 2021, 5:46 a.m. OK Java 8 TESTS 2 93 0
120636261 gagan_6730 A June 26, 2021, 5:10 a.m. OK Java 8 TESTS 2 93 0
120633125 aviJ A June 26, 2021, 4:16 a.m. OK Java 8 TESTS 2 93 0
120632611 aviJ A June 26, 2021, 4:06 a.m. OK Java 8 TESTS 2 93 0
120629151 athu18 A June 26, 2021, 2:49 a.m. OK Java 8 TESTS 2 93 0
120610708 Dstoical A June 25, 2021, 6:15 p.m. OK Java 8 TESTS 2 93 0
120613709 koper A June 25, 2021, 6:43 p.m. OK Kotlin TESTS 2 124 0
120626521 caesaroh A June 26, 2021, 1:17 a.m. OK Kotlin TESTS 2 124 0
120632309 rabbitsthecat A June 26, 2021, 4 a.m. OK Kotlin TESTS 2 124 204800
120611319 Tlatoani A June 25, 2021, 6:19 p.m. OK Kotlin TESTS 2 139 102400
120631887 Potassium A June 26, 2021, 3:51 a.m. OK Kotlin TESTS 2 139 307200
120619810 lhcalphaA A June 25, 2021, 8:31 p.m. OK MS C++ 2017 TESTS 2 15 0
120638064 OMgL A June 26, 2021, 5:38 a.m. OK MS C++ 2017 TESTS 2 15 0
120630206 exode4 A June 26, 2021, 3:14 a.m. OK MS C++ 2017 TESTS 2 15 0
120626334 Rick_GT A June 26, 2021, 1:10 a.m. OK MS C++ 2017 TESTS 2 15 0
120624656 _Rimjhim_36 A June 25, 2021, 11:44 p.m. OK MS C++ 2017 TESTS 2 15 0
120619177 incuiio A June 25, 2021, 8:17 p.m. OK MS C++ 2017 TESTS 2 15 0
120616206 Baobab0304 A June 25, 2021, 7:19 p.m. OK MS C++ 2017 TESTS 2 15 0
120611928 Vitazzz A June 25, 2021, 6:25 p.m. OK MS C++ 2017 TESTS 2 15 0
120610227 Tangerine A June 25, 2021, 6:12 p.m. OK MS C++ 2017 TESTS 2 15 0
120603462 Yogesh_iitd A June 25, 2021, 5:31 p.m. OK MS C++ 2017 TESTS 2 15 0
120630902 hossain95 A June 26, 2021, 3:30 a.m. OK .NET Core C# TESTS 2 77 204800
120614055 ShashankZobb A June 25, 2021, 6:48 p.m. OK PyPy 2 TESTS 2 77 409600
120617844 nhipata A June 25, 2021, 7:48 p.m. OK PyPy 2 TESTS 2 93 1843200
120615461 Marshmello A June 25, 2021, 7:07 p.m. OK PyPy 2 TESTS 2 171 2764800
120612505 asheux A June 25, 2021, 6:30 p.m. OK PyPy 3 TESTS 2 77 1433600
120611428 asheux A June 25, 2021, 6:20 p.m. OK PyPy 3 TESTS 2 77 1433600
120601069 sPARTY A June 25, 2021, 5:23 p.m. OK PyPy 3 TESTS 2 77 2048000
120637522 bukunu A June 26, 2021, 5:30 a.m. OK PyPy 3 TESTS 2 93 1331200
120623912 ISSilva A June 25, 2021, 10:58 p.m. OK PyPy 3 TESTS 2 93 1433600
120611194 rivnam A June 25, 2021, 6:18 p.m. OK PyPy 3 TESTS 2 93 2048000
120600680 Mehnaj_islam A June 25, 2021, 5:22 p.m. OK PyPy 3 TESTS 2 93 2252800
120614870 SPD_9X2 A June 25, 2021, 6:58 p.m. OK PyPy 3 TESTS 2 93 2355200
120632569 jitendra_joshi3112000 A June 26, 2021, 4:06 a.m. OK PyPy 3 TESTS 2 93 2560000
120613304 dheerajkhatri0802 A June 25, 2021, 6:39 p.m. OK PyPy 3 TESTS 2 93 2560000
120623700 eugalt A June 25, 2021, 10:47 p.m. OK Python 3 TESTS 2 46 0
120638976 albertino1903 A June 26, 2021, 5:51 a.m. OK Python 3 TESTS 2 46 0
120636831 nattu179 A June 26, 2021, 5:19 a.m. OK Python 3 TESTS 2 46 0
120635797 Into_You A June 26, 2021, 5:02 a.m. OK Python 3 TESTS 2 46 0
120633770 thErocKstaR A June 26, 2021, 4:28 a.m. OK Python 3 TESTS 2 46 0
120632367 dwijit17 A June 26, 2021, 4:02 a.m. OK Python 3 TESTS 2 46 0
120632365 Nirey A June 26, 2021, 4:01 a.m. OK Python 3 TESTS 2 46 0
120628228 kaviruban A June 26, 2021, 2:23 a.m. OK Python 3 TESTS 2 46 0
120627860 y_axis A June 26, 2021, 2:11 a.m. OK Python 3 TESTS 2 46 0
120621914 abhidcoder_ A June 25, 2021, 9:34 p.m. OK Python 3 TESTS 2 46 0

remove filters

Back to search problems