Educational Codeforces Round 126 (Rated for 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
1661 Educational Codeforces Round 126 (Rated for Div. 2) FINISHED False 7200 87751463 April 9, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18515 ) A Array Balancing PROGRAMMING greedy math

B"You are given two arrays of length n : a_1, a_2, ... , a_n and b_1, b_2, ... , b_n . You can perform the following operation any number of times: What is the minimum possible sum |a_1 - a_2| + |a_2 - a_3| + ... + |a_{n-1} - a_n| + |b_1 - b_2| + |b_2 - b_3| + ... + |b_{n-1} - b_n| (in other words, sum limits_{i=1}^{n - 1}{ <= ft(|a_i - a_{i+1}| + |b_i - b_{i+1}| right)} ) you can achieve after performing several (possibly, zero) operations? The first line contains a single integer t ( 1 <= t <= 4000 ) -- the number of test cases. Then, t test cases follow. The first line of each test case contains the single integer n ( 2 <= n <= 25 ) -- the length of arrays a and b . The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ) -- the array a . The third line of each test case contains n integers b_1, b_2, ... , b_n ( 1 <= b_i <= 10^9 ) -- the array b . For each test case, print one integer -- the minimum possible sum sum limits_{i=1}^{n-1}{ <= ft(|a_i - a_{i+1}| + |b_i - b_{i+1}| right)} . In the first test case, we can, for example, swap a_3 with b_3 and a_4 with b_4 . We'll get arrays a = [3, 3, 3, 3] and b = [10, 10, 10, 10] with sum 3 cdot |3 - 3| + 3 cdot |10 - 10| = 0 . In the second test case, arrays already have minimum sum (described above) equal to |1 - 2| + ... + |4 - 5| + |6 - 7| + ... + |9 - 10| = 4 + 4 = 8 . In the third test case, we can, for example, swap a_5 and b_5 . "...

Tutorials

