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 121879463 March 9, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 36 ) J Flower Shop PROGRAMMING *special fft math

B"Your friend is running a flower shop. In order to be prepared for the next holidays (when, as usual, sales skyrocket) she asked you to write her a special program that will help to analyze the stocks she has. There are n different types of flowers she can order and each flower of the type i costs w_i . The last holidays were a great success, she sold all flowers she had, so right now all her stocks are empty. From this point, she starts routine operations of ordering and selling flowers, while trying to analyze what she has at hand. All of this can be represented as m queries of three types: Help your friend and write the program that can process all these queries. The first line contains two integers n and m ( 1 <= n <= 1000 ; 1 <= m <= 1000 ) -- the number of flower types and the number of queries. The second line contains n integers w_1, w_2, ... , w_n ( 1 <= w_i <= 1000 ) -- the cost of one flower of each type. The next m lines contains queries -- one per line. Each query has one of three types: It's guaranteed that the total cost of all flowers in stock after each query doesn't exceed 5000 . For each query of the third type, print how many variants of bouquets she can make using only flowers of types l, l + 1, ... , r with the total cost no more than k . Since the answer may be too large, print it modulo 998 ,244 ,353 . "...

Tutorials

88522

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109505496 eatmore J March 9, 2021, 4:55 p.m. OK Kotlin TESTS 64 1778 77209600
109510021 Benq J March 9, 2021, 5:58 p.m. OK Kotlin TESTS 64 4243 142438400
109509826 Benq J March 9, 2021, 5:55 p.m. OK Kotlin TESTS 64 4399 142438400

remove filters

Back to search problems