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 |
---|---|---|---|---|---|---|
1810 | CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 7200 | 56993062 | March 31, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 752 ) | G | The Maximum Prefix | PROGRAMMING | dp |
B"You're going to generate an array a with a length of at most n , where each a_{i} equals either 1 or -1 . You generate this array in the following way. After the array is generated, you calculate s_{i} = a_{1} + a_{2} + a_{3}+ ldots + a_{i} . Specially, s_{0} = 0 . Then you let S equal to displaystyle max_{i=0}^{k}{s_{i}} . That is, S is the maximum prefix sum of the array a . You are given n+1 integers h_{0} , h_{1}, ldots ,h_{n} . The score of an array a with maximum prefix sum S is h_{S} . Now, for each k , you want to know the expected score for an array of length k modulo 10^9+7 . Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 5000 ) -- the number of test cases. Their description follows. The first line contains an integer n ( 1 <= n <= 5000 ). Then for the following n lines, each line contains two integers x_{i} and y_{i} ( 0 <= x_{i} < 10^9 + 7 , 1 <= y_{i} < 10^9 + 7 , x_{i} <= y_{i} ), indicating p_{i} = frac{x_{i}}{y_{i}} . The next line contains n+1 integers h_{0},h_{1}, ldots, h_{n} ( 0 <= h_{i} < 10^9 + 7 ). It is guaranteed that the sum of n over all test cases does not exceed 5000 . For each test case, output n integers in one single line, the i -th of which denotes the expected score for an array of length i , modulo 10^9 + 7 . Formally, let M = 10^9 + 7 . It can be shown that the answer can be expressed as an irreducible fraction frac{p}{q} , where p and q are integers and q not equiv 0 pmod{M} . Output the integer equal to p cdot q^{-1} bmod M . In other words, output such an integer x that 0 <= x < M and x cdot q equiv p pmod{M} . In the first test case, if we choose k=1 , there are 2 possible arrays wi"... |
Editorial of CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
200078083 | Lasya24 | G | April 1, 2023, 5:42 a.m. | OK | GNU C++14 | TESTS | 38 | 217 | 100659200 | ||
200064250 | ix35 | G | April 1, 2023, 2:25 a.m. | OK | GNU C++14 | TESTS | 38 | 217 | 100659200 | ||
200037145 | dreamoon_love_AA | G | March 31, 2023, 7:03 p.m. | OK | GNU C++14 | TESTS | 38 | 483 | 201113600 | ||
200068312 | 1459007298 | G | April 1, 2023, 3:34 a.m. | OK | GNU C++17 | TESTS | 38 | 327 | 200908800 | ||
200037387 | KassiJulgus | G | March 31, 2023, 7:05 p.m. | OK | GNU C++17 | TESTS | 38 | 436 | 307200 | ||
200035854 | HassanKh2002 | G | March 31, 2023, 6:49 p.m. | OK | GNU C++17 | TESTS | 38 | 592 | 204800 | ||
200035061 | mlk_moaz_01 | G | March 31, 2023, 6:41 p.m. | OK | GNU C++17 | TESTS | 38 | 592 | 204800 | ||
200063517 | yexisu | G | April 1, 2023, 2:12 a.m. | OK | GNU C++17 | TESTS | 38 | 717 | 208998400 | ||
200026059 | hank55663 | G | March 31, 2023, 5:25 p.m. | OK | GNU C++17 | TESTS | 38 | 764 | 409600 | ||
200056764 | MarcosK | G | March 31, 2023, 11:27 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 93 | 102400 | ||
200056563 | MarcosK | G | March 31, 2023, 11:23 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 108 | 102400 | ||
200025456 | hitonanode | G | March 31, 2023, 5:21 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 124 | 30720000 | ||
200056460 | MarcosK | G | March 31, 2023, 11:20 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 124 | 100659200 | ||
200044407 | kotatsugame | G | March 31, 2023, 8:24 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 155 | 100249600 | ||
200021313 | Nyaan | G | March 31, 2023, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 312 | 204800 | ||
200025686 | Marckess | G | March 31, 2023, 5:23 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 374 | 200908800 | ||
200017198 | Geothermal | G | March 31, 2023, 4:31 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 390 | 409600 | ||
200065721 | A_G | G | April 1, 2023, 2:52 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 46 | 2662400 | ||
200042874 | A_G | G | March 31, 2023, 8:07 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 78 | 102400 | ||
200031523 | dmenezes | G | March 31, 2023, 6:08 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 93 | 102400 | ||
200070392 | DeMen100ns | G | April 1, 2023, 4:07 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 108 | 100454400 | ||
200041573 | A_G | G | March 31, 2023, 7:53 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 124 | 102400 | ||
200036535 | Mangooste | G | March 31, 2023, 6:56 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 124 | 102400 | ||
200024225 | noimi | G | March 31, 2023, 5:14 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 140 | 13721600 | ||
200028696 | turmax | G | March 31, 2023, 5:44 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 187 | 200908800 | ||
200040842 | 244mhq | G | March 31, 2023, 7:44 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 234 | 204800 | ||
200027268 | cabbit | G | March 31, 2023, 5:33 p.m. | OK | GNU C++20 (64) | TESTS | 38 | 249 | 102400 |
Back to search problems