Codeforces Round 142 (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
229 Codeforces Round 142 (Div. 1) FINISHED False 7500 388247411 Oct. 1, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2297 ) D Towers PROGRAMMING dp greedy two pointers 2000

B"The city of D consists of n towers, built consecutively on a straight line. The height of the tower that goes i-th (from left to right) in the sequence equals hi. The city mayor decided to rebuild the city to make it beautiful. In a beautiful city all towers are are arranged in non-descending order of their height from left to right. The rebuilding consists of performing several (perhaps zero) operations. An operation constitutes using a crane to take any tower and put it altogether on the top of some other neighboring tower. In other words, we can take the tower that stands i-th and put it on the top of either the (i xe2 x80 x89- xe2 x80 x891)-th tower (if it exists), or the (i xe2 x80 x89+ xe2 x80 x891)-th tower (of it exists). The height of the resulting tower equals the sum of heights of the two towers that were put together. After that the two towers can't be split by any means, but more similar operations can be performed on the resulting tower. Note that after each operation the total number of towers on the straight line decreases by 1. Help the mayor determine the minimum number of operations required to make the city beautiful. The first line contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895000) -- the number of towers in the city. The next line contains n space-separated integers: the i-th number hi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89hi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) determines the height of the tower that is i-th (from left to right) in the initial tower sequence. Print a single integer -- the minimum number of operations needed to make the city beautiful."...

Tutorials

