TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!)

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
1787 TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 10800 62263463 Jan. 29, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 297 ) I Treasure Hunt PROGRAMMING divide and conquer two pointers

B"Define the beauty value of a sequence b_1,b_2, ldots,b_c as the maximum value of sum limits_{i=1}^{q}b_i + sum limits_{i=s}^{t}b_i , where q , s , t are all integers and s > q or t <= q q . Note that b_i = 0 when i<1 or i>c , sum limits_{i=s}^{t}b_i = 0 when s>t . For example, when b = [-1,-2,-3] , we may have q = 0 , s = 3 , t = 2 so the beauty value is 0 + 0 = 0 . And when b = [-1,2,-3] , we have q = s = t = 2 so the beauty value is 1 + 2 = 3 . You are given a sequence a of length n , determine the sum of the beauty value of all non-empty subsegments a_l,a_{l+1}, ldots,a_r ( 1 <= q l <= q r <= q n ) of the sequence a . Print the answer modulo 998 ,244 ,353 . Each test contains multiple test cases. The first line contains an integer T ( 1 <= T <= 10^4 ) -- the number of test cases. The first line contains an integer n ( 1 <= n <= 10^6 ) -- the length of a . The second line contains n integers a_1,a_2, ldots,a_n ( -10^6 <= q a_i <= q 10^6 ) -- the given sequence. It's guaranteed that the sum of n does not exceed 10^6 . For each test case, print a line containing a single integer -- the answer modulo 998 ,244 ,353 . In the second test case, for the subsequence [-26,43,-41,34,13] , when q=5 , s=2 , t=5 , sum limits_{i=1}^{q}b_i + sum limits_{i=s}^{t}b_i = 23 + 49 = 72 . In the third test case, there is only one non-empty consecutive subsequence [74] . When q=1 , s=1 , t=1 , sum limits_{i=1}^{q}b_i + sum limits_{i=s}^{t}b_i = 148 . "...

Tutorials

TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
191159985 Um_nik I Jan. 29, 2023, 5:19 p.m. OK GNU C++17 TESTS 69 982 76185600
191199133 lxyzlz1 I Jan. 30, 2023, 3:13 a.m. OK GNU C++17 TESTS 69 1466 50380800
191173195 Benq I Jan. 29, 2023, 7:13 p.m. OK GNU C++17 (64) TESTS 69 483 93593600
191180384 Benq I Jan. 29, 2023, 8:36 p.m. OK GNU C++17 (64) TESTS 69 623 45977600
191182912 Benq I Jan. 29, 2023, 9:13 p.m. OK GNU C++17 (64) TESTS 69 920 50892800
191151856 rainboy I Jan. 29, 2023, 4:40 p.m. OK GNU C++17 (64) TESTS 69 1762 44032000
191153893 feecle6418 I Jan. 29, 2023, 4:50 p.m. OK GNU C++20 (64) TESTS 69 358 91648000
191147076 tourist I Jan. 29, 2023, 4:19 p.m. OK GNU C++20 (64) TESTS 69 623 84684800
191158380 ecnerwala I Jan. 29, 2023, 5:11 p.m. OK GNU C++20 (64) TESTS 69 1122 188416000
191200280 Tadapally I Jan. 30, 2023, 3:31 a.m. OK GNU C++20 (64) TESTS 69 1153 66764800
191162418 ugly2333 I Jan. 29, 2023, 5:30 p.m. OK GNU C++20 (64) TESTS 69 1153 66764800
191159474 Radewoosh I Jan. 29, 2023, 5:16 p.m. OK GNU C++20 (64) TESTS 69 1248 74752000
191162667 ko_osaga I Jan. 29, 2023, 5:31 p.m. OK GNU C++20 (64) TESTS 69 1575 108236800
191170332 jiangly I Jan. 29, 2023, 6:48 p.m. OK GNU C++20 (64) TESTS 69 1825 96153600
191147979 ksun48 I Jan. 29, 2023, 4:23 p.m. OK GNU C++20 (64) TESTS 69 1933 104960000

remove filters

Back to search problems