Educational Codeforces Round 118 (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
1613 Educational Codeforces Round 118 (Rated for Div. 2) FINISHED False 7200 93453899 Dec. 1, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4735 ) D MEX Sequences PROGRAMMING dp

B"Let's call a sequence of integers x_1, x_2, ... , x_k MEX-correct if for all i ( 1 <= i <= k ) |x_i - operatorname{MEX}(x_1, x_2, ... , x_i)| <= 1 holds. Where operatorname{MEX}(x_1, ... , x_k) is the minimum non-negative integer that doesn't belong to the set x_1, ... , x_k . For example, operatorname{MEX}(1, 0, 1, 3) = 2 and operatorname{MEX}(2, 1, 5) = 0 . You are given an array a consisting of n non-negative integers. Calculate the number of non-empty MEX-correct subsequences of a given array. The number of subsequences can be very large, so print it modulo 998244353 . Note: a subsequence of an array a is a sequence [a_{i_1}, a_{i_2}, ... , a_{i_m}] meeting the constraints 1 <= i_1 < i_2 < ... < i_m <= n . If two different ways to choose the sequence of indices [i_1, i_2, ... , i_m] yield the same subsequence, the resulting subsequence should be counted twice (i. xe2 x80 x89e. two subsequences are different if their sequences of indices [i_1, i_2, ... , i_m] are not the same). The first line contains a single integer t ( 1 <= t <= 10^5 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 5 cdot 10^5 ). The second line contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= n ). The sum of n over all test cases doesn't exceed 5 cdot 10^5 . For each test case, print a single integer -- the number of non-empty MEX-correct subsequences of a given array, taken modulo 998244353 . In the first example, the valid subsequences are [0] , [1] , [0,1] and [0,2] . In the second example, the valid subsequences are [0] and [1] . In the third example, any non-empty subsequence is valid. "...

Tutorials

