Codeforces Round 339 (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
613 Codeforces Round 339 (Div. 1) FINISHED False 7200 284822704 Jan. 14, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1020 ) C Necklace PROGRAMMING constructive algorithms math 2800

B"Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative to the cut point between two adjacent beads, if the chain of beads remaining after this cut is a palindrome (reads the same forward and backward). Ivan has beads of n colors. He wants to make a necklace, such that it's beautiful relative to as many cuts as possible. He certainly wants to use all the beads. Help him to make the most beautiful necklace. The first line of the input contains a single number n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8926) -- the number of colors of beads. The second line contains after n positive integers ai -- the quantity of beads of i-th color. It is guaranteed that the sum of ai is at least 2 and does not exceed 100 xe2 x80 x89000. In the first line print a single number -- the maximum number of beautiful cuts that a necklace composed from given beads may have. In the second line print any example of such necklace. Each color of the beads should be represented by the corresponding lowercase English letter (starting with a). As the necklace is cyclic, print it starting from any point. In the first sample a necklace can have at most one beautiful cut. The example of such a necklace is shown on the picture. In the second sample there is only one way to compose a necklace."...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
15361700 Gassa C Jan. 14, 2016, 5:31 p.m. OK D TESTS 34 15 4198400 2800
15820661 ez_zkj C Feb. 5, 2016, 7:47 a.m. OK FPC TESTS 34 155 102400 2800
19193216 0lkeh C July 17, 2016, 4:25 p.m. OK FPC TESTS 34 171 409600 2800
16142460 AndyGoX C Feb. 18, 2016, 1:51 p.m. OK FPC TESTS 34 187 0 2800
18330346 marina_mota18 C June 8, 2016, 8:26 p.m. OK GNU C TESTS 34 30 1945600 2800
29506041 lllllllllllllllllllllll C Aug. 16, 2017, 1:10 p.m. OK GNU C++ TESTS 34 15 0 2800
27674316 Scut82 C June 8, 2017, 3:16 p.m. OK GNU C++ TESTS 34 15 0 2800
22298847 _ShadowSong C Nov. 18, 2016, 2:30 a.m. OK GNU C++ TESTS 34 15 0 2800
16690981 Css C March 13, 2016, 11:47 a.m. OK GNU C++ TESTS 34 15 0 2800
16318734 KFDong C Feb. 25, 2016, 1:14 a.m. OK GNU C++ TESTS 34 15 0 2800
16070377 kawatea C Feb. 17, 2016, 12:01 p.m. OK GNU C++ TESTS 34 15 0 2800
16070151 kawatea C Feb. 17, 2016, 11:48 a.m. OK GNU C++ TESTS 34 15 0 2800
16029113 Randolph87 C Feb. 15, 2016, 8:23 a.m. OK GNU C++ TESTS 34 15 0 2800
15827908 sfiction C Feb. 5, 2016, 3:06 p.m. OK GNU C++ TESTS 34 15 0 2800
15762623 tankche1 C Feb. 3, 2016, 5:39 a.m. OK GNU C++ TESTS 34 15 0 2800
29506344 emoairx C Aug. 16, 2017, 1:23 p.m. OK GNU C++11 TESTS 34 15 0 2800
27791031 yanQval C June 15, 2017, 10:05 a.m. OK GNU C++11 TESTS 34 15 0 2800
22623697 comfi C Nov. 30, 2016, 12:49 p.m. OK GNU C++11 TESTS 34 15 0 2800
22071756 00001 C Nov. 6, 2016, 9:29 a.m. OK GNU C++11 TESTS 34 15 0 2800
20493314 unused C Sept. 10, 2016, 8:50 a.m. OK GNU C++11 TESTS 34 15 0 2800
20472785 jiyutian C Sept. 9, 2016, 6:17 a.m. OK GNU C++11 TESTS 34 15 0 2800
18692427 Dirak C June 24, 2016, 2:33 a.m. OK GNU C++11 TESTS 34 15 0 2800
18575890 keepit C June 18, 2016, 9:38 a.m. OK GNU C++11 TESTS 34 15 0 2800
17286418 Timur_Sitdikov C April 12, 2016, 6:51 a.m. OK GNU C++11 TESTS 34 15 0 2800
16380668 eolv C Feb. 27, 2016, 11:28 a.m. OK GNU C++11 TESTS 34 15 0 2800
30197940 NiroBC C Sept. 8, 2017, 8:20 a.m. OK GNU C++14 TESTS 34 15 0 2800
30324505 Shivram C Sept. 14, 2017, 9:54 a.m. OK GNU C++14 TESTS 34 15 409600 2800
20673828 semiexp C Sept. 17, 2016, 5:43 a.m. OK GNU C++14 TESTS 34 15 409600 2800
30309654 193s C Sept. 13, 2017, 2:43 p.m. OK GNU C++14 TESTS 34 15 512000 2800
32566372 FallDream C Nov. 23, 2017, 4:57 a.m. OK GNU C++14 TESTS 34 15 819200 2800
27461674 joisino C May 31, 2017, 8 a.m. OK GNU C++14 TESTS 34 15 1331200 2800
27461588 vjudge2 C May 31, 2017, 7:54 a.m. OK GNU C++14 TESTS 34 15 1331200 2800
20743263 totsamyzed C Sept. 18, 2016, 8:08 p.m. OK GNU C++14 TESTS 34 15 1638400 2800
24035430 Hujiwara C Jan. 22, 2017, 5:52 p.m. OK GNU C++14 TESTS 34 15 1945600 2800
28489194 vjudge1 C July 13, 2017, 4:33 a.m. OK GNU C++14 TESTS 34 15 2048000 2800
66634535 hjk1030 C Dec. 11, 2019, 12:26 p.m. OK GNU C++17 TESTS 34 30 0 2800
52501317 alex_Harry C April 8, 2019, 4:14 p.m. OK GNU C++17 TESTS 34 30 204800 2800
62836402 ivan100sic C Oct. 17, 2019, 10:53 p.m. OK GNU C++17 TESTS 34 30 307200 2800
54744461 roll_no_1 C May 28, 2019, 9:48 a.m. OK GNU C++17 TESTS 34 30 1024000 2800
69904001 vjudge1 C Jan. 31, 2020, 1:42 p.m. OK GNU C++17 TESTS 34 31 0 2800
43519915 vjudge5 C Sept. 28, 2018, 7:42 a.m. OK GNU C++17 TESTS 34 31 0 2800
57990262 ogo C July 30, 2019, 12:57 p.m. OK GNU C++17 TESTS 34 31 204800 2800
65672653 NonGoxicTum C Nov. 24, 2019, 4:36 p.m. OK GNU C++17 TESTS 34 31 307200 2800
65347529 David-M C Nov. 19, 2019, 1:06 p.m. OK GNU C++17 TESTS 34 31 307200 2800
65576329 GioChkhaidze C Nov. 23, 2019, 9:30 a.m. OK GNU C++17 TESTS 34 31 409600 2800
15355270 Petr C Jan. 14, 2016, 5:06 p.m. OK Java 7 TESTS 34 108 0 2800
17814400 228 C May 9, 2016, 12:34 a.m. OK Java 7 TESTS 34 124 39321600 2800
15494941 squee_spoon C Jan. 22, 2016, 8:35 a.m. OK Java 8 TESTS 34 109 0 2800
15378047 AlexFetisov C Jan. 14, 2016, 9:30 p.m. OK Java 8 TESTS 34 109 0 2800
15372949 pashka C Jan. 14, 2016, 6:33 p.m. OK Java 8 TESTS 34 109 0 2800
15874585 hama-du C Feb. 7, 2016, 12:04 p.m. OK Java 8 TESTS 34 124 0 2800
15495145 squee_spoon C Jan. 22, 2016, 8:47 a.m. OK Java 8 TESTS 34 124 0 2800
20220641 ljsayson00 C Aug. 29, 2016, 12:17 a.m. OK Java 8 TESTS 34 139 0 2800
15605055 cchli C Jan. 27, 2016, 4:52 a.m. OK Java 8 TESTS 34 139 0 2800
15487631 gpita C Jan. 22, 2016, 12:06 a.m. OK Java 8 TESTS 34 139 0 2800
19228655 alibaba C July 19, 2016, 9:30 a.m. OK Java 8 TESTS 34 140 0 2800
15604891 cchli C Jan. 27, 2016, 4:37 a.m. OK Java 8 TESTS 34 140 0 2800
17700434 camypaper C May 3, 2016, 4:07 p.m. OK MS C# TESTS 34 62 12390400 2800
15419900 bossfang7878 C Jan. 17, 2016, 11:49 p.m. OK MS C# TESTS 34 420 921600 2800
15371859 gnomina007 C Jan. 14, 2016, 6:27 p.m. OK MS C++ TESTS 34 15 0 2800
15366116 Chameleon2460 C Jan. 14, 2016, 5:54 p.m. OK MS C++ TESTS 34 15 0 2800
16192481 sister_what_hate_most C Feb. 19, 2016, 5:11 a.m. OK MS C++ TESTS 34 15 102400 2800
16137690 vjudge3 C Feb. 18, 2016, 7:23 a.m. OK MS C++ TESTS 34 15 102400 2800
15381013 Death_Knight_DK C Jan. 15, 2016, 3:17 a.m. OK MS C++ TESTS 34 15 102400 2800
15367791 Milanin C Jan. 14, 2016, 6:04 p.m. OK MS C++ TESTS 34 15 102400 2800
15387946 Carups C Jan. 15, 2016, 12:04 p.m. OK MS C++ TESTS 34 15 204800 2800
15365561 RAD C Jan. 14, 2016, 5:51 p.m. OK MS C++ TESTS 34 15 409600 2800
15393855 AleksanderBalobanov C Jan. 15, 2016, 6:43 p.m. OK MS C++ TESTS 34 15 1126400 2800
16280065 HappyLittlePony C Feb. 22, 2016, 4:07 p.m. OK MS C++ TESTS 34 30 307200 2800
15373895 cugel C Jan. 14, 2016, 7:12 p.m. OK Python 3 TESTS 34 62 1228800 2800
42136218 Mk_Python_v1 C Aug. 27, 2018, 12:15 a.m. OK Python 3 TESTS 34 187 1433600 2800

remove filters

Back to search problems