Codeforces Round 829 (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
1754 Codeforces Round 829 (Div. 2) FINISHED False 7200 70754963 Oct. 23, 2022, 7:50 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19082 ) B Kevin and Permutation PROGRAMMING constructive algorithms constructive algorithms math 800

B"For his birthday, Kevin received the set of pairwise distinct numbers 1, 2, 3, ldots, n as a gift. He is going to arrange these numbers in a way such that the minimum absolute difference between two consecutive numbers be maximum possible. More formally, if he arranges numbers in order p_1, p_2, ldots, p_n , he wants to maximize the value min limits_{i=1}^{n - 1} lvert p_{i + 1} - p_i rvert, where |x| denotes the absolute value of x . Help Kevin to do that. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. Description of the test cases follows. The only line of each test case contains an integer n ( 2 <= n <= q 1 ,000 ) -- the size of the set. For each test case print a single line containing n distinct integers p_1, p_2, ldots, p_n ( 1 <= p_i <= n ) describing the arrangement that maximizes the minimum absolute difference of consecutive elements. Formally, you have to print a permutation p which maximizes the value min limits_{i=1}^{n - 1} lvert p_{i + 1} - p_i rvert . If there are multiple optimal solutions, print any of them. In the first test case the minimum absolute difference of consecutive elements equals min { lvert 4 - 2 rvert, lvert 1 - 4 rvert, lvert 3 - 1 rvert } = min {2, 3, 2 } = 2 . It's easy to prove that this answer is optimal. In the second test case each permutation of numbers 1, 2, 3 is an optimal answer. The minimum absolute difference of consecutive elements equals to 1 . "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
177694573 TIN-slayer B Oct. 23, 2022, 8 p.m. OK C# 10 TESTS 6 124 2252800 800
177692962 GO_MO B Oct. 23, 2022, 7:35 p.m. OK C# 10 TESTS 6 124 2355200 800
177707035 dzechan98 B Oct. 24, 2022, 1:14 a.m. OK Clang++17 Diagnostics TESTS 6 124 0 800
177671167 SP2003 B Oct. 23, 2022, 4:13 p.m. OK GNU C11 TESTS 6 78 0 800
177657374 zl17 B Oct. 23, 2022, 2:22 p.m. OK GNU C11 TESTS 6 139 0 800
177685216 TahmidMuntaser B Oct. 23, 2022, 6:27 p.m. OK GNU C11 TESTS 6 155 0 800
177603386 pradeepc B Oct. 23, 2022, 9:47 a.m. OK GNU C11 TESTS 6 155 0 800
177723159 TQY0228 B Oct. 24, 2022, 6:03 a.m. OK GNU C11 TESTS 6 186 0 800
177710800 puja_24 B Oct. 24, 2022, 2:34 a.m. OK GNU C++14 TESTS 6 0 0 800
177706177 ko_RT_nya B Oct. 24, 2022, 12:50 a.m. OK GNU C++14 TESTS 6 0 0 800
177705289 maybee_utkarsh B Oct. 24, 2022, 12:21 a.m. OK GNU C++14 TESTS 6 0 0 800
177703012 Liu_Kevin B Oct. 23, 2022, 11:08 p.m. OK GNU C++14 TESTS 6 0 0 800
177668136 Ravi_Savsani B Oct. 23, 2022, 3:47 p.m. OK GNU C++14 TESTS 6 0 0 800
177656374 neeraj_91277 B Oct. 23, 2022, 2:15 p.m. OK GNU C++14 TESTS 6 0 0 800
177652947 OrazB B Oct. 23, 2022, 1:52 p.m. OK GNU C++14 TESTS 6 0 0 800
177599795 tace B Oct. 23, 2022, 9:38 a.m. OK GNU C++14 TESTS 6 0 0 800
177720951 December456 B Oct. 24, 2022, 5:32 a.m. OK GNU C++14 TESTS 6 0 0 800
177710812 zyk2507 B Oct. 24, 2022, 2:34 a.m. OK GNU C++14 TESTS 6 0 0 800
177701892 xiaofanxian810 B Oct. 23, 2022, 10:32 p.m. OK GNU C++17 TESTS 6 0 0 800
177701158 infinity567 B Oct. 23, 2022, 10:09 p.m. OK GNU C++17 TESTS 6 0 0 800
177695533 gupta_gopal B Oct. 23, 2022, 8:15 p.m. OK GNU C++17 TESTS 6 0 0 800
177693278 tanishq1508 B Oct. 23, 2022, 7:39 p.m. OK GNU C++17 TESTS 6 0 0 800
177674554 Ekubo261 B Oct. 23, 2022, 4:43 p.m. OK GNU C++17 TESTS 6 0 0 800
177708422 Sahil3002 B Oct. 24, 2022, 1:48 a.m. OK GNU C++17 TESTS 6 0 0 800
177712878 DiegoIvan B Oct. 24, 2022, 3:11 a.m. OK GNU C++17 TESTS 6 0 0 800
177720662 ouubai B Oct. 24, 2022, 5:28 a.m. OK GNU C++17 TESTS 6 0 0 800
177705319 MinhThang B Oct. 24, 2022, 12:22 a.m. OK GNU C++17 TESTS 6 0 0 800
177705061 Bananayy B Oct. 24, 2022, 12:15 a.m. OK GNU C++17 TESTS 6 0 0 800
177699247 joao.breno.ro17 B Oct. 23, 2022, 9:21 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177717539 Muly B Oct. 24, 2022, 4:36 a.m. OK GNU C++17 (64) TESTS 6 0 0 800
177706879 shiyunhao B Oct. 24, 2022, 1:10 a.m. OK GNU C++17 (64) TESTS 6 0 0 800
177702439 ALILILILILI-KHAN B Oct. 23, 2022, 10:49 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177701665 enslaved B Oct. 23, 2022, 10:24 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177691157 Mosharrof13 B Oct. 23, 2022, 7:11 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177686464 AAAAA_A B Oct. 23, 2022, 6:42 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177684991 incursive B Oct. 23, 2022, 6:25 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177682238 MateoCV B Oct. 23, 2022, 5:56 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177682161 rounak_58 B Oct. 23, 2022, 5:55 p.m. OK GNU C++17 (64) TESTS 6 0 0 800
177721395 DarkyBoy B Oct. 24, 2022, 5:39 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177721240 rafarkabir B Oct. 24, 2022, 5:37 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177720969 _pallab_99 B Oct. 24, 2022, 5:33 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177720893 ishwarendra B Oct. 24, 2022, 5:31 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177720259 TecV B Oct. 24, 2022, 5:21 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177721487 Fysty B Oct. 24, 2022, 5:40 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177722064 wangzheng2008 B Oct. 24, 2022, 5:48 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177722197 aryan1602 B Oct. 24, 2022, 5:50 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177722746 saumya25 B Oct. 24, 2022, 5:58 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177723006 welleyth B Oct. 24, 2022, 6:01 a.m. OK GNU C++20 (64) TESTS 6 0 0 800
177665647 procrastinate7 B Oct. 23, 2022, 3:27 p.m. OK Java 11 TESTS 6 171 0 800
177717290 SpookyJumpyBeans B Oct. 24, 2022, 4:32 a.m. OK Java 11 TESTS 6 202 0 800
177708323 KarMa_ B Oct. 24, 2022, 1:45 a.m. OK Java 11 TESTS 6 202 0 800
177705517 wat2 B Oct. 24, 2022, 12:28 a.m. OK Java 11 TESTS 6 202 24371200 800
177705447 wat2 B Oct. 24, 2022, 12:26 a.m. OK Java 11 TESTS 6 202 24371200 800
177660016 FirstException B Oct. 23, 2022, 2:43 p.m. OK Java 11 TESTS 6 202 40448000 800
177674170 AadishJain B Oct. 23, 2022, 4:40 p.m. OK Java 11 TESTS 6 265 0 800
177660153 rd37574 B Oct. 23, 2022, 2:44 p.m. OK Java 11 TESTS 6 295 0 800
177664710 ajha45021 B Oct. 23, 2022, 3:19 p.m. OK Java 11 TESTS 6 296 0 800
177653413 rajneesh.osho B Oct. 23, 2022, 1:55 p.m. OK Java 11 TESTS 6 311 0 800
177670394 anuragkr898 B Oct. 23, 2022, 4:06 p.m. OK Java 17 TESTS 6 202 409600 800
177721860 manvendramehrotra B Oct. 24, 2022, 5:45 a.m. OK Java 17 TESTS 6 218 307200 800
177666788 silkwom B Oct. 23, 2022, 3:36 p.m. OK Java 17 TESTS 6 233 614400 800
177597788 code_my_way123 B Oct. 23, 2022, 9:33 a.m. OK Java 17 TESTS 6 280 102400 800
177597148 zEzzlike B Oct. 23, 2022, 9:31 a.m. OK Java 17 TESTS 6 311 409600 800
177653186 sharadtandale2878 B Oct. 23, 2022, 1:53 p.m. OK Java 17 TESTS 6 343 512000 800
177718142 Anurag-singh B Oct. 24, 2022, 4:47 a.m. OK Java 17 TESTS 6 421 102400 800
177719849 gssakash B Oct. 24, 2022, 5:15 a.m. OK Java 8 TESTS 6 92 0 800
177676902 Sussykin B Oct. 23, 2022, 5:06 p.m. OK Java 8 TESTS 6 93 0 800
177669154 Koka B Oct. 23, 2022, 3:56 p.m. OK Java 8 TESTS 6 93 0 800
177659422 ankit_0207 B Oct. 23, 2022, 2:38 p.m. OK Java 8 TESTS 6 93 0 800
177657575 xulunfan B Oct. 23, 2022, 2:24 p.m. OK Java 8 TESTS 6 109 0 800
177657412 youtsuha B Oct. 23, 2022, 2:22 p.m. OK Java 8 TESTS 6 109 0 800
177646941 ikillmyself B Oct. 23, 2022, 1:07 p.m. OK Java 8 TESTS 6 109 0 800
177603677 Do_not_Look_Back B Oct. 23, 2022, 9:47 a.m. OK Java 8 TESTS 6 109 0 800
177651782 Otepbergen B Oct. 23, 2022, 1:44 p.m. OK Java 8 TESTS 6 109 4096000 800
177654485 Kenzhezhan B Oct. 23, 2022, 2:01 p.m. OK Java 8 TESTS 6 155 0 800
177596907 in_the_Air B Oct. 23, 2022, 9:31 a.m. OK Kotlin 1.6 TESTS 6 295 0 800
177657621 Rivennnnnnnmm B Oct. 23, 2022, 2:24 p.m. OK MS C++ 2017 TESTS 6 15 0 800
177598646 gkukanov B Oct. 23, 2022, 9:35 a.m. OK MS C++ 2017 TESTS 6 15 0 800
177716017 Zq5437 B Oct. 24, 2022, 4:06 a.m. OK MS C++ 2017 TESTS 6 30 102400 800
177671971 shivamaggarwal513 B Oct. 23, 2022, 4:20 p.m. OK MS C++ 2017 TESTS 6 31 0 800
177678448 akimuuwu B Oct. 23, 2022, 5:21 p.m. OK PyPy 3 TESTS 6 77 1843200 800
177660495 misorin B Oct. 23, 2022, 2:46 p.m. OK PyPy 3 TESTS 6 78 2560000 800
177718573 sw_enthusiast B Oct. 24, 2022, 4:54 a.m. OK PyPy 3 TESTS 6 93 66969600 800
177597265 PumpkinSpiceLatte B Oct. 23, 2022, 9:32 a.m. OK PyPy 3 TESTS 6 108 2867200 800
177720617 sgcc B Oct. 24, 2022, 5:27 a.m. OK PyPy 3 TESTS 6 109 4403200 800
177718744 bokunopicolo B Oct. 24, 2022, 4:58 a.m. OK PyPy 3 TESTS 6 109 5324800 800
177679600 Yash_Nandwana B Oct. 23, 2022, 5:32 p.m. OK PyPy 3 TESTS 6 124 3686400 800
177598422 arpan.parikh B Oct. 23, 2022, 9:35 a.m. OK PyPy 3 TESTS 6 124 4608000 800
177649142 bpdolson B Oct. 23, 2022, 1:29 p.m. OK PyPy 3 TESTS 6 155 3379200 800
177682770 LegEndary1155 B Oct. 23, 2022, 6:01 p.m. OK PyPy 3-64 TESTS 6 46 2355200 800
177595100 IamDIPANKAR B Oct. 23, 2022, 9:26 a.m. OK PyPy 3-64 TESTS 6 61 1740800 800
177602285 Kalyano B Oct. 23, 2022, 9:44 a.m. OK PyPy 3-64 TESTS 6 61 2560000 800
177714556 ZaeThrix B Oct. 24, 2022, 3:39 a.m. OK PyPy 3-64 TESTS 6 61 3481600 800
177602158 Alpha_Zer0 B Oct. 23, 2022, 9:44 a.m. OK PyPy 3-64 TESTS 6 62 1638400 800
177597693 harshvora64 B Oct. 23, 2022, 9:33 a.m. OK PyPy 3-64 TESTS 6 62 1843200 800
177665765 sabj B Oct. 23, 2022, 3:28 p.m. OK PyPy 3-64 TESTS 6 62 2457600 800
177714616 ZaeThrix B Oct. 24, 2022, 3:40 a.m. OK PyPy 3-64 TESTS 6 62 3481600 800
177682282 H3X460N157 B Oct. 23, 2022, 5:57 p.m. OK PyPy 3-64 TESTS 6 62 3481600 800
177716448 chromate00 B Oct. 24, 2022, 4:14 a.m. OK PyPy 3-64 TESTS 6 62 4198400 800
177671154 Calliope B Oct. 23, 2022, 4:13 p.m. OK Python 3 TESTS 6 61 409600 800
177665913 Musab1Blaser B Oct. 23, 2022, 3:29 p.m. OK Python 3 TESTS 6 62 0 800
177720002 xxgiasonxx B Oct. 24, 2022, 5:17 a.m. OK Python 3 TESTS 6 77 0 800
177675950 Aadi03 B Oct. 23, 2022, 4:57 p.m. OK Python 3 TESTS 6 77 0 800
177663665 binilj04 B Oct. 23, 2022, 3:11 p.m. OK Python 3 TESTS 6 77 0 800
177656568 idk_coding B Oct. 23, 2022, 2:16 p.m. OK Python 3 TESTS 6 77 0 800
177602140 Alouchte B Oct. 23, 2022, 9:44 a.m. OK Python 3 TESTS 6 77 0 800
177598737 glexa B Oct. 23, 2022, 9:35 a.m. OK Python 3 TESTS 6 77 0 800
177596888 UTTAM_02 B Oct. 23, 2022, 9:31 a.m. OK Python 3 TESTS 6 77 102400 800
177686046 propashii B Oct. 23, 2022, 6:37 p.m. OK Python 3 TESTS 6 77 716800 800

remove filters

Back to search problems