Codeforces Round 1017 (Div. 4)

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
2094 Codeforces Round 1017 (Div. 4) FINISHED False 8100 31847123 April 13, 2025, 3:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 7806 ) G Chimpanzini Bananini PROGRAMMING data structures math

Chimpanzini Bananini stands on the brink of a momentous battle—one destined to bring finality. For an arbitrary array (b) of length (m), let's denote the rizziness of the array to be (\sum_{i=1}^mb_i\cdot i=b_1\cdot 1+b_2\cdot 2+b_3\cdot 3+\ldots + b_m\cdot m). Chimpanzini Bananini gifts you an empty array. There are three types of operations you can perform on it. Perform a cyclic shift on the array. That is, the array (a_1, a_2, \ldots, a_n) becomes (a_n, a_1, a_2, \ldots, a_{n-1}.) Reverse the entire array. That is, the array (a_1, a_2, \ldots, a_n) becomes (a_n, a_{n-1}, \ldots, a_1.) Append an element to the end of the array. The array (a_1, a_2, \ldots, a_n) becomes (a_1, a_2, \ldots, a_n, k) after appending (k) to the end of the array. After each operation, you are interested in calculating the rizziness of your array. Note that all operations are persistent . This means that each operation modifies the array, and subsequent operations should be applied to the current state of the array after the previous operations. The first line contains an integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains an integer (q) ((1 \leq q \leq 2\cdot 10^5)) — the number of operations you perform on your array. The following (q) lines first contain a single integer (s) ((1 \leq s \leq 3)) — the operation type. If (s=1), then the cyclic shift operation should be performed. If (s=2), then the reversal operation should be performed. If (s=3), then the line will contain an additional integer (k) ((1 \leq k \leq 10^6)), denoting the element appended to the back of the array. It is guaranteed that the sum of (q) will not exceed (2\cdot 10^5) over all test cases. Additionally, it is guaranteed that the first operation on each test case will be one with (s=3). For each test case, output (q) lines, outputting th

Tutorials

