Codeforces Round 863 (Div. 3)

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
1811 Codeforces Round 863 (Div. 3) FINISHED False 8100 56647463 April 4, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20470 ) C Restore the Array PROGRAMMING constructive algorithms greedy

B'Kristina had an array a of length n consisting of non-negative integers. She built a new array b of length n-1 , such that b_i = max(a_i, a_{i+1}) ( 1 <= i <= n-1 ). For example, suppose Kristina had an array a = [ 3, 0, 4, 0, 5 ] of length 5 . Then she did the following: You only know the array b . Find any matching array a that Kristina may have originally had. The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains one integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of elements in the array a that Kristina originally had. The second line of each test case contains exactly n-1 non-negative integer -- elements of array b ( 0 <= b_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 , and that array b was built correctly from some array a . For each test case on a separate line, print exactly n non-negative integers -- the elements of the array a that Kristina originally had. If there are several possible answers -- output any of them. The first test case is explained in the problem statement. In the second test case, we can get array b = [ 2, 2, 1 ] from the array a = [ 2, 2, 1, 1 ]: In the third test case, all elements of the array b are zeros. Since each b_i is the maximum of two adjacent elements of array a , array a can only consist entirely of zeros. In the fourth test case, we can get array b = [ 0, 3, 4, 4, 3 ] from the array a = [ 0, 0, 3, 4, 3, 3 ] : '...

Tutorials

