Codeforces Round 633 (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
1339 Codeforces Round 633 (Div. 2) FINISHED False 7200 150652511 April 12, 2020, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 26779 ) B Sorted Adjacent Differences PROGRAMMING constructive algorithms sortings

B'You have array of n numbers a_{1}, a_{2}, ldots, a_{n} . Rearrange these numbers to satisfy |a_{1} - a_{2}| <= |a_{2} - a_{3}| <= ldots <= |a_{n-1} - a_{n}| , where |x| denotes absolute value of x . It 's always possible to find such rearrangement. Note that all numbers in a are not necessarily different. In other words, some numbers of a may be same. You have to answer independent t test cases. The first line contains a single integer t ( 1 <= t <= 10^{4} ) -- the number of test cases. The first line of each test case contains single integer n ( 3 <= n <= 10^{5} ) -- the length of array a . It is guaranteed that the sum of values of n over all test cases in the input does not exceed 10^{5} . The second line of each test case contains n integers a_{1}, a_{2}, ldots, a_{n} ( -10^{9} <= a_{i} <= 10^{9} ). For each test case, print the rearranged version of array a which satisfies given condition. If there are multiple valid rearrangements, print any of them. In the first test case, after given rearrangement, |a_{1} - a_{2}| = 0 <= |a_{2} - a_{3}| = 1 <= |a_{3} - a_{4}| = 2 <= |a_{4} - a_{5}| = 2 <= |a_{5} - a_{6}| = 10 . There are other possible answers like "5 4 5 6 -2 8". In the second test case, after given rearrangement, |a_{1} - a_{2}| = 1 <= |a_{2} - a_{3}| = 2 <= |a_{3} - a_{4}| = 4 . There are other possible answers like "2 4 8 1". '...

Tutorials

