Educational Codeforces Round 184 (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
2169 Educational Codeforces Round 184 (Rated for Div. 2) FINISHED False 7200 13274723 Nov. 14, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 330 ) F Subsequence Problem PROGRAMMING combinatorics dp fft math

Given three integers (n, m, k), as well as (k) arrays of integers of lengths (l_1, l_2, \dots, l_k) respectively. We denote the element at position (j) in array number (i) as (a_{i,j}). In each array, all elements are distinct (but may repeat in different arrays). We call an array (b) of length (k) beautiful if for each (i) from (1) to (k), the element (b_i) is equal to one of the elements of the array (a_i). We call an array (c) perfect if every beautiful array (b) can be obtained from array (c) by deleting several (possibly zero) elements without changing their order. In other words, array (c) is perfect if every beautiful array (b) is a subsequence of it. Your task is to count the number of perfect arrays (c) of length (n) containing only integers from (1) to (m). The first line contains three integers (n, m, k) ((2 \le n \le 2 \cdot 10^5); (5 \le m \le 10^8); (2 \le k \le n)). The second line contains (k) integers (l_1, l_2, \dots, l_k) ((1 \le l_i \le 5)). The following (k) lines contain the (i)-th line with (l_i) distinct integers (a_{i,1}, a_{i,2}, \dots, a_{i,l_i}) ((1 \le a_{i,j} \le m)). Additional constraint on the input: the sum of (l_i) does not exceed (n). Print one integer — the number of perfect arrays of length (n) such that they contain only integers from (1) to (m). Since the answer may be very large, output it modulo (998244353). In the first example, there are two beautiful arrays: (4, 1, 4) and (4, 1, 3). Only two arrays of length (4) contain both of these arrays as subsequences: (4, 1, 4, 3) and (4, 1, 3, 4). In the second example, there is only one beautiful array: (5, 2). There are (13) arrays of length (3) with integers from (1) to (5) that contain it as a subsequence.

Tutorials

Educational Codeforces Round 184 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
348985999 BeyondDestiny F Nov. 14, 2025, 4:30 p.m. OK C++17 (GCC 7-32) TESTS 50 796 16998400
348980262 Abhi_Rawat F Nov. 14, 2025, 4:19 p.m. OK C++17 (GCC 7-32) TESTS 50 874 16998400
348998102 weebyes F Nov. 14, 2025, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 50 1578 9318400
348980298 TAhmed33 F Nov. 14, 2025, 4:19 p.m. OK C++17 (GCC 7-32) TESTS 50 1718 221900800
348980493 TAhmed33 F Nov. 14, 2025, 4:20 p.m. OK C++17 (GCC 7-32) TESTS 50 1718 222003200
348993074 kishan_seth F Nov. 14, 2025, 4:57 p.m. OK C++17 (GCC 7-32) TESTS 50 2077 10137600
348988296 shy_guy_16 F Nov. 14, 2025, 4:34 p.m. OK C++17 (GCC 7-32) TESTS 50 3077 13516800
348982185 pulluripranavi F Nov. 14, 2025, 4:23 p.m. OK C++17 (GCC 7-32) TESTS 50 3156 13516800
348996761 k_for_ks F Nov. 14, 2025, 5:22 p.m. OK C++17 (GCC 7-32) TESTS 50 3218 13516800
349044719 sunchenyu2012 F Nov. 15, 2025, 5:08 a.m. OK C++17 (GCC 7-32) TESTS 50 3593 81920000
348984198 kotatsugame F Nov. 14, 2025, 4:27 p.m. OK C++20 (GCC 13-64) TESTS 50 265 14643200
349025130 Abdulelah_kartal F Nov. 14, 2025, 10:18 p.m. OK C++20 (GCC 13-64) TESTS 50 312 16998400
349007109 Helloworld66676.8 F Nov. 14, 2025, 6:42 p.m. OK C++20 (GCC 13-64) TESTS 50 359 16998400
349033724 Tobo F Nov. 15, 2025, 2:20 a.m. OK C++20 (GCC 13-64) TESTS 50 406 14950400
348989104 _D_D_ F Nov. 14, 2025, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 50 421 16998400
348982691 jahnavi_v F Nov. 14, 2025, 4:24 p.m. OK C++20 (GCC 13-64) TESTS 50 421 16998400
348987397 NMHsw_cfs F Nov. 14, 2025, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 50 452 33689600
348989912 sqwiijqk F Nov. 14, 2025, 4:39 p.m. OK C++20 (GCC 13-64) TESTS 50 624 26316800
348986923 Kude F Nov. 14, 2025, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 50 687 14950400
349029860 adam.jq.xu F Nov. 15, 2025, 12:47 a.m. OK C++20 (GCC 13-64) TESTS 50 718 336691200
349025904 kaiboy F Nov. 14, 2025, 10:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 77 1638400
348982178 tddaij F Nov. 14, 2025, 4:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 108 4812800
349028420 enslaved F Nov. 14, 2025, 11:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 249 17100800
348991419 AbdelmagedNour F Nov. 14, 2025, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 312 12595200
348981255 winidod785 F Nov. 14, 2025, 4:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 358 17100800
348984135 abhinxvz F Nov. 14, 2025, 4:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 359 9113600
348987807 melancholy_ F Nov. 14, 2025, 4:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 405 11878400
348981245 Axovagony F Nov. 14, 2025, 4:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 468 12083200
348990294 MaroonCoder21 F Nov. 14, 2025, 4:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 531 5734400
349048474 liaoyanxu F Nov. 15, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 531 32051200
348991753 Ab_hoga_real_Cumback F Nov. 14, 2025, 4:49 p.m. OK Java 21 TESTS 50 656 2457600
348982630 nikhilsingh_21 F Nov. 14, 2025, 4:24 p.m. OK Java 21 TESTS 50 3484 14438400
348986277 AnimeshT1008 F Nov. 14, 2025, 4:31 p.m. OK Java 21 TESTS 50 3983 13824000
349045359 Little_Sheep_Yawn F Nov. 15, 2025, 5:14 a.m. OK PyPy 3-64 TESTS 50 1328 63180800
349024880 VaHiX F Nov. 14, 2025, 10:13 p.m. OK PyPy 3-64 TESTS 50 1968 48537600
348986890 tassei903 F Nov. 14, 2025, 4:32 p.m. OK PyPy 3-64 TESTS 50 3796 68096000
348987288 Dilha_1526 F Nov. 14, 2025, 4:32 p.m. OK Rust 2024 TESTS 50 687 25190400
348983815 Sugar_fan F Nov. 14, 2025, 4:26 p.m. OK Rust 2024 TESTS 50 1499 39628800

remove filters

Back to search problems