Codeforces Round #142 Problem Analysis

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
2292640 Oryshych D Oct. 2, 2012, 2:48 p.m. OK Delphi TESTS 39 296 100249600 2000
2295164 AleksanderBalobanov D Oct. 3, 2012, 9:27 a.m. OK Delphi TESTS 39 500 204800 2000
3992236 Omelianenko D June 29, 2013, 2:49 p.m. OK FPC TESTS 39 15 102400 2000
2300954 zxh809444285 D Oct. 5, 2012, 2:11 a.m. OK FPC TESTS 39 31 102400 2000
2292619 hung06061995 D Oct. 2, 2012, 2:44 p.m. OK FPC TESTS 39 31 102400 2000
45401693 linhlrx D Nov. 7, 2018, 8:55 a.m. OK FPC TESTS 39 31 204800 2000
2424604 waterkid D Oct. 25, 2012, 8:44 a.m. OK FPC TESTS 39 31 204800 2000
2441559 waterkid D Oct. 27, 2012, 8:41 a.m. OK FPC TESTS 39 31 32051200 2000
2423602 wxyz1234 D Oct. 25, 2012, 2:13 a.m. OK FPC TESTS 39 46 102400 2000
11175933 vjudge4 D May 20, 2015, 9:55 a.m. OK FPC TESTS 39 46 204800 2000
5448970 vuonghy2442 D Dec. 16, 2013, 8:18 a.m. OK FPC TESTS 39 62 102400 2000
42296308 chaorenhaha D Aug. 31, 2018, 3:29 a.m. OK FPC TESTS 39 62 307200 2000
20261087 reachkritz D Aug. 29, 2016, 5:55 p.m. OK GNU C TESTS 39 31 307200 2000
7168226 vis10326 D July 19, 2014, 2:13 p.m. OK GNU C TESTS 39 46 102400 2000
2307253 dante_devil D Oct. 6, 2012, 1:33 p.m. OK GNU C TESTS 39 46 102400 2000
2977910 hariprasath D Jan. 21, 2013, 11:15 a.m. OK GNU C TESTS 39 171 100454400 2000
2383421 liyuqiao D Oct. 18, 2012, 12:08 p.m. OK GNU C TESTS 39 171 100454400 2000
19443931 vjudge3 D July 27, 2016, 2:25 p.m. OK GNU C++ TESTS 39 15 0 2000
14125641 130705009 D Nov. 7, 2015, 2:23 p.m. OK GNU C++ TESTS 39 15 0 2000
12382061 vjudge2 D Aug. 6, 2015, 5:02 a.m. OK GNU C++ TESTS 39 15 0 2000
11177153 vjudge5 D May 20, 2015, 12:02 p.m. OK GNU C++ TESTS 39 15 0 2000
11176395 vjudge3 D May 20, 2015, 10:42 a.m. OK GNU C++ TESTS 39 15 0 2000
7933651 Altria-PenDragon D Sept. 24, 2014, 7:36 a.m. OK GNU C++ TESTS 39 15 0 2000
7732408 nimohunter D Sept. 10, 2014, 4:56 a.m. OK GNU C++ TESTS 39 15 0 2000
7438143 vjudge4 D Aug. 13, 2014, 1:49 a.m. OK GNU C++ TESTS 39 15 0 2000
4124524 YogyKwan D July 20, 2013, 10:26 p.m. OK GNU C++ TESTS 39 15 0 2000
4076610 JoaoM10 D July 15, 2013, 4:12 p.m. OK GNU C++ TESTS 39 15 0 2000
10307880 tapan0007 D March 17, 2015, 7:51 a.m. OK GNU C++0x TESTS 39 15 102400 2000
7041803 numbers D July 7, 2014, 3:21 p.m. OK GNU C++0x TESTS 39 15 102400 2000
2936702 lonelyboy D Jan. 16, 2013, 2:40 p.m. OK GNU C++0x TESTS 39 15 512000 2000
2926142 lonelyboy D Jan. 15, 2013, 6:05 a.m. OK GNU C++0x TESTS 39 15 512000 2000
6615605 FancyCoder D May 14, 2014, 1:59 p.m. OK GNU C++0x TESTS 39 30 102400 2000
2282414 Zlobober D Oct. 1, 2012, 4:43 p.m. OK GNU C++0x TESTS 39 31 0 2000
10154654 thesilione D March 4, 2015, 10:50 p.m. OK GNU C++0x TESTS 39 31 102400 2000
2306897 dc. D Oct. 6, 2012, 12:41 p.m. OK GNU C++0x TESTS 39 31 102400 2000
2289339 FatSheep D Oct. 2, 2012, 4:32 a.m. OK GNU C++0x TESTS 39 31 102400 2000
2284974 savinov D Oct. 1, 2012, 5:21 p.m. OK GNU C++0x TESTS 39 31 102400 2000
58869566 rainboy D Aug. 15, 2019, 2:47 p.m. OK GNU C11 TESTS 39 140 100249600 2000
27269030 2360 D May 21, 2017, 2:31 p.m. OK GNU C++11 TESTS 39 15 102400 2000
14511070 strawbreey D Nov. 27, 2015, 12:37 p.m. OK GNU C++11 TESTS 39 15 102400 2000
12821040 PlayfulPanda D Sept. 2, 2015, 9:25 p.m. OK GNU C++11 TESTS 39 15 102400 2000
12274403 TC_goshawk D July 30, 2015, 10:58 a.m. OK GNU C++11 TESTS 39 15 102400 2000
12234689 zainan D July 27, 2015, 4:32 a.m. OK GNU C++11 TESTS 39 15 102400 2000
30004277 Icewk D Sept. 2, 2017, 8:48 a.m. OK GNU C++11 TESTS 39 15 102400 2000
30009552 Icewk D Sept. 2, 2017, 9:39 a.m. OK GNU C++11 TESTS 39 15 1228800 2000
32574351 N3SL D Nov. 23, 2017, 12:05 p.m. OK GNU C++11 TESTS 39 15 1228800 2000
17122173 freebsdx D April 2, 2016, 3:39 a.m. OK GNU C++11 TESTS 39 15 2048000 2000
29361544 I_love_Captain_America D Aug. 11, 2017, 6:40 p.m. OK GNU C++11 TESTS 39 15 2150400 2000
21646971 frabbi-sw D Oct. 21, 2016, 4:25 p.m. OK GNU C++14 TESTS 39 15 102400 2000
21237781 Motarack D Oct. 6, 2016, 2:36 p.m. OK GNU C++14 TESTS 39 15 102400 2000
30124169 lukomskiy D Sept. 6, 2017, 6:29 a.m. OK GNU C++14 TESTS 39 15 102400 2000
32557434 MohammadRezaBateni D Nov. 22, 2017, 5:05 p.m. OK GNU C++14 TESTS 39 15 204800 2000
34980052 vjudge2 D Feb. 6, 2018, 6:42 p.m. OK GNU C++14 TESTS 39 15 1945600 2000
34980012 a.j.decoder D Feb. 6, 2018, 6:40 p.m. OK GNU C++14 TESTS 39 15 1945600 2000
33827947 nk_xyz D Dec. 31, 2017, 8:53 a.m. OK GNU C++14 TESTS 39 15 1945600 2000
35603106 kuppu D Feb. 23, 2018, 4:37 p.m. OK GNU C++14 TESTS 39 15 1945600 2000
28954746 Jubair_2147483647 D July 28, 2017, 1:16 p.m. OK GNU C++14 TESTS 39 15 1945600 2000
29223241 mochow D Aug. 5, 2017, 4:27 p.m. OK GNU C++14 TESTS 39 15 1945600 2000
64191624 Leks360 D Nov. 4, 2019, 7:58 a.m. OK GNU C++17 TESTS 39 30 0 2000
60348478 PandaIsTheBest D Sept. 10, 2019, 1:26 p.m. OK GNU C++17 TESTS 39 30 102400 2000
68400368 Phortox D Jan. 8, 2020, 12:56 p.m. OK GNU C++17 TESTS 39 30 102400 2000
38085686 RobeZH D May 10, 2018, 5:49 a.m. OK GNU C++17 TESTS 39 30 3481600 2000
60348581 PandaIsTheBest D Sept. 10, 2019, 1:28 p.m. OK GNU C++17 TESTS 39 31 102400 2000
60332344 MsICb D Sept. 10, 2019, 6:44 a.m. OK GNU C++17 TESTS 39 31 102400 2000
68445388 srikanth.nettikanti D Jan. 9, 2020, 12:30 p.m. OK GNU C++17 TESTS 39 31 102400 2000
60287024 sxweetlollipop2912 D Sept. 9, 2019, 3:35 a.m. OK GNU C++17 TESTS 39 31 102400 2000
50397372 ruo D Feb. 23, 2019, 4:32 p.m. OK GNU C++17 TESTS 39 31 102400 2000
60328458 MalLee0403 D Sept. 10, 2019, 3:59 a.m. OK GNU C++17 TESTS 39 31 102400 2000
2405567 kost D Oct. 21, 2012, 6:14 p.m. OK Haskell TESTS 39 62 2150400 2000
65466028 its_aks_ulure D Nov. 21, 2019, 5:57 a.m. OK Java 11 TESTS 39 1232 260403200 2000
2300643 mashinist D Oct. 4, 2012, 8:11 p.m. OK Java 6 TESTS 39 93 0 2000
2286971 danbanica D Oct. 1, 2012, 7:17 p.m. OK Java 6 TESTS 39 125 102400 2000
2806718 lxgsbqylbk D Dec. 22, 2012, 12:36 p.m. OK Java 6 TESTS 39 140 2457600 2000
2391575 Kornacker D Oct. 20, 2012, 7:03 p.m. OK Java 6 TESTS 39 171 0 2000
7237716 vjudge5 D July 25, 2014, 4:10 a.m. OK Java 6 TESTS 39 186 102400 2000
2329164 santjuan D Oct. 9, 2012, 3:59 p.m. OK Java 6 TESTS 39 562 142336000 2000
2281170 ivan.popelyshev D Oct. 1, 2012, 4:28 p.m. OK Java 6 TESTS 39 625 135680000 2000
2583102 pschuprikov D Nov. 18, 2012, 12:07 a.m. OK Java 6 TESTS 39 718 139366400 2000
2297956 zjut_DD D Oct. 4, 2012, 6:30 a.m. OK Java 6 TESTS 39 734 144179200 2000
2280399 uwi D Oct. 1, 2012, 4:21 p.m. OK Java 6 TESTS 39 937 131993600 2000
2299875 THE_QUEEN_IN_THE_NORTH D Oct. 4, 2012, 3:48 p.m. OK Java 7 TESTS 39 140 102400 2000
4477635 hama-du D Sept. 15, 2013, 1:17 p.m. OK Java 7 TESTS 39 342 102400 2000
10016251 emo D Feb. 25, 2015, 8:15 a.m. OK Java 7 TESTS 39 451 141721600 2000
3266899 PlayLikeNeverB4 D March 8, 2013, 5:27 p.m. OK Java 7 TESTS 39 562 139264000 2000
2289047 nitegazer D Oct. 2, 2012, 3:27 a.m. OK Java 7 TESTS 39 859 142131200 2000
2300391 LovelyPenguin D Oct. 4, 2012, 6:24 p.m. OK Java 7 TESTS 39 1656 142848000 2000
2299723 qwerty787788 D Oct. 4, 2012, 3:10 p.m. OK Java 7 TESTS 39 1671 142848000 2000
50890053 hongquanntct D March 6, 2019, 12:52 p.m. OK Java 8 TESTS 39 109 0 2000
46630713 I_love_Harpae D Dec. 5, 2018, 2:46 a.m. OK Java 8 TESTS 39 140 0 2000
12631858 alibaba D Aug. 21, 2015, 5:44 p.m. OK Java 8 TESTS 39 311 0 2000
53282403 barakraganosungam D April 25, 2019, 12:31 p.m. OK Java 8 TESTS 39 358 154931200 2000
58869570 Dukkha D Aug. 15, 2019, 2:48 p.m. OK Java 8 TESTS 39 405 146432000 2000
26231739 molikto D April 9, 2017, 7:22 a.m. OK Java 8 TESTS 39 514 98816000 2000
11957443 santa_calus D July 7, 2015, 8:15 a.m. OK Java 8 TESTS 39 529 127692800 2000
56553980 Ahmed_Diab D July 5, 2019, 11:26 a.m. OK Java 8 TESTS 39 748 142540800 2000
47893985 Ahmad D Jan. 4, 2019, 8:57 a.m. OK Java 8 TESTS 39 1029 143667200 2000
8890001 IgorKoval D Nov. 29, 2014, 12:06 p.m. OK Java 8 TESTS 39 1107 210022400 2000
6968959 evilkrauzer D June 27, 2014, 10:28 a.m. OK Mono C# TESTS 39 77 512000 2000
2291547 mylifefordota D Oct. 2, 2012, 11:50 a.m. OK Mono C# TESTS 39 1125 103116800 2000
2864222 -DMYTRO- D Jan. 1, 2013, 4:13 p.m. OK MS C++ TESTS 39 15 2048000 2000
48698111 vjudge5 D Jan. 22, 2019, 12:48 a.m. OK MS C++ TESTS 39 30 102400 2000
48673764 vjudge5 D Jan. 21, 2019, 11:04 a.m. OK MS C++ TESTS 39 30 102400 2000
48698091 vjudge4 D Jan. 22, 2019, 12:47 a.m. OK MS C++ TESTS 39 31 102400 2000
57506276 echr D July 22, 2019, 12:09 p.m. OK MS C++ TESTS 39 31 102400 2000
48770722 vjudge2 D Jan. 22, 2019, 11:33 p.m. OK MS C++ TESTS 39 31 102400 2000
48698577 vjudge1 D Jan. 22, 2019, 1:11 a.m. OK MS C++ TESTS 39 31 102400 2000
48698354 vjudge1 D Jan. 22, 2019, 1:01 a.m. OK MS C++ TESTS 39 31 102400 2000
48698353 vjudge3 D Jan. 22, 2019, 1 a.m. OK MS C++ TESTS 39 31 102400 2000
48697798 vjudge4 D Jan. 22, 2019, 12:27 a.m. OK MS C++ TESTS 39 31 102400 2000
3955917 kachayev D June 24, 2013, 2:21 p.m. OK Python 2 TESTS 39 93 409600 2000
2865736 nealzane D Jan. 2, 2013, 8:26 a.m. OK Python 2 TESTS 39 109 409600 2000
35848995 ______u______ D March 2, 2018, 5:07 p.m. OK Python 2 TESTS 39 109 4915200 2000
35848876 ______n______ D March 2, 2018, 5:06 p.m. OK Python 2 TESTS 39 109 4915200 2000
35848593 _____i_____ D March 2, 2018, 5:01 p.m. OK Python 2 TESTS 39 109 4915200 2000
35848533 _____k_____ D March 2, 2018, 5:01 p.m. OK Python 2 TESTS 39 109 4915200 2000
35841859 ______h______ D March 2, 2018, 2:43 p.m. OK Python 2 TESTS 39 109 4915200 2000
35841764 ______k______ D March 2, 2018, 2:42 p.m. OK Python 2 TESTS 39 109 4915200 2000
35841493 ______i______ D March 2, 2018, 2:37 p.m. OK Python 2 TESTS 39 109 4915200 2000
35838582 ______M______ D March 2, 2018, 1:35 p.m. OK Python 2 TESTS 39 109 4915200 2000

remove filters

Back to search problems