Codeforces Round #633 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
76441974 TiorK B April 13, 2020, 2:16 a.m. OK Clang++17 Diagnostics TESTS 12 171 307200
76440144 fpc_coder B April 13, 2020, 1:28 a.m. OK FPC TESTS 12 342 409600
76382989 PAG B April 12, 2020, 3:18 p.m. OK FPC TESTS 12 342 819200
76378771 Madalina_Chirpicinic B April 12, 2020, 3:10 p.m. OK FPC TESTS 12 374 15155200
76387300 Winivin B April 12, 2020, 3:28 p.m. OK GNU C11 TESTS 12 264 819200
76411902 pallavpp B April 12, 2020, 5:30 p.m. OK GNU C11 TESTS 12 265 409600
76434631 ARSLANNN B April 12, 2020, 10:45 p.m. OK GNU C11 TESTS 12 265 614400
76389798 Mithu.ict B April 12, 2020, 3:33 p.m. OK GNU C11 TESTS 12 280 921600
76429943 Mahedee B April 12, 2020, 8:58 p.m. OK GNU C11 TESTS 12 390 819200
76431623 phos2103 B April 12, 2020, 9:31 p.m. OK GNU C11 TESTS 12 390 1638400
76446314 satyam_5123 B April 13, 2020, 3:53 a.m. OK GNU C11 TESTS 12 405 819200
76409182 rialkush B April 12, 2020, 5:10 p.m. OK GNU C11 TESTS 12 405 819200
76383504 tarush0605 B April 12, 2020, 3:20 p.m. OK GNU C11 TESTS 12 405 819200
76378609 ananaygupta70 B April 12, 2020, 3:09 p.m. OK GNU C11 TESTS 12 405 819200
76440694 QwQcOrZ B April 13, 2020, 1:42 a.m. OK GNU C++11 TESTS 12 31 409600
76368795 WZP2018 B April 12, 2020, 2:52 p.m. OK GNU C++11 TESTS 12 46 409600
76363127 geomancy B April 12, 2020, 2:43 p.m. OK GNU C++11 TESTS 12 46 409600
76361614 dreamdream B April 12, 2020, 2:41 p.m. OK GNU C++11 TESTS 12 46 409600
76360689 devout B April 12, 2020, 2:39 p.m. OK GNU C++11 TESTS 12 46 409600
76359414 Baybay B April 12, 2020, 2:37 p.m. OK GNU C++11 TESTS 12 46 409600
76369582 orzxz B April 12, 2020, 2:53 p.m. OK GNU C++11 TESTS 12 46 409600
76371782 haimin B April 12, 2020, 2:57 p.m. OK GNU C++11 TESTS 12 46 409600
76381200 J_IE B April 12, 2020, 3:15 p.m. OK GNU C++11 TESTS 12 46 409600
76415929 Dan13llljws B April 12, 2020, 6:04 p.m. OK GNU C++11 TESTS 12 46 409600
76382869 vishnu_m B April 12, 2020, 3:18 p.m. OK GNU C++14 TESTS 12 46 819200
76358225 IArifAlta B April 12, 2020, 2:36 p.m. OK GNU C++14 TESTS 12 46 4608000
76419556 HAEtaRhoEta B April 12, 2020, 6:40 p.m. OK GNU C++14 TESTS 12 61 409600
76422419 Th3Rd_bR0 B April 12, 2020, 7:11 p.m. OK GNU C++14 TESTS 12 61 819200
76367654 hope_it_ac B April 12, 2020, 2:50 p.m. OK GNU C++14 TESTS 12 61 819200
76359925 rentu B April 12, 2020, 2:38 p.m. OK GNU C++14 TESTS 12 61 819200
76366371 gorileo B April 12, 2020, 2:48 p.m. OK GNU C++14 TESTS 12 61 819200
76421955 PStepien B April 12, 2020, 7:05 p.m. OK GNU C++14 TESTS 12 61 819200
76410513 2fid B April 12, 2020, 5:19 p.m. OK GNU C++14 TESTS 12 61 1433600
76365835 GEMAmedeiros B April 12, 2020, 2:47 p.m. OK GNU C++14 TESTS 12 61 1638400
76437653 _andyli B April 13, 2020, 12:14 a.m. OK GNU C++17 TESTS 12 31 4608000
76442788 Maybach B April 13, 2020, 2:37 a.m. OK GNU C++17 TESTS 12 46 2457600
76414120 Tanvir_Rasel B April 12, 2020, 5:48 p.m. OK GNU C++17 TESTS 12 61 409600
76359274 TomatoGuy0502 B April 12, 2020, 2:37 p.m. OK GNU C++17 TESTS 12 61 512000
76422228 gihewapos B April 12, 2020, 7:08 p.m. OK GNU C++17 TESTS 12 61 819200
76435185 xiahongyu B April 12, 2020, 10:59 p.m. OK GNU C++17 TESTS 12 61 819200
76419983 joseacaz B April 12, 2020, 6:45 p.m. OK GNU C++17 TESTS 12 61 819200
76362802 kronos B April 12, 2020, 2:42 p.m. OK GNU C++17 TESTS 12 61 819200
76403015 mateusrjbrasil B April 12, 2020, 4:03 p.m. OK GNU C++17 TESTS 12 61 1126400
76412185 Bench0310 B April 12, 2020, 5:32 p.m. OK GNU C++17 TESTS 12 61 1433600
76387137 Khostiqa B April 12, 2020, 3:27 p.m. OK GNU C++17 (64) TESTS 12 46 409600
76375244 syawl-1017 B April 12, 2020, 3:03 p.m. OK GNU C++17 (64) TESTS 12 46 819200
76447993 Theofratus B April 13, 2020, 4:25 a.m. OK GNU C++17 (64) TESTS 12 46 819200
76427714 Falla7 B April 12, 2020, 8:22 p.m. OK GNU C++17 (64) TESTS 12 46 1228800
76436223 ankushkhanna B April 12, 2020, 11:30 p.m. OK GNU C++17 (64) TESTS 12 46 1536000
76409213 TselmegKh B April 12, 2020, 5:10 p.m. OK GNU C++17 (64) TESTS 12 46 1536000
76407276 anzuof B April 12, 2020, 4:57 p.m. OK GNU C++17 (64) TESTS 12 46 1638400
76424781 Ameliorate B April 12, 2020, 7:40 p.m. OK GNU C++17 (64) TESTS 12 46 2048000
76408973 prottoyfuad B April 12, 2020, 5:08 p.m. OK GNU C++17 (64) TESTS 12 46 2662400
76425018 Akulyat B April 12, 2020, 7:44 p.m. OK GNU C++17 (64) TESTS 12 46 2969600
76377733 justplesh B April 12, 2020, 3:08 p.m. OK Go TESTS 12 108 5222400
76375502 snow_bear_328 B April 12, 2020, 3:04 p.m. OK Go TESTS 12 421 5427200
76428559 ddhroov10 B April 12, 2020, 8:34 p.m. OK Java 11 TESTS 12 233 0
76396061 wabadabakalakaboo B April 12, 2020, 3:48 p.m. OK Java 11 TESTS 12 233 0
76358870 atishay127 B April 12, 2020, 2:37 p.m. OK Java 11 TESTS 12 233 0
76387187 rgupta917 B April 12, 2020, 3:28 p.m. OK Java 11 TESTS 12 249 0
76370354 avijit_agarwal B April 12, 2020, 2:54 p.m. OK Java 11 TESTS 12 249 0
76358781 idk321 B April 12, 2020, 2:37 p.m. OK Java 11 TESTS 12 249 0
76414987 nickleoden299 B April 12, 2020, 5:56 p.m. OK Java 11 TESTS 12 249 1638400
76422152 Clowyy B April 12, 2020, 7:08 p.m. OK Java 11 TESTS 12 264 0
76413830 jaynils B April 12, 2020, 5:46 p.m. OK Java 11 TESTS 12 265 0
76365962 D2XP B April 12, 2020, 2:47 p.m. OK Java 11 TESTS 12 265 0
76368857 johnny16 B April 12, 2020, 2:52 p.m. OK Java 8 TESTS 12 139 0
76366003 MakeMoroccoGreatAgain B April 12, 2020, 2:47 p.m. OK Java 8 TESTS 12 139 0
76412895 labdhi B April 12, 2020, 5:38 p.m. OK Java 8 TESTS 12 140 0
76408112 yash49 B April 12, 2020, 5:02 p.m. OK Java 8 TESTS 12 140 0
76420362 marcose18 B April 12, 2020, 6:49 p.m. OK Java 8 TESTS 12 155 0
76414509 ravi_dtu B April 12, 2020, 5:52 p.m. OK Java 8 TESTS 12 155 0
76388056 afidodree B April 12, 2020, 3:30 p.m. OK Java 8 TESTS 12 155 0
76382939 dewanshnigam B April 12, 2020, 3:18 p.m. OK Java 8 TESTS 12 155 0
76382211 saikaushik B April 12, 2020, 3:17 p.m. OK Java 8 TESTS 12 155 0
76378527 Pranay2516 B April 12, 2020, 3:09 p.m. OK Java 8 TESTS 12 155 0
76366892 link_alex B April 12, 2020, 2:49 p.m. OK JavaScript TESTS 12 139 21606400
76420485 arpit2438735 B April 12, 2020, 6:50 p.m. OK JavaScript TESTS 12 139 21708800
76362974 timurtibeyev B April 12, 2020, 2:43 p.m. OK Kotlin TESTS 12 202 409600
76408692 Tlatoani B April 12, 2020, 5:06 p.m. OK Kotlin TESTS 12 233 2764800
76369709 Hakiobo B April 12, 2020, 2:53 p.m. OK Kotlin TESTS 12 233 6348800
76435992 abdukodir B April 12, 2020, 11:23 p.m. OK Kotlin TESTS 12 311 8499200
76374731 sid9406 B April 12, 2020, 3:02 p.m. OK Kotlin TESTS 12 343 8499200
76389633 princebelkovetz B April 12, 2020, 3:33 p.m. OK Kotlin TESTS 12 639 8601600
76376148 paulus B April 12, 2020, 3:05 p.m. OK Kotlin TESTS 12 670 8089600
76372200 sergmel B April 12, 2020, 2:58 p.m. OK Kotlin TESTS 12 686 8089600
76388555 mbakalov B April 12, 2020, 3:31 p.m. OK Mono C# TESTS 12 140 24678400
76372307 orloffm B April 12, 2020, 2:58 p.m. OK Mono C# TESTS 12 140 25907200
76365127 kilicars B April 12, 2020, 2:46 p.m. OK Mono C# TESTS 12 140 27648000
76377955 mishgan B April 12, 2020, 3:08 p.m. OK Mono C# TESTS 12 155 27750400
76373889 tvvister B April 12, 2020, 3:01 p.m. OK Mono C# TESTS 12 155 28672000
76393882 ravinem1 B April 12, 2020, 3:43 p.m. OK Mono C# TESTS 12 156 29696000
76366165 Anastasiya_Andreevna B April 12, 2020, 2:47 p.m. OK Mono C# TESTS 12 264 27955200
76425411 ilia.kot B April 12, 2020, 7:49 p.m. OK Mono C# TESTS 12 265 21708800
76359868 MyEighthName B April 12, 2020, 2:38 p.m. OK Mono C# TESTS 12 296 36659200
76370855 melnikova.myu B April 12, 2020, 2:55 p.m. OK Mono C# TESTS 12 405 15155200
76364628 fucking_man B April 12, 2020, 2:45 p.m. OK MS C++ TESTS 12 78 1638400
76362751 tranthanhtra B April 12, 2020, 2:42 p.m. OK MS C++ TESTS 12 171 409600
76437427 weiguangyuehui B April 13, 2020, 12:07 a.m. OK MS C++ TESTS 12 171 819200
76378604 frigobar B April 12, 2020, 3:09 p.m. OK MS C++ TESTS 12 171 1843200
76391701 YTICpoch B April 12, 2020, 3:38 p.m. OK MS C++ TESTS 12 217 4812800
76372196 dundae B April 12, 2020, 2:58 p.m. OK MS C++ 2017 TESTS 12 77 409600
76364097 jackcaptain B April 12, 2020, 2:44 p.m. OK MS C++ 2017 TESTS 12 78 409600
76374190 hwqconceptnick B April 12, 2020, 3:01 p.m. OK MS C++ 2017 TESTS 12 78 409600
76436245 leventa B April 12, 2020, 11:31 p.m. OK MS C++ 2017 TESTS 12 78 819200
76437215 SPOON796 B April 13, 2020, midnight OK MS C++ 2017 TESTS 12 78 1638400
76436195 SPOON796 B April 12, 2020, 11:29 p.m. OK MS C++ 2017 TESTS 12 78 1638400
76414312 TMHazem B April 12, 2020, 5:50 p.m. OK MS C++ 2017 TESTS 12 78 4812800
76396326 Bigface B April 12, 2020, 3:49 p.m. OK MS C++ 2017 TESTS 12 78 7987200
76358851 naitsabes.ezluhcs B April 12, 2020, 2:37 p.m. OK MS C++ 2017 TESTS 12 93 409600
76384155 Zhoujie1999 B April 12, 2020, 3:21 p.m. OK MS C++ 2017 TESTS 12 93 409600
76379778 durjoy_talukdar B April 12, 2020, 3:12 p.m. OK Node.js TESTS 12 342 20275200
76389058 olga-rmrf B April 12, 2020, 3:32 p.m. OK Node.js TESTS 12 358 18739200
76369061 vixenn B April 12, 2020, 2:52 p.m. OK Node.js TESTS 12 358 20070400
76434106 nioh B April 12, 2020, 10:31 p.m. OK Node.js TESTS 12 374 19558400
76434154 nioh B April 12, 2020, 10:32 p.m. OK Node.js TESTS 12 389 19558400
76383768 Golub_mihail B April 12, 2020, 3:20 p.m. OK PascalABC.NET TESTS 12 998 0
76381401 snape_here B April 12, 2020, 3:15 p.m. OK PyPy 2 TESTS 12 171 11264000
76411509 realnimish B April 12, 2020, 5:26 p.m. OK PyPy 2 TESTS 12 202 15667200
76368508 zaceleiseliakai B April 12, 2020, 2:51 p.m. OK PyPy 2 TESTS 12 265 11468800
76366936 arccosh B April 12, 2020, 2:49 p.m. OK PyPy 2 TESTS 12 389 15360000
76393115 rayu B April 12, 2020, 3:41 p.m. OK PyPy 2 TESTS 12 436 13312000
76396300 bazzyadb B April 12, 2020, 3:49 p.m. OK PyPy 2 TESTS 12 701 10137600
76360246 PracticeAccountICL B April 12, 2020, 2:39 p.m. OK PyPy 3 TESTS 12 233 15257600
76421581 Why_WA B April 12, 2020, 7:01 p.m. OK PyPy 3 TESTS 12 248 12800000
76365815 vishwesh20 B April 12, 2020, 2:47 p.m. OK PyPy 3 TESTS 12 265 10752000
76412213 hulky_bulky B April 12, 2020, 5:32 p.m. OK PyPy 3 TESTS 12 280 11059200
76419650 omarnvidia B April 12, 2020, 6:41 p.m. OK PyPy 3 TESTS 12 280 12390400
76366430 brthyyjp B April 12, 2020, 2:48 p.m. OK PyPy 3 TESTS 12 280 13004800
76358826 jabhi_18 B April 12, 2020, 2:37 p.m. OK PyPy 3 TESTS 12 296 11571200
76415316 PavelJunior B April 12, 2020, 5:59 p.m. OK PyPy 3 TESTS 12 296 13414400
76372966 deepanshu_pali B April 12, 2020, 2:59 p.m. OK PyPy 3 TESTS 12 311 10444800
76359560 divyamohan123 B April 12, 2020, 2:38 p.m. OK PyPy 3 TESTS 12 311 11468800
76427236 elistark B April 12, 2020, 8:14 p.m. OK Python 2 TESTS 12 311 5632000
76358199 khoatran_viet B April 12, 2020, 2:36 p.m. OK Python 2 TESTS 12 311 8089600
76403040 aniket11 B April 12, 2020, 4:03 p.m. OK Python 2 TESTS 12 312 5632000
76387409 ComptineDunAutreEte B April 12, 2020, 3:28 p.m. OK Python 2 TESTS 12 327 5632000
76387587 vitaly888 B April 12, 2020, 3:28 p.m. OK Python 3 TESTS 12 218 10444800
76406943 rollov B April 12, 2020, 4:56 p.m. OK Python 3 TESTS 12 233 8499200
76375367 InspectorPikachu B April 12, 2020, 3:03 p.m. OK Python 3 TESTS 12 248 10752000
76381398 Nop1ks B April 12, 2020, 3:15 p.m. OK Python 3 TESTS 12 249 9932800
76395539 sw_enthusiast B April 12, 2020, 3:47 p.m. OK Python 3 TESTS 12 264 10240000
76399167 patrikos B April 12, 2020, 3:55 p.m. OK Python 3 TESTS 12 264 10342400
76391647 pallav12 B April 12, 2020, 3:38 p.m. OK Python 3 TESTS 12 265 9830400
76377926 kylytyx B April 12, 2020, 3:08 p.m. OK Python 3 TESTS 12 265 10240000
76370831 supermimi123 B April 12, 2020, 2:55 p.m. OK Python 3 TESTS 12 265 10649600
76363939 Andreas_Kreuz B April 12, 2020, 2:44 p.m. OK Python 3 TESTS 12 280 8704000
76369814 molety B April 12, 2020, 2:54 p.m. OK Ruby TESTS 12 202 18841600
76441108 sansen B April 13, 2020, 1:53 a.m. OK Rust TESTS 12 61 5324800
76361739 rustafarian B April 12, 2020, 2:41 p.m. OK Rust TESTS 12 78 6348800
76370135 AnteeOne B April 12, 2020, 2:54 p.m. OK Rust TESTS 12 155 6041600
76397876 magicgrin B April 12, 2020, 3:52 p.m. OK Rust TESTS 12 171 5017600
76427768 AhmedRashad B April 12, 2020, 8:23 p.m. OK Scala TESTS 12 654 9523200
76427610 AhmedRashad B April 12, 2020, 8:20 p.m. OK Scala TESTS 12 670 9523200

remove filters

Back to search problems