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
( 1428 ) E2 Looking at Towers (difficult version) PROGRAMMING combinatorics data structures dp implementation

This is the difficult 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 10^4)) — the number of test cases. Each test case consists of two lines: the first line contains one integer (n) ((1 \le n \le 3 \cdot 10^5)); 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 (3 \cdot 10^5). 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 sub

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
338902799 notenc E2 Sept. 16, 2025, 10:56 a.m. OK C++17 (GCC 7-32) TESTS 39 218 24576000
338980666 MohamadKian E2 Sept. 16, 2025, 5:13 p.m. OK C++17 (GCC 7-32) TESTS 39 249 7782400
338955169 Alida2005 E2 Sept. 16, 2025, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 39 249 9011200
338896901 KS_Fszha E2 Sept. 16, 2025, 10:01 a.m. OK C++17 (GCC 7-32) TESTS 39 327 38502400
338823305 smallsmart E2 Sept. 15, 2025, 5:48 p.m. OK C++17 (GCC 7-32) TESTS 39 327 43315200
338833934 Eslam_Saleh E2 Sept. 15, 2025, 7:34 p.m. OK C++17 (GCC 7-32) TESTS 39 328 9113600
338863616 Nightsky-yekong E2 Sept. 16, 2025, 5:01 a.m. OK C++17 (GCC 7-32) TESTS 39 343 9625600
338821623 -Guts E2 Sept. 15, 2025, 5:34 p.m. OK C++17 (GCC 7-32) TESTS 39 343 24985600
338856792 lenhanbounofficial E2 Sept. 16, 2025, 3:19 a.m. OK C++17 (GCC 7-32) TESTS 39 343 37683200
338915916 wsy_jim E2 Sept. 16, 2025, 12:18 p.m. OK C++17 (GCC 7-32) TESTS 39 374 39731200
338819546 anonymuspj2.0 E2 Sept. 15, 2025, 5:18 p.m. OK C++20 (GCC 13-64) TESTS 39 139 23040000
338931392 konni35 E2 Sept. 16, 2025, 1:56 p.m. OK C++20 (GCC 13-64) TESTS 39 140 20684800
338820914 PsychoPinkQ E2 Sept. 15, 2025, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 39 140 28364800
338932124 zztqwq E2 Sept. 16, 2025, 2 p.m. OK C++20 (GCC 13-64) TESTS 39 156 14438400
338820115 2304 E2 Sept. 15, 2025, 5:22 p.m. OK C++20 (GCC 13-64) TESTS 39 156 28364800
338984220 NotFound E2 Sept. 16, 2025, 5:41 p.m. OK C++20 (GCC 13-64) TESTS 39 171 7270400
338912496 Danielcdo E2 Sept. 16, 2025, 11:59 a.m. OK C++20 (GCC 13-64) TESTS 39 171 15667200
338911869 Danielcdo E2 Sept. 16, 2025, 11:55 a.m. OK C++20 (GCC 13-64) TESTS 39 171 15667200
338946327 sashatorba12022008 E2 Sept. 16, 2025, 3:32 p.m. OK C++20 (GCC 13-64) TESTS 39 171 16179200
338880657 Panyang E2 Sept. 16, 2025, 8:10 a.m. OK C++20 (GCC 13-64) TESTS 39 171 24166400
339012108 tdiv E2 Sept. 17, 2025, 1:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 139 6656000
338908378 MINO1 E2 Sept. 16, 2025, 11:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 155 11571200
338838451 Proofy E2 Sept. 15, 2025, 8:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 156 10240000
338968111 enslaved E2 Sept. 16, 2025, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 171 13824000
338884359 retah E2 Sept. 16, 2025, 8:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 171 20480000
338876828 pizza53 E2 Sept. 16, 2025, 7:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 171 26521600
338875484 sidat E2 Sept. 16, 2025, 7:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 171 26726400
338874690 sidat E2 Sept. 16, 2025, 7:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 171 26726400
338825448 VanshRA E2 Sept. 15, 2025, 6:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 171 26726400
338829397 Wawi_ E2 Sept. 15, 2025, 6:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 187 10240000
338828267 BOB_005 E2 Sept. 15, 2025, 6:32 p.m. OK Java 21 TESTS 39 3624 84889600
338819210 Animesh1008 E2 Sept. 15, 2025, 5:15 p.m. OK Java 21 TESTS 39 3624 84889600
338844162 LMeyling E2 Sept. 15, 2025, 10:34 p.m. OK PyPy 3-64 TESTS 39 702 49971200
338922903 yjsl1025 E2 Sept. 16, 2025, 1:04 p.m. OK PyPy 3-64 TESTS 39 1031 60006400
338900017 34z12000 E2 Sept. 16, 2025, 10:30 a.m. OK PyPy 3-64 TESTS 39 1062 176742400
338900129 34z12000 E2 Sept. 16, 2025, 10:31 a.m. OK PyPy 3-64 TESTS 39 1139 177561600
338844798 denilb E2 Sept. 15, 2025, 10:50 p.m. OK PyPy 3-64 TESTS 39 1343 92569600
339008939 IcyGirl E2 Sept. 17, 2025, 12:18 a.m. OK PyPy 3-64 TESTS 39 2437 50995200
338854060 NagisaF E2 Sept. 16, 2025, 2:31 a.m. OK Rust 2021 TESTS 39 531 27648000
338950645 Ming_Xu E2 Sept. 16, 2025, 3:59 p.m. OK Rust 2024 TESTS 39 733 118169600

remove filters

Back to search problems