Educational Codeforces Round 188 (Rated for 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
2204 Educational Codeforces Round 188 (Rated for Div. 2) FINISHED False 8100 2733923 March 16, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1172 ) F Sum of Fractions PROGRAMMING binary search combinatorics greedy math two pointers

Let's call an increase of the fraction (\frac{x}{y}) one of the following operations: either increase its numerator (x) by (1); or, if the denominator (y \gt 1), decrease its denominator (y) by (1). Note that the fraction is not reduced after the increase. For example, if you have a fraction (\frac{3}{7}) and you decrease its denominator by (1), you get (\frac{3}{6}), not (\frac{1}{2}). Suppose you are given an integer array (b_1, b_2, \dots, b_m) and an integer (k). You apply the following algorithm: Construct the array (\frac{1}{b_1}, \frac{1}{b_2}, \dots, \frac{1}{b_m}). Choose any of the fractions and increase it. Repeat the previous step (k) times (the same fraction can be chosen multiple times). Calculate the sum of the resulting fractions. We will denote (\mathrm{MSF}(b, k)) as the maximum sum of fractions that can be obtained from the array (b) by applying the increase operation exactly (k) times. Let (al \dots r) be the subarray (a_l, a_{l + 1}, \dots a_r) of the array (a). You are given two arrays of integers (a_1, a_2, \dots, a_n) and (k_1, k_2, \dots, k_m). For each (k_i), calculate ()\left( \sum\limits_{l = 1}^{n}{\sum\limits_{r = l}^{n}\mathrm{MSF}(al \dots r, k_i)} \right) \bmod 998\,244\,353.() In other words, for each (k_i), calculate the sum of (\mathrm{MSF}) over all subarrays of the array (a) and output the answer modulo. The first line contains two integers (n) and (m) ((1 \le n, m \le 5 \cdot 10^5)) — the sizes of the arrays (a) and (k). The second line contains (n) integers (a_1, a_2, \dots, a_n) ((1 \le a_i \le 10^8)) — the array (a). The third line contains (m) integers (k_1, k_2, \dots, k_m) ((0 \le k_1 \le k_2 \le \dots \le k_m \le 10^8)) — the array (k) in non-decreasing order. For each (k_i), output a single integer — the sum of (\mathrm{MSF}) over all su

Tutorials

