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 |
---|---|---|---|---|---|---|
1788 | Codeforces Round 851 (Div. 2) | FINISHED | False | 7200 | 61226663 | Feb. 9, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2773 ) | E | Sum Over Zero | PROGRAMMING | data structures dp |
B'You are given an array a_1, a_2, ldots, a_n of n integers. Consider S as a set of segments satisfying the following conditions. The length of the segment [x, y] is defined as y-x+1 . f(S) is defined as the sum of the lengths of every element in S . In a formal way, f(S) = sum_{[x, y] in S} (y - x + 1) . Note that if S is empty, f(S) is 0 . What is the maximum f(S) among all possible S ? The first line contains one integer n ( 1 <= q n <= q 2 cdot 10^5 ). The next line is followed by n integers a_1, a_2, ldots, a_n ( -10^9 <= q a_i <= q 10^9 ). Print a single integer, the maximum f(S) among every possible S . In the first example, S= {[1, 2], [4, 5] } can be a possible S because a_1+a_2=0 and a_4+a_5=1 . S= {[1, 4] } can also be a possible solution. Since there does not exist any S that satisfies f(S) > 4 , the answer is 4 . In the second example, S= {[1, 9] } is the only set that satisfies f(S)=9 . Since every possible S satisfies f(S) <= q 9 , the answer is 9 . In the third example, S can only be an empty set, so the answer is 0 . '... |
Codeforces Round #851 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
193009103 | Tdyx | E | Feb. 10, 2023, 3:27 a.m. | OK | C# 10 | TESTS | 71 | 155 | 28876800 | ||
192968589 | Gassa | E | Feb. 9, 2023, 5:32 p.m. | OK | D | TESTS | 71 | 187 | 29593600 | ||
193010755 | william556 | E | Feb. 10, 2023, 3:54 a.m. | OK | GNU C++14 | TESTS | 71 | 93 | 4812800 | ||
192997723 | sprads | E | Feb. 9, 2023, 11:02 p.m. | OK | GNU C++14 | TESTS | 71 | 93 | 5632000 | ||
192976357 | sshs18102 | E | Feb. 9, 2023, 6:25 p.m. | OK | GNU C++14 | TESTS | 71 | 93 | 11161600 | ||
192999374 | liujunyi123 | E | Feb. 9, 2023, 11:46 p.m. | OK | GNU C++14 | TESTS | 71 | 108 | 4812800 | ||
193017052 | liujunyi123 | E | Feb. 10, 2023, 5:20 a.m. | OK | GNU C++14 | TESTS | 71 | 109 | 4812800 | ||
192998517 | dengziyue | E | Feb. 9, 2023, 11:22 p.m. | OK | GNU C++14 | TESTS | 71 | 109 | 6348800 | ||
193001165 | lovely-ckj | E | Feb. 10, 2023, 12:36 a.m. | OK | GNU C++14 | TESTS | 71 | 109 | 160358400 | ||
193003752 | xiaowu5933 | E | Feb. 10, 2023, 1:46 a.m. | OK | GNU C++14 | TESTS | 71 | 124 | 4812800 | ||
193018757 | LXH-cat | E | Feb. 10, 2023, 5:40 a.m. | OK | GNU C++14 | TESTS | 71 | 124 | 6451200 | ||
192979947 | _martynas | E | Feb. 9, 2023, 6:57 p.m. | OK | GNU C++14 | TESTS | 71 | 124 | 11366400 | ||
193001136 | ventusliberum | E | Feb. 10, 2023, 12:35 a.m. | OK | GNU C++17 | TESTS | 71 | 78 | 5632000 | ||
192968681 | patou | E | Feb. 9, 2023, 5:32 p.m. | OK | GNU C++17 | TESTS | 71 | 93 | 5120000 | ||
193007917 | nhuhieu193 | E | Feb. 10, 2023, 3:08 a.m. | OK | GNU C++17 | TESTS | 71 | 93 | 6451200 | ||
192976245 | counter | E | Feb. 9, 2023, 6:24 p.m. | OK | GNU C++17 | TESTS | 71 | 93 | 7168000 | ||
193012187 | chunzhifeng | E | Feb. 10, 2023, 4:16 a.m. | OK | GNU C++17 | TESTS | 71 | 108 | 4812800 | ||
193008323 | limengke | E | Feb. 10, 2023, 3:15 a.m. | OK | GNU C++17 | TESTS | 71 | 108 | 5632000 | ||
192968713 | Ann | E | Feb. 9, 2023, 5:32 p.m. | OK | GNU C++17 | TESTS | 71 | 108 | 5632000 | ||
193002841 | Marckess | E | Feb. 10, 2023, 1:21 a.m. | OK | GNU C++17 | TESTS | 71 | 108 | 7987200 | ||
193017008 | ComistryMo | E | Feb. 10, 2023, 5:19 a.m. | OK | GNU C++17 | TESTS | 71 | 108 | 9625600 | ||
192987224 | ocarima | E | Feb. 9, 2023, 8:11 p.m. | OK | GNU C++17 | TESTS | 71 | 108 | 11264000 | ||
193007419 | Sempr | E | Feb. 10, 2023, 2:59 a.m. | OK | GNU C++17 (64) | TESTS | 71 | 62 | 9113600 | ||
193020061 | korokseeds | E | Feb. 10, 2023, 5:54 a.m. | OK | GNU C++17 (64) | TESTS | 71 | 77 | 5939200 | ||
192972880 | _shakespeare_ | E | Feb. 9, 2023, 5:59 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 77 | 6451200 | ||
192977357 | Elza_York | E | Feb. 9, 2023, 6:33 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 77 | 7987200 | ||
192968081 | nathanlee726 | E | Feb. 9, 2023, 5:29 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 78 | 6348800 | ||
192980874 | Anshul_yd | E | Feb. 9, 2023, 7:05 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 78 | 6451200 | ||
192960135 | trainwithoutpain | E | Feb. 9, 2023, 4:31 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 78 | 6451200 | ||
193013908 | camc | E | Feb. 10, 2023, 4:40 a.m. | OK | GNU C++17 (64) | TESTS | 71 | 78 | 7987200 | ||
192967497 | xuxu4213 | E | Feb. 9, 2023, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 78 | 8294400 | ||
192985831 | enslaved | E | Feb. 9, 2023, 7:54 p.m. | OK | GNU C++17 (64) | TESTS | 71 | 78 | 8499200 | ||
192971327 | threethreetwothree | E | Feb. 9, 2023, 5:49 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 46 | 20684800 | ||
192967564 | threethreetwothree | E | Feb. 9, 2023, 5:26 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 46 | 20684800 | ||
192967230 | threethreetwothree | E | Feb. 9, 2023, 5:25 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 46 | 20684800 | ||
192978958 | _Mahmoud_Ayman | E | Feb. 9, 2023, 6:48 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 61 | 4812800 | ||
192974310 | thanhchauns2 | E | Feb. 9, 2023, 6:10 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 61 | 11264000 | ||
193007002 | K-423 | E | Feb. 10, 2023, 2:51 a.m. | OK | GNU C++20 (64) | TESTS | 71 | 62 | 3993600 | ||
192985793 | dmenezes | E | Feb. 9, 2023, 7:54 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 62 | 4812800 | ||
192985214 | dmenezes | E | Feb. 9, 2023, 7:48 p.m. | OK | GNU C++20 (64) | TESTS | 71 | 62 | 4812800 | ||
193018253 | next_here | E | Feb. 10, 2023, 5:34 a.m. | OK | GNU C++20 (64) | TESTS | 71 | 62 | 5632000 | ||
193017862 | next_here | E | Feb. 10, 2023, 5:30 a.m. | OK | GNU C++20 (64) | TESTS | 71 | 62 | 5632000 | ||
192970809 | profchi | E | Feb. 9, 2023, 5:46 p.m. | OK | Java 11 | TESTS | 71 | 639 | 64102400 | ||
192976850 | TCchen | E | Feb. 9, 2023, 6:29 p.m. | OK | Java 17 | TESTS | 71 | 467 | 24678400 | ||
192981424 | merlin_ | E | Feb. 9, 2023, 7:10 p.m. | OK | Java 17 | TESTS | 71 | 717 | 76083200 | ||
193000605 | Little_Sheep_Yawn | E | Feb. 10, 2023, 12:19 a.m. | OK | PyPy 3-64 | TESTS | 71 | 265 | 28774400 | ||
192988969 | NP_Prob | E | Feb. 9, 2023, 8:32 p.m. | OK | PyPy 3-64 | TESTS | 71 | 327 | 42598400 | ||
192994038 | beethoven97 | E | Feb. 9, 2023, 9:48 p.m. | OK | PyPy 3-64 | TESTS | 71 | 420 | 35020800 | ||
192994376 | beethoven97 | E | Feb. 9, 2023, 9:54 p.m. | OK | PyPy 3-64 | TESTS | 71 | 420 | 35737600 | ||
193007669 | SoleProprietor | E | Feb. 10, 2023, 3:04 a.m. | OK | PyPy 3-64 | TESTS | 71 | 420 | 41472000 | ||
193017611 | NINGucas | E | Feb. 10, 2023, 5:26 a.m. | OK | PyPy 3-64 | TESTS | 71 | 421 | 42803200 | ||
193012255 | ZrjaK | E | Feb. 10, 2023, 4:17 a.m. | OK | PyPy 3-64 | TESTS | 71 | 436 | 40755200 | ||
193017544 | NINGucas | E | Feb. 10, 2023, 5:26 a.m. | OK | PyPy 3-64 | TESTS | 71 | 529 | 42393600 | ||
193000661 | bronze_coder | E | Feb. 10, 2023, 12:21 a.m. | OK | PyPy 3-64 | TESTS | 71 | 670 | 40345600 | ||
192976389 | sushmanth.dampur8780 | E | Feb. 9, 2023, 6:25 p.m. | OK | PyPy 3-64 | TESTS | 71 | 685 | 42086400 |
Back to search problems