Codeforces Round 1028 (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
2116 Codeforces Round 1028 (Div. 2) FINISHED False 7200 27703523 May 31, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 17464 ) B Gellyfish and Baby's Breath PROGRAMMING greedy

Flower gives Gellyfish two permutations(^{\text{∗}}) of (0, 1, \ldots, n-1): (p_0, p_1, \ldots, p_{n-1}) and (q_0, q_1, \ldots, q_{n-1}). Now Gellyfish wants to calculate an array (r_0,r_1,\ldots,r_{n-1}) through the following method: For all (i) ((0 \leq i \leq n-1)), (r_i = \max\limits_{j=0}^{i} \left(2^{p_j} + 2^{q_{i-j}} \right)) But since Gellyfish is very lazy, you have to help her figure out the elements of (r). Since the elements of (r) are very large, you are only required to output the elements of (r) modulo (998\,244\,353). (^{\text{∗}})An array (b) is a permutation of an array (a) if (b) consists of the elements of (a) in arbitrary order. For example, (4,2,3,4) is a permutation of (3,2,4,4) while (1,2,2) is not a permutation of (1,2,3). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \leq n \leq 10^5)). The second line of each test case contains (n) integers (p_0, p_1, \ldots,p_{n-1}) ((0 \leq p_i < n)). The third line of each test case contains (n) integers (q_0, q_1, \ldots,q_{n-1}) ((0 \leq q_i < n)). It is guaranteed that both (p) and (q) are permutations of (0, 1, \ldots, n-1). It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each test case, output (n) integers (r_0, r_1, \ldots, r_{n-1}) in a single line, modulo (998\,244\,353). In the first test case: (r_0 = 2^{p_0} + 2^{q_0} = 1+2=3) (r_1 = \max(2^{p_0} + 2^{q_1}, 2^{p_1} + 2^{q_0}) = \max(1+4, 4+2) = 6) (r_2 = \max(2^{p_0} + 2^{q_2}, 2^{p_1}+2^{q_1}, 2^{p_2}+2^{q_0}) = (1+1, 4+4, 2+2) = 8)

Tutorials

