Codeforces Round 852 (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
1793 Codeforces Round 852 (Div. 2) FINISHED False 7200 55632299 Feb. 12, 2023, 8:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15917 ) B Fedya and Array PROGRAMMING constructive algorithms math

B"For his birthday recently Fedya was given an array a of n integers arranged in a circle, For each pair of neighboring numbers ( a_1 and a_2 , a_2 and a_3 , ldots , a_{n - 1} and a_n , a_n and a_1 ) the absolute difference between them is equal to 1 . Let's call a local maximum an element, which is greater than both of its neighboring elements. Also call a local minimum an element, which is less than both of its neighboring elements. Note, that elements a_1 and a_n are neighboring elements. Unfortunately, Fedya lost an array, but he remembered in it the sum of local maximums x and the sum of local minimums y . Given x and y , help Fedya find any matching array of minimum length. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). Description of the test cases follows. Each line of each test case contain two integers x and y ( -10^{9} <= y < x <= 10^{9} ) -- the sum of local maximums and the sum of local minimums, respectively. For each test case, in the first line print one integer n -- the minimum length of matching arrays. In the second line print n integers a_1, a_2, ldots, a_n ( -10^{9} <= qslant a_i <= qslant 10^{9} ) -- the array elements such that the the absolute difference between each pair of neighboring is equal to 1 . If there are multiple solutions, print any of them. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^{5} . In the first test case, the local maximums are the numbers at 3, 7 and 10 positions, and the local minimums are the numbers at 1, 6 and 8 positions. x = a_3 + a_7 + a_{10} = 2 + 0 + 1 = 3 , y = a_1 + a_6 + a_8 = 0 + (-1) + (-1) = -2 . In the second test case, the local maximums are the numbers at 2 and 10 positions, and th"...

Tutorials

