Educational Codeforces Round 182 (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
2144 Educational Codeforces Round 182 (Rated for Div. 2) FINISHED False 7200 18458723 Sept. 15, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2543 ) E1 Looking at Towers (easy version) PROGRAMMING combinatorics dp implementation

This is the easy version of the problem. The only differences between the easy and the difficult version are the constraints on (t) and (n). Consider a row of (m) towers; the height of the (i)-th tower in the row is (h_i). If you look at this row of towers from the left, you see all towers that are strictly higher than all towers before them. Similarly, if you look at this row of towers from the right, you see all towers that are strictly higher than all towers after them. For example, if the towers have heights (3, 5, 5, 7, 4, 6, 7, 2, 4), then: when looking from the left, you see towers with heights (3), (5) and (7); when looking from the right, you see towers with heights (7) and (4). Let (L(h)) be the set of heights you see from the left, and (R(h)) be the set of heights you see from the right when the sequence of heights is (h). In the example above, (L(h) = \{3, 5, 7\}), and (R(h) = \{4, 7\}). You are given a sequence (a_1, a_2, \dots, a_n). Your task is to calculate the number of subsequences of (a) such that (L(a) = L(a')) and (R(a) = R(a')), where (a') is the subsequence you consider. Two subsequences are different if indices of chosen elements are different. The first line contains one integer (t) ((1 \le t \le 100)) — the number of test cases. Each test case consists of two lines: the first line contains one integer (n) ((1 \le n \le 5000)); the second line contains (n) integers (a_1, a_2, \dots, a_n) ((1 \le a_i \le 10^9)). Additional constraint on the input: the sum of (n) over all test cases does not exceed (5000). For each test case, print one integer — the number of subsequences (a') of the given sequence (a) such that (L(a) = L(a')) and (R(a) = R(a')). Since it might be huge, print it modulo (998244353). In the first example, (L(a) = \{4, 8\}), (R(a) = \{3, 8\}). The subsequences included in

Tutorials

Educational Codeforces Round 182 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
338980711 MohamadKian E1 Sept. 16, 2025, 5:13 p.m. OK C++17 (GCC 7-32) TESTS 26 46 0
338955200 Alida2005 E1 Sept. 16, 2025, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 26 46 102400
338851902 alternn E1 Sept. 16, 2025, 1:51 a.m. OK C++17 (GCC 7-32) TESTS 25 46 3686400
339003910 disastah E1 Sept. 16, 2025, 9:36 p.m. OK C++17 (GCC 7-32) TESTS 26 61 3993600
338929137 mohitdmark E1 Sept. 16, 2025, 1:42 p.m. OK C++17 (GCC 7-32) TESTS 26 61 48128000
339017996 wuliuyi E1 Sept. 17, 2025, 3:10 a.m. OK C++17 (GCC 7-32) TESTS 26 62 0
338840351 Kerw1l E1 Sept. 15, 2025, 9:12 p.m. OK C++17 (GCC 7-32) TESTS 25 62 0
338833925 Eslam_Saleh E1 Sept. 15, 2025, 7:34 p.m. OK C++17 (GCC 7-32) TESTS 25 62 0
339009772 aucoder123 E1 Sept. 17, 2025, 12:43 a.m. OK C++17 (GCC 7-32) TESTS 26 62 102400
338816881 ehuawife E1 Sept. 15, 2025, 4:58 p.m. OK C++17 (GCC 7-32) TESTS 25 62 204800
339030200 Genius737 E1 Sept. 17, 2025, 6 a.m. OK C++20 (GCC 13-64) TESTS 26 46 0
338937418 LoiDak E1 Sept. 16, 2025, 2:33 p.m. OK C++20 (GCC 13-64) TESTS 26 46 0
338861871 Jensen123 E1 Sept. 16, 2025, 4:38 a.m. OK C++20 (GCC 13-64) TESTS 25 46 102400
339007623 Mlchael_Petrov E1 Sept. 16, 2025, 11:32 p.m. OK C++20 (GCC 13-64) TESTS 26 46 15667200
338922878 Grisses E1 Sept. 16, 2025, 1:04 p.m. OK C++20 (GCC 13-64) TESTS 26 46 50483200
339007489 Terrorb1ade E1 Sept. 16, 2025, 11:26 p.m. OK C++20 (GCC 13-64) TESTS 26 61 0
338861941 lddlinan E1 Sept. 16, 2025, 4:39 a.m. OK C++20 (GCC 13-64) TESTS 25 61 17510400
338982882 setsuna_780 E1 Sept. 16, 2025, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 26 61 26419200
338821461 PandaGhost E1 Sept. 15, 2025, 5:32 p.m. OK C++20 (GCC 13-64) TESTS 25 61 45772800
339014093 FZANOTFOUND E1 Sept. 17, 2025, 2:24 a.m. OK C++20 (GCC 13-64) TESTS 26 62 0
338944399 VitaliiV E1 Sept. 16, 2025, 3:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 46 0
338849429 BlackCat_ E1 Sept. 16, 2025, 12:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 46 0
338911685 complextree E1 Sept. 16, 2025, 11:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 46 102400
338851169 DeMen100ns E1 Sept. 16, 2025, 1:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 46 102400
338850210 bingpao E1 Sept. 16, 2025, 1:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 46 307200
338855598 _DuccNamm_ E1 Sept. 16, 2025, 2:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 46 50585600
339002539 Kevin_Pan E1 Sept. 16, 2025, 9:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 61 0
338968162 enslaved E1 Sept. 16, 2025, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 61 0
338932004 KuR222 E1 Sept. 16, 2025, 2 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 61 0
338917101 a.out E1 Sept. 16, 2025, 12:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 61 0
338819303 Animesh1008 E1 Sept. 15, 2025, 5:16 p.m. OK Java 21 TESTS 25 609 614400
338826562 BOB_005 E1 Sept. 15, 2025, 6:17 p.m. OK Java 21 TESTS 25 624 1126400
338891684 NpHardcore_05 E1 Sept. 16, 2025, 9:20 a.m. OK Java 21 TESTS 25 1390 258355200
338901452 34z12000 E1 Sept. 16, 2025, 10:44 a.m. OK PyPy 3-64 TESTS 25 171 8704000
338885540 34z12000 E1 Sept. 16, 2025, 8:40 a.m. OK PyPy 3-64 TESTS 25 249 3072000
338838144 denilb E1 Sept. 15, 2025, 8:33 p.m. OK PyPy 3-64 TESTS 25 264 3276800
338823702 fermion5 E1 Sept. 15, 2025, 5:52 p.m. OK PyPy 3-64 TESTS 25 265 3481600
339009007 IcyGirl E1 Sept. 17, 2025, 12:20 a.m. OK PyPy 3-64 TESTS 26 296 9625600
338830168 twosquares E1 Sept. 15, 2025, 6:52 p.m. OK PyPy 3-64 TESTS 25 358 7065600
338904112 yjsl1025 E1 Sept. 16, 2025, 11:07 a.m. OK PyPy 3-64 TESTS 25 531 9011200
338908938 gardengnome E1 Sept. 16, 2025, 11:39 a.m. OK PyPy 3-64 TESTS 26 561 203878400
338838214 denilb E1 Sept. 15, 2025, 8:35 p.m. OK PyPy 3-64 TESTS 25 562 9318400
338900098 eepsilon E1 Sept. 16, 2025, 10:31 a.m. OK PyPy 3-64 TESTS 25 577 9830400

remove filters

Back to search problems