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 |
---|---|---|---|---|---|---|
1918 | Codeforces Round 922 (Div. 2) | FINISHED | False | 7800 | 25197899 | Jan. 30, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4849 ) | D | Blocking Elements | PROGRAMMING | binary search data structures dp greedy implementation two pointers |
B'You are given an array of numbers a_1, a_2, ldots, a_n . Your task is to block some elements of the array in order to minimize its cost. Suppose you block the elements with indices 1 <= q b_1 < b_2 < ldots < b_m <= q n . Then the cost of the array is calculated as the maximum of: For example, if n = 6 , the original array is [ 1, 4, 5, 3, 3, 2 ], and you block the elements at positions 2 and 5 , then the cost of the array will be the maximum of the sum of the blocked elements ( 4 + 3 = 7 ) and the sums of the subarrays ( 1 , 5 + 3 = 8 , 2 ), which is max(7,1,8,2) = 8 . You need to output the minimum cost of the array after blocking. The first line of the input contains a single integer t ( 1 <= q t <= q 30 ,000 ) -- the number of queries. Each test case consists of two lines. The first line contains an integer n ( 1 <= q n <= q 10^5 ) -- the length of the array a . The second line contains n elements a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^9 ) -- the array a . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output a single number -- the minimum cost of blocking the array. The first test case matches with the array from the statement. To obtain a cost of 7 , you need to block the elements at positions 2 and 4 . In this case, the cost of the array is calculated as the maximum of: So the cost is max(7,5) = 7 . In the second test case, you can block the elements at positions 1 and 4 . In the third test case, to obtain the answer 11 , you can block the elements at positions 2 and 5 . There are other ways to get this answer, for example, blocking positions 4 and 6 . '... |
Codeforces Round #922 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
244197336 | qwqIdontHaveAgf | D | Jan. 31, 2024, 3:53 a.m. | OK | C# 10 | TESTS | 29 | 3088 | 47411200 | ||
244165151 | rainboy | D | Jan. 30, 2024, 7:25 p.m. | OK | GNU C11 | TESTS | 29 | 202 | 1843200 | ||
244144727 | pengin_2000 | D | Jan. 30, 2024, 4:44 p.m. | OK | GNU C11 | TESTS | 29 | 218 | 3481600 | ||
244170381 | prakhar7472pk | D | Jan. 30, 2024, 8:15 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 2457600 | ||
244172087 | prakhar7472pk | D | Jan. 30, 2024, 8:33 p.m. | OK | GNU C++17 | TESTS | 29 | 78 | 2457600 | ||
244189577 | Cras0432 | D | Jan. 31, 2024, 2:04 a.m. | OK | GNU C++17 | TESTS | 29 | 78 | 2457600 | ||
244169112 | prakhar7472pk | D | Jan. 30, 2024, 8:02 p.m. | OK | GNU C++17 | TESTS | 29 | 93 | 2457600 | ||
244163459 | zjrfanfanfan__ | D | Jan. 30, 2024, 7:11 p.m. | OK | GNU C++17 | TESTS | 29 | 108 | 2764800 | ||
244158428 | HHT0501 | D | Jan. 30, 2024, 6:37 p.m. | OK | GNU C++17 | TESTS | 29 | 108 | 64102400 | ||
244203296 | NortGlG | D | Jan. 31, 2024, 4:57 a.m. | OK | GNU C++17 | TESTS | 29 | 109 | 1228800 | ||
244193122 | Ether13 | D | Jan. 31, 2024, 2:56 a.m. | OK | GNU C++17 | TESTS | 29 | 109 | 3174400 | ||
244198883 | longting | D | Jan. 31, 2024, 4:13 a.m. | OK | GNU C++17 | TESTS | 29 | 109 | 3174400 | ||
244194086 | Djangle162857 | D | Jan. 31, 2024, 3:09 a.m. | OK | GNU C++17 | TESTS | 29 | 109 | 5632000 | ||
244184356 | leo202200925 | D | Jan. 31, 2024, 12:23 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 62 | 2457600 | ||
244186854 | dcchendada | D | Jan. 31, 2024, 1:14 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 62 | 3174400 | ||
244139275 | AINgrey | D | Jan. 30, 2024, 4:30 p.m. | OK | GNU C++17 (64) | TESTS | 29 | 62 | 5427200 | ||
244142993 | Lu_xZ | D | Jan. 30, 2024, 4:40 p.m. | OK | GNU C++17 (64) | TESTS | 29 | 77 | 2048000 | ||
244195653 | chunzhifeng | D | Jan. 31, 2024, 3:29 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 77 | 2457600 | ||
244138524 | DrownedTerrene | D | Jan. 30, 2024, 4:28 p.m. | OK | GNU C++17 (64) | TESTS | 29 | 77 | 2867200 | ||
244191652 | laxx | D | Jan. 31, 2024, 2:35 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 77 | 64204800 | ||
244136469 | 2005zhw | D | Jan. 30, 2024, 4:23 p.m. | OK | GNU C++17 (64) | TESTS | 29 | 78 | 2457600 | ||
244198717 | supine | D | Jan. 31, 2024, 4:10 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 78 | 2457600 | ||
244195535 | Winding. | D | Jan. 31, 2024, 3:28 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 78 | 2457600 | ||
244159439 | Numinous | D | Jan. 30, 2024, 6:43 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 46 | 1331200 | ||
244160183 | Numinous | D | Jan. 30, 2024, 6:48 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 46 | 1331200 | ||
244205791 | kjhhjki | D | Jan. 31, 2024, 5:23 a.m. | OK | GNU C++20 (64) | TESTS | 30 | 46 | 4812800 | ||
244196760 | lnu_xunxxxx | D | Jan. 31, 2024, 3:45 a.m. | OK | GNU C++20 (64) | TESTS | 29 | 61 | 3276800 | ||
244160572 | Numinous | D | Jan. 30, 2024, 6:50 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 62 | 1331200 | ||
244162657 | Numinous | D | Jan. 30, 2024, 7:06 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 62 | 1331200 | ||
244162605 | Numinous | D | Jan. 30, 2024, 7:05 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 62 | 1331200 | ||
244162314 | Numinous | D | Jan. 30, 2024, 7:03 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 62 | 1331200 | ||
244160896 | Numinous | D | Jan. 30, 2024, 6:53 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 62 | 1331200 | ||
244160503 | Numinous | D | Jan. 30, 2024, 6:50 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 62 | 1331200 | ||
244184134 | 0x3F | D | Jan. 31, 2024, 12:17 a.m. | OK | Go | TESTS | 29 | 202 | 6451200 | ||
244141759 | Dukkha | D | Jan. 30, 2024, 4:36 p.m. | OK | Java 21 | TESTS | 29 | 685 | 614400 | ||
244187382 | ccj123 | D | Jan. 31, 2024, 1:24 a.m. | OK | Java 21 | TESTS | 29 | 686 | 307200 | ||
244136605 | vinay_panwar | D | Jan. 30, 2024, 4:23 p.m. | OK | Java 21 | TESTS | 29 | 779 | 9216000 | ||
244153820 | ccj123 | D | Jan. 30, 2024, 6:16 p.m. | OK | Java 21 | TESTS | 29 | 1512 | 7372800 | ||
244207521 | 28leoleo28 | D | Jan. 31, 2024, 5:40 a.m. | OK | Java 21 | TESTS | 30 | 2870 | 2560000 | ||
244208414 | 28leoleo28 | D | Jan. 31, 2024, 5:48 a.m. | OK | Java 21 | TESTS | 30 | 2994 | 3072000 | ||
244161502 | Naitik.6803 | D | Jan. 30, 2024, 6:57 p.m. | OK | Java 21 | TESTS | 29 | 3041 | 4710400 | ||
244159502 | 1-1-1 | D | Jan. 30, 2024, 6:44 p.m. | OK | Java 21 | TESTS | 29 | 3821 | 11161600 | ||
244144915 | invincible777 | D | Jan. 30, 2024, 4:44 p.m. | OK | Java 8 | TESTS | 29 | 3743 | 12902400 | ||
244169227 | Darisishe | D | Jan. 30, 2024, 8:03 p.m. | OK | MS C++ 2017 | TESTS | 29 | 1731 | 7270400 | ||
244165585 | viliamgott | D | Jan. 30, 2024, 7:29 p.m. | OK | MS C++ 2017 | TESTS | 29 | 2495 | 7475200 | ||
244154000 | chinesedfan | D | Jan. 30, 2024, 6:17 p.m. | OK | Node.js | TESTS | 29 | 2932 | 82432000 | ||
244184069 | Remineva | D | Jan. 31, 2024, 12:16 a.m. | OK | PyPy 3-64 | TESTS | 29 | 404 | 15155200 | ||
244194315 | SoleProprietor | D | Jan. 31, 2024, 3:12 a.m. | OK | PyPy 3-64 | TESTS | 29 | 420 | 18329600 | ||
244193535 | SoleProprietor | D | Jan. 31, 2024, 3:02 a.m. | OK | PyPy 3-64 | TESTS | 29 | 436 | 18227200 | ||
244159043 | strashila | D | Jan. 30, 2024, 6:41 p.m. | OK | PyPy 3-64 | TESTS | 29 | 452 | 18841600 | ||
244198231 | mikeac | D | Jan. 31, 2024, 4:04 a.m. | OK | PyPy 3-64 | TESTS | 29 | 545 | 20582400 | ||
244168707 | PROELECTRO444 | D | Jan. 30, 2024, 7:58 p.m. | OK | PyPy 3-64 | TESTS | 29 | 561 | 14028800 | ||
244198155 | JinYuManTang | D | Jan. 31, 2024, 4:03 a.m. | OK | PyPy 3-64 | TESTS | 29 | 670 | 22937600 | ||
244155011 | VeryLate | D | Jan. 30, 2024, 6:20 p.m. | OK | PyPy 3-64 | TESTS | 29 | 686 | 19763200 | ||
244197866 | JinYuManTang | D | Jan. 31, 2024, 3:59 a.m. | OK | PyPy 3-64 | TESTS | 29 | 701 | 23552000 | ||
244193619 | hunglomdom | D | Jan. 31, 2024, 3:03 a.m. | OK | PyPy 3-64 | TESTS | 29 | 919 | 18534400 | ||
244161163 | rishabhxchoudhary | D | Jan. 30, 2024, 6:55 p.m. | OK | Python 3 | TESTS | 29 | 2948 | 17920000 | ||
244164998 | rishabhxchoudhary | D | Jan. 30, 2024, 7:24 p.m. | OK | Python 3 | TESTS | 29 | 2978 | 18636800 |
Back to search problems