Codeforces Round #852 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
193342493 PavolKoman B Feb. 12, 2023, 12:16 p.m. OK C# 10 TESTS 22 77 30822400
193340600 PavolKoman B Feb. 12, 2023, 11:59 a.m. OK C# 10 TESTS 22 78 30822400
193342368 PavolKoman B Feb. 12, 2023, 12:15 p.m. OK C# 10 TESTS 22 92 30822400
193382213 mister_Aj B Feb. 12, 2023, 5:58 p.m. OK Clang++17 Diagnostics TESTS 22 701 0
193422957 Joe_yue6 B Feb. 13, 2023, 5:48 a.m. OK Clang++20 Diagnostics TESTS 22 702 0
193413236 under_cover_ B Feb. 13, 2023, 2:27 a.m. OK GNU C11 TESTS 22 842 0
193376914 mdadnan B Feb. 12, 2023, 5:13 p.m. OK GNU C11 TESTS 22 842 0
193345295 gandour B Feb. 12, 2023, 12:43 p.m. OK GNU C11 TESTS 22 857 819200
193410608 shenlc B Feb. 13, 2023, 1:13 a.m. OK GNU C11 TESTS 22 858 0
193412496 Smallorange B Feb. 13, 2023, 2:09 a.m. OK GNU C11 TESTS 22 888 0
193397617 1419__ B Feb. 12, 2023, 8:35 p.m. OK GNU C11 TESTS 22 888 79974400
193330899 andreyk444 B Feb. 12, 2023, 10:33 a.m. OK GNU C11 TESTS 22 998 0
193358676 code_himanshu1 B Feb. 12, 2023, 2:38 p.m. OK GNU C++14 TESTS 22 31 0
193355321 Raghunandan B Feb. 12, 2023, 2:08 p.m. OK GNU C++14 TESTS 22 31 0
193352730 aryamaanT B Feb. 12, 2023, 1:47 p.m. OK GNU C++14 TESTS 22 31 0
193350728 Bloodstalk B Feb. 12, 2023, 1:30 p.m. OK GNU C++14 TESTS 22 31 0
193419684 yuanruiqi B Feb. 13, 2023, 4:53 a.m. OK GNU C++14 TESTS 22 31 0
193416411 CJCZRX B Feb. 13, 2023, 3:43 a.m. OK GNU C++14 TESTS 22 31 0
193422315 diguo B Feb. 13, 2023, 5:38 a.m. OK GNU C++14 TESTS 22 46 0
193420181 lightyagmai465 B Feb. 13, 2023, 5:02 a.m. OK GNU C++14 TESTS 22 46 0
193420682 ankush_kumar_gupta B Feb. 13, 2023, 5:10 a.m. OK GNU C++14 TESTS 22 46 0
193420822 noobfromeast B Feb. 13, 2023, 5:13 a.m. OK GNU C++14 TESTS 22 46 0
193364281 yaraaaab B Feb. 12, 2023, 3:25 p.m. OK GNU C++17 TESTS 22 31 0
193355855 Neeraj_14 B Feb. 12, 2023, 2:13 p.m. OK GNU C++17 TESTS 22 31 0
193355189 youthA1 B Feb. 12, 2023, 2:07 p.m. OK GNU C++17 TESTS 22 31 0
193420104 ankur0508 B Feb. 13, 2023, 5:01 a.m. OK GNU C++17 TESTS 22 31 0
193378654 hunt2kill B Feb. 12, 2023, 5:28 p.m. OK GNU C++17 TESTS 22 31 0
193378630 Niladree_Datta B Feb. 12, 2023, 5:27 p.m. OK GNU C++17 TESTS 22 31 0
193374707 JellyGames B Feb. 12, 2023, 4:55 p.m. OK GNU C++17 TESTS 22 31 0
193373644 Gr00t B Feb. 12, 2023, 4:46 p.m. OK GNU C++17 TESTS 22 31 0
193389485 Ahmed-Ezzat B Feb. 12, 2023, 7:04 p.m. OK GNU C++17 TESTS 22 31 0
193400231 shikhardixit11 B Feb. 12, 2023, 9:13 p.m. OK GNU C++17 TESTS 22 31 0
193416087 Remilia1023 B Feb. 13, 2023, 3:37 a.m. OK GNU C++17 (64) TESTS 22 15 512000
193356644 raoxiangjun B Feb. 12, 2023, 2:20 p.m. OK GNU C++17 (64) TESTS 22 31 0
193421292 Ash_Dr B Feb. 13, 2023, 5:20 a.m. OK GNU C++17 (64) TESTS 22 31 0
193419342 llyyhh B Feb. 13, 2023, 4:46 a.m. OK GNU C++17 (64) TESTS 22 31 0
193397522 juancarlostapiab.1 B Feb. 12, 2023, 8:34 p.m. OK GNU C++17 (64) TESTS 22 31 0
193393913 Amer_Oniza10 B Feb. 12, 2023, 7:51 p.m. OK GNU C++17 (64) TESTS 22 31 0
193384343 _mephisto B Feb. 12, 2023, 6:16 p.m. OK GNU C++17 (64) TESTS 22 31 0
193351952 Rohit_a9887 B Feb. 12, 2023, 1:41 p.m. OK GNU C++17 (64) TESTS 22 31 0
193348805 guptaaditya30121 B Feb. 12, 2023, 1:14 p.m. OK GNU C++17 (64) TESTS 22 31 0
193346628 rahulraj16914119 B Feb. 12, 2023, 12:55 p.m. OK GNU C++17 (64) TESTS 22 31 0
193329525 raccoon.pavlov B Feb. 12, 2023, 10:30 a.m. OK GNU C++20 (64) TESTS 22 15 0
193419000 qing_feng B Feb. 13, 2023, 4:40 a.m. OK GNU C++20 (64) TESTS 22 15 3993600
193333818 A__S B Feb. 12, 2023, 11:06 a.m. OK GNU C++20 (64) TESTS 22 15 4300800
193410605 sanxun B Feb. 13, 2023, 1:13 a.m. OK GNU C++20 (64) TESTS 22 30 0
193414938 Only1ahmed B Feb. 13, 2023, 3:09 a.m. OK GNU C++20 (64) TESTS 22 30 0
193396618 LaZ1Upret1 B Feb. 12, 2023, 8:22 p.m. OK GNU C++20 (64) TESTS 22 30 0
193418656 DoverHi B Feb. 13, 2023, 4:33 a.m. OK GNU C++20 (64) TESTS 22 30 0
193416066 SabihaLithi B Feb. 13, 2023, 3:36 a.m. OK GNU C++20 (64) TESTS 22 30 0
193393709 Fellow_junior B Feb. 12, 2023, 7:49 p.m. OK GNU C++20 (64) TESTS 22 30 0
193392861 eucalyptus B Feb. 12, 2023, 7:40 p.m. OK GNU C++20 (64) TESTS 22 30 0
193414165 HMETAO B Feb. 13, 2023, 2:49 a.m. OK Java 11 TESTS 22 202 0
193362390 Panther369 B Feb. 12, 2023, 3:09 p.m. OK Java 11 TESTS 22 202 0
193376840 vijender_8601 B Feb. 12, 2023, 5:13 p.m. OK Java 11 TESTS 22 233 0
193349723 pakkapapad B Feb. 12, 2023, 1:22 p.m. OK Java 11 TESTS 22 233 0
193339575 Kempachi B Feb. 12, 2023, 11:50 a.m. OK Java 11 TESTS 22 233 0
193334560 WORTH B Feb. 12, 2023, 11:12 a.m. OK Java 11 TESTS 22 233 1228800
193390764 mcrash12 B Feb. 12, 2023, 7:17 p.m. OK Java 11 TESTS 22 248 0
193416893 rajgupta77540 B Feb. 13, 2023, 3:54 a.m. OK Java 11 TESTS 22 249 0
193390432 mcrash12 B Feb. 12, 2023, 7:14 p.m. OK Java 11 TESTS 22 249 1740800
193352335 ilasiawo B Feb. 12, 2023, 1:44 p.m. OK Java 11 TESTS 22 264 204800
193351379 bleach__ B Feb. 12, 2023, 1:36 p.m. OK Java 17 TESTS 22 249 716800
193342249 shahvraj1500 B Feb. 12, 2023, 12:14 p.m. OK Java 17 TESTS 22 265 4403200
193344352 Hiranmoy B Feb. 12, 2023, 12:34 p.m. OK Java 17 TESTS 22 280 4198400
193390212 jimmyd211 B Feb. 12, 2023, 7:11 p.m. OK Java 17 TESTS 22 296 614400
193392051 Anu_Jha B Feb. 12, 2023, 7:31 p.m. OK Java 17 TESTS 22 343 819200
193369915 ahmed.elbakly B Feb. 12, 2023, 4:16 p.m. OK Java 17 TESTS 22 795 512000
193373769 Abdelrahman.M.3 B Feb. 12, 2023, 4:47 p.m. OK Java 17 TESTS 22 826 204800
193343602 Abhinav__hadole B Feb. 12, 2023, 12:27 p.m. OK Java 17 TESTS 22 826 921600
193363629 Black-Heart B Feb. 12, 2023, 3:19 p.m. OK Java 17 TESTS 22 841 819200
193334538 kaifkhan. B Feb. 12, 2023, 11:12 a.m. OK Java 17 TESTS 22 842 4300800
193399766 mohamedhassan_c B Feb. 12, 2023, 9:06 p.m. OK Java 8 TESTS 22 124 0
193344597 Koka B Feb. 12, 2023, 12:36 p.m. OK Java 8 TESTS 22 124 0
193422579 Socrates1232 B Feb. 13, 2023, 5:42 a.m. OK Java 8 TESTS 22 124 3379200
193333379 raj_shahh B Feb. 12, 2023, 11:05 a.m. OK Java 8 TESTS 22 139 0
193423649 lpychemistry B Feb. 13, 2023, 5:59 a.m. OK Java 8 TESTS 22 140 0
193420936 vkukretiwork B Feb. 13, 2023, 5:14 a.m. OK Java 8 TESTS 22 140 0
193347142 anonxx5 B Feb. 12, 2023, 12:59 p.m. OK Java 8 TESTS 22 140 3379200
193417023 -crazy_coder- B Feb. 13, 2023, 3:57 a.m. OK Java 8 TESTS 22 140 7168000
193339012 Mohamed_Ahmed B Feb. 12, 2023, 11:46 a.m. OK Java 8 TESTS 22 155 0
193329486 rahul_81 B Feb. 12, 2023, 10:30 a.m. OK Java 8 TESTS 22 156 0
193343025 1434314294 B Feb. 12, 2023, 12:22 p.m. OK MS C++ 2017 TESTS 22 62 819200
193345298 georgii03 B Feb. 12, 2023, 12:43 p.m. OK MS C++ 2017 TESTS 22 124 0
193338702 Yychen B Feb. 12, 2023, 11:43 a.m. OK MS C++ 2017 TESTS 22 124 0
193333640 Kingod0011 B Feb. 12, 2023, 11:06 a.m. OK MS C++ 2017 TESTS 22 124 0
193376950 mark77 B Feb. 12, 2023, 5:13 p.m. OK MS C++ 2017 TESTS 22 124 819200
193340704 Tory_A B Feb. 12, 2023, noon OK MS C++ 2017 TESTS 22 124 2252800
193340969 lqj B Feb. 12, 2023, 12:02 p.m. OK MS C++ 2017 TESTS 22 139 3993600
193422530 SmilingBraniac B Feb. 13, 2023, 5:41 a.m. OK MS C++ 2017 TESTS 22 140 0
193394608 153floppa B Feb. 12, 2023, 7:59 p.m. OK MS C++ 2017 TESTS 22 140 0
193418697 ishybee B Feb. 13, 2023, 4:34 a.m. OK MS C++ 2017 TESTS 22 140 2252800
193370110 Yash_Nandwana B Feb. 12, 2023, 4:17 p.m. OK PyPy 3 TESTS 22 139 13926400
193334939 _magnus_carlsen_ B Feb. 12, 2023, 11:14 a.m. OK PyPy 3 TESTS 22 264 11059200
193392066 khonshu_99 B Feb. 12, 2023, 7:31 p.m. OK PyPy 3 TESTS 22 265 12595200
193385640 ankitesh B Feb. 12, 2023, 6:27 p.m. OK PyPy 3 TESTS 22 280 11878400
193418997 KeiTsukishima B Feb. 13, 2023, 4:40 a.m. OK PyPy 3 TESTS 22 296 17510400
193358276 meet3447 B Feb. 12, 2023, 2:34 p.m. OK PyPy 3 TESTS 22 342 9625600
193342260 Gwin232 B Feb. 12, 2023, 12:14 p.m. OK PyPy 3 TESTS 22 343 9523200
193417895 bpdolson B Feb. 13, 2023, 4:17 a.m. OK PyPy 3 TESTS 22 358 10035200
193335730 Has-Borutocu B Feb. 12, 2023, 11:19 a.m. OK PyPy 3 TESTS 22 373 9625600
193338281 LazyRGuy B Feb. 12, 2023, 11:39 a.m. OK PyPy 3 TESTS 22 389 9728000
193375855 anshumannandan B Feb. 12, 2023, 5:05 p.m. OK PyPy 3-64 TESTS 22 93 6758400
193352390 adithya1207 B Feb. 12, 2023, 1:45 p.m. OK PyPy 3-64 TESTS 22 93 23449600
193362020 EnDeRBeaT B Feb. 12, 2023, 3:06 p.m. OK PyPy 3-64 TESTS 22 108 14643200
193361829 EnDeRBeaT B Feb. 12, 2023, 3:04 p.m. OK PyPy 3-64 TESTS 22 109 13926400
193362846 EnDeRBeaT B Feb. 12, 2023, 3:13 p.m. OK PyPy 3-64 TESTS 22 109 14028800
193415308 gardengnome B Feb. 13, 2023, 3:18 a.m. OK PyPy 3-64 TESTS 22 109 14233600
193423642 0x3b800001 B Feb. 13, 2023, 5:58 a.m. OK PyPy 3-64 TESTS 22 109 14643200
193358048 SophieHatter B Feb. 12, 2023, 2:32 p.m. OK PyPy 3-64 TESTS 22 124 14438400
193361931 EnDeRBeaT B Feb. 12, 2023, 3:05 p.m. OK PyPy 3-64 TESTS 22 124 14643200
193408241 RobinFromTheHood B Feb. 13, 2023, 12:04 a.m. OK PyPy 3-64 TESTS 22 124 15360000
193333863 sum_it. B Feb. 12, 2023, 11:07 a.m. OK Python 3 TESTS 22 140 15974400
193333272 sumitmt0264 B Feb. 12, 2023, 11:04 a.m. OK Python 3 TESTS 22 140 15974400
193340716 nik_enjoy B Feb. 12, 2023, noon OK Python 3 TESTS 22 140 16691200
193333830 TeamGTH B Feb. 12, 2023, 11:06 a.m. OK Python 3 TESTS 22 155 16281600
193386285 NS3081992 B Feb. 12, 2023, 6:33 p.m. OK Python 3 TESTS 22 171 20377600
193372647 tariq05 B Feb. 12, 2023, 4:38 p.m. OK Python 3 TESTS 22 264 4710400
193345884 akakjj B Feb. 12, 2023, 12:48 p.m. OK Python 3 TESTS 22 265 5529600
193330852 honamido B Feb. 12, 2023, 10:33 a.m. OK Python 3 TESTS 22 280 0
193419200 ernur_077 B Feb. 13, 2023, 4:44 a.m. OK Python 3 TESTS 22 280 204800
193384977 2momo2 B Feb. 12, 2023, 6:22 p.m. OK Python 3 TESTS 22 280 5017600
193341184 togatoga B Feb. 12, 2023, 12:04 p.m. OK Rust 2021 TESTS 22 46 3788800
193333611 tafaB B Feb. 12, 2023, 11:05 a.m. OK Rust 2021 TESTS 22 62 102400

remove filters

Back to search problems