Codeforces Round 256 (Div. 2)

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
448 Codeforces Round 256 (Div. 2) FINISHED False 7200 332006404 July 17, 2014, 2 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8409 ) C Painting Fence PROGRAMMING divide and conquer dp greedy 1900

B"Bizon the Champion isn't just attentive, he also is very hardworking. Bizon the Champion decided to paint his old fence his favorite color, orange. The fence is represented as n vertical planks, put in a row. Adjacent planks have no gap between them. The planks are numbered from the left to the right starting from one, the i-th plank has the width of 1 meter and the height of ai meters. Bizon the Champion bought a brush in the shop, the brush's width is 1 meter. He can make vertical and horizontal strokes with the brush. During a stroke the brush's full surface must touch the fence at all the time (see the samples for the better understanding). What minimum number of strokes should Bizon the Champion do to fully paint the fence? Note that you are allowed to paint the same area of the fence multiple times. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895000) -- the number of fence planks. The second line contains n space-separated integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Print a single integer -- the minimum number of strokes needed to paint the whole fence. In the first sample you need to paint the fence in three strokes with the brush: the first stroke goes on height 1 horizontally along all the planks. The second stroke goes on height 2 horizontally and paints the first and second planks and the third stroke (it can be horizontal and vertical) finishes painting the fourth plank. In the second sample you can paint the fence with two strokes, either two horizontal or two vertical strokes. In the third sample there is only one plank that can be painted using a single vertical stroke."...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
40187901 stdoo C July 11, 2018, 3:40 a.m. OK Clang++17 Diagnostics TESTS 50 265 1638400 1900
40185680 stdoo C July 11, 2018, 1:20 a.m. OK Clang++17 Diagnostics TESTS 50 295 1433600 1900
42295343 boneinegg C Aug. 31, 2018, 2:30 a.m. OK Clang++17 Diagnostics TESTS 50 529 1433600 1900
41584003 chaorenhaha C Aug. 14, 2018, 9:48 a.m. OK FPC TESTS 50 31 614400 1900
26125588 Sanja C April 4, 2017, 3:36 p.m. OK FPC TESTS 50 31 1740800 1900
52808929 chaorenhaha C April 16, 2019, 7:13 a.m. OK FPC TESTS 50 46 512000 1900
17807849 Gray_58 C May 8, 2016, 12:47 p.m. OK FPC TESTS 50 46 1945600 1900
52771371 chaorenhaha C April 15, 2019, 9:02 a.m. OK FPC TESTS 50 61 204800 1900
42969543 Liah C Sept. 17, 2018, 4:57 a.m. OK FPC TESTS 50 61 204800 1900
42969549 vjudge1 C Sept. 17, 2018, 4:57 a.m. OK FPC TESTS 50 62 204800 1900
26097135 ice_tea C April 3, 2017, 10:47 a.m. OK FPC TESTS 50 62 3686400 1900
41152831 chaorenhaha C Aug. 3, 2018, 9:57 a.m. OK FPC TESTS 50 78 201011200 1900
42883729 vjudge1 C Sept. 15, 2018, 8:33 a.m. OK FPC TESTS 50 93 204800 1900
34512831 GAlia C Jan. 24, 2018, 10:27 a.m. OK GNU C TESTS 50 15 2150400 1900
34203630 yustas C Jan. 15, 2018, 5:43 p.m. OK GNU C TESTS 50 15 2150400 1900
18361036 surjection C June 10, 2016, 3:34 p.m. OK GNU C TESTS 50 15 2252800 1900
18414816 surjection C June 13, 2016, 2:39 p.m. OK GNU C TESTS 50 15 2457600 1900
17478413 lastpoetdarkmoon C April 24, 2016, 10:14 a.m. OK GNU C TESTS 50 30 2252800 1900
18415237 surjection C June 13, 2016, 3:01 p.m. OK GNU C TESTS 50 30 2457600 1900
18415078 surjection C June 13, 2016, 2:53 p.m. OK GNU C TESTS 50 30 2662400 1900
27205216 mchmachino C May 18, 2017, 10:24 p.m. OK GNU C TESTS 50 31 204800 1900
15678560 hardiknegi C Jan. 30, 2016, 12:54 p.m. OK GNU C TESTS 50 31 307200 1900
18361127 surjection C June 10, 2016, 3:39 p.m. OK GNU C TESTS 50 31 2252800 1900
22128754 vjudge3 C Nov. 9, 2016, 11:46 a.m. OK GNU C++ TESTS 50 15 102400 1900
29805160 vjudge1 C Aug. 26, 2017, 11:31 a.m. OK GNU C++ TESTS 50 15 307200 1900
20361791 vjudge2 C Sept. 3, 2016, 12:59 p.m. OK GNU C++ TESTS 50 15 307200 1900
16199147 117208 C Feb. 19, 2016, 11:54 a.m. OK GNU C++ TESTS 50 15 307200 1900
31006405 vjudge1 C Oct. 5, 2017, 3:11 a.m. OK GNU C++ TESTS 50 15 512000 1900
20375697 zyding C Sept. 4, 2016, 6:17 a.m. OK GNU C++ TESTS 50 15 512000 1900
19183677 Phoenix C July 17, 2016, 4:10 a.m. OK GNU C++ TESTS 50 15 512000 1900
18527263 Ranjan01kr C June 16, 2016, 5:23 p.m. OK GNU C++ TESTS 50 15 512000 1900
29126532 vjudge1 C Aug. 2, 2017, 10:14 a.m. OK GNU C++ TESTS 50 15 2252800 1900
29126600 vjudge3 C Aug. 2, 2017, 10:17 a.m. OK GNU C++ TESTS 50 15 2252800 1900
29686497 vjudge5 C Aug. 22, 2017, 3:10 p.m. OK GNU C11 TESTS 50 15 307200 1900
51085833 nguyenthugiang96 C March 9, 2019, 12:59 p.m. OK GNU C11 TESTS 50 31 307200 1900
51075821 nguyenthugiang96 C March 9, 2019, 9:20 a.m. OK GNU C11 TESTS 50 31 307200 1900
50513541 hodinhtan C Feb. 26, 2019, 4:07 a.m. OK GNU C11 TESTS 50 31 307200 1900
29686754 vjudge5 C Aug. 22, 2017, 3:20 p.m. OK GNU C11 TESTS 50 31 307200 1900
51123848 nguyenthugiang96 C March 10, 2019, 10:40 a.m. OK GNU C11 TESTS 50 31 307200 1900
57947111 rainboy C July 29, 2019, 2:47 p.m. OK GNU C11 TESTS 50 31 409600 1900
59426271 tsyba.y.a C Aug. 25, 2019, 2:46 a.m. OK GNU C11 TESTS 50 31 614400 1900
65908649 luogu_bot1 C Nov. 28, 2019, 12:02 p.m. OK GNU C11 TESTS 50 46 307200 1900
34508050 hjn C Jan. 24, 2018, 7:46 a.m. OK GNU C11 TESTS 50 46 2252800 1900
30018992 igneel C Sept. 2, 2017, 6:46 p.m. OK GNU C++11 TESTS 50 15 102400 1900
21120104 ulna C Oct. 2, 2016, 4:32 p.m. OK GNU C++11 TESTS 50 15 307200 1900
21969352 garynja C Nov. 1, 2016, 1:53 p.m. OK GNU C++11 TESTS 50 15 307200 1900
20754940 voxel C Sept. 19, 2016, 12:30 p.m. OK GNU C++11 TESTS 50 15 307200 1900
31008263 dakuhosu C Oct. 5, 2017, 5:21 a.m. OK GNU C++11 TESTS 50 15 409600 1900
31008155 darkknight896 C Oct. 5, 2017, 5:15 a.m. OK GNU C++11 TESTS 50 15 409600 1900
31006369 dsl2002 C Oct. 5, 2017, 3:08 a.m. OK GNU C++11 TESTS 50 15 512000 1900
30306897 narci6ix C Sept. 13, 2017, 12:34 p.m. OK GNU C++11 TESTS 50 15 614400 1900
20289310 Light C Aug. 30, 2016, 8:17 p.m. OK GNU C++11 TESTS 50 15 921600 1900
31161067 Ali.Nili.Zas C Oct. 9, 2017, 7:08 a.m. OK GNU C++11 TESTS 50 15 921600 1900
32110236 lovelynihilism C Nov. 7, 2017, 5:21 a.m. OK GNU C++14 TESTS 50 15 307200 1900
32068975 S031402233 C Nov. 5, 2017, 6:16 a.m. OK GNU C++14 TESTS 50 15 307200 1900
31281302 darkkcyan C Oct. 13, 2017, 5:30 p.m. OK GNU C++14 TESTS 50 15 307200 1900
30912508 boatt C Oct. 1, 2017, 3:17 p.m. OK GNU C++14 TESTS 50 15 307200 1900
22208499 0w1 C Nov. 14, 2016, 2 p.m. OK GNU C++14 TESTS 50 15 307200 1900
22207496 0w1 C Nov. 14, 2016, 12:50 p.m. OK GNU C++14 TESTS 50 15 307200 1900
32101508 Sergkon C Nov. 6, 2017, 5:06 p.m. OK GNU C++14 TESTS 50 15 307200 1900
27788301 Absur_Siam C June 15, 2017, 7:19 a.m. OK GNU C++14 TESTS 50 15 512000 1900
27788453 Absur_Siam C June 15, 2017, 7:28 a.m. OK GNU C++14 TESTS 50 15 512000 1900
32110215 lovelynihilism C Nov. 7, 2017, 5:19 a.m. OK GNU C++14 TESTS 50 15 614400 1900
60453063 dannmmaster C Sept. 12, 2019, 4:44 p.m. OK GNU C++17 TESTS 50 15 3993600 1900
66787002 Leonardo_Blanger C Dec. 13, 2019, 2 p.m. OK GNU C++17 TESTS 50 30 307200 1900
55823858 mlyean C June 20, 2019, 9:51 a.m. OK GNU C++17 TESTS 50 30 819200 1900
61926967 anakib1 C Oct. 5, 2019, 2:57 p.m. OK GNU C++17 TESTS 50 30 819200 1900
38827979 kidjerret C June 1, 2018, 12:32 p.m. OK GNU C++17 TESTS 50 30 3686400 1900
56719394 ILgeRiT C July 8, 2019, 4:02 p.m. OK GNU C++17 TESTS 50 31 0 1900
65537513 QuteMelon C Nov. 22, 2019, 2:43 p.m. OK GNU C++17 TESTS 50 31 204800 1900
46350926 yassin_ C Nov. 28, 2018, 9:38 p.m. OK GNU C++17 TESTS 50 31 204800 1900
58473956 vjudge4 C Aug. 9, 2019, 2:08 a.m. OK GNU C++17 TESTS 50 31 204800 1900
69642808 Kinder. C Jan. 27, 2020, 10:03 p.m. OK GNU C++17 TESTS 50 31 307200 1900
22612154 Menschenkindlein C Nov. 30, 2016, 12:17 a.m. OK Haskell TESTS 50 30 0 1900
22667629 opudalo C Dec. 3, 2016, 12:52 a.m. OK Haskell TESTS 50 217 14848000 1900
18522917 MarcoXerox C June 16, 2016, 2:50 p.m. OK Haskell TESTS 50 499 9523200 1900
27524211 karlm C June 2, 2017, 1:07 p.m. OK Haskell TESTS 50 514 16998400 1900
35872773 ______u______ C March 3, 2018, 7:16 a.m. OK Haskell TESTS 50 514 54272000 1900
35872661 ______n______ C March 3, 2018, 7:16 a.m. OK Haskell TESTS 50 514 54272000 1900
35872063 _____k_____ C March 3, 2018, 7:04 a.m. OK Haskell TESTS 50 514 54272000 1900
35872062 _____i_____ C March 3, 2018, 7:04 a.m. OK Haskell TESTS 50 514 54272000 1900
35863005 ______k______ C March 2, 2018, 10:37 p.m. OK Haskell TESTS 50 514 54272000 1900
35862988 ______h______ C March 2, 2018, 10:36 p.m. OK Haskell TESTS 50 514 54272000 1900
15965727 cjkim C Feb. 12, 2016, 2:59 a.m. OK Java 7 TESTS 50 108 0 1900
17286555 MazzForces C April 12, 2016, 7:11 a.m. OK Java 7 TESTS 50 124 0 1900
16061225 anjie C Feb. 16, 2016, 7:15 p.m. OK Java 7 TESTS 50 140 0 1900
16127892 mhankin C Feb. 17, 2016, 10:19 p.m. OK Java 7 TESTS 50 155 0 1900
18365603 gontragar C June 10, 2016, 9:37 p.m. OK Java 7 TESTS 50 171 40243200 1900
22649233 Japanspy C Dec. 1, 2016, 10:13 p.m. OK Java 8 TESTS 50 109 0 1900
58233026 _Sergey_ C Aug. 3, 2019, 5:52 p.m. OK Java 8 TESTS 50 109 0 1900
60846825 LAKOUAM_IMAD C Sept. 19, 2019, 12:48 p.m. OK Java 8 TESTS 50 124 0 1900
58961395 Washoum C Aug. 17, 2019, 3:27 p.m. OK Java 8 TESTS 50 124 0 1900
55332813 Playfair C June 9, 2019, noon OK Java 8 TESTS 50 124 0 1900
55319863 vjudge1 C June 9, 2019, 3:23 a.m. OK Java 8 TESTS 50 124 0 1900
51075344 hongquanntct C March 9, 2019, 9:11 a.m. OK Java 8 TESTS 50 124 0 1900
46619575 ankurdua15 C Dec. 4, 2018, 4:54 p.m. OK Java 8 TESTS 50 124 0 1900
67605509 adarsh000321 C Dec. 25, 2019, 1:26 p.m. OK Java 8 TESTS 50 124 0 1900
66732778 Oom C Dec. 12, 2019, 6:05 p.m. OK Java 8 TESTS 50 124 0 1900
22718768 dzharvis C Dec. 5, 2016, 7:58 p.m. OK Kotlin TESTS 50 233 1740800 1900
22720147 dzharvis C Dec. 5, 2016, 9:58 p.m. OK Kotlin TESTS 50 311 2048000 1900
68077522 mban259 C Jan. 2, 2020, 1:09 p.m. OK Mono C# TESTS 50 62 512000 1900
18811552 angella.andrea C June 29, 2016, 9:22 p.m. OK Mono C# TESTS 50 62 3276800 1900
22172383 franter C Nov. 12, 2016, 5:01 a.m. OK Mono C# TESTS 50 92 614400 1900
18360025 Jezza32 C June 10, 2016, 2:18 p.m. OK Mono C# TESTS 50 670 14848000 1900
16347267 Mem C Feb. 26, 2016, 1:24 p.m. OK MS C# TESTS 50 78 3174400 1900
22701925 liss_mouse C Dec. 4, 2016, 7:02 p.m. OK MS C# TESTS 50 124 614400 1900
20567900 sunmoyi C Sept. 13, 2016, 12:59 p.m. OK MS C++ TESTS 50 15 204800 1900
29119281 vjudge5 C Aug. 2, 2017, 6:29 a.m. OK MS C++ TESTS 50 15 2252800 1900
42944390 vjudge4 C Sept. 16, 2018, 12:23 p.m. OK MS C++ TESTS 50 30 204800 1900
29796078 vjudge2 C Aug. 26, 2017, 3:35 a.m. OK MS C++ TESTS 50 30 204800 1900
19297649 vjudge2 C July 21, 2016, 8:39 a.m. OK MS C++ TESTS 50 30 204800 1900
16324466 arkahjp C Feb. 25, 2016, 10:13 a.m. OK MS C++ TESTS 50 30 614400 1900
65934105 vjudge5 C Nov. 28, 2019, 11:55 p.m. OK MS C++ TESTS 50 31 204800 1900
65585467 vjudge1 C Nov. 23, 2019, 12:18 p.m. OK MS C++ TESTS 50 31 204800 1900
58108274 vjudge1 C Aug. 1, 2019, 5:44 a.m. OK MS C++ TESTS 50 31 204800 1900
57139324 VipThanh C July 16, 2019, 10:18 a.m. OK MS C++ TESTS 50 31 204800 1900
58143736 yorky C Aug. 1, 2019, 7:33 p.m. OK MS C++ 2017 TESTS 50 46 307200 1900
59108187 yorky C Aug. 19, 2019, 7 p.m. OK MS C++ 2017 TESTS 50 46 307200 1900
65025613 thy0602 C Nov. 15, 2019, 7:30 a.m. OK MS C++ 2017 TESTS 50 46 409600 1900
67565769 kotamanegi C Dec. 24, 2019, 7:14 p.m. OK MS C++ 2017 TESTS 50 202 289075200 1900
48331304 syzymon C Jan. 13, 2019, 2:34 p.m. OK Ocaml TESTS 50 124 204800 1900
22730194 mongooose C Dec. 6, 2016, 12:37 p.m. OK PyPy 2 TESTS 50 139 14336000 1900
22589087 alyaxey C Nov. 28, 2016, 11:56 p.m. OK PyPy 2 TESTS 50 171 14336000 1900
22721318 mariana-scorp C Dec. 6, 2016, 1:03 a.m. OK PyPy 2 TESTS 50 171 15155200 1900
22775139 andrey.la C Dec. 7, 2016, 3:52 a.m. OK PyPy 2 TESTS 50 171 56627200 1900
22720568 Kucheriava C Dec. 5, 2016, 10:52 p.m. OK PyPy 2 TESTS 50 187 34508800 1900
22679176 diunko C Dec. 3, 2016, 2:32 p.m. OK PyPy 2 TESTS 50 217 34713600 1900
50504154 Heibor C Feb. 25, 2019, 6:42 p.m. OK PyPy 2 TESTS 50 733 112537600 1900
22779720 rodio C Dec. 7, 2016, 8:09 a.m. OK PyPy 2 TESTS 50 982 136294400 1900
68399055 Firepaw C Jan. 8, 2020, 12:24 p.m. OK PyPy 3 TESTS 50 592 12083200 1900
22726046 abrikosik C Dec. 6, 2016, 8:39 a.m. OK Python 2 TESTS 50 280 15257600 1900
53089465 thuutin C April 21, 2019, 10:30 a.m. OK Python 2 TESTS 50 935 3379200 1900
31151896 yugle7 C Oct. 8, 2017, 6:15 p.m. OK Python 3 TESTS 50 124 4198400 1900
27989595 cotefon C June 23, 2017, 5:13 p.m. OK Python 3 TESTS 50 171 8499200 1900
66480398 dsa_problems C Dec. 8, 2019, 1:45 a.m. OK Python 3 TESTS 50 187 3993600 1900
42762008 Khang C Sept. 11, 2018, 11:15 a.m. OK Python 3 TESTS 50 218 3584000 1900
42135613 Mk_Python_v1 C Aug. 26, 2018, 11:26 p.m. OK Python 3 TESTS 50 248 3584000 1900
57155729 VipThanh C July 16, 2019, 4:35 p.m. OK Python 3 TESTS 50 514 1536000 1900
48894310 vyung C Jan. 24, 2019, 3:14 p.m. OK Python 3 TESTS 50 530 4198400 1900
48894325 newpie C Jan. 24, 2019, 3:15 p.m. OK Python 3 TESTS 50 545 4403200 1900
60661330 ricardor4 C Sept. 16, 2019, 5:06 a.m. OK Python 3 TESTS 50 560 4403200 1900
61081786 may12day C Sept. 22, 2019, 4:40 p.m. OK Python 3 TESTS 50 561 4198400 1900

remove filters

Back to search problems