Educational Codeforces Round 126 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
153230021 Pendem A April 9, 2022, 6:16 p.m. OK Clang++17 Diagnostics TESTS 12 967 0
153225244 Nikunj1703 A April 9, 2022, 5:16 p.m. OK GNU C11 TESTS 12 46 0
153237479 ABDULLAH_AL_MAHMUD_ARAF A April 9, 2022, 8:05 p.m. OK GNU C11 TESTS 12 46 0
153238001 sabbir772002 A April 9, 2022, 8:13 p.m. OK GNU C11 TESTS 12 46 102400
153226791 Tasbeh A April 9, 2022, 5:34 p.m. OK GNU C11 TESTS 12 62 0
153236023 sabbir772002 A April 9, 2022, 7:40 p.m. OK GNU C11 TESTS 12 62 0
153232750 Aurnab10 A April 9, 2022, 6:53 p.m. OK GNU C11 TESTS 12 62 0
153244521 Rim404 A April 9, 2022, 10:34 p.m. OK GNU C11 TESTS 12 62 0
153225604 shanu11223 A April 9, 2022, 5:20 p.m. OK GNU C11 TESTS 12 62 0
153223563 jubayer08 A April 9, 2022, 5:01 p.m. OK GNU C11 TESTS 12 62 0
153246006 Acfboy A April 9, 2022, 11:22 p.m. OK GNU C++14 TESTS 12 46 0
153230418 _CapedCrusader_ A April 9, 2022, 6:20 p.m. OK GNU C++14 TESTS 12 46 0
153226439 Canace_HKF A April 9, 2022, 5:30 p.m. OK GNU C++14 TESTS 12 46 0
153224502 Tarun_PSV A April 9, 2022, 5:09 p.m. OK GNU C++14 TESTS 12 46 0
153223853 duyphong1204 A April 9, 2022, 5:03 p.m. OK GNU C++14 TESTS 12 46 0
153220454 unimpossibler A April 9, 2022, 4:40 p.m. OK GNU C++14 TESTS 12 46 0
153259316 A_normal_OIer A April 10, 2022, 5:12 a.m. OK GNU C++14 TESTS 12 46 0
153256929 tawhidhassan A April 10, 2022, 4:28 a.m. OK GNU C++14 TESTS 12 46 0
153254300 kk8 A April 10, 2022, 3:30 a.m. OK GNU C++14 TESTS 12 46 0
153247534 Mr__Peanutbutter A April 10, 2022, 12:17 a.m. OK GNU C++14 TESTS 12 46 0
153250149 YashisNoob A April 10, 2022, 1:46 a.m. OK GNU C++17 TESTS 12 46 0
153242751 JoseDavid A April 9, 2022, 9:47 p.m. OK GNU C++17 TESTS 12 46 0
153242496 cant_decide A April 9, 2022, 9:41 p.m. OK GNU C++17 TESTS 12 46 0
153253577 _groot A April 10, 2022, 3:11 a.m. OK GNU C++17 TESTS 12 46 0
153249136 Story1419 A April 10, 2022, 1:13 a.m. OK GNU C++17 TESTS 12 46 0
153257161 Sudipt2001Vyas A April 10, 2022, 4:32 a.m. OK GNU C++17 TESTS 12 46 0
153262034 P1g A April 10, 2022, 5:46 a.m. OK GNU C++17 TESTS 12 46 0
153262102 Pannu A April 10, 2022, 5:46 a.m. OK GNU C++17 TESTS 12 46 0
153257154 bgg0516 A April 10, 2022, 4:32 a.m. OK GNU C++17 TESTS 12 46 0
153256827 wxhtzdy A April 10, 2022, 4:26 a.m. OK GNU C++17 TESTS 12 46 0
153250555 shirley_ A April 10, 2022, 1:57 a.m. OK GNU C++17 (64) TESTS 12 15 4198400
153219894 shivansh_jaiswal A April 9, 2022, 4:37 p.m. OK GNU C++17 (64) TESTS 12 30 0
153239419 mrbrown A April 9, 2022, 8:35 p.m. OK GNU C++17 (64) TESTS 12 31 0
153263281 Amank2854 A April 10, 2022, 6 a.m. OK GNU C++17 (64) TESTS 12 31 0
153250034 Svlad_Cjelli A April 10, 2022, 1:42 a.m. OK GNU C++17 (64) TESTS 12 31 0
153244020 Stark0509 A April 9, 2022, 10:18 p.m. OK GNU C++17 (64) TESTS 12 31 0
153239295 epsilon_573 A April 9, 2022, 8:33 p.m. OK GNU C++17 (64) TESTS 12 31 0
153237062 Zyad_Elfakharany A April 9, 2022, 7:58 p.m. OK GNU C++17 (64) TESTS 12 31 0
153233277 Mosharrof13 A April 9, 2022, 7:01 p.m. OK GNU C++17 (64) TESTS 12 31 0
153230224 manzano A April 9, 2022, 6:18 p.m. OK GNU C++17 (64) TESTS 12 31 0
153248709 lto5 A April 10, 2022, 12:57 a.m. OK GNU C++20 (64) TESTS 12 15 0
153224152 SirPh A April 9, 2022, 5:06 p.m. OK GNU C++20 (64) TESTS 12 15 0
153224609 riya_singh_mat21 A April 9, 2022, 5:10 p.m. OK GNU C++20 (64) TESTS 12 15 0
153212665 chepestb A April 9, 2022, 4:18 p.m. OK GNU C++20 (64) TESTS 12 15 102400
153230033 _ForeRunner_ A April 9, 2022, 6:16 p.m. OK GNU C++20 (64) TESTS 12 15 307200
153257450 Lovely_moon A April 10, 2022, 4:37 a.m. OK GNU C++20 (64) TESTS 12 15 48128000
153257471 Lost_moon A April 10, 2022, 4:37 a.m. OK GNU C++20 (64) TESTS 12 15 48128000
153262176 kingstonduy A April 10, 2022, 5:47 a.m. OK GNU C++20 (64) TESTS 12 30 0
153240152 vaibhav.goyal A April 9, 2022, 8:48 p.m. OK GNU C++20 (64) TESTS 12 30 0
153228093 SRI_SUNDARAN_13 A April 9, 2022, 5:49 p.m. OK GNU C++20 (64) TESTS 12 30 0
153262873 MarcelShi_96 A April 10, 2022, 5:55 a.m. OK Go TESTS 12 139 113868800
153247556 not_good_enough_yet A April 10, 2022, 12:18 a.m. OK Go TESTS 12 156 4710400
153221890 naniraghu A April 9, 2022, 4:48 p.m. OK Java 11 TESTS 12 187 0
153221645 naniraghu A April 9, 2022, 4:47 p.m. OK Java 11 TESTS 12 202 0
153234378 DEMO23 A April 9, 2022, 7:16 p.m. OK Java 11 TESTS 12 202 0
153257262 iamsoumik A April 10, 2022, 4:34 a.m. OK Java 11 TESTS 12 202 0
153257129 __Serendipity A April 10, 2022, 4:31 a.m. OK Java 11 TESTS 12 202 0
153261244 _ryan18_ A April 10, 2022, 5:36 a.m. OK Java 11 TESTS 12 217 0
153260157 vijender_8601 A April 10, 2022, 5:23 a.m. OK Java 11 TESTS 12 217 0
153229819 Saell A April 9, 2022, 6:13 p.m. OK Java 11 TESTS 12 217 102400
153228964 Piyush1607 A April 9, 2022, 6:01 p.m. OK Java 11 TESTS 12 218 0
153224432 saurabh_kh A April 9, 2022, 5:08 p.m. OK Java 11 TESTS 12 218 0
153249315 adeon A April 10, 2022, 1:19 a.m. OK Java 8 TESTS 12 109 0
153239974 Daly105 A April 9, 2022, 8:45 p.m. OK Java 8 TESTS 12 124 0
153231424 IcantSeeCsharp A April 9, 2022, 6:34 p.m. OK Java 8 TESTS 12 139 0
153220765 _Eyepatch A April 9, 2022, 4:41 p.m. OK Java 8 TESTS 12 155 0
153233794 VishuTomar A April 9, 2022, 7:08 p.m. OK Java 8 TESTS 12 170 0
153223346 rajneesh.osho A April 9, 2022, 4:59 p.m. OK Java 8 TESTS 12 187 38297600
153226278 rajneesh.osho A April 9, 2022, 5:28 p.m. OK Java 8 TESTS 12 187 38297600
153255816 simranhotchandani93 A April 10, 2022, 4:06 a.m. OK Java 8 TESTS 12 296 0
153252437 hassanfahd75 A April 10, 2022, 2:44 a.m. OK Java 8 TESTS 12 389 0
153260683 iamraghavawasthi A April 10, 2022, 5:29 a.m. OK Java 8 TESTS 12 405 0
153228148 arvindf232 A April 9, 2022, 5:50 p.m. OK Kotlin 1.4 TESTS 12 140 0
153244286 saiedmomen A April 9, 2022, 10:26 p.m. OK Kotlin 1.4 TESTS 12 312 307200
153226450 vovanstrr A April 9, 2022, 5:30 p.m. OK Mono C# TESTS 12 171 3072000
153216970 YGT_n A April 9, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 12 171 0
153249760 vmffotltka A April 10, 2022, 1:34 a.m. OK MS C++ 2017 TESTS 12 171 0
153218054 delivron A April 9, 2022, 4:32 p.m. OK MS C++ 2017 TESTS 12 171 0
153217650 handsomefkg A April 9, 2022, 4:31 p.m. OK MS C++ 2017 TESTS 12 171 0
153211720 lyin A April 9, 2022, 4:16 p.m. OK MS C++ 2017 TESTS 12 171 0
153215035 De_nis A April 9, 2022, 4:25 p.m. OK MS C++ 2017 TESTS 12 171 1740800
153230245 dogoeswoof A April 9, 2022, 6:18 p.m. OK MS C++ 2017 TESTS 12 186 0
153216280 Timbor A April 9, 2022, 4:28 p.m. OK MS C++ 2017 TESTS 12 187 0
153219113 Ncato_Del_Gormo7 A April 9, 2022, 4:34 p.m. OK MS C++ 2017 TESTS 12 187 0
153223795 Dybulina_Anna A April 9, 2022, 5:03 p.m. OK MS C++ 2017 TESTS 12 187 921600
153221618 h210107039 A April 9, 2022, 4:46 p.m. OK .NET Core C# TESTS 12 124 3276800
153221342 h210107039 A April 9, 2022, 4:45 p.m. OK .NET Core C# TESTS 12 124 3276800
153220919 1_2_3_4_5_9 A April 9, 2022, 4:42 p.m. OK PyPy 2 TESTS 12 202 10956800
153220158 lemiao12 A April 9, 2022, 4:38 p.m. OK PyPy 3 TESTS 12 280 9216000
153244005 crapcode A April 9, 2022, 10:18 p.m. OK PyPy 3 TESTS 12 389 9625600
153238191 Arnodian A April 9, 2022, 8:16 p.m. OK PyPy 3 TESTS 12 451 9625600
153244255 crapcode A April 9, 2022, 10:25 p.m. OK PyPy 3 TESTS 12 467 10854400
153254569 Roches_bai A April 10, 2022, 3:37 a.m. OK PyPy 3 TESTS 12 545 9728000
153218639 daneshtoshniwal A April 9, 2022, 4:33 p.m. OK PyPy 3 TESTS 12 545 10035200
153215125 tanishksharma795 A April 9, 2022, 4:25 p.m. OK PyPy 3 TESTS 12 576 9728000
153238978 Midhilesh A April 9, 2022, 8:28 p.m. OK PyPy 3 TESTS 12 592 10444800
153217747 neko0774 A April 9, 2022, 4:31 p.m. OK PyPy 3 TESTS 12 826 10547200
153257813 notTehlka A April 10, 2022, 4:43 a.m. OK PyPy 3-64 TESTS 12 140 10035200
153246213 nealzane A April 9, 2022, 11:30 p.m. OK PyPy 3-64 TESTS 12 155 9932800
153260777 raushnn A April 10, 2022, 5:31 a.m. OK PyPy 3-64 TESTS 12 171 10240000
153253206 sr3gm A April 10, 2022, 3:03 a.m. OK PyPy 3-64 TESTS 12 249 9523200
153238889 A_Alam A April 9, 2022, 8:26 p.m. OK PyPy 3-64 TESTS 12 264 9625600
153229154 _icy_ A April 9, 2022, 6:04 p.m. OK PyPy 3-64 TESTS 12 295 10137600
153239975 chetanpatel003 A April 9, 2022, 8:45 p.m. OK PyPy 3-64 TESTS 12 311 10854400
153219917 ek44 A April 9, 2022, 4:37 p.m. OK PyPy 3-64 TESTS 12 343 10547200
153255795 the_emerging_coder A April 10, 2022, 4:05 a.m. OK PyPy 3-64 TESTS 12 389 11571200
153238755 A_Alam A April 9, 2022, 8:24 p.m. OK PyPy 3-64 TESTS 12 389 12288000
153219781 ek44 A April 9, 2022, 4:36 p.m. OK Python 3 TESTS 12 171 0
153218827 vamsikrishnashauri A April 9, 2022, 4:34 p.m. OK Python 3 TESTS 12 171 0
153224381 Ecola A April 9, 2022, 5:08 p.m. OK Python 3 TESTS 12 187 0
153232166 rbamhore20 A April 9, 2022, 6:44 p.m. OK Python 3 TESTS 12 202 0
153227855 iron_nicko A April 9, 2022, 5:46 p.m. OK Python 3 TESTS 12 218 0
153217554 Danny19 A April 9, 2022, 4:31 p.m. OK Python 3 TESTS 12 218 0
153213690 rajatguptakgp A April 9, 2022, 4:21 p.m. OK Python 3 TESTS 12 218 0
153213058 Aditya.xyz A April 9, 2022, 4:19 p.m. OK Python 3 TESTS 12 218 0
153214195 gmbrandt A April 9, 2022, 4:22 p.m. OK Python 3 TESTS 12 218 2969600
153256314 vschs007 A April 10, 2022, 4:16 a.m. OK Python 3 TESTS 12 233 0
153232841 RunGood A April 9, 2022, 6:54 p.m. OK Rust 2021 TESTS 12 15 307200
153231272 RunGood A April 9, 2022, 6:32 p.m. OK Rust 2021 TESTS 12 15 307200

remove filters

Back to search problems