Codeforces Round 172 (Div. 1)

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
280 Codeforces Round 172 (Div. 1) FINISHED False 7200 374768997 March 10, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1366 ) D k-Maximum Subsequence Sum PROGRAMMING data structures flows graphs implementation 2800

B"Consider integer sequence a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an. You should run queries of two types: The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105), showing how many numbers the sequence has. The next line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (|ai| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500). The third line contains integer m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of queries. The next m lines contain the queries in the format, given in the statement. All changing queries fit into limits: 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, |val| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500. All queries to count the maximum sum of at most k non-intersecting subsegments fit into limits: 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8920. It is guaranteed that the number of the queries to count the maximum sum of at most k non-intersecting subsegments doesn't exceed 10000. For each query to count the maximum sum of at most k non-intersecting subsegments print the reply -- the maximum sum. Print the answers to the queries in the order, in which the queries follow in the input. In the first query of the first example you can select a single pair (1, xe2 x80 x899). So the described sum will be 17. Look at the second query of the first example. How to choose two subsegments? (1, 3) and (7, 9)? Definitely not, the sum we could get from (1, 3) and (7, 9) is 20, against the optimal configuration (1, 7) and (9, 9) with 25. The answer to the third query is 0, we prefer select nothing if all of the numbers in the given interval are negative."...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3315708 zscc D March 14, 2013, 10:39 a.m. OK FPC TESTS 60 1015 26009600 2800
10523840 vjudge4 D March 30, 2015, 11:24 a.m. OK FPC TESTS 60 1464 38092800 2800
11396360 phile D June 3, 2015, 2:57 a.m. OK FPC TESTS 60 1466 29696000 2800
10523836 ez_cjb D March 30, 2015, 11:23 a.m. OK FPC TESTS 60 1466 38092800 2800
6903602 zhouzixuan D June 18, 2014, 7:07 a.m. OK FPC TESTS 60 1590 32460800 2800
25265093 zhan8855 D March 5, 2017, 3:09 p.m. OK GNU C++ TESTS 60 327 28057600 2800
30609155 Heaplax D Sept. 22, 2017, 8:21 a.m. OK GNU C++ TESTS 60 358 23552000 2800
37089073 vjudge3 D April 8, 2018, 6:26 a.m. OK GNU C++ TESTS 60 358 30412800 2800
25562617 vjudge3 D March 17, 2017, 1:55 a.m. OK GNU C++ TESTS 60 358 54784000 2800
36218260 RabbitHu D March 12, 2018, 8:46 a.m. OK GNU C++ TESTS 60 373 30617600 2800
34518532 vjudge2 D Jan. 24, 2018, 1:39 p.m. OK GNU C++ TESTS 60 373 31334400 2800
30609147 Heaplax D Sept. 22, 2017, 8:21 a.m. OK GNU C++ TESTS 60 374 27750400 2800
30609140 Heaplax D Sept. 22, 2017, 8:20 a.m. OK GNU C++ TESTS 60 374 36249600 2800
42025810 New-ErA D Aug. 24, 2018, 12:24 p.m. OK GNU C++ TESTS 60 389 28467200 2800
35756748 Coming D Feb. 27, 2018, 9:19 a.m. OK GNU C++ TESTS 60 390 31232000 2800
7001123 mayukuner D July 3, 2014, 4:33 a.m. OK GNU C++0x TESTS 60 780 26009600 2800
10213704 dzy97 D March 9, 2015, 12:48 a.m. OK GNU C++0x TESTS 60 902 35635200 2800
7061649 bill125 D July 11, 2014, 4:52 a.m. OK GNU C++0x TESTS 60 934 17203200 2800
3498803 pandoc D April 10, 2013, 8:21 a.m. OK GNU C++0x TESTS 60 968 21196800 2800
8351506 zshi D Oct. 22, 2014, 12:19 p.m. OK GNU C++0x TESTS 60 1466 65433600 2800
3286428 MinakoKojima D March 10, 2013, 9:25 p.m. OK GNU C++0x TESTS 60 1625 23756800 2800
5975774 FancyCoder D March 10, 2014, 11:03 a.m. OK GNU C++0x TESTS 60 1652 26112000 2800
5457092 niklasb D Dec. 17, 2013, 6:58 p.m. OK GNU C++0x TESTS 60 1996 20582400 2800
5457099 niklasb D Dec. 17, 2013, 7 p.m. OK GNU C++0x TESTS 60 2028 20582400 2800
5456980 niklasb D Dec. 17, 2013, 6:32 p.m. OK GNU C++0x TESTS 60 2028 22630400 2800
64139474 _ppp204 D Nov. 3, 2019, 8:07 a.m. OK GNU C++11 TESTS 60 218 40857600 2800
64773910 mlby D Nov. 13, 2019, 2:35 a.m. OK GNU C++11 TESTS 60 249 28160000 2800
56738816 FAQmother D July 9, 2019, 6:43 a.m. OK GNU C++11 TESTS 60 265 28160000 2800
56738800 FAQmother D July 9, 2019, 6:43 a.m. OK GNU C++11 TESTS 60 265 28160000 2800
56735004 luogu_bot3 D July 9, 2019, 4:33 a.m. OK GNU C++11 TESTS 60 265 28160000 2800
63903993 luogu_bot3 D Oct. 31, 2019, 5:55 a.m. OK GNU C++11 TESTS 60 280 26112000 2800
56738852 luogu_bot3 D July 9, 2019, 6:44 a.m. OK GNU C++11 TESTS 60 280 28160000 2800
56772893 Rachel_in D July 10, 2019, midnight OK GNU C++11 TESTS 60 295 52121600 2800
68495136 ddytxdy D Jan. 10, 2020, 1:10 p.m. OK GNU C++11 TESTS 60 296 26828800 2800
63767550 chasedeath D Oct. 30, 2019, 6:46 a.m. OK GNU C++11 TESTS 60 296 28467200 2800
66311622 disangan233 D Dec. 5, 2019, 11:38 a.m. OK GNU C++14 TESTS 60 327 35123200 2800
58525215 ezoilearner D Aug. 10, 2019, 6:49 a.m. OK GNU C++14 TESTS 60 405 27238400 2800
33072315 Ignatz D Dec. 10, 2017, 4:37 a.m. OK GNU C++14 TESTS 60 421 30412800 2800
26925794 xy20130630 D May 7, 2017, 2:52 p.m. OK GNU C++14 TESTS 60 421 30515200 2800
45969675 sy_chen D Nov. 19, 2018, 3:16 p.m. OK GNU C++14 TESTS 60 421 33382400 2800
37022073 xy20130630 D April 6, 2018, 1:30 p.m. OK GNU C++14 TESTS 60 421 33792000 2800
37022132 xy20130630 D April 6, 2018, 1:32 p.m. OK GNU C++14 TESTS 60 436 33792000 2800
37022004 xy20130630 D April 6, 2018, 1:27 p.m. OK GNU C++14 TESTS 60 452 33792000 2800
34518738 Never_See D Jan. 24, 2018, 1:46 p.m. OK GNU C++14 TESTS 60 467 31129600 2800
37022101 xy20130630 D April 6, 2018, 1:31 p.m. OK GNU C++14 TESTS 60 467 33792000 2800
51956067 CMXRYNP D March 29, 2019, 2:33 a.m. OK GNU C++17 TESTS 60 218 37478400 2800
51956038 CMXRYNP D March 29, 2019, 2:31 a.m. OK GNU C++17 TESTS 60 296 26419200 2800
62191017 C20193638 D Oct. 9, 2019, 9:41 a.m. OK GNU C++17 TESTS 60 390 29286400 2800
56754274 ygy D July 9, 2019, 1:13 p.m. OK GNU C++17 TESTS 60 405 25907200 2800
62191078 vjudge4 D Oct. 9, 2019, 9:42 a.m. OK GNU C++17 TESTS 60 405 29286400 2800
56754307 luogu_bot3 D July 9, 2019, 1:14 p.m. OK GNU C++17 TESTS 60 421 25907200 2800
66391142 justfocusplease D Dec. 6, 2019, 9:10 a.m. OK GNU C++17 TESTS 60 436 26214400 2800
39742729 .I. D June 28, 2018, 12:27 p.m. OK GNU C++17 TESTS 60 451 19558400 2800
36072789 Creeper_LKF D March 8, 2018, 1:41 p.m. OK GNU C++17 TESTS 60 451 49766400 2800
61584932 Roundgod D Oct. 1, 2019, 4:25 a.m. OK GNU C++17 TESTS 60 452 26009600 2800
3286383 MinakoKojima D March 10, 2013, 9:17 p.m. OK Java 7 TESTS 60 1843 57036800 2800
8894072 IgorKoval D Nov. 29, 2014, 9:25 p.m. OK Java 7 TESTS 60 2058 57241600 2800
29453977 uwi D Aug. 14, 2017, 9:07 a.m. OK Java 8 TESTS 60 811 57753600 2800
61881445 vjudge5 D Oct. 5, 2019, 12:09 a.m. OK MS C++ TESTS 60 483 29286400 2800
61852676 vjudge2 D Oct. 4, 2019, 1:10 p.m. OK MS C++ TESTS 60 483 29286400 2800
61914686 vjudge3 D Oct. 5, 2019, 11:47 a.m. OK MS C++ TESTS 60 561 26112000 2800
6609183 blueseen D May 13, 2014, 10:58 a.m. OK MS C++ TESTS 60 654 30720000 2800
8894528 IgorKoval D Nov. 29, 2014, 11:27 p.m. OK MS C++ TESTS 60 842 31539200 2800
3311916 witua D March 13, 2013, 8:23 p.m. OK MS C++ TESTS 60 1125 51200000 2800
4199482 aa2985759 D July 29, 2013, 12:28 p.m. OK MS C++ TESTS 60 1278 38297600 2800
9353449 AleksanderBalobanov D Jan. 3, 2015, 2:16 p.m. OK MS C++ TESTS 60 1466 40550400 2800
10851665 Anastasko D April 24, 2015, 6:52 p.m. OK MS C++ TESTS 60 1808 37376000 2800
17187368 dwp D April 6, 2016, 1:30 p.m. OK MS C++ TESTS 60 1872 32972800 2800

remove filters

Back to search problems