Codeforces Round 773 (Div. 1)

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
1641 Codeforces Round 773 (Div. 1) FINISHED False 7200 86212199 Feb. 23, 2022, 10:10 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3826 ) B Repetitions Decoding PROGRAMMING constructive algorithms implementation sortings

B"Olya has an array of integers a_1, a_2, ldots, a_n . She wants to split it into tandem repeats. Since it's rarely possible, before that she wants to perform the following operation several (possibly, zero) number of times: insert a pair of equal numbers into an arbitrary position. Help her! More formally: Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 30 ,000 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 500 ). The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the initial array. It is guaranteed that the sum of n^2 over all test cases does not exceed 250 ,000 . For each test case print answer in the following format. If you cannot turn the array into a concatenation of tandem repeats, print a single integer -1 . Otherwise print the number of operations q ( 0 <= q <= 2 cdot n^2 ) that you want to do. Then print the descriptions of operations. In each of the following q lines print two integers p and c ( 1 <= c <= 10^9 ), which mean that you insert the integer c twice after p elements of the array. If the length of the array is m before the operation, then the condition 0 <= p <= m should be satisfied. Then you should print any way to split the resulting array into tandem repeats. First, print a single integer d , and then print a sequence t_1, t_2, ldots, t_d of even integers of size d ( d, t_i ge 1 ). These numbers are the lengths of the subsegments from left to right. Note that the size of the resulting array a is m = n + 2 cdot q . The following statements must hold: It can be shown that if the array can be turned into a concatenation of tandem repeats, then there exists a solution satisfying all constraints. If th"...

Tutorials

