Codeforces Round 1098 (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
2228 Codeforces Round 1098 (Div. 2) FINISHED False 8100 1437887 May 16, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 514 ) E1 Amanojaku and Sequence (Easy Version) PROGRAMMING combinatorics math

This is the easy version of the problem. The difference between the versions is that in this version, (q=1) and (\mathrm{op}=2). You can hack only if you solved all versions of this problem. For a sequence (s), let (|s|) denote its length. For a non-negative integer sequence (c), define (f(c)) as the sum of the squares of its prefix sums: () f(c)=\sum_{i=1}^{|c|}\left(\sum_{j=1}^{i} c_j\right)^2. () Now define (g(b,m)) as follows. Let (b) be an integer sequence such that (b_i\ge -1) for every (i), and let (m) be a non-negative integer. A non-negative integer sequence (c) is called valid for ((b,m)) if all of the following conditions hold: (|c|=|b|); (\sum_{i=1}^{|c|} c_i=m); for every (1\le i\le |b|), if (b_i\ge 0), then (c_i=b_i); otherwise, if (b_i=-1), then (c_i) may be any non-negative integer. The value (g(b,m)) is defined as the sum of (f(c)) over all valid sequences (c) for ((b,m)). If there is no such sequence, then (g(b,m)=0). You are given an array (a) of length (n), where (a_i\ge -1), and (q) queries of the following one type: Given three integers (l), (r), and (m), compute (g(a_l,a_{l+1},\ldots,a_r,m)) modulo (998\,244\,353), where (a_l,a_{l+1},\ldots,a_r) denotes the subarray(^{\text{∗}}) of (a) from position (l) to position (r). (^{\text{∗}})An array (a) is a subarray of an array (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. 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. For each test case, the first line contains two integers (n) and (q) ((1\leq n\leq 3\cdot 10^5), (q=1)). The second line contains $

Tutorials

Codeforces Round 1098 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
374852645 sronak E1 May 16, 2026, 4:45 p.m. OK C# 10 TESTS 40 140 70144000
374845945 independent E1 May 16, 2026, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 40 109 4915200
374852222 j.w E1 May 16, 2026, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 40 109 22630400
374847414 wreck_22 E1 May 16, 2026, 4:36 p.m. OK C++17 (GCC 7-32) TESTS 40 125 21401600
374894199 bit1ift E1 May 17, 2026, 4:09 a.m. OK C++17 (GCC 7-32) TESTS 40 125 24064000
374852766 osama_alsalkhdi E1 May 16, 2026, 4:46 p.m. OK C++17 (GCC 7-32) TESTS 40 125 24064000
374850055 cormid E1 May 16, 2026, 4:41 p.m. OK C++17 (GCC 7-32) TESTS 40 140 21299200
374851126 Terminator_genesis_07 E1 May 16, 2026, 4:43 p.m. OK C++17 (GCC 7-32) TESTS 40 140 22528000
374865300 stateCompressed E1 May 16, 2026, 7:08 p.m. OK C++17 (GCC 7-32) TESTS 40 140 24064000
374900556 SUN_LIGHT_ E1 May 17, 2026, 5:24 a.m. OK C++17 (GCC 7-32) TESTS 40 140 30617600
374849991 Terr0r E1 May 16, 2026, 4:41 p.m. OK C++17 (GCC 7-32) TESTS 40 140 38707200
374853494 ngna2406 E1 May 16, 2026, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 40 78 24064000
374850190 siddique233 E1 May 16, 2026, 4:41 p.m. OK C++20 (GCC 13-64) TESTS 40 93 102400
374876778 niyu E1 May 16, 2026, 9:54 p.m. OK C++20 (GCC 13-64) TESTS 40 93 14848000
374847011 Vpert E1 May 16, 2026, 4:35 p.m. OK C++20 (GCC 13-64) TESTS 40 93 22630400
374852774 superi0r E1 May 16, 2026, 4:46 p.m. OK C++20 (GCC 13-64) TESTS 40 93 32153600
374847988 a_patra E1 May 16, 2026, 4:37 p.m. OK C++20 (GCC 13-64) TESTS 40 93 32153600
374879831 gerkghdri E1 May 16, 2026, 11:24 p.m. OK C++20 (GCC 13-64) TESTS 40 93 47411200
374896333 Sachchit E1 May 17, 2026, 4:38 a.m. OK C++20 (GCC 13-64) TESTS 40 109 102400
374854648 PiLoCode E1 May 16, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 40 109 9011200
374845932 shravani20 E1 May 16, 2026, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 40 109 20889600
374846628 postpone E1 May 16, 2026, 4:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 40 78 20377600
374851097 PlxyJoy E1 May 16, 2026, 4:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 40 78 21811200
374865850 424479543 E1 May 16, 2026, 7:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 40 78 24780800
374848970 Div.5 E1 May 16, 2026, 4:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 40 78 44646400
374889775 y_himanshu E1 May 17, 2026, 3:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 40 78 92979200
374894592 clueless_girrafe E1 May 17, 2026, 4:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 40 93 18329600
374886472 DQ1275 E1 May 17, 2026, 2:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 40 93 22630400
374883238 DQ1275 E1 May 17, 2026, 1:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 40 93 22630400
374884235 gyi89052 E1 May 17, 2026, 1:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 40 93 24064000
374883925 ds7023500 E1 May 17, 2026, 1:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 40 93 24064000
374884296 gyi89052 E1 May 17, 2026, 1:57 a.m. OK Java 21 TESTS 40 328 31436800
374883827 ds7023500 E1 May 17, 2026, 1:46 a.m. OK Java 21 TESTS 40 328 31641600
374846843 Raunak02 E1 May 16, 2026, 4:35 p.m. OK Java 21 TESTS 40 375 42188800
374851986 jimhendrixbageo E1 May 16, 2026, 4:44 p.m. OK Java 21 TESTS 40 640 31232000
374845883 harshitha280 E1 May 16, 2026, 4:33 p.m. OK Java 8 TESTS 40 203 44544000
374846530 niharikas18 E1 May 16, 2026, 4:34 p.m. OK Java 8 TESTS 40 218 39219200
374874684 harsh08 E1 May 16, 2026, 9:09 p.m. OK Java 8 TESTS 40 234 26828800
374903118 eigen_loop E1 May 17, 2026, 5:50 a.m. OK PyPy 3 TESTS 40 390 50483200
374879672 loveax E1 May 16, 2026, 11:18 p.m. OK PyPy 3 TESTS 40 1640 253440000
374848432 sos89756 E1 May 16, 2026, 4:38 p.m. OK PyPy 3 TESTS 40 2796 375808000
374883772 s-ahmad461 E1 May 17, 2026, 1:45 a.m. OK PyPy 3-64 TESTS 40 187 67276800
374854108 Doflaming0 E1 May 16, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 40 281 41574400
374852015 mikelou E1 May 16, 2026, 4:44 p.m. OK PyPy 3-64 TESTS 40 281 41779200
374847184 jmiarecki E1 May 16, 2026, 4:35 p.m. OK PyPy 3-64 TESTS 40 312 42086400
374852412 gadeermh E1 May 16, 2026, 4:45 p.m. OK PyPy 3-64 TESTS 40 359 74342400
374846237 toam E1 May 16, 2026, 4:34 p.m. OK PyPy 3-64 TESTS 40 468 165580800
374851525 Puddles_Penguin E1 May 16, 2026, 4:43 p.m. OK PyPy 3-64 TESTS 40 890 74854400
374848741 sbt214 E1 May 16, 2026, 4:38 p.m. OK Python 3 TESTS 40 500 40038400
374847565 sarmahirakjyoti35 E1 May 16, 2026, 4:36 p.m. OK Python 3 TESTS 40 609 129536000
374854773 Dattasai001 E1 May 16, 2026, 4:49 p.m. OK Python 3 TESTS 40 875 189132800
374847882 cvs-650 E1 May 16, 2026, 4:37 p.m. OK Rust 2024 TESTS 40 78 46284800
374851807 A_G E1 May 16, 2026, 4:44 p.m. OK Rust 2024 TESTS 40 203 64614400

remove filters

Back to search problems