Codeforces Round 1028 (Div.1, Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
322346080 og.kostya B June 1, 2025, 5:43 a.m. OK C# 10 TESTS 10 108 6348800
322346112 og.kostya B June 1, 2025, 5:44 a.m. OK C# 13 TESTS 10 140 7168000
322338737 _Equinox B June 1, 2025, 4:10 a.m. OK C# 13 TESTS 10 389 14336000
322339873 dillen77joe B June 1, 2025, 4:26 a.m. OK C++17 (GCC 7-32) TESTS 10 77 102400
322302266 ansshh B May 31, 2025, 5:57 p.m. OK C++17 (GCC 7-32) TESTS 10 78 102400
322345292 esh_war2 B June 1, 2025, 5:35 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322343263 kjstyles987 B June 1, 2025, 5:11 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322341705 Ab_D._Ullah B June 1, 2025, 4:50 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322334388 nsampath06 B June 1, 2025, 3:06 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322326816 racsosabe B June 1, 2025, 12:05 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322326815 wiza_rd B June 1, 2025, 12:05 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322316561 Archit746 B May 31, 2025, 8:03 p.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322309404 Aaditya_Raj_iitr B May 31, 2025, 6:46 p.m. OK C++17 (GCC 7-32) TESTS 10 93 0
322329017 Harshnegi2005 B June 1, 2025, 1:23 a.m. OK C++20 (GCC 13-64) TESTS 10 77 0
322306413 konni35 B May 31, 2025, 6:23 p.m. OK C++20 (GCC 13-64) TESTS 10 77 0
322344317 -rynk2200 B June 1, 2025, 5:23 a.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322342683 PHANTOM_23 B June 1, 2025, 5:03 a.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322342502 NoobMaster069 B June 1, 2025, 5:01 a.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322342229 Krabbypatty B June 1, 2025, 4:57 a.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322336664 B_Sarkar B June 1, 2025, 3:41 a.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322329644 zyom B June 1, 2025, 1:40 a.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322308764 matveyryabtsev1 B May 31, 2025, 6:41 p.m. OK C++20 (GCC 13-64) TESTS 10 77 102400
322307206 kunalsurana B May 31, 2025, 6:28 p.m. OK C++20 (GCC 13-64) TESTS 10 77 307200
322328568 AdamWinnowicz B June 1, 2025, 1:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
322328185 Ragib100 B June 1, 2025, 12:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
322316556 Wa_Noor B May 31, 2025, 8:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
322309680 LeoninCS B May 31, 2025, 6:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
322308207 bot_42 B May 31, 2025, 6:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
322339729 Suryansh3679 B June 1, 2025, 4:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 102400
322335317 L1r0gn B June 1, 2025, 3:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 102400
322332137 goddddgg B June 1, 2025, 2:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 102400
322324550 Abir-Xcommunicado B May 31, 2025, 10:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 102400
322323370 canine B May 31, 2025, 10:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 102400
322288491 1435730 B May 31, 2025, 4:26 p.m. OK GNU C11 TESTS 10 139 4812800
322330999 F91forever B June 1, 2025, 2:12 a.m. OK GNU C11 TESTS 10 499 1638400
322300322 Adamant18 B May 31, 2025, 5:47 p.m. OK GNU C11 TESTS 10 499 2048000
322291315 MrWizard_574 B May 31, 2025, 4:30 p.m. OK GNU C11 TESTS 10 531 1228800
322348180 roy1012 B June 1, 2025, 6:04 a.m. OK GNU C11 TESTS 10 734 3276800
322290990 treasuryonly B May 31, 2025, 4:30 p.m. OK Haskell TESTS 10 452 48332800
322289967 dhruv17 B May 31, 2025, 4:28 p.m. OK Java 21 TESTS 10 327 512000
322315668 _gazedbyhim_ B May 31, 2025, 7:51 p.m. OK Java 21 TESTS 10 342 1126400
322317324 iamalizaidi B May 31, 2025, 8:13 p.m. OK Java 21 TESTS 10 343 409600
322289128 RohithPothuganti B May 31, 2025, 4:27 p.m. OK Java 21 TESTS 10 359 5017600
322313395 This_Is_Amazing B May 31, 2025, 7:24 p.m. OK Java 21 TESTS 10 374 1126400
322290163 SUNDEEPGANGWAR B May 31, 2025, 4:29 p.m. OK Java 21 TESTS 10 374 3174400
322313407 swatishivam23 B May 31, 2025, 7:24 p.m. OK Java 21 TESTS 10 390 819200
322308961 animalbeforehuman B May 31, 2025, 6:42 p.m. OK Java 21 TESTS 10 406 18329600
322344910 maxVoyager B June 1, 2025, 5:30 a.m. OK Java 21 TESTS 10 421 22323200
322306676 AJ_Forces B May 31, 2025, 6:24 p.m. OK Java 21 TESTS 10 468 1433600
322322154 dom0619 B May 31, 2025, 9:38 p.m. OK Java 8 TESTS 10 171 102400
322328838 CipherSphinx_Raj B June 1, 2025, 1:17 a.m. OK Java 8 TESTS 10 203 39526400
322307259 abhayrajnegi0416 B May 31, 2025, 6:28 p.m. OK Java 8 TESTS 10 217 1638400
322292608 M_Varalakshmi B May 31, 2025, 4:32 p.m. OK Java 8 TESTS 10 233 10342400
322290137 vasily.slesarev B May 31, 2025, 4:28 p.m. OK Java 8 TESTS 10 437 0
322290304 engineer123 B May 31, 2025, 4:29 p.m. OK Java 8 TESTS 10 562 0
322292075 NikhilKushwah B May 31, 2025, 4:31 p.m. OK Java 8 TESTS 10 577 7475200
322315345 samamn_varshney B May 31, 2025, 7:47 p.m. OK Java 8 TESTS 10 608 0
322291822 agrawalvishal2806 B May 31, 2025, 4:31 p.m. OK Java 8 TESTS 10 639 0
322294285 yashbansal99 B May 31, 2025, 4:34 p.m. OK Java 8 TESTS 10 671 0
322306103 pravith B May 31, 2025, 6:20 p.m. OK PyPy 3 TESTS 10 468 13926400
322317895 Arvind215271 B May 31, 2025, 8:22 p.m. OK PyPy 3 TESTS 10 499 15155200
322343007 rameshiitd B June 1, 2025, 5:07 a.m. OK PyPy 3 TESTS 10 531 13516800
322338094 ruben.coorahua B June 1, 2025, 4:01 a.m. OK PyPy 3-64 TESTS 10 155 18841600
322317456 mbial B May 31, 2025, 8:15 p.m. OK PyPy 3-64 TESTS 10 155 19968000
322338254 2armBandit B June 1, 2025, 4:04 a.m. OK PyPy 3-64 TESTS 10 156 21094400
322331606 harishrswamy1 B June 1, 2025, 2:23 a.m. OK PyPy 3-64 TESTS 10 156 25190400
322342728 gardengnome B June 1, 2025, 5:04 a.m. OK PyPy 3-64 TESTS 10 171 19660800
322327032 qoble233 B June 1, 2025, 12:13 a.m. OK PyPy 3-64 TESTS 10 202 27443200
322311507 vuhunganh0301 B May 31, 2025, 7:03 p.m. OK PyPy 3-64 TESTS 10 203 18534400
322313647 Pie854 B May 31, 2025, 7:27 p.m. OK PyPy 3-64 TESTS 10 203 18739200
322316730 S4nViX B May 31, 2025, 8:05 p.m. OK PyPy 3-64 TESTS 10 218 30617600
322308992 Himanshu_patel13 B May 31, 2025, 6:42 p.m. OK PyPy 3-64 TESTS 10 234 20582400
322323597 samosasoul B May 31, 2025, 10:14 p.m. OK Python 3 TESTS 10 171 37580800
322327048 qoble233 B June 1, 2025, 12:14 a.m. OK Python 3 TESTS 10 187 35123200
322327068 qoble233 B June 1, 2025, 12:15 a.m. OK Python 3 TESTS 10 202 35020800
322293351 snider641188 B May 31, 2025, 4:33 p.m. OK Python 3 TESTS 10 249 47411200
322292626 garner533865 B May 31, 2025, 4:32 p.m. OK Python 3 TESTS 10 250 47206400
322301687 dhruvsharma03022 B May 31, 2025, 5:54 p.m. OK Python 3 TESTS 10 265 26828800
322292632 gilbert052907 B May 31, 2025, 4:32 p.m. OK Python 3 TESTS 10 265 47206400
322292193 jqcwgzsjdj B May 31, 2025, 4:32 p.m. OK Python 3 TESTS 10 265 47308800
322291867 kelsey623064 B May 31, 2025, 4:31 p.m. OK Python 3 TESTS 10 265 47411200
322293070 tucdkpqufj B May 31, 2025, 4:33 p.m. OK Python 3 TESTS 10 280 47308800
322324466 LuffyKai B May 31, 2025, 10:39 p.m. OK Rust 2021 TESTS 10 93 9318400

remove filters

Back to search problems