Educational Codeforces Round 188 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
367022180 kevinyu F March 16, 2026, 6:11 p.m. OK C++17 (GCC 7-32) TESTS 35 593 33280000
367016226 MCPlayer542 F March 16, 2026, 5:08 p.m. OK C++17 (GCC 7-32) TESTS 35 671 124313600
367005346 yikaluosi F March 16, 2026, 4:25 p.m. OK C++17 (GCC 7-32) TESTS 35 687 26521600
367013342 zoryn F March 16, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 35 687 29286400
367000377 Yanpb02 F March 16, 2026, 4:12 p.m. OK C++17 (GCC 7-32) TESTS 35 687 33382400
367013115 doof_19O3 F March 16, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 35 703 28774400
367004114 Tima2578 F March 16, 2026, 4:22 p.m. OK C++17 (GCC 7-32) TESTS 35 703 30617600
367045570 frozen621 F March 17, 2026, 2:14 a.m. OK C++17 (GCC 7-32) TESTS 35 703 43008000
367015706 Earlyamazon F March 16, 2026, 5:03 p.m. OK C++17 (GCC 7-32) TESTS 35 734 33484800
367004462 ShadowSlayer1 F March 16, 2026, 4:23 p.m. OK C++17 (GCC 7-32) TESTS 35 734 45977600
367037905 Rvess F March 16, 2026, 10:19 p.m. OK C++20 (GCC 13-64) TESTS 35 343 12492800
367004024 shegh1 F March 16, 2026, 4:22 p.m. OK C++20 (GCC 13-64) TESTS 35 343 18841600
367019289 amaruu F March 16, 2026, 5:35 p.m. OK C++20 (GCC 13-64) TESTS 35 343 20992000
367000692 beiyuli F March 16, 2026, 4:12 p.m. OK C++20 (GCC 13-64) TESTS 35 343 74240000
367016139 amaruu F March 16, 2026, 5:07 p.m. OK C++20 (GCC 13-64) TESTS 35 375 18227200
367005014 islingr F March 16, 2026, 4:24 p.m. OK C++20 (GCC 13-64) TESTS 35 390 10547200
367051889 MiaoBoat F March 17, 2026, 4:12 a.m. OK C++20 (GCC 13-64) TESTS 35 390 24576000
367009038 aadfdfsdfgdfg F March 16, 2026, 4:36 p.m. OK C++20 (GCC 13-64) TESTS 35 390 27443200
367045247 phasmida F March 17, 2026, 2:02 a.m. OK C++20 (GCC 13-64) TESTS 35 390 32256000
367024351 islingr F March 16, 2026, 6:43 p.m. OK C++20 (GCC 13-64) TESTS 35 406 6246400
367004668 orange_man F March 16, 2026, 4:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 312 12288000
367012076 415411 F March 16, 2026, 4:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 328 38400000
367014181 welken F March 16, 2026, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 343 33894400
367010029 lynora_qwq F March 16, 2026, 4:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 343 33894400
367004370 thibautblanc F March 16, 2026, 4:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 359 20377600
367053223 Martian148 F March 17, 2026, 4:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 35 359 24371200
367012050 mochaqwq F March 16, 2026, 4:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 359 29593600
367013726 ashwini492222 F March 16, 2026, 4:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 375 25190400
367033593 dooglius F March 16, 2026, 8:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 390 19456000
367001514 konichi F March 16, 2026, 4:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 35 390 20070400
367003477 AJ123496 F March 16, 2026, 4:20 p.m. OK Java 21 TESTS 35 828 51916800
367014800 _kazuto_nwb F March 16, 2026, 4:57 p.m. OK Java 21 TESTS 35 1156 19456000
367026707 pieande F March 16, 2026, 7:27 p.m. OK Java 21 TESTS 35 1453 35942400
367027284 Bicky_verma077 F March 16, 2026, 7:34 p.m. OK Java 21 TESTS 35 1468 22937600
367009937 karimov10 F March 16, 2026, 4:39 p.m. OK Java 21 TESTS 35 1593 35328000
367010922 ysd2004 F March 16, 2026, 4:42 p.m. OK Java 21 TESTS 35 1812 47206400
367006142 gagantirumareddy F March 16, 2026, 4:28 p.m. OK Java 21 TESTS 35 1828 72908800
367008328 Thanmai_19 F March 16, 2026, 4:34 p.m. OK Java 21 TESTS 35 1859 42496000
367028495 roman.yakhimovich F March 16, 2026, 7:52 p.m. OK Kotlin 2.2 TESTS 35 859 79360000
367012963 yg.margo F March 16, 2026, 4:48 p.m. OK Kotlin 2.2 TESTS 35 921 74649600
367011050 sleepisweak F March 16, 2026, 4:43 p.m. OK Node.js TESTS 35 1687 170291200
367014947 tyuyu_62 F March 16, 2026, 4:58 p.m. OK PyPy 3-64 TESTS 35 937 87244800
367013091 NiklasPlugin F March 16, 2026, 4:49 p.m. OK PyPy 3-64 TESTS 35 1234 103628800
367057573 smilences F March 17, 2026, 5:22 a.m. OK PyPy 3-64 TESTS 35 1343 139673600
367018295 krism F March 16, 2026, 5:25 p.m. OK PyPy 3-64 TESTS 35 1421 133939200
367016317 sigtuna F March 16, 2026, 5:09 p.m. OK PyPy 3-64 TESTS 35 1421 133939200
367012908 Amogh_Gajera F March 16, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 35 1546 91955200
367056961 smilences F March 17, 2026, 5:15 a.m. OK PyPy 3-64 TESTS 35 1671 167014400
367007479 syncrain F March 16, 2026, 4:31 p.m. OK PyPy 3-64 TESTS 35 1968 263168000
367010085 mo0307b1006 F March 16, 2026, 4:40 p.m. OK Rust 2024 TESTS 35 265 85708800
367003980 mo0307b1006 F March 16, 2026, 4:21 p.m. OK Rust 2024 TESTS 35 453 104550400
367013775 123gjweq2 F March 16, 2026, 4:51 p.m. OK Rust 2024 TESTS 35 1578 307200000

remove filters

Back to search problems