Codeforces Round #773 editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
147431117 Gassa B Feb. 23, 2022, 10:41 a.m. OK D TESTS 20 46 4198400
147454521 Acfboy B Feb. 23, 2022, 11:36 a.m. OK GNU C++14 TESTS 20 15 614400
147446844 bary B Feb. 23, 2022, 11:13 a.m. OK GNU C++14 TESTS 20 15 716800
147422902 ugly2333 B Feb. 23, 2022, 10:28 a.m. OK GNU C++14 TESTS 20 15 1024000
147436298 BARBARIANNNNN B Feb. 23, 2022, 10:50 a.m. OK GNU C++14 TESTS 20 15 1228800
147436454 He_Ren B Feb. 23, 2022, 10:50 a.m. OK GNU C++14 TESTS 20 15 1228800
147529156 SharpnessX B Feb. 24, 2022, 3:33 a.m. OK GNU C++14 TESTS 21 15 1228800
147486833 WDCnew B Feb. 23, 2022, 3:11 p.m. OK GNU C++14 TESTS 20 15 1228800
147447599 Eric_hooo B Feb. 23, 2022, 11:15 a.m. OK GNU C++14 TESTS 20 15 1228800
147527607 walk_alone B Feb. 24, 2022, 2:59 a.m. OK GNU C++14 TESTS 21 15 1331200
147464629 Early B Feb. 23, 2022, 12:08 p.m. OK GNU C++14 TESTS 20 15 1433600
147516090 yangster67 B Feb. 23, 2022, 9:24 p.m. OK GNU C++17 TESTS 20 15 1126400
147527433 cnnfls_csy B Feb. 24, 2022, 2:55 a.m. OK GNU C++17 TESTS 21 15 1126400
147435937 se1ka2 B Feb. 23, 2022, 10:49 a.m. OK GNU C++17 TESTS 20 15 1126400
147439297 TeaPot B Feb. 23, 2022, 10:56 a.m. OK GNU C++17 TESTS 20 15 1228800
147524599 _dlbm17 B Feb. 24, 2022, 1:38 a.m. OK GNU C++17 TESTS 21 15 1228800
147512265 TolyaHo B Feb. 23, 2022, 8:06 p.m. OK GNU C++17 TESTS 20 15 1228800
147460262 Victoriano012 B Feb. 23, 2022, 11:55 a.m. OK GNU C++17 TESTS 20 15 1228800
147456579 MinakoKojima B Feb. 23, 2022, 11:42 a.m. OK GNU C++17 TESTS 20 15 1228800
147451871 chuchu B Feb. 23, 2022, 11:27 a.m. OK GNU C++17 TESTS 20 15 1228800
147435974 the_computer_jock B Feb. 23, 2022, 10:49 a.m. OK GNU C++17 TESTS 20 15 1228800
147439697 zhrrrr B Feb. 23, 2022, 10:57 a.m. OK GNU C++17 (64) TESTS 20 15 1126400
147523355 Sion_y B Feb. 24, 2022, 1:03 a.m. OK GNU C++17 (64) TESTS 21 15 1126400
147474660 codelegend B Feb. 23, 2022, 1:26 p.m. OK GNU C++17 (64) TESTS 20 15 1126400
147474021 GoatTamer B Feb. 23, 2022, 1:21 p.m. OK GNU C++17 (64) TESTS 20 15 1126400
147469754 Andreasyan B Feb. 23, 2022, 12:53 p.m. OK GNU C++17 (64) TESTS 20 15 1126400
147454625 triple__a B Feb. 23, 2022, 11:36 a.m. OK GNU C++17 (64) TESTS 20 15 1126400
147448571 dfcmd B Feb. 23, 2022, 11:18 a.m. OK GNU C++17 (64) TESTS 20 15 1126400
147444681 s_master0517 B Feb. 23, 2022, 11:08 a.m. OK GNU C++17 (64) TESTS 20 15 1126400
147443922 Lawali B Feb. 23, 2022, 11:06 a.m. OK GNU C++17 (64) TESTS 20 15 1126400
147439963 Kude B Feb. 23, 2022, 10:57 a.m. OK GNU C++17 (64) TESTS 20 15 1126400
147448918 Macesuted-Moe B Feb. 23, 2022, 11:19 a.m. OK GNU C++20 (64) TESTS 20 0 3174400
147439467 IsaacMoris B Feb. 23, 2022, 10:56 a.m. OK GNU C++20 (64) TESTS 20 15 614400
147436315 Sui-chan_wa... B Feb. 23, 2022, 10:50 a.m. OK GNU C++20 (64) TESTS 20 15 614400
147438976 ultizet B Feb. 23, 2022, 10:55 a.m. OK GNU C++20 (64) TESTS 20 15 1024000
147475109 yingluosanqian B Feb. 23, 2022, 1:29 p.m. OK GNU C++20 (64) TESTS 20 15 1024000
147458303 Cantor. B Feb. 23, 2022, 11:48 a.m. OK GNU C++20 (64) TESTS 20 15 1024000
147439945 AriaH B Feb. 23, 2022, 10:57 a.m. OK GNU C++20 (64) TESTS 20 15 1024000
147433173 _su1sen B Feb. 23, 2022, 10:44 a.m. OK GNU C++20 (64) TESTS 20 15 1024000
147526271 askd B Feb. 24, 2022, 2:25 a.m. OK GNU C++20 (64) TESTS 21 15 1126400
147526239 askd B Feb. 24, 2022, 2:24 a.m. OK GNU C++20 (64) TESTS 21 15 1126400
147480914 0x3F B Feb. 23, 2022, 2:17 p.m. OK Go TESTS 20 46 4608000
147482041 0x3F B Feb. 23, 2022, 2:27 p.m. OK Go TESTS 20 62 4812800
147487119 Cepera B Feb. 23, 2022, 3:14 p.m. OK Java 11 TESTS 20 202 0
147436798 robinz62 B Feb. 23, 2022, 10:51 a.m. OK Java 11 TESTS 20 233 0
147528731 Wuya B Feb. 24, 2022, 3:24 a.m. OK Java 11 TESTS 21 233 0
147513722 Cepera B Feb. 23, 2022, 8:32 p.m. OK Java 11 TESTS 20 233 0
147487313 Cepera B Feb. 23, 2022, 3:16 p.m. OK Java 11 TESTS 20 233 0
147424739 uwi B Feb. 23, 2022, 10:31 a.m. OK Java 11 TESTS 20 233 0
147438954 procrastinate7 B Feb. 23, 2022, 10:55 a.m. OK Java 11 TESTS 20 249 512000
147455924 insert_cool_handle B Feb. 23, 2022, 11:40 a.m. OK Java 11 TESTS 20 264 0
147428839 iakovlev.zakhar B Feb. 23, 2022, 10:37 a.m. OK Java 8 TESTS 20 124 0
147456103 Hemose B Feb. 23, 2022, 11:41 a.m. OK Java 8 TESTS 20 124 0
147436271 zloyrobot B Feb. 23, 2022, 10:50 a.m. OK Java 8 TESTS 20 124 0
147451183 Hakiobo B Feb. 23, 2022, 11:25 a.m. OK Kotlin 1.4 TESTS 20 156 1536000
147482179 arvindf232 B Feb. 23, 2022, 2:28 p.m. OK Kotlin 1.4 TESTS 20 202 1945600
147428971 Sparky_Master_WCH1226 B Feb. 23, 2022, 10:38 a.m. OK Kotlin 1.4 TESTS 20 202 1945600
147439639 darnley B Feb. 23, 2022, 10:57 a.m. OK Kotlin 1.5 TESTS 20 623 1331200
147481002 ComPhyPark B Feb. 23, 2022, 2:18 p.m. OK MS C++ 2017 TESTS 20 31 2764800
147470184 LXl491214 B Feb. 23, 2022, 12:56 p.m. OK MS C++ 2017 TESTS 20 46 1638400
147435287 machine_solution B Feb. 23, 2022, 10:48 a.m. OK MS C++ 2017 TESTS 20 93 3072000
147446046 kakel_san B Feb. 23, 2022, 11:11 a.m. OK .NET Core C# TESTS 20 93 6963200
147481600 ktthree B Feb. 23, 2022, 2:23 p.m. OK PyPy 3 TESTS 20 233 9318400
147509351 whatshisbucket B Feb. 23, 2022, 7:23 p.m. OK PyPy 3 TESTS 20 233 14540800
147427742 akhan42 B Feb. 23, 2022, 10:36 a.m. OK PyPy 3 TESTS 20 264 9932800
147426815 asdsasd B Feb. 23, 2022, 10:34 a.m. OK PyPy 3 TESTS 20 280 9830400
147468456 NecroSean38 B Feb. 23, 2022, 12:47 p.m. OK PyPy 3 TESTS 20 280 18534400
147454618 eepsilon B Feb. 23, 2022, 11:36 a.m. OK PyPy 3 TESTS 20 342 9625600
147513070 plevande B Feb. 23, 2022, 8:20 p.m. OK PyPy 3-64 TESTS 20 187 12902400
147445832 lucifer1004 B Feb. 23, 2022, 11:11 a.m. OK PyPy 3-64 TESTS 20 264 11673600
147440253 tamato B Feb. 23, 2022, 10:58 a.m. OK PyPy 3-64 TESTS 20 280 12800000
147433234 chinerist B Feb. 23, 2022, 10:45 a.m. OK PyPy 3-64 TESTS 20 499 17715200
147499401 OLOGY B Feb. 23, 2022, 5:21 p.m. OK Python 2 TESTS 20 108 8499200
147499224 OLOGY B Feb. 23, 2022, 5:19 p.m. OK Python 2 TESTS 20 108 8499200
147501575 sansen B Feb. 23, 2022, 5:47 p.m. OK Rust 2021 TESTS 20 15 2150400
147425574 Egor B Feb. 23, 2022, 10:32 a.m. OK Rust 2021 TESTS 20 15 2150400
147425562 qwerty787788 B Feb. 23, 2022, 10:32 a.m. OK Rust 2021 TESTS 20 30 2150400

remove filters

Back to search problems