114788

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
200826358 zhoujk C April 5, 2023, 3:46 a.m. OK GNU C11 TESTS 9 889 1638400
200822429 Bernoullitelsla C April 5, 2023, 2:34 a.m. OK GNU C11 TESTS 9 935 819200
200824043 M0r1arty C April 5, 2023, 3:04 a.m. OK GNU C11 TESTS 9 935 1638400
200834698 Tom66 C April 5, 2023, 5:52 a.m. OK GNU C++14 TESTS 9 62 1536000
200800611 bridgeminion C April 4, 2023, 7:26 p.m. OK GNU C++14 TESTS 8 77 819200
200826050 WangTianzhuo C April 5, 2023, 3:40 a.m. OK GNU C++14 TESTS 9 78 1638400
200783970 drakipovic C April 4, 2023, 5:03 p.m. OK GNU C++14 TESTS 5 92 819200
200814065 Unbeaten_ C April 4, 2023, 11:09 p.m. OK GNU C++14 TESTS 9 92 819200
200785444 dhairya_3 C April 4, 2023, 5:12 p.m. OK GNU C++14 TESTS 5 92 1638400
200786223 deydhananjoy5 C April 4, 2023, 5:18 p.m. OK GNU C++14 TESTS 5 92 1638400
200799847 ridham_2 C April 4, 2023, 7:16 p.m. OK GNU C++14 TESTS 8 92 2355200
200803804 minus_50 C April 4, 2023, 8:07 p.m. OK GNU C++14 TESTS 8 92 2457600
200792149 prateek2172 C April 4, 2023, 6:13 p.m. OK GNU C++14 TESTS 5 92 3174400
200778293 yaadhav.07 C April 4, 2023, 4:44 p.m. OK GNU C++17 TESTS 5 62 3072000
200793267 tinrenf C April 4, 2023, 6:25 p.m. OK GNU C++17 TESTS 8 77 0
200791398 Samratrpal01 C April 4, 2023, 6:05 p.m. OK GNU C++17 TESTS 5 77 819200
200787550 codeAlxx C April 4, 2023, 5:29 p.m. OK GNU C++17 TESTS 5 77 819200
200783416 Sahilence C April 4, 2023, 5 p.m. OK GNU C++17 TESTS 5 77 819200
200808498 helag C April 4, 2023, 9:12 p.m. OK GNU C++17 TESTS 8 77 819200
200800313 108_adi C April 4, 2023, 7:22 p.m. OK GNU C++17 TESTS 8 77 819200
200791419 xdliw C April 4, 2023, 6:06 p.m. OK GNU C++17 TESTS 5 77 819200
200813454 A_C_boy C April 4, 2023, 10:53 p.m. OK GNU C++17 TESTS 8 77 1638400
200827589 17879963468 C April 5, 2023, 4:07 a.m. OK GNU C++17 TESTS 9 77 1638400
200801315 pritish_001 C April 4, 2023, 7:35 p.m. OK GNU C++17 (64) TESTS 8 46 819200
200777924 khalid_bin_walid C April 4, 2023, 4:44 p.m. OK GNU C++17 (64) TESTS 5 46 3174400
200794715 Eman_Elharery C April 4, 2023, 6:41 p.m. OK GNU C++17 (64) TESTS 8 61 819200
200807546 not_ahmed_hamed C April 4, 2023, 8:58 p.m. OK GNU C++17 (64) TESTS 8 61 819200
200835109 wxszd C April 5, 2023, 5:58 a.m. OK GNU C++17 (64) TESTS 9 61 1638400
200810814 Rocket13 C April 4, 2023, 9:51 p.m. OK GNU C++17 (64) TESTS 8 61 1638400
200782957 mobbb C April 4, 2023, 4:57 p.m. OK GNU C++17 (64) TESTS 5 61 1638400
200784758 korokseeds C April 4, 2023, 5:08 p.m. OK GNU C++17 (64) TESTS 5 61 1843200
200831506 husain21 C April 5, 2023, 5:10 a.m. OK GNU C++17 (64) TESTS 9 61 2969600
200782151 godgenji C April 4, 2023, 4:53 p.m. OK GNU C++17 (64) TESTS 5 61 3174400
200800406 Amdadul C April 4, 2023, 7:24 p.m. OK GNU C++20 (64) TESTS 8 30 1638400
200808398 k.sanskruti.2203 C April 4, 2023, 9:10 p.m. OK GNU C++20 (64) TESTS 8 30 1638400
200803100 orke2001 C April 4, 2023, 7:58 p.m. OK GNU C++20 (64) TESTS 8 30 1638400
200781717 abaafaa C April 4, 2023, 4:52 p.m. OK GNU C++20 (64) TESTS 5 30 2969600
200790520 Re4p3r C April 4, 2023, 5:57 p.m. OK GNU C++20 (64) TESTS 5 30 5836800
200785639 Yash_Raj981 C April 4, 2023, 5:14 p.m. OK GNU C++20 (64) TESTS 5 31 0
200805830 obada_katma C April 4, 2023, 8:35 p.m. OK GNU C++20 (64) TESTS 8 31 102400
200813608 Majed_khatab C April 4, 2023, 10:57 p.m. OK GNU C++20 (64) TESTS 8 31 819200
200814930 marc2825 C April 4, 2023, 11:34 p.m. OK GNU C++20 (64) TESTS 9 31 819200
200800840 Ali_Sensei C April 4, 2023, 7:29 p.m. OK GNU C++20 (64) TESTS 8 31 819200
200783952 ming1ing C April 4, 2023, 5:03 p.m. OK Go TESTS 5 124 6348800
200816812 harsh.awasthi C April 5, 2023, 12:24 a.m. OK Go TESTS 9 140 4812800
200808797 GR1ZLER C April 4, 2023, 9:17 p.m. OK Java 11 TESTS 8 202 0
200830523 leoncn C April 5, 2023, 4:56 a.m. OK Java 11 TESTS 9 202 0
200778573 pakkapapad C April 4, 2023, 4:45 p.m. OK Java 11 TESTS 5 249 4403200
200794521 vijender_8601 C April 4, 2023, 6:39 p.m. OK Java 11 TESTS 8 265 0
200784316 etian6795 C April 4, 2023, 5:05 p.m. OK Java 11 TESTS 5 295 409600
200816379 DayDayStudyDayDayUp C April 5, 2023, 12:12 a.m. OK Java 11 TESTS 9 295 13721600
200809954 qw_er__ty C April 4, 2023, 9:36 p.m. OK Java 11 TESTS 8 311 0
200794827 ilasiawo C April 4, 2023, 6:42 p.m. OK Java 11 TESTS 8 467 0
200783549 manas8260 C April 4, 2023, 5:01 p.m. OK Java 11 TESTS 5 498 0
200783714 tammmer07 C April 4, 2023, 5:02 p.m. OK Java 11 TESTS 5 514 1433600
200811653 rated21 C April 4, 2023, 10:11 p.m. OK Java 17 TESTS 8 202 5017600
200786740 mumuxinfei C April 4, 2023, 5:22 p.m. OK Java 17 TESTS 5 233 614400
200783226 _lwq_123_ C April 4, 2023, 4:59 p.m. OK Java 17 TESTS 5 249 307200
200794984 Suraj1607 C April 4, 2023, 6:44 p.m. OK Java 17 TESTS 8 265 512000
200781501 adityasen167 C April 4, 2023, 4:51 p.m. OK Java 17 TESTS 5 280 0
200799451 skynet_07 C April 4, 2023, 7:12 p.m. OK Java 17 TESTS 8 280 409600
200798127 Suraj1607 C April 4, 2023, 6:57 p.m. OK Java 17 TESTS 8 280 409600
200785385 Aaryendra C April 4, 2023, 5:12 p.m. OK Java 17 TESTS 5 295 204800
200782640 m0rka1 C April 4, 2023, 4:56 p.m. OK Java 17 TESTS 5 295 512000
200790503 Badass_Nemesis C April 4, 2023, 5:57 p.m. OK Java 17 TESTS 5 296 0
200826040 Kenzhezhan C April 5, 2023, 3:40 a.m. OK Java 8 TESTS 9 124 3379200
200798282 Sylvester_ C April 4, 2023, 6:58 p.m. OK Java 8 TESTS 8 140 2764800
200826231 Kenzhezhan C April 5, 2023, 3:44 a.m. OK Java 8 TESTS 9 140 3276800
200826164 Kenzhezhan C April 5, 2023, 3:42 a.m. OK Java 8 TESTS 9 140 3379200
200785552 QUITTING C April 4, 2023, 5:13 p.m. OK Java 8 TESTS 5 155 0
200785419 iamdimonis C April 4, 2023, 5:12 p.m. OK Java 8 TESTS 5 155 2764800
200833188 T_PAVAN_NAGARAJU C April 5, 2023, 5:32 a.m. OK Java 8 TESTS 9 170 2867200
200784649 iamdimonis C April 4, 2023, 5:07 p.m. OK Java 8 TESTS 5 171 2764800
200780888 FeehamSzYr C April 4, 2023, 4:49 p.m. OK Java 8 TESTS 5 186 2764800
200792940 NerfThis C April 4, 2023, 6:22 p.m. OK Java 8 TESTS 8 186 2867200
200783428 yixi C April 4, 2023, 5 p.m. OK MS C++ 2017 TESTS 5 124 3174400
200780521 yixi C April 4, 2023, 4:49 p.m. OK MS C++ 2017 TESTS 5 139 3174400
200787110 nawalhaidar C April 4, 2023, 5:25 p.m. OK MS C++ 2017 TESTS 5 296 1638400
200784946 phantomthief1412 C April 4, 2023, 5:09 p.m. OK MS C++ 2017 TESTS 5 296 1638400
200785414 tatianyi C April 4, 2023, 5:12 p.m. OK MS C++ 2017 TESTS 5 296 3174400
200800997 Karimarm C April 4, 2023, 7:31 p.m. OK MS C++ 2017 TESTS 8 873 0
200802373 variance C April 4, 2023, 7:49 p.m. OK Ocaml TESTS 8 156 6246400
200786423 bvf C April 4, 2023, 5:20 p.m. OK PyPy 3 TESTS 5 187 24166400
200780140 Omega_3 C April 4, 2023, 4:48 p.m. OK PyPy 3 TESTS 5 436 18944000
200810478 Chelovek9 C April 4, 2023, 9:45 p.m. OK PyPy 3 TESTS 8 452 21401600
200798688 Bhaskar1702 C April 4, 2023, 7:03 p.m. OK PyPy 3 TESTS 8 467 18739200
200777969 Omega_3 C April 4, 2023, 4:44 p.m. OK PyPy 3 TESTS 5 483 19148800
200799624 chicosena C April 4, 2023, 7:14 p.m. OK PyPy 3 TESTS 8 483 21504000
200817338 Nas C April 5, 2023, 12:38 a.m. OK PyPy 3 TESTS 9 639 23552000
200829766 VKnight C April 5, 2023, 4:45 a.m. OK PyPy 3 TESTS 9 654 20172800
200795760 oneku16 C April 4, 2023, 6:53 p.m. OK PyPy 3-64 TESTS 8 124 30105600
200779105 arun.bh C April 4, 2023, 4:46 p.m. OK PyPy 3-64 TESTS 5 139 26828800
200793506 SophieHatter C April 4, 2023, 6:27 p.m. OK PyPy 3-64 TESTS 8 139 30822400
200792242 sai.anvesh17 C April 4, 2023, 6:15 p.m. OK PyPy 3-64 TESTS 5 140 26726400
200832195 AyuAnchor C April 5, 2023, 5:19 a.m. OK PyPy 3-64 TESTS 9 140 29593600
200824154 Youarenotgood C April 5, 2023, 3:06 a.m. OK PyPy 3-64 TESTS 9 140 29900800
200826752 leanlean C April 5, 2023, 3:53 a.m. OK PyPy 3-64 TESTS 9 140 30105600
200778384 Yergali C April 4, 2023, 4:45 p.m. OK PyPy 3-64 TESTS 5 140 30310400
200789835 -Neel- C April 4, 2023, 5:50 p.m. OK PyPy 3-64 TESTS 5 155 30617600
200809233 zachyang C April 4, 2023, 9:24 p.m. OK PyPy 3-64 TESTS 8 186 27750400
200803621 Cladonia_mitis C April 4, 2023, 8:05 p.m. OK Python 3 TESTS 8 233 16179200
200779402 Anuj_Naval C April 4, 2023, 4:47 p.m. OK Python 3 TESTS 5 248 16281600
200779032 vaibhavbunny C April 4, 2023, 4:46 p.m. OK Python 3 TESTS 5 249 15155200
200818312 bittercof C April 5, 2023, 1:02 a.m. OK Python 3 TESTS 9 264 17817600
200808722 got_dizzy C April 4, 2023, 9:16 p.m. OK Python 3 TESTS 8 280 17203200
200798226 praditha_alwis C April 4, 2023, 6:58 p.m. OK Python 3 TESTS 8 312 17920000
200800166 Arkp C April 4, 2023, 7:21 p.m. OK Python 3 TESTS 8 358 16076800
200779243 Bakha2022 C April 4, 2023, 4:46 p.m. OK Python 3 TESTS 5 374 15052800
200784587 Biruktas C April 4, 2023, 5:07 p.m. OK Python 3 TESTS 5 389 15155200
200782598 PrakshalJain C April 4, 2023, 4:56 p.m. OK Python 3 TESTS 5 389 15769600
200779431 The_Ultimate_Cheater C April 4, 2023, 4:47 p.m. OK Ruby 3 TESTS 5 545 24166400
200826606 Kither C April 5, 2023, 3:51 a.m. OK Rust 2021 TESTS 9 46 17408000
200788765 michaldudzisz C April 4, 2023, 5:40 p.m. OK Scala TESTS 5 717 21504000
200788200 michaldudzisz C April 4, 2023, 5:35 p.m. OK Scala TESTS 5 857 16179200

remove filters

Back to search problems