Codeforces Round 516 (Div. 1, by Moscow Team Olympiad)

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
1063 Codeforces Round 516 (Div. 1, by Moscow Team Olympiad) FINISHED False 7200 197668463 Oct. 14, 2018, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10484 ) A Oh Those Palindromes PROGRAMMING constructive algorithms strings 1400

B'A non-empty string is called palindrome, if it reads the same from the left to the right and from the right to the left. For example, "abcba", "a", and "abba" are palindromes, while "abab" and "xy" are not. A string is called a substring of another string, if it can be obtained from that string by dropping some (possibly zero) number of characters from the beginning and from the end of it. For example, "abc", "ab", and "c" are substrings of the string "abc", while "ac" and "d" are not. Let 's define a palindromic count of the string as the number of its substrings that are palindromes. For example, the palindromic count of the string "aaa" is 6 because all its substrings are palindromes, and the palindromic count of the string "abc" is 3 because only its substrings of length 1 are palindromes. You are given a string s . You can arbitrarily rearrange its characters. You goal is to obtain a string with the maximum possible value of palindromic count. The first line contains an integer n ( 1 <= n <= 100 ,000 ) -- the length of string s . The second line contains string s that consists of exactly n lowercase characters of Latin alphabet. Print string t , which consists of the same set of characters (and each characters appears exactly the same number of times) as string s . Moreover, t should have the maximum possible value of palindromic count among all such strings strings. If there are multiple such strings, print any of them. In the first example, string "ololo" has 9 palindromic substrings: "o", "l", "o", "l", "o", "olo", "lol", "olo", "ololo". Note, that even though some substrings coincide, they are counted as many times as they appear in the resulting string. In the second example, the palindromic count of string "abccbaghghghgdfd" is 29 . '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
44734427 linusdengah A Oct. 23, 2018, 12:13 p.m. OK Clang++17 Diagnostics TESTS 48 77 14950400 1400
44535358 hack_01 A Oct. 19, 2018, 8:40 a.m. OK Clang++17 Diagnostics TESTS 48 171 409600 1400
45566745 nanae1914 A Nov. 11, 2018, 3:01 p.m. OK D TESTS 48 46 4198400 1400
44294911 Gassa A Oct. 14, 2018, 10:15 a.m. OK D TESTS 48 46 4198400 1400
44696972 luogu_bot1 A Oct. 22, 2018, 1:20 p.m. OK FPC TESTS 48 311 614400 1400
44466615 titititing A Oct. 18, 2018, 2:58 a.m. OK FPC TESTS 48 311 614400 1400
59532789 luogu_bot1 A Aug. 26, 2019, 3:42 p.m. OK FPC TESTS 48 312 614400 1400
44472272 luogu_bot2 A Oct. 18, 2018, 6:59 a.m. OK FPC TESTS 48 327 409600 1400
45916475 zarif_2002 A Nov. 18, 2018, 2:15 p.m. OK GNU C11 TESTS 48 31 0 1400
45572320 Maruf_IIT A Nov. 11, 2018, 6:50 p.m. OK GNU C11 TESTS 48 31 0 1400
47001553 NoSoul A Dec. 14, 2018, 11:49 a.m. OK GNU C11 TESTS 48 31 102400 1400
46764867 sobhanmahfuz A Dec. 8, 2018, 1:49 p.m. OK GNU C11 TESTS 48 312 102400 1400
47539459 ishusharma A Dec. 27, 2018, 5:52 a.m. OK GNU C11 TESTS 48 312 102400 1400
69412465 Piccacu A Jan. 23, 2020, 12:04 p.m. OK GNU C11 TESTS 48 327 102400 1400
55058499 patilc125 A June 3, 2019, 8:22 p.m. OK GNU C11 TESTS 48 327 102400 1400
44589009 nguyenvlm A Oct. 20, 2018, 10:29 a.m. OK GNU C11 TESTS 48 358 0 1400
44350843 codesonic A Oct. 15, 2018, 10:03 a.m. OK GNU C++11 TESTS 48 30 102400 1400
44339223 ZUTTER_ A Oct. 15, 2018, 1:28 a.m. OK GNU C++11 TESTS 48 30 1024000 1400
46265919 CrazyTeaMajor A Nov. 27, 2018, 2:45 a.m. OK GNU C++11 TESTS 48 31 0 1400
45394302 _ShadowSong A Nov. 7, 2018, 2:19 a.m. OK GNU C++11 TESTS 48 31 0 1400
45126185 Siyuan A Oct. 31, 2018, 8:09 a.m. OK GNU C++11 TESTS 48 31 0 1400
48795481 Rayment A Jan. 23, 2019, 12:30 p.m. OK GNU C++11 TESTS 48 31 0 1400
52379399 luogu_bot1 A April 6, 2019, 9:28 a.m. OK GNU C++11 TESTS 48 31 0 1400
63128600 luogu_bot1 A Oct. 22, 2019, 1:32 p.m. OK GNU C++11 TESTS 48 31 0 1400
69544741 geneanlyz A Jan. 26, 2020, 1:15 a.m. OK GNU C++11 TESTS 48 31 0 1400
46264512 CrazyTeaMajor A Nov. 27, 2018, 12:26 a.m. OK GNU C++11 TESTS 48 31 0 1400
44355153 sk_singh A Oct. 15, 2018, 12:06 p.m. OK GNU C++14 TESTS 48 15 307200 1400
44339708 erogame A Oct. 15, 2018, 2:07 a.m. OK GNU C++14 TESTS 48 15 307200 1400
49632237 abdolsamad A Feb. 8, 2019, 4:42 p.m. OK GNU C++14 TESTS 48 30 0 1400
44387481 iaojnh A Oct. 16, 2018, 6:39 a.m. OK GNU C++14 TESTS 48 30 102400 1400
44342829 liulise A Oct. 15, 2018, 5:06 a.m. OK GNU C++14 TESTS 48 30 102400 1400
44387381 TinTin122 A Oct. 16, 2018, 6:36 a.m. OK GNU C++14 TESTS 48 30 307200 1400
57109255 JayK007 A July 15, 2019, 4:37 p.m. OK GNU C++14 TESTS 48 30 307200 1400
52570946 PavanChaithanya A April 10, 2019, 2:10 p.m. OK GNU C++14 TESTS 48 30 307200 1400
44381555 yongwhan A Oct. 16, 2018, 4:13 a.m. OK GNU C++14 TESTS 48 30 307200 1400
44300708 bukefala A Oct. 14, 2018, 10:40 a.m. OK GNU C++14 TESTS 48 30 307200 1400
53840275 duyvip6a4 A May 7, 2019, 7 a.m. OK GNU C++17 TESTS 48 15 102400 1400
68379545 luis8 A Jan. 7, 2020, 10:52 p.m. OK GNU C++17 TESTS 48 30 102400 1400
50648967 hsnavarro A March 1, 2019, 4:52 p.m. OK GNU C++17 TESTS 48 30 307200 1400
51770225 prhythm3099 A March 23, 2019, 5:59 p.m. OK GNU C++17 TESTS 48 30 307200 1400
53299617 AnTi_N00B A April 25, 2019, 7:42 p.m. OK GNU C++17 TESTS 48 30 307200 1400
54507459 aalas_ka_pedh A May 23, 2019, 5:04 a.m. OK GNU C++17 TESTS 48 30 307200 1400
58793944 MrD3viL A Aug. 14, 2019, 3:56 a.m. OK GNU C++17 TESTS 48 30 307200 1400
69523128 panditjii A Jan. 25, 2020, 2:01 p.m. OK GNU C++17 TESTS 48 30 307200 1400
47369701 Rzepa A Dec. 22, 2018, 1:32 p.m. OK GNU C++17 TESTS 48 30 307200 1400
46216321 abdelrahman____tarek A Nov. 25, 2018, 5:20 p.m. OK GNU C++17 TESTS 48 30 307200 1400
62827143 an09mous A Oct. 17, 2019, 6:27 p.m. OK Java 8 TESTS 48 109 0 1400
45707455 KharYusuf A Nov. 14, 2018, 12:19 p.m. OK Java 8 TESTS 48 109 0 1400
44419859 GiantTornado A Oct. 16, 2018, 9:27 p.m. OK Java 8 TESTS 48 109 0 1400
44377971 BiIIy A Oct. 15, 2018, 11:48 p.m. OK Java 8 TESTS 48 109 0 1400
45191006 SpargelTarzan A Nov. 2, 2018, 2:08 a.m. OK Java 8 TESTS 48 124 0 1400
58994445 adeepgarg13 A Aug. 18, 2019, 10:44 a.m. OK Java 8 TESTS 48 124 0 1400
50780996 yaminote A March 4, 2019, 11:21 a.m. OK Java 8 TESTS 48 124 0 1400
45798910 Baroudy A Nov. 16, 2018, 12:18 p.m. OK Java 8 TESTS 48 124 0 1400
45227558 xyz_000 A Nov. 3, 2018, 4:46 a.m. OK Java 8 TESTS 48 124 0 1400
44599391 Sentient5 A Oct. 20, 2018, 1:39 p.m. OK Java 8 TESTS 48 124 0 1400
62282328 david_varela A Oct. 10, 2019, 12:58 p.m. OK Kotlin TESTS 48 155 0 1400
62282810 david_varela A Oct. 10, 2019, 1:07 p.m. OK Kotlin TESTS 48 202 1126400 1400
54912268 og.kostya A June 1, 2019, 11:48 a.m. OK Mono C# TESTS 48 46 614400 1400
44405939 azukun A Oct. 16, 2018, 2:50 p.m. OK Mono C# TESTS 48 77 3379200 1400
49068256 nemars A Jan. 27, 2019, 6:56 p.m. OK Mono C# TESTS 48 93 6246400 1400
44569363 vjudge5 A Oct. 20, 2018, 3:49 a.m. OK MS C++ TESTS 48 30 204800 1400
50413943 vjudge2 A Feb. 24, 2019, 5:18 a.m. OK MS C++ TESTS 48 31 102400 1400
50413840 vjudge4 A Feb. 24, 2019, 5:14 a.m. OK MS C++ TESTS 48 31 102400 1400
50413243 vjudge5 A Feb. 24, 2019, 4:45 a.m. OK MS C++ TESTS 48 31 102400 1400
47525077 vjudge4 A Dec. 26, 2018, 3:22 p.m. OK MS C++ TESTS 48 31 102400 1400
50414334 vjudge4 A Feb. 24, 2019, 5:35 a.m. OK MS C++ TESTS 48 31 102400 1400
44544662 vjudge1 A Oct. 19, 2018, 12:59 p.m. OK MS C++ TESTS 48 31 102400 1400
53305910 vjudge2 A April 26, 2019, 3:09 a.m. OK MS C++ TESTS 48 31 102400 1400
53306360 vjudge2 A April 26, 2019, 3:24 a.m. OK MS C++ TESTS 48 31 102400 1400
46279977 vjudge1 A Nov. 27, 2018, 12:52 p.m. OK MS C++ TESTS 48 31 102400 1400
64196604 Mad112233 A Nov. 4, 2019, 9:57 a.m. OK MS C++ 2017 TESTS 48 31 512000 1400
64196457 Mad112233 A Nov. 4, 2019, 9:54 a.m. OK MS C++ 2017 TESTS 48 46 512000 1400
45916158 rinatisk A Nov. 18, 2018, 2:07 p.m. OK PascalABC.NET TESTS 48 327 0 1400
45336178 KGYYT A Nov. 5, 2018, 5:46 p.m. OK PascalABC.NET TESTS 48 327 0 1400
44321909 mayakin A Oct. 14, 2018, 2:28 p.m. OK PHP TESTS 48 62 7987200 1400
44469796 masonsbro A Oct. 18, 2018, 5:37 a.m. OK PyPy 2 TESTS 48 140 3174400 1400
44293047 pajenegod A Oct. 14, 2018, 10:10 a.m. OK PyPy 2 TESTS 48 155 2969600 1400
44453099 nealzane A Oct. 17, 2018, 4:45 p.m. OK PyPy 2 TESTS 48 156 3174400 1400
44917191 noob77777 A Oct. 26, 2018, 4:03 p.m. OK PyPy 2 TESTS 48 202 3174400 1400
45274913 ulyabelyaeva A Nov. 4, 2018, 10:32 a.m. OK PyPy 3 TESTS 48 170 4710400 1400
63406785 KrishRawat A Oct. 25, 2019, 8:51 p.m. OK PyPy 3 TESTS 48 171 3788800 1400
55429351 sksinghal17 A June 11, 2019, 10:36 a.m. OK PyPy 3 TESTS 48 171 4710400 1400
44470890 vjudge2 A Oct. 18, 2018, 6:18 a.m. OK PyPy 3 TESTS 48 171 4915200 1400
68114682 KuzlyaevNikita A Jan. 3, 2020, 10:59 a.m. OK PyPy 3 TESTS 48 171 5017600 1400
49631850 abdolsamad A Feb. 8, 2019, 4:31 p.m. OK PyPy 3 TESTS 48 186 1945600 1400
68484800 gaidash A Jan. 10, 2020, 9:15 a.m. OK PyPy 3 TESTS 48 186 3481600 1400
57508673 X_ILYA_X A July 22, 2019, 12:55 p.m. OK PyPy 3 TESTS 48 186 3788800 1400
64183188 kchau A Nov. 4, 2019, 2:47 a.m. OK PyPy 3 TESTS 48 187 3481600 1400
49632058 abdolsamad A Feb. 8, 2019, 4:37 p.m. OK PyPy 3 TESTS 48 202 5120000 1400
44563281 neo_123 A Oct. 19, 2018, 8:44 p.m. OK Python 2 TESTS 48 187 921600 1400
44534933 test616.cpp A Oct. 19, 2018, 8:28 a.m. OK Python 2 TESTS 48 187 921600 1400
44326534 divya0808 A Oct. 14, 2018, 4:18 p.m. OK Python 2 TESTS 48 187 921600 1400
44299087 WNG A Oct. 14, 2018, 10:32 a.m. OK Python 2 TESTS 48 187 921600 1400
45222419 samchen123 A Nov. 2, 2018, 10:42 p.m. OK Python 2 TESTS 48 202 921600 1400
48300950 conjecture_xyz A Jan. 12, 2019, 4:53 p.m. OK Python 2 TESTS 48 218 1945600 1400
52624943 daotiennamhlvl A April 12, 2019, 2:25 a.m. OK Python 3 TESTS 48 124 307200 1400
47963472 shivammishra A Jan. 5, 2019, 10:49 a.m. OK Python 3 TESTS 48 124 819200 1400
47941367 BaJIepka A Jan. 4, 2019, 5:26 p.m. OK Python 3 TESTS 48 124 819200 1400
46817407 ar7L A Dec. 9, 2018, 12:59 p.m. OK Python 3 TESTS 48 124 819200 1400
44527033 jackyliuxx A Oct. 19, 2018, 3:39 a.m. OK Python 3 TESTS 48 124 921600 1400
68869244 sreyans A Jan. 15, 2020, 2:36 p.m. OK Python 3 TESTS 48 124 1126400 1400
61056547 vegetablesandwich A Sept. 22, 2019, 8:14 a.m. OK Python 3 TESTS 48 139 819200 1400
47520884 jaaguptamme A Dec. 26, 2018, 1:01 p.m. OK Python 3 TESTS 48 139 921600 1400
44673838 wangzpeng A Oct. 22, 2018, 1:03 a.m. OK Python 3 TESTS 48 139 921600 1400
44648498 michaelyuan A Oct. 21, 2018, 10:10 a.m. OK Python 3 TESTS 48 139 921600 1400
44318189 0w1 A Oct. 14, 2018, 1:26 p.m. OK Ruby TESTS 48 109 9011200 1400
50413414 vjudge4 A Feb. 24, 2019, 4:53 a.m. OK Ruby TESTS 48 109 15257600 1400
44434120 BaconLi A Oct. 17, 2018, 9:05 a.m. OK Rust TESTS 48 31 921600 1400

remove filters

Back to search problems