Kotlin Heroes: Episode 6

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
1488 Kotlin Heroes: Episode 6 FINISHED False 9000 122052311 March 9, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 61 ) H Build From Suffixes PROGRAMMING *special combinatorics data structures

B'You are given an integer n and a sequence a of n-1 integers, each element is either 0 or 1 . You are asked to build a string of length n such that: You will be asked q queries of form: After each query print the number of different strings that satisfy the given constraints modulo 998 ,244 ,353 . The first line contains two integers n and q ( 2 <= n <= 10^5 ; 1 <= q <= 10^5 ) -- the length of the string and the number of queries. The second line contains n-1 integers a_1, a_2, ... , a_{n-1} ( a_i in {0, 1 } ) -- the constraints on suffixes of the string. Each of the next q lines contains a query: an integer i ( 1 <= i <= n - 1 ) -- flip the value of a_i (if a_i=0 , then set a_i to 1 , and vice versa). After each query print the number of different strings that satisfy the given constraints modulo 998 ,244 ,353 . The i -th suffix of a string is a continuous substring that starts from the i -th position and ends in the last position. A string a is lexicographically smaller than a string b if and only if one of the following holds: Two strings a and b of length n differ if there exists a position i such that a_i neq b_i . '...

Tutorials

88522

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109502241 Egor H March 9, 2021, 4:14 p.m. OK Kotlin TESTS 12 2386 40857600
109500859 eatmore H March 9, 2021, 3:58 p.m. OK Kotlin TESTS 12 2479 15974400
109526545 Spheniscine H March 10, 2021, 3:36 a.m. OK Kotlin TESTS 12 2542 16384000
109505743 dalt H March 9, 2021, 4:58 p.m. OK Kotlin TESTS 12 2651 71270400
109513752 yudedako H March 9, 2021, 7:02 p.m. OK Kotlin TESTS 12 3291 77926400
109513508 yudedako H March 9, 2021, 6:57 p.m. OK Kotlin TESTS 12 3587 77926400
109509306 nuip H March 9, 2021, 5:48 p.m. OK Kotlin TESTS 12 4133 73318400
109509745 nuip H March 9, 2021, 5:54 p.m. OK Kotlin TESTS 12 4196 73420800
109508552 nuip H March 9, 2021, 5:37 p.m. OK Kotlin TESTS 12 4617 70348800
109508864 nuip H March 9, 2021, 5:41 p.m. OK Kotlin TESTS 12 4633 70348800

remove filters

Back to search problems