97467

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
137734074 XyzL D Dec. 2, 2021, 12:36 a.m. OK GNU C++14 TESTS 31 46 14438400
137735333 et3_tsy D Dec. 2, 2021, 1:17 a.m. OK GNU C++14 TESTS 31 46 16179200
137704372 Rings D Dec. 1, 2021, 4:33 p.m. OK GNU C++14 TESTS 28 62 44441600
137742367 ACOIer D Dec. 2, 2021, 4:15 a.m. OK GNU C++14 TESTS 31 124 6041600
137740461 maomao330 D Dec. 2, 2021, 3:34 a.m. OK GNU C++14 TESTS 31 124 6041600
137724284 Synthra D Dec. 1, 2021, 7:43 p.m. OK GNU C++14 TESTS 28 124 7987200
137710597 Isshiki_Hugh D Dec. 1, 2021, 5:04 p.m. OK GNU C++14 TESTS 28 124 24064000
137700927 Gubbins D Dec. 1, 2021, 4:26 p.m. OK GNU C++14 TESTS 28 139 7987200
137707711 vongvinhtoan D Dec. 1, 2021, 4:45 p.m. OK GNU C++14 TESTS 28 139 7987200
137737316 walht D Dec. 2, 2021, 2:17 a.m. OK GNU C++14 TESTS 31 139 10035200
137704272 MathildaNeko D Dec. 1, 2021, 4:33 p.m. OK GNU C++17 TESTS 28 46 12083200
137710334 Enumerater D Dec. 1, 2021, 5:02 p.m. OK GNU C++17 TESTS 28 46 12185600
137704121 llztxdy D Dec. 1, 2021, 4:33 p.m. OK GNU C++17 TESTS 28 93 6041600
137705932 GodLovesYou D Dec. 1, 2021, 4:37 p.m. OK GNU C++17 TESTS 28 109 10035200
137741406 Jin_Chuan D Dec. 2, 2021, 3:55 a.m. OK GNU C++17 TESTS 31 124 6041600
137741088 Jin_Chuan D Dec. 2, 2021, 3:49 a.m. OK GNU C++17 TESTS 31 124 6041600
137741014 Jin_Chuan D Dec. 2, 2021, 3:47 a.m. OK GNU C++17 TESTS 31 124 6041600
137739958 aniketspeaks D Dec. 2, 2021, 3:22 a.m. OK GNU C++17 TESTS 31 124 6041600
137737506 utkarsh.agarwal.min19 D Dec. 2, 2021, 2:22 a.m. OK GNU C++17 TESTS 31 124 6041600
137736450 abcdhhhh D Dec. 2, 2021, 1:51 a.m. OK GNU C++17 TESTS 31 124 6041600
137711937 Uppercase D Dec. 1, 2021, 5:15 p.m. OK GNU C++17 (64) TESTS 28 78 3993600
137711223 Uppercase D Dec. 1, 2021, 5:09 p.m. OK GNU C++17 (64) TESTS 28 78 3993600
137737541 cjoa D Dec. 2, 2021, 2:23 a.m. OK GNU C++17 (64) TESTS 31 78 6041600
137737263 93wilsonlu D Dec. 2, 2021, 2:16 a.m. OK GNU C++17 (64) TESTS 31 78 10035200
137713577 Golden D Dec. 1, 2021, 5:29 p.m. OK GNU C++17 (64) TESTS 28 78 10035200
137737138 keenlf D Dec. 2, 2021, 2:11 a.m. OK GNU C++17 (64) TESTS 31 78 12083200
137733315 WGYLOVEZXQ D Dec. 2, 2021, 12:08 a.m. OK GNU C++17 (64) TESTS 31 78 121958400
137745009 AnNotShy D Dec. 2, 2021, 5:03 a.m. OK GNU C++17 (64) TESTS 31 92 7987200
137711005 Uppercase D Dec. 1, 2021, 5:08 p.m. OK GNU C++17 (64) TESTS 28 93 3993600
137740897 PhaiCoGiaiQuocGia D Dec. 2, 2021, 3:44 a.m. OK GNU C++17 (64) TESTS 31 93 6041600
137708353 generic_placeholder_name D Dec. 1, 2021, 4:49 p.m. OK GNU C++20 (64) TESTS 28 62 3993600
137745915 buidangnguyen05 D Dec. 2, 2021, 5:19 a.m. OK GNU C++20 (64) TESTS 31 77 6041600
137712514 silverfish D Dec. 1, 2021, 5:20 p.m. OK GNU C++20 (64) TESTS 28 77 10035200
137748795 M.Ali D Dec. 2, 2021, 5:59 a.m. OK GNU C++20 (64) TESTS 31 77 10035200
137708746 YeoBL D Dec. 1, 2021, 4:52 p.m. OK GNU C++20 (64) TESTS 28 77 172339200
137735740 nguot D Dec. 2, 2021, 1:29 a.m. OK GNU C++20 (64) TESTS 31 78 3993600
137725006 Bench0310 D Dec. 1, 2021, 7:54 p.m. OK GNU C++20 (64) TESTS 28 78 3993600
137726450 the_hyp0cr1t3 D Dec. 1, 2021, 8:22 p.m. OK GNU C++20 (64) TESTS 28 78 3993600
137739530 _____Sky___ D Dec. 2, 2021, 3:12 a.m. OK GNU C++20 (64) TESTS 31 78 6041600
137711604 phanlong2811 D Dec. 1, 2021, 5:13 p.m. OK GNU C++20 (64) TESTS 28 78 6041600
137700461 clyring D Dec. 1, 2021, 4:25 p.m. OK Haskell TESTS 28 296 18944000
137722953 henrychenOutlook D Dec. 1, 2021, 7:22 p.m. OK Java 11 TESTS 28 264 11264000
137734217 LongWalk D Dec. 2, 2021, 12:41 a.m. OK Java 11 TESTS 31 311 11264000
137721582 henrychenOutlook D Dec. 1, 2021, 7:01 p.m. OK Java 11 TESTS 28 327 11264000
137722514 kamranm D Dec. 1, 2021, 7:15 p.m. OK Java 11 TESTS 28 390 61030400
137717198 kamranm D Dec. 1, 2021, 6:07 p.m. OK Java 11 TESTS 28 420 71372800
137732488 podtelkin D Dec. 1, 2021, 11:11 p.m. OK Java 11 TESTS 31 858 11161600
137748324 dzhi D Dec. 2, 2021, 5:53 a.m. OK Java 11 TESTS 31 1294 5222400
137713299 Adi_7861 D Dec. 1, 2021, 5:27 p.m. OK Java 8 TESTS 28 202 16281600
137729269 O_E D Dec. 1, 2021, 9:27 p.m. OK Java 8 TESTS 28 326 17100800
137729436 O_E D Dec. 1, 2021, 9:31 p.m. OK Java 8 TESTS 28 327 16998400
137733295 invincible777 D Dec. 2, 2021, 12:07 a.m. OK Java 8 TESTS 31 576 24576000
137739067 XianztsZhong D Dec. 2, 2021, 3:01 a.m. OK MS C++ 2017 TESTS 31 171 16076800
137738456 XianztsZhong D Dec. 2, 2021, 2:47 a.m. OK MS C++ 2017 TESTS 31 171 16076800
137746391 hcp D Dec. 2, 2021, 5:26 a.m. OK MS C++ 2017 TESTS 31 202 14028800
137701437 fuchun95 D Dec. 1, 2021, 4:27 p.m. OK MS C++ 2017 TESTS 28 732 34099200
137704018 fatant D Dec. 1, 2021, 4:33 p.m. OK MS C++ 2017 TESTS 28 794 16076800
137703340 rokirovochka D Dec. 1, 2021, 4:31 p.m. OK MS C++ 2017 TESTS 28 1013 44134400
137705579 avtoruxadze D Dec. 1, 2021, 4:36 p.m. OK .NET Core C# TESTS 28 670 49971200
137720915 kagu D Dec. 1, 2021, 6:52 p.m. OK PyPy 2 TESTS 28 452 56627200
137717213 OlavBakken D Dec. 1, 2021, 6:07 p.m. OK PyPy 2 TESTS 28 1949 50483200
137705018 Eguy D Dec. 1, 2021, 4:34 p.m. OK PyPy 3 TESTS 28 545 38297600
137709580 NecroSean38 D Dec. 1, 2021, 4:57 p.m. OK PyPy 3 TESTS 28 592 69427200
137725157 hxu10 D Dec. 1, 2021, 7:57 p.m. OK PyPy 3 TESTS 28 655 76185600
137719293 coder_sounak D Dec. 1, 2021, 6:32 p.m. OK PyPy 3 TESTS 28 670 76083200
137723036 Believer_Ayush D Dec. 1, 2021, 7:23 p.m. OK PyPy 3 TESTS 28 1232 158720000
137729012 whatshisbucket D Dec. 1, 2021, 9:20 p.m. OK PyPy 3 TESTS 28 1622 90214400
137700952 tomu.hirata D Dec. 1, 2021, 4:26 p.m. OK PyPy 3 TESTS 28 1747 52326400
137720586 aberent D Dec. 1, 2021, 6:48 p.m. OK PyPy 3-64 TESTS 28 374 50790400
137703243 laplce D Dec. 1, 2021, 4:31 p.m. OK PyPy 3-64 TESTS 28 436 61337600
137735413 hxu10 D Dec. 2, 2021, 1:19 a.m. OK PyPy 3-64 TESTS 31 467 87552000
137704690 anishde85 D Dec. 1, 2021, 4:34 p.m. OK PyPy 3-64 TESTS 28 514 81612800
137705939 Venia D Dec. 1, 2021, 4:37 p.m. OK PyPy 3-64 TESTS 28 639 59801600
137735691 armsusman D Dec. 2, 2021, 1:28 a.m. OK PyPy 3-64 TESTS 31 764 78848000
137714127 ctt312000 D Dec. 1, 2021, 5:34 p.m. OK PyPy 3-64 TESTS 28 967 134246400
137714268 akshaykhandelwal D Dec. 1, 2021, 5:36 p.m. OK PyPy 3-64 TESTS 28 1981 64819200
137712729 OLOGY D Dec. 1, 2021, 5:22 p.m. OK Python 2 TESTS 28 826 33382400
137717708 OLOGY D Dec. 1, 2021, 6:12 p.m. OK Python 2 TESTS 28 841 33484800
137709368 sjtuzlp D Dec. 1, 2021, 4:56 p.m. OK Python 3 TESTS 28 1294 50892800
137721836 rustafari D Dec. 1, 2021, 7:05 p.m. OK Rust TESTS 28 62 13312000
137729380 noogler D Dec. 1, 2021, 9:30 p.m. OK Rust TESTS 28 93 33484800
137729202 noogler D Dec. 1, 2021, 9:26 p.m. OK Rust TESTS 28 93 33484800
137728670 noogler D Dec. 1, 2021, 9:12 p.m. OK Rust TESTS 28 93 33484800
137719858 sansen D Dec. 1, 2021, 6:39 p.m. OK Rust 2021 TESTS 28 46 9318400
137703941 Slayer_ D Dec. 1, 2021, 4:32 p.m. OK Scala TESTS 28 545 18329600

remove filters

Back to search problems