Codeforces Round 1017 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
315486907 chrisTris G April 13, 2025, 6:06 p.m. OK C# 10 TESTS 4 171 13004800
315538367 Nisikto G April 14, 2025, 6:03 a.m. OK C++17 (GCC 7-32) TESTS 4 155 0
315533328 a_dxyz G April 14, 2025, 5:14 a.m. OK C++17 (GCC 7-32) TESTS 4 155 0
315531720 Binary-Brigade G April 14, 2025, 4:58 a.m. OK C++17 (GCC 7-32) TESTS 4 155 0
315532162 Ravindra_Rinwa G April 14, 2025, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 4 156 0
315528353 starglazer G April 14, 2025, 4:21 a.m. OK C++17 (GCC 7-32) TESTS 4 156 0
315521045 Hanggoash G April 14, 2025, 2:23 a.m. OK C++17 (GCC 7-32) TESTS 4 156 0
315507220 Kener_Castillo G April 13, 2025, 9:05 p.m. OK C++17 (GCC 7-32) TESTS 4 156 0
315497645 bhagwandai G April 13, 2025, 7:22 p.m. OK C++17 (GCC 7-32) TESTS 4 156 102400
315490523 lock_in_ G April 13, 2025, 6:27 p.m. OK C++17 (GCC 7-32) TESTS 4 156 102400
315538443 ___.....___ G April 14, 2025, 6:04 a.m. OK C++17 (GCC 7-32) TESTS 4 171 0
315529651 Zhao_JH G April 14, 2025, 4:36 a.m. OK C++20 (GCC 13-64) TESTS 4 77 0
315511092 OTC G April 13, 2025, 10:05 p.m. OK C++20 (GCC 13-64) TESTS 4 93 0
315509708 SadArtira G April 13, 2025, 9:40 p.m. OK C++20 (GCC 13-64) TESTS 4 93 0
315509259 Abraxos G April 13, 2025, 9:33 p.m. OK C++20 (GCC 13-64) TESTS 4 93 0
315506300 LegendSukuna G April 13, 2025, 8:52 p.m. OK C++20 (GCC 13-64) TESTS 4 93 0
315496694 nvvy G April 13, 2025, 7:14 p.m. OK C++20 (GCC 13-64) TESTS 4 93 0
315490600 IrenN G April 13, 2025, 6:28 p.m. OK C++20 (GCC 13-64) TESTS 4 93 0
315533645 Zhao_JH G April 14, 2025, 5:17 a.m. OK C++20 (GCC 13-64) TESTS 4 93 102400
315513719 jamil_safi G April 13, 2025, 11:05 p.m. OK C++20 (GCC 13-64) TESTS 4 93 102400
315502882 ab_malek G April 13, 2025, 8:12 p.m. OK C++20 (GCC 13-64) TESTS 4 93 102400
315521311 vitamin_hugmefirst G April 14, 2025, 2:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 0
315484603 I_love_humingyu G April 13, 2025, 5:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 0
315511376 Omar2718 G April 13, 2025, 10:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 102400
315509401 SeeElsayed G April 13, 2025, 9:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 102400
315491064 Nastya_An G April 13, 2025, 6:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 102400
315488901 failure514 G April 13, 2025, 6:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 102400
315485221 HotHeadd G April 13, 2025, 5:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 102400
315531759 MrCharlezzz G April 14, 2025, 4:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 93 1638400
315538469 Tz1934 G April 14, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 108 0
315537821 A_R_Adnan G April 14, 2025, 5:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 108 0
315494687 psharaev G April 13, 2025, 6:58 p.m. OK Go TESTS 4 187 4915200
315510899 Yousef_Badr G April 13, 2025, 10:01 p.m. OK Java 21 TESTS 4 327 204800
315527742 lyongwolf G April 14, 2025, 4:13 a.m. OK Java 21 TESTS 4 328 3993600
315504446 yashjaiswal2509 G April 13, 2025, 8:30 p.m. OK Java 21 TESTS 4 374 10649600
315495369 manish_pravesh G April 13, 2025, 7:03 p.m. OK Java 21 TESTS 4 421 204800
315519468 man-ray G April 14, 2025, 1:49 a.m. OK Java 21 TESTS 4 421 1024000
315492496 BurnerAce G April 13, 2025, 6:41 p.m. OK Java 21 TESTS 4 436 1024000
315491378 Balu2907 G April 13, 2025, 6:33 p.m. OK Java 21 TESTS 4 437 409600
315522638 wish2fun G April 14, 2025, 2:53 a.m. OK Java 21 TESTS 4 452 8294400
315529002 naveencf25 G April 14, 2025, 4:29 a.m. OK Java 21 TESTS 4 484 1228800
315532649 akshatsaxena552004.ss G April 14, 2025, 5:08 a.m. OK Java 21 TESTS 4 531 819200
315538541 adibhai0845R G April 14, 2025, 6:05 a.m. OK Java 8 TESTS 4 796 0
315535978 ChongQY G April 14, 2025, 5:41 a.m. OK Java 8 TESTS 4 811 3174400
315500884 kingcabrams G April 13, 2025, 7:51 p.m. OK Kotlin 1.9 TESTS 4 265 1740800
315500227 kingcabrams G April 13, 2025, 7:45 p.m. OK Kotlin 1.9 TESTS 4 265 1843200
315501444 kingcabrams G April 13, 2025, 7:57 p.m. OK Kotlin 1.9 TESTS 4 296 1843200
315502902 kingcabrams G April 13, 2025, 8:12 p.m. OK Kotlin 1.9 TESTS 4 296 2867200
315490207 kryoton_98 G April 13, 2025, 6:25 p.m. OK PyPy 3 TESTS 4 718 47104000
315506511 _PD_ G April 13, 2025, 8:55 p.m. OK PyPy 3 TESTS 4 1015 12390400
315499436 gardengnome G April 13, 2025, 7:37 p.m. OK PyPy 3-64 TESTS 4 187 16896000
315505372 Om_Singh_ G April 13, 2025, 8:41 p.m. OK PyPy 3-64 TESTS 4 202 23552000
315509993 OmarMoBadr G April 13, 2025, 9:45 p.m. OK PyPy 3-64 TESTS 4 265 10547200
315485716 Abhishek_Dhamshetty_99 G April 13, 2025, 6 p.m. OK PyPy 3-64 TESTS 4 265 11161600
315511723 KinanAyed G April 13, 2025, 10:17 p.m. OK PyPy 3-64 TESTS 4 280 32768000
315494125 Guardiantzb G April 13, 2025, 6:53 p.m. OK PyPy 3-64 TESTS 4 281 11468800
315485646 pizet G April 13, 2025, 6 p.m. OK PyPy 3-64 TESTS 4 281 13004800
315488888 Mamba_AI G April 13, 2025, 6:17 p.m. OK PyPy 3-64 TESTS 4 281 31539200
315512230 Kasli G April 13, 2025, 10:28 p.m. OK PyPy 3-64 TESTS 4 296 11776000
315497144 smilence G April 13, 2025, 7:18 p.m. OK PyPy 3-64 TESTS 4 296 23552000
315485604 shashanksp851 G April 13, 2025, 6 p.m. OK Python 3 TESTS 4 249 42188800
315495324 braveblc G April 13, 2025, 7:03 p.m. OK Python 3 TESTS 4 1061 7065600
315492117 mudanvit.goyal G April 13, 2025, 6:39 p.m. OK Python 3 TESTS 4 1062 7065600
315493778 kingcabrams G April 13, 2025, 6:51 p.m. OK Rust 2021 TESTS 4 62 5222400
315493653 DeanMenezes93 G April 13, 2025, 6:50 p.m. OK Rust 2021 TESTS 4 390 512000

remove filters

Back to search problems