Codeforces Round 894 (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
1862 Codeforces Round 894 (Div. 3) FINISHED False 8100 38935499 Aug. 24, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 32982 ) B Sequence Game PROGRAMMING constructive algorithms

B'Tema and Vika are playing the following game. First, Vika comes up with a sequence of positive integers a of length m and writes it down on a piece of paper. Then she takes a new piece of paper and writes down the sequence b according to the following rule: For example, from the sequence a=[4, 3, 2, 6, 3, 3] , Vika will obtain the sequence b=[4, 6, 3] . She then gives the piece of paper with the sequence b to Tema. He, in turn, tries to guess the sequence a . Tema considers winning in such a game highly unlikely, but still wants to find at least one sequence a that could have been originally chosen by Vika. Help him and output any such sequence. Note that the length of the sequence you output should not exceed the input sequence length by more than two times. Each test consists of multiple test cases. The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. This is followed by a description of the test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the sequence b . The second line of each test case contains n integers b_1, b_2, b_3, ... , b_n ( 1 <= b_i <= 10^9 ) -- the elements of the sequence. The sum of the values of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output two lines. In the first line, output a single integer m -- the length of the sequence ( n <= m <= 2 cdot n ). In the second line, output m integers a_1, a_2, a_3, ... , a_m ( 1 <= a_i <= 10^9 ) -- the assumed sequence that Vika could have written on the first piece of paper. If there are multiple suitable sequences, you can output any of them. The first sample is explained in the problem statement. In the second sample, Vika could have chosen the original sequence. '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
220449897 mban259 B Aug. 26, 2023, 1:42 a.m. OK C# 10 TESTS 8 140 57241600
220427146 Salery B Aug. 25, 2023, 6:56 p.m. OK C# 10 TESTS 8 171 48537600
220363080 Kamill_m B Aug. 25, 2023, 10:54 a.m. OK C# 10 TESTS 8 1153 34713600
220362987 LL__LOX B Aug. 25, 2023, 10:54 a.m. OK C# 10 TESTS 8 1153 34713600
220424073 SaumyaBalina B Aug. 25, 2023, 6:27 p.m. OK GNU C11 TESTS 8 1621 2355200
220414008 WASIF_74 B Aug. 25, 2023, 5:10 p.m. OK GNU C11 TESTS 8 1638 2355200
220417098 AnshGoel2004 B Aug. 25, 2023, 5:33 p.m. OK GNU C11 TESTS 8 1653 2355200
220423929 SaumyaBalina B Aug. 25, 2023, 6:25 p.m. OK GNU C11 TESTS 8 1669 2355200
220439659 Nakshatra07 B Aug. 25, 2023, 9:43 p.m. OK GNU C11 TESTS 8 1715 2355200
220374226 sz_jinzikai01 B Aug. 25, 2023, 12:27 p.m. OK GNU C++14 TESTS 8 93 3174400
220381401 MrPython B Aug. 25, 2023, 1:22 p.m. OK GNU C++14 TESTS 8 93 6656000
220373714 Zboh_Zbp B Aug. 25, 2023, 12:23 p.m. OK GNU C++14 TESTS 8 108 1638400
220375895 zwyyy B Aug. 25, 2023, 12:40 p.m. OK GNU C++14 TESTS 8 108 2457600
220367861 Prms-Prmt B Aug. 25, 2023, 11:35 a.m. OK GNU C++14 TESTS 8 108 2457600
220445241 Tokai. B Aug. 25, 2023, 11:52 p.m. OK GNU C++14 TESTS 8 108 3174400
220444720 Yuics B Aug. 25, 2023, 11:40 p.m. OK GNU C++14 TESTS 8 108 3174400
220459448 InfiniteChallenge B Aug. 26, 2023, 4:35 a.m. OK GNU C++14 TESTS 8 108 3993600
220401443 omeganot B Aug. 25, 2023, 3:39 p.m. OK GNU C++14 TESTS 8 108 3993600
220462291 Vipul21435 B Aug. 26, 2023, 5:17 a.m. OK GNU C++14 TESTS 8 108 3993600
220409856 jubesh B Aug. 25, 2023, 4:38 p.m. OK GNU C++17 TESTS 8 93 3993600
220378704 zhuoli B Aug. 25, 2023, 1:01 p.m. OK GNU C++17 TESTS 8 108 2355200
220367607 darcop B Aug. 25, 2023, 11:33 a.m. OK GNU C++17 TESTS 8 108 3174400
220363694 NiKol09 B Aug. 25, 2023, 11 a.m. OK GNU C++17 TESTS 8 108 3993600
220362747 sane-O-pede07 B Aug. 25, 2023, 10:51 a.m. OK GNU C++17 TESTS 8 108 3993600
220451193 hello_ume. B Aug. 26, 2023, 2:08 a.m. OK GNU C++17 TESTS 8 108 3993600
220436340 owhut B Aug. 25, 2023, 8:48 p.m. OK GNU C++17 TESTS 8 108 3993600
220407495 moon_095 B Aug. 25, 2023, 4:21 p.m. OK GNU C++17 TESTS 8 108 3993600
220465600 reeturajGogoi B Aug. 26, 2023, 5:55 a.m. OK GNU C++17 TESTS 8 108 3993600
220459415 yysxy B Aug. 26, 2023, 4:35 a.m. OK GNU C++17 TESTS 8 108 3993600
220434372 eiqkx B Aug. 25, 2023, 8:22 p.m. OK GNU C++17 (64) TESTS 8 77 1638400
220434127 eiqkx B Aug. 25, 2023, 8:18 p.m. OK GNU C++17 (64) TESTS 8 77 4198400
220439709 Ammoor-O.A.G B Aug. 25, 2023, 9:44 p.m. OK GNU C++17 (64) TESTS 8 78 819200
220464725 Zhaojh B Aug. 26, 2023, 5:45 a.m. OK GNU C++17 (64) TESTS 8 93 819200
220410689 Fast_submit B Aug. 25, 2023, 4:44 p.m. OK GNU C++17 (64) TESTS 8 93 4198400
220460433 JorbanS B Aug. 26, 2023, 4:51 a.m. OK GNU C++17 (64) TESTS 8 93 4198400
220387733 _chroneZ B Aug. 25, 2023, 2:23 p.m. OK GNU C++17 (64) TESTS 8 93 5017600
220346215 rishit3234 B Aug. 25, 2023, 6:33 a.m. OK GNU C++17 (64) TESTS 8 93 5017600
220350979 Krzychuo B Aug. 25, 2023, 7:34 a.m. OK GNU C++17 (64) TESTS 8 93 5017600
220380893 AmirMoris B Aug. 25, 2023, 1:18 p.m. OK GNU C++17 (64) TESTS 8 93 5017600
220401297 eternal_happiness B Aug. 25, 2023, 3:38 p.m. OK GNU C++20 (64) TESTS 8 46 819200
220415464 tasneemkhaled350 B Aug. 25, 2023, 5:20 p.m. OK GNU C++20 (64) TESTS 8 46 5017600
220377926 mazzn B Aug. 25, 2023, 12:55 p.m. OK GNU C++20 (64) TESTS 8 46 5017600
220379398 luogu_bot2 B Aug. 25, 2023, 1:05 p.m. OK GNU C++20 (64) TESTS 8 46 7065600
220402685 nekoyukino B Aug. 25, 2023, 3:46 p.m. OK GNU C++20 (64) TESTS 8 46 7168000
220435205 armish_123 B Aug. 25, 2023, 8:33 p.m. OK GNU C++20 (64) TESTS 8 46 9011200
220417148 mohammad_harahsha B Aug. 25, 2023, 5:33 p.m. OK GNU C++20 (64) TESTS 8 61 819200
220445261 BlueDiamond B Aug. 25, 2023, 11:52 p.m. OK GNU C++20 (64) TESTS 8 61 819200
220356484 KMB_2003 B Aug. 25, 2023, 9:06 a.m. OK GNU C++20 (64) TESTS 8 61 1638400
220430381 Spider47 B Aug. 25, 2023, 7:32 p.m. OK GNU C++20 (64) TESTS 8 61 1638400
220448621 profchi B Aug. 26, 2023, 1:15 a.m. OK Java 11 TESTS 8 265 7577600
220445031 iamavalon B Aug. 25, 2023, 11:45 p.m. OK Java 11 TESTS 8 296 10649600
220376120 momofcis96 B Aug. 25, 2023, 12:42 p.m. OK Java 11 TESTS 8 358 13926400
220406656 FirstException B Aug. 25, 2023, 4:15 p.m. OK Java 11 TESTS 8 421 79052800
220362400 nk_Navin B Aug. 25, 2023, 10:49 a.m. OK Java 11 TESTS 8 1653 14540800
220364436 jayasuryasubashini B Aug. 25, 2023, 11:06 a.m. OK Java 11 TESTS 8 1731 20889600
220376201 Mostafa_Murad B Aug. 25, 2023, 12:42 p.m. OK Java 17 TESTS 8 327 15667200
220354336 swatishivam23 B Aug. 25, 2023, 8:31 a.m. OK Java 17 TESTS 8 342 7475200
220463176 raito3z B Aug. 26, 2023, 5:28 a.m. OK Java 17 TESTS 8 373 5427200
220438864 utkarsh3112 B Aug. 25, 2023, 9:27 p.m. OK Java 17 TESTS 8 420 9318400
220414303 Talaat-Jr B Aug. 25, 2023, 5:12 p.m. OK Java 17 TESTS 8 639 6553600
220409880 Udayf B Aug. 25, 2023, 4:38 p.m. OK Java 17 TESTS 8 919 22016000
220368790 Udayf B Aug. 25, 2023, 11:43 a.m. OK Java 17 TESTS 8 951 22220800
220369133 PshhyX B Aug. 25, 2023, 11:46 a.m. OK Java 17 TESTS 8 982 22835200
220365289 AKhacks B Aug. 25, 2023, 11:13 a.m. OK Java 17 TESTS 8 1591 11878400
220378538 Rodolphe B Aug. 25, 2023, 12:59 p.m. OK Java 17 TESTS 8 1684 6348800
220422093 Udayf B Aug. 25, 2023, 6:11 p.m. OK Java 8 TESTS 8 202 2867200
220458105 Udayf B Aug. 26, 2023, 4:13 a.m. OK Java 8 TESTS 8 248 4812800
220464077 magic_kid B Aug. 26, 2023, 5:38 a.m. OK Java 8 TESTS 8 264 14131200
220374036 lemma_Forever B Aug. 25, 2023, 12:25 p.m. OK Java 8 TESTS 8 296 9523200
220378241 Nanthakumar06 B Aug. 25, 2023, 12:57 p.m. OK Java 8 TESTS 8 296 14233600
220402600 dhruvil8804 B Aug. 25, 2023, 3:46 p.m. OK Java 8 TESTS 8 296 14336000
220351321 depurador_ik B Aug. 25, 2023, 7:38 a.m. OK Java 8 TESTS 8 327 51097600
220368846 QianCCC B Aug. 25, 2023, 11:44 a.m. OK Java 8 TESTS 8 498 9318400
220419764 Udayf B Aug. 25, 2023, 5:53 p.m. OK Java 8 TESTS 8 873 2867200
220409936 Udayf B Aug. 25, 2023, 4:38 p.m. OK Java 8 TESTS 8 919 17817600
220371566 blkrop B Aug. 25, 2023, 12:05 p.m. OK Kotlin 1.7 TESTS 8 1029 138035200
220426273 matalex04 B Aug. 25, 2023, 6:47 p.m. OK MS C++ 2017 TESTS 8 296 5734400
220376806 maxK99 B Aug. 25, 2023, 12:47 p.m. OK MS C++ 2017 TESTS 8 374 819200
220438984 Matvec B Aug. 25, 2023, 9:30 p.m. OK MS C++ 2017 TESTS 8 389 2457600
220403114 nhimlongxuuu B Aug. 25, 2023, 3:49 p.m. OK MS C++ 2017 TESTS 8 404 2252800
220352212 1434314294 B Aug. 25, 2023, 7:52 a.m. OK MS C++ 2017 TESTS 8 436 5939200
220352364 1173 B Aug. 25, 2023, 7:55 a.m. OK MS C++ 2017 TESTS 8 451 4812800
220410154 Merge_404 B Aug. 25, 2023, 4:40 p.m. OK MS C++ 2017 TESTS 8 467 4812800
220412275 ankitksingh B Aug. 25, 2023, 4:57 p.m. OK MS C++ 2017 TESTS 8 468 4812800
220371719 Dick007 B Aug. 25, 2023, 12:07 p.m. OK MS C++ 2017 TESTS 8 483 3993600
220460563 ramab B Aug. 26, 2023, 4:53 a.m. OK PyPy 3 TESTS 8 608 23142400
220424947 MedhaM B Aug. 25, 2023, 6:34 p.m. OK PyPy 3 TESTS 8 779 19046400
220442073 adamjamil B Aug. 25, 2023, 10:34 p.m. OK PyPy 3-64 TESTS 8 156 35020800
220446069 adamjamil B Aug. 26, 2023, 12:12 a.m. OK PyPy 3-64 TESTS 8 171 40652800
220437901 Kvazarus B Aug. 25, 2023, 9:12 p.m. OK PyPy 3-64 TESTS 8 186 33280000
220430263 MdAbedin B Aug. 25, 2023, 7:30 p.m. OK PyPy 3-64 TESTS 8 202 27750400
220374373 _icy_ B Aug. 25, 2023, 12:28 p.m. OK PyPy 3-64 TESTS 8 202 28979200
220410454 Sahitya02 B Aug. 25, 2023, 4:43 p.m. OK PyPy 3-64 TESTS 8 202 29593600
220368582 Marco_Lau B Aug. 25, 2023, 11:42 a.m. OK PyPy 3-64 TESTS 8 202 30617600
220358653 harrylfoppa B Aug. 25, 2023, 9:43 a.m. OK PyPy 3-64 TESTS 8 202 31129600
220418735 Tinky1224 B Aug. 25, 2023, 5:45 p.m. OK PyPy 3-64 TESTS 8 202 33382400
220446224 alveeram B Aug. 26, 2023, 12:17 a.m. OK PyPy 3-64 TESTS 8 202 40652800
220419053 husseainshalaby6 B Aug. 25, 2023, 5:47 p.m. OK Python 3 TESTS 8 233 25804800
220424476 yosefxlr8 B Aug. 25, 2023, 6:30 p.m. OK Python 3 TESTS 8 265 46080000
220448069 xu3kev B Aug. 26, 2023, 1:03 a.m. OK Python 3 TESTS 8 265 47718400
220344936 -BOOGEYMAN- B Aug. 25, 2023, 6:16 a.m. OK Python 3 TESTS 8 280 48537600
220435507 FaroukM B Aug. 25, 2023, 8:37 p.m. OK Python 3 TESTS 8 280 49868800
220348554 hermonita B Aug. 25, 2023, 7:04 a.m. OK Python 3 TESTS 8 280 50278400
220387511 gaganm B Aug. 25, 2023, 2:21 p.m. OK Python 3 TESTS 8 296 48230400
220456337 NoLongerHuman B Aug. 26, 2023, 3:44 a.m. OK Python 3 TESTS 8 467 28672000
220435442 himanshu124 B Aug. 25, 2023, 8:36 p.m. OK Python 3 TESTS 8 468 26214400
220413844 maruf_khan96 B Aug. 25, 2023, 5:09 p.m. OK Python 3 TESTS 8 468 28672000
220414531 Parth_Dhokane B Aug. 25, 2023, 5:13 p.m. OK Ruby 3 TESTS 8 561 27443200

remove filters

Back to search problems