Codeforces Round 336 (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
607 Codeforces Round 336 (Div. 1) FINISHED False 7200 286723503 Dec. 23, 2015, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12762 ) B Zuma PROGRAMMING dp 2000

B'Genos recently installed the game Zuma on his phone. In Zuma there exists a line of n gemstones, the i-th of which has color ci. The goal of the game is to destroy all the gemstones in the line as quickly as possible. In one second, Genos is able to choose exactly one continuous substring of colored gemstones that is a palindrome and remove it from the line. After the substring is removed, the remaining gemstones shift to form a solid line again. What is the minimum number of seconds needed to destroy the entire line? Let us remind, that the string (or substring) is called palindrome, if it reads same backwards or forward. In our case this means the color of the first gemstone is equal to the color of the last one, the color of the second gemstone is equal to the color of the next to last and so on. The first line of input contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500) -- the number of gemstones. The second line contains n space-separated integers, the i-th of which is ci (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the color of the i-th gemstone in a line. Print a single integer -- the minimum number of seconds needed to destroy the entire line. In the first sample, Genos can destroy the entire line in one second. In the second sample, Genos can only destroy one gemstone at a time, so destroying three gemstones takes three seconds. In the third sample, to achieve the optimal time of two seconds, destroy palindrome 4 4 first and then destroy palindrome 1 2 3 2 1.'...

Tutorials

Codeforces Round #336 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
51120015 shenqihao B March 10, 2019, 8:48 a.m. OK Clang++17 Diagnostics TESTS 103 904 1228800 2000
14947414 Gassa B Dec. 23, 2015, 5:08 p.m. OK D TESTS 103 373 4198400 2000
41073304 cpy B Aug. 1, 2018, 5:58 a.m. OK D TESTS 103 748 12083200 2000
41076332 cpy B Aug. 1, 2018, 8:31 a.m. OK D TESTS 103 764 12083200 2000
15092091 dohonghuan B Dec. 30, 2015, 3:40 a.m. OK FPC TESTS 103 77 1126400 2000
15080891 luckystars B Dec. 29, 2015, 7:28 a.m. OK FPC TESTS 103 77 1126400 2000
15092059 darkwind52 B Dec. 30, 2015, 3:31 a.m. OK FPC TESTS 103 77 1126400 2000
42295539 chaorenhaha B Aug. 31, 2018, 2:41 a.m. OK FPC TESTS 103 78 1024000 2000
15085875 ligerre B Dec. 29, 2015, 2:14 p.m. OK FPC TESTS 103 78 1126400 2000
15092169 Thranda B Dec. 30, 2015, 3:58 a.m. OK FPC TESTS 103 93 1126400 2000
14993109 gamo B Dec. 24, 2015, 5:37 p.m. OK FPC TESTS 103 93 1126400 2000
15084162 Kleaschev_Maksim B Dec. 29, 2015, 11:59 a.m. OK FPC TESTS 103 108 4505600 2000
42138570 chaorenhaha B Aug. 27, 2018, 2:43 a.m. OK FPC TESTS 103 109 1024000 2000
26182095 GreymaneSilverfang B April 7, 2017, 1:07 a.m. OK FPC TESTS 103 109 2662400 2000
16200171 vasic B Feb. 19, 2016, 12:44 p.m. OK GNU C TESTS 103 46 1024000 2000
16200110 vasic B Feb. 19, 2016, 12:42 p.m. OK GNU C TESTS 103 46 1024000 2000
15980435 vasic B Feb. 13, 2016, 1:32 a.m. OK GNU C TESTS 103 46 1024000 2000
15980433 vasic B Feb. 13, 2016, 1:32 a.m. OK GNU C TESTS 103 46 1024000 2000
15980374 vasic B Feb. 13, 2016, 1:20 a.m. OK GNU C TESTS 103 46 1024000 2000
15974795 vasic B Feb. 12, 2016, 4:55 p.m. OK GNU C TESTS 103 46 1024000 2000
15974742 vasic B Feb. 12, 2016, 4:52 p.m. OK GNU C TESTS 103 46 1024000 2000
15974267 vasic B Feb. 12, 2016, 4:24 p.m. OK GNU C TESTS 103 46 1024000 2000
15428176 scorcher B Jan. 18, 2016, 2:13 p.m. OK GNU C TESTS 103 46 1024000 2000
17142699 hrazvan B April 3, 2016, 9:06 a.m. OK GNU C TESTS 103 46 3072000 2000
15761249 RNS_JKS B Feb. 3, 2016, 2:57 a.m. OK GNU C++ TESTS 103 31 819200 2000
14963793 gyz_gyz B Dec. 24, 2015, 4:57 a.m. OK GNU C++ TESTS 103 31 819200 2000
14945718 gs12117 B Dec. 23, 2015, 4:58 p.m. OK GNU C++ TESTS 103 31 819200 2000
14949583 zas409257934 B Dec. 23, 2015, 5:22 p.m. OK GNU C++ TESTS 103 31 1024000 2000
33958679 zhuky.RLG B Jan. 6, 2018, 8:08 a.m. OK GNU C++ TESTS 103 31 3072000 2000
28988135 vjudge1 B July 30, 2017, 10:24 a.m. OK GNU C++ TESTS 103 31 3379200 2000
28987039 vjudge2 B July 30, 2017, 9:15 a.m. OK GNU C++ TESTS 103 31 3379200 2000
14951819 naagi B Dec. 23, 2015, 5:40 p.m. OK GNU C++ TESTS 103 31 5939200 2000
38415552 vjudge4 B May 19, 2018, 3:24 a.m. OK GNU C++ TESTS 103 46 819200 2000
31806236 oscarcode B Oct. 27, 2017, 3:04 p.m. OK GNU C++ TESTS 103 46 819200 2000
57114729 rainboy B July 15, 2019, 7:19 p.m. OK GNU C11 TESTS 103 46 1024000 2000
37499596 kolic B April 20, 2018, 11:23 p.m. OK GNU C11 TESTS 103 46 4608000 2000
19293098 jose.ortega1401 B July 21, 2016, 4:58 a.m. OK GNU C11 TESTS 103 61 1024000 2000
37445613 pakili B April 18, 2018, 6:35 p.m. OK GNU C11 TESTS 103 61 4403200 2000
19376503 rawat B July 24, 2016, 5:17 a.m. OK GNU C11 TESTS 103 140 1126400 2000
14948065 f.bialas B Dec. 23, 2015, 5:12 p.m. OK GNU C++11 TESTS 103 31 819200 2000
14944962 geniucos B Dec. 23, 2015, 4:54 p.m. OK GNU C++11 TESTS 103 31 819200 2000
14945507 ExfJoe B Dec. 23, 2015, 4:57 p.m. OK GNU C++11 TESTS 103 31 1024000 2000
14951961 Neddlh B Dec. 23, 2015, 5:41 p.m. OK GNU C++11 TESTS 103 31 1228800 2000
14949240 agul B Dec. 23, 2015, 5:20 p.m. OK GNU C++11 TESTS 103 31 1740800 2000
27984702 RNS B June 23, 2017, 12:23 p.m. OK GNU C++11 TESTS 103 31 3174400 2000
56229840 Prof_BL B June 28, 2019, 1:52 p.m. OK GNU C++11 TESTS 103 46 512000 2000
53653879 vjudge4 B May 2, 2019, 3:19 a.m. OK GNU C++11 TESTS 103 46 819200 2000
57139537 luogu_bot5 B July 16, 2019, 10:24 a.m. OK GNU C++11 TESTS 103 46 819200 2000
58498792 TianZuiXing B Aug. 9, 2019, 1:20 p.m. OK GNU C++11 TESTS 103 46 819200 2000
60026775 zyxw B Sept. 4, 2019, 2:21 p.m. OK GNU C++14 TESTS 103 46 1024000 2000
67269459 armin.atarod B Dec. 20, 2019, 7:33 a.m. OK GNU C++14 TESTS 103 46 1024000 2000
63729904 d_i_m_a B Oct. 29, 2019, 1:44 p.m. OK GNU C++14 TESTS 103 46 1024000 2000
62111364 Cruiying B Oct. 8, 2019, 12:17 p.m. OK GNU C++14 TESTS 103 46 1024000 2000
60542802 NinjaDragon B Sept. 14, 2019, 1:31 p.m. OK GNU C++14 TESTS 103 46 1024000 2000
60340303 VirtualApple B Sept. 10, 2019, 10:30 a.m. OK GNU C++14 TESTS 103 46 1024000 2000
58500115 TianPingXing B Aug. 9, 2019, 1:53 p.m. OK GNU C++14 TESTS 103 46 1024000 2000
58483362 TianSunXing B Aug. 9, 2019, 6:38 a.m. OK GNU C++14 TESTS 103 46 1024000 2000
58482804 TianZuiXing B Aug. 9, 2019, 6:24 a.m. OK GNU C++14 TESTS 103 46 1024000 2000
58481131 TianSunXing B Aug. 9, 2019, 5:36 a.m. OK GNU C++14 TESTS 103 46 1024000 2000
67523130 nikita.shevchenko B Dec. 24, 2019, 1:04 p.m. OK GNU C++17 TESTS 103 46 1024000 2000
66809078 jhzjk B Dec. 14, 2019, 12:32 a.m. OK GNU C++17 TESTS 103 46 1024000 2000
66809066 Zhou_JK B Dec. 14, 2019, 12:31 a.m. OK GNU C++17 TESTS 103 46 1024000 2000
66541868 behradmollaee B Dec. 9, 2019, 11:49 a.m. OK GNU C++17 TESTS 103 46 1024000 2000
64195301 newvar B Nov. 4, 2019, 9:26 a.m. OK GNU C++17 TESTS 103 46 1024000 2000
68613824 Mastre B Jan. 11, 2020, 4:43 p.m. OK GNU C++17 TESTS 103 46 1024000 2000
68648685 sm1ley B Jan. 12, 2020, 9:59 a.m. OK GNU C++17 TESTS 103 46 1024000 2000
68773321 Alchemist0 B Jan. 14, 2020, 12:37 p.m. OK GNU C++17 TESTS 103 46 1024000 2000
69966216 vjudge4 B Feb. 1, 2020, 12:46 p.m. OK GNU C++17 TESTS 103 46 1024000 2000
69970400 vjudge2 B Feb. 1, 2020, 1:42 p.m. OK GNU C++17 TESTS 103 46 1024000 2000
53006521 opqq B April 19, 2019, 9:51 a.m. OK Go TESTS 103 93 0 2000
37922584 vjudge1 B May 6, 2018, 7:53 a.m. OK Go TESTS 103 218 25497600 2000
37922558 1lann B May 6, 2018, 7:51 a.m. OK Go TESTS 103 218 25497600 2000
23516730 togatoga B Jan. 3, 2017, 1 p.m. OK Go TESTS 103 249 24166400 2000
69094729 jst_forfun B Jan. 19, 2020, 11:36 a.m. OK Java 11 TESTS 103 295 0 2000
14946694 pashka B Dec. 23, 2015, 5:03 p.m. OK Java 7 TESTS 103 171 0 2000
15261565 NeSumHaker B Jan. 8, 2016, 10:52 p.m. OK Java 7 TESTS 103 186 0 2000
18755955 daiict B June 27, 2016, 5:21 p.m. OK Java 7 TESTS 103 202 0 2000
14950599 anton.bannykh B Dec. 23, 2015, 5:30 p.m. OK Java 7 TESTS 103 202 0 2000
14946133 fromWork B Dec. 23, 2015, 5 p.m. OK Java 7 TESTS 103 202 0 2000
18595550 harshitbhut14 B June 19, 2016, 10:09 a.m. OK Java 7 TESTS 103 217 0 2000
16546959 niting112 B March 6, 2016, 7:13 a.m. OK Java 7 TESTS 103 217 0 2000
17328589 Nirmit B April 15, 2016, 2:53 p.m. OK Java 7 TESTS 103 218 0 2000
15962849 lucasr B Feb. 11, 2016, 7:24 p.m. OK Java 7 TESTS 103 218 0 2000
15134851 squee_spoon B Dec. 31, 2015, 9:33 a.m. OK Java 7 TESTS 103 218 0 2000
14951974 jopiko123 B Dec. 23, 2015, 5:41 p.m. OK Java 8 TESTS 103 156 0 2000
14948711 lal B Dec. 23, 2015, 5:16 p.m. OK Java 8 TESTS 103 171 0 2000
14942927 niyaznigmatul B Dec. 23, 2015, 4:44 p.m. OK Java 8 TESTS 103 171 0 2000
49269987 introibo B Jan. 31, 2019, 2:03 p.m. OK Java 8 TESTS 103 171 20889600 2000
49269634 introibo B Jan. 31, 2019, 2:01 p.m. OK Java 8 TESTS 103 171 20889600 2000
49827019 Celesta B Feb. 12, 2019, 12:10 p.m. OK Java 8 TESTS 103 186 0 2000
14950937 nmakarov B Dec. 23, 2015, 5:32 p.m. OK Java 8 TESTS 103 186 0 2000
61744406 armking B Oct. 2, 2019, 10:37 p.m. OK Java 8 TESTS 103 187 0 2000
57114728 Dukkha B July 15, 2019, 7:19 p.m. OK Java 8 TESTS 103 187 0 2000
47344837 xodiac B Dec. 21, 2018, 7:10 p.m. OK Java 8 TESTS 103 187 0 2000
16872917 Kero B March 22, 2016, 3:02 p.m. OK JavaScript TESTS 103 358 17817600 2000
65504905 gkochakidze B Nov. 21, 2019, 9:26 p.m. OK Mono C# TESTS 103 171 4608000 2000
14958318 og.kostya B Dec. 23, 2015, 7:03 p.m. OK MS C# TESTS 103 93 1126400 2000
21636355 bohak.adi B Oct. 21, 2016, 8:24 a.m. OK MS C# TESTS 103 140 1024000 2000
32082213 Phortox B Nov. 5, 2017, 7:07 p.m. OK MS C# TESTS 103 140 1024000 2000
14949012 camypaper B Dec. 23, 2015, 5:18 p.m. OK MS C# TESTS 103 233 1126400 2000
14949427 azukun B Dec. 23, 2015, 5:21 p.m. OK MS C# TESTS 103 655 6451200 2000
15001136 zy1997 B Dec. 25, 2015, 10:29 a.m. OK MS C++ TESTS 103 31 1024000 2000
56706513 vjudge2 B July 8, 2019, 11:15 a.m. OK MS C++ TESTS 103 46 1024000 2000
15160340 _phoenixFierce B Jan. 2, 2016, 4:08 p.m. OK MS C++ TESTS 103 46 1024000 2000
15000173 zy1997 B Dec. 25, 2015, 9:16 a.m. OK MS C++ TESTS 103 46 1024000 2000
14975614 TillEnd B Dec. 24, 2015, 3:49 p.m. OK MS C++ TESTS 103 46 1024000 2000
14964990 LLI_E_P_JI_O_K B Dec. 24, 2015, 6:44 a.m. OK MS C++ TESTS 103 46 1024000 2000
56750061 vjudge5 B July 9, 2019, 11:32 a.m. OK MS C++ TESTS 103 46 1024000 2000
14945077 AGrigorii B Dec. 23, 2015, 4:54 p.m. OK MS C++ TESTS 103 46 1024000 2000
14947486 miagkov B Dec. 23, 2015, 5:08 p.m. OK MS C++ TESTS 103 46 1126400 2000
14955206 AnnKats93 B Dec. 23, 2015, 6:11 p.m. OK MS C++ TESTS 103 46 1126400 2000
58481347 TianJianXing B Aug. 9, 2019, 5:43 a.m. OK MS C++ 2017 TESTS 103 46 1228800 2000
58487884 TianSunXing B Aug. 9, 2019, 8:24 a.m. OK MS C++ 2017 TESTS 103 93 1024000 2000
53996787 Timonnable B May 11, 2019, 3:01 p.m. OK MS C++ 2017 TESTS 103 93 1228800 2000
50899420 kubsu B March 6, 2019, 4:41 p.m. OK MS C++ 2017 TESTS 103 108 1126400 2000
59945407 CtrlAlt B Sept. 3, 2019, 12:50 p.m. OK MS C++ 2017 TESTS 103 202 2150400 2000
15076524 Ljubitel B Dec. 28, 2015, 7:29 p.m. OK PyPy 2 TESTS 103 404 5017600 2000
15460039 orailly B Jan. 20, 2016, 11:16 p.m. OK PyPy 2 TESTS 103 436 3481600 2000
49265794 introibo B Jan. 31, 2019, 1:40 p.m. OK PyPy 2 TESTS 103 763 26009600 2000
15459931 orailly B Jan. 20, 2016, 10:50 p.m. OK PyPy 3 TESTS 103 467 4505600 2000
15460160 orailly B Jan. 20, 2016, 11:46 p.m. OK PyPy 3 TESTS 103 514 4915200 2000
15277776 wisest B Jan. 10, 2016, 8:33 a.m. OK PyPy 3 TESTS 103 514 6246400 2000
35895973 _____k_____ B March 3, 2018, 4:58 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
35895385 ______n______ B March 3, 2018, 4:42 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
35895300 ______u______ B March 3, 2018, 4:41 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
35895132 _____i_____ B March 3, 2018, 4:36 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
35893270 ______i______ B March 3, 2018, 3:47 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
35886996 ______h______ B March 3, 2018, 1:57 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
35886392 ______k______ B March 3, 2018, 1:45 p.m. OK PyPy 3 TESTS 103 764 22425600 2000
16059450 RoundheadOFF B Feb. 16, 2016, 4:55 p.m. OK Scala TESTS 103 623 0 2000

remove filters

Back to search problems