Codeforces Round 535 (Div. 3)

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
1108 Codeforces Round 535 (Div. 3) FINISHED False 7200 183569099 Jan. 23, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15300 ) D Diverse Garland PROGRAMMING constructive algorithms dp greedy 1400

B"You have a garland consisting of n lamps. Each lamp is colored red, green or blue. The color of the i -th lamp is s_i ('R', 'G' and 'B' -- colors of lamps in the garland). You have to recolor some lamps in this garland (recoloring a lamp means changing its initial color to another) in such a way that the obtained garland is diverse. A garland is called diverse if any two adjacent (consecutive) lamps (i. xe2 x80 x89e. such lamps that the distance between their positions is 1 ) have distinct colors. In other words, if the obtained garland is t then for each i from 1 to n-1 the condition t_i ne t_{i + 1} should be satisfied. Among all ways to recolor the initial garland to make it diverse you have to choose one with the minimum number of recolored lamps. If there are multiple optimal solutions, print any of them. The first line of the input contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of lamps. The second line of the input contains the string s consisting of n characters 'R', 'G' and 'B' -- colors of lamps in the garland. In the first line of the output print one integer r -- the minimum number of recolors needed to obtain a diverse garland from the given one. In the second line of the output print one string t of length n -- a diverse garland obtained from the initial one with minimum number of recolors. If there are multiple optimal solutions, print any of them. "...

Tutorials

64751

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50584307 Minasenayuki D Feb. 28, 2019, 1:40 a.m. OK Clang++17 Diagnostics TESTS 24 62 0 1400
50810718 sakurakatana D March 5, 2019, 8:37 a.m. OK Clang++17 Diagnostics TESTS 24 109 15155200 1400
63137302 LeamyCodes D Oct. 22, 2019, 2:45 p.m. OK Clang++17 Diagnostics TESTS 24 109 15155200 1400
49515704 guaguastandup D Feb. 6, 2019, 2:26 a.m. OK Clang++17 Diagnostics TESTS 24 218 15155200 1400
49085251 MiohitoKiri5474 D Jan. 28, 2019, 7:16 a.m. OK Clang++17 Diagnostics TESTS 24 233 21606400 1400
54701045 Denor D May 26, 2019, 11:30 p.m. OK Delphi TESTS 24 92 409600 1400
49206464 gyrgen D Jan. 30, 2019, 2:02 p.m. OK FPC TESTS 24 31 1331200 1400
51850217 chaorenhaha D March 26, 2019, 7:30 a.m. OK FPC TESTS 24 31 1331200 1400
48937627 CallBoy D Jan. 25, 2019, 2:59 p.m. OK FPC TESTS 24 31 1331200 1400
50927391 Oompaloompa D March 7, 2019, 12:29 p.m. OK FPC TESTS 24 561 2355200 1400
50927381 Oompaloompa D March 7, 2019, 12:29 p.m. OK FPC TESTS 24 561 2355200 1400
49326552 vvvnnn911 D Feb. 1, 2019, 2:18 p.m. OK FPC TESTS 24 607 204800 1400
58177268 pnt2k2 D Aug. 2, 2019, 1:35 p.m. OK FPC TESTS 24 607 16076800 1400
50679171 DarkAvengerr D March 2, 2019, 10:44 a.m. OK FPC TESTS 24 623 204800 1400
52365209 doudou215960 D April 6, 2019, 12:17 a.m. OK GNU C11 TESTS 24 31 204800 1400
54072467 pk1210 D May 13, 2019, 5:13 p.m. OK GNU C11 TESTS 24 31 204800 1400
56277148 sunnyjain D June 29, 2019, 2:50 p.m. OK GNU C11 TESTS 24 31 204800 1400
57257995 alwaysF D July 18, 2019, 3:22 a.m. OK GNU C11 TESTS 24 31 204800 1400
58490791 wander_dog D Aug. 9, 2019, 9:38 a.m. OK GNU C11 TESTS 24 31 204800 1400
61864355 MHHasan D Oct. 4, 2019, 4:10 p.m. OK GNU C11 TESTS 24 31 204800 1400
49618744 hyoi D Feb. 8, 2019, 7:59 a.m. OK GNU C11 TESTS 24 31 204800 1400
49872830 Dynamic. D Feb. 13, 2019, 2:33 p.m. OK GNU C11 TESTS 24 31 204800 1400
52026607 SMANIANI D March 30, 2019, 3:14 p.m. OK GNU C11 TESTS 24 31 204800 1400
52026652 vjudge5 D March 30, 2019, 3:15 p.m. OK GNU C11 TESTS 24 31 204800 1400
49863345 Z_zc D Feb. 13, 2019, 10:50 a.m. OK GNU C++11 TESTS 24 15 204800 1400
48940873 parsa333111 D Jan. 25, 2019, 4:27 p.m. OK GNU C++11 TESTS 24 15 1126400 1400
51294361 baihualiaoluan D March 14, 2019, 11:53 a.m. OK GNU C++11 TESTS 24 30 0 1400
48953970 Hackerchf D Jan. 26, 2019, 3:09 a.m. OK GNU C++11 TESTS 24 30 204800 1400
49202824 vjudge3 D Jan. 30, 2019, 1 p.m. OK GNU C++11 TESTS 24 30 204800 1400
49364714 LQL D Feb. 2, 2019, 2:31 p.m. OK GNU C++11 TESTS 24 30 204800 1400
66313289 vjudge1 D Dec. 5, 2019, 12:11 p.m. OK GNU C++11 TESTS 24 30 204800 1400
68333874 vjudge5 D Jan. 6, 2020, 8:18 p.m. OK GNU C++11 TESTS 24 30 512000 1400
66148059 Kaunta D Dec. 1, 2019, 5:33 p.m. OK GNU C++11 TESTS 24 30 512000 1400
49234469 KobetheGOAT D Jan. 31, 2019, 7:15 a.m. OK GNU C++11 TESTS 24 30 512000 1400
50706264 igorqs D March 3, 2019, 4:15 a.m. OK GNU C++14 TESTS 24 15 204800 1400
51292852 vjudge5 D March 14, 2019, 11:18 a.m. OK GNU C++14 TESTS 24 15 204800 1400
51292676 vjudge3 D March 14, 2019, 11:14 a.m. OK GNU C++14 TESTS 24 15 204800 1400
50706424 igorqs D March 3, 2019, 4:23 a.m. OK GNU C++14 TESTS 24 15 204800 1400
49851395 hank55663 D Feb. 13, 2019, 4:01 a.m. OK GNU C++14 TESTS 24 15 204800 1400
49646641 sridip D Feb. 9, 2019, 4:58 a.m. OK GNU C++14 TESTS 24 15 204800 1400
66253393 AbhiSanta D Dec. 4, 2019, 4:10 a.m. OK GNU C++14 TESTS 24 15 512000 1400
66399544 kyrgyz.nomad D Dec. 6, 2019, 11:52 a.m. OK GNU C++14 TESTS 24 15 512000 1400
68344091 durano D Jan. 7, 2020, 6:09 a.m. OK GNU C++14 TESTS 24 15 512000 1400
68936392 BG07 D Jan. 16, 2020, 12:59 p.m. OK GNU C++14 TESTS 24 15 512000 1400
49831047 vjudge2 D Feb. 12, 2019, 1:56 p.m. OK GNU C++17 TESTS 24 15 204800 1400
49889744 mohamedeltair D Feb. 14, 2019, 2:21 a.m. OK GNU C++17 TESTS 24 15 204800 1400
50918008 vjudge1 D March 7, 2019, 7:32 a.m. OK GNU C++17 TESTS 24 15 204800 1400
54900178 vjudge3 D June 1, 2019, 6:11 a.m. OK GNU C++17 TESTS 24 15 204800 1400
66446906 vlad.iftimescu D Dec. 7, 2019, 10 a.m. OK GNU C++17 TESTS 24 15 204800 1400
69690348 alif_cse_ju D Jan. 28, 2020, 6:23 p.m. OK GNU C++17 TESTS 24 15 204800 1400
68869229 Darc_horse D Jan. 15, 2020, 2:36 p.m. OK GNU C++17 TESTS 24 15 512000 1400
66984606 dsp_2503 D Dec. 15, 2019, 5:37 p.m. OK GNU C++17 TESTS 24 15 512000 1400
64899011 utk_007 D Nov. 14, 2019, 5:58 p.m. OK GNU C++17 TESTS 24 15 512000 1400
62871830 Dragon_warrior_iitk D Oct. 18, 2019, 2:01 p.m. OK GNU C++17 TESTS 24 15 512000 1400
49142206 UnconfSlnce D Jan. 29, 2019, 10:49 a.m. OK Go TESTS 24 31 716800 1400
49242448 qinhang3 D Jan. 31, 2019, 11 a.m. OK Go TESTS 24 655 0 1400
69678554 shubh_jha98 D Jan. 28, 2020, 2:55 p.m. OK Java 11 TESTS 24 218 0 1400
69685056 shubh_jha98 D Jan. 28, 2020, 4:44 p.m. OK Java 11 TESTS 24 249 7065600 1400
58208990 garnacha D Aug. 3, 2019, 8:11 a.m. OK Java 8 TESTS 24 109 0 1400
49501046 zekigurbuz D Feb. 5, 2019, 3:10 p.m. OK Java 8 TESTS 24 109 0 1400
49215318 Harbin D Jan. 30, 2019, 4:58 p.m. OK Java 8 TESTS 24 109 0 1400
49193665 rajat188 D Jan. 30, 2019, 9:21 a.m. OK Java 8 TESTS 24 109 0 1400
49132286 arnavks97 D Jan. 29, 2019, 5:25 a.m. OK Java 8 TESTS 24 109 0 1400
49073622 tmwilliamlin168 D Jan. 27, 2019, 11:55 p.m. OK Java 8 TESTS 24 109 0 1400
48935538 k_chandrahas D Jan. 25, 2019, 2:04 p.m. OK Java 8 TESTS 24 109 0 1400
69537176 Mahakarma D Jan. 25, 2020, 7:23 p.m. OK Java 8 TESTS 24 124 0 1400
65712765 qwerty46246 D Nov. 25, 2019, 3:05 p.m. OK Java 8 TESTS 24 124 0 1400
60728252 maheshwari29 D Sept. 17, 2019, 2:43 p.m. OK Java 8 TESTS 24 124 0 1400
50560962 SergeySh D Feb. 27, 2019, 11:01 a.m. OK JavaScript TESTS 24 46 2764800 1400
50560203 SergeySh D Feb. 27, 2019, 10:32 a.m. OK JavaScript TESTS 24 46 2764800 1400
50701198 sayeh D March 2, 2019, 9:43 p.m. OK JavaScript TESTS 24 62 3788800 1400
49149605 Semih_ D Jan. 29, 2019, 12:09 p.m. OK JavaScript TESTS 24 62 13516800 1400
50906908 ondrej.konecny D March 6, 2019, 8:47 p.m. OK Kotlin TESTS 24 170 204800 1400
60216060 RIPBruh._. D Sept. 7, 2019, 11:53 a.m. OK Kotlin TESTS 24 171 0 1400
49377463 Quaternion D Feb. 2, 2019, 9:07 p.m. OK Kotlin TESTS 24 187 102400 1400
49991099 glider.g D Feb. 16, 2019, 12:52 p.m. OK Kotlin TESTS 24 187 1228800 1400
61335501 david_varela D Sept. 26, 2019, 4:18 p.m. OK Kotlin TESTS 24 218 307200 1400
59700302 Spheniscine D Aug. 30, 2019, 10:23 a.m. OK Kotlin TESTS 24 249 4505600 1400
59700463 Spheniscine D Aug. 30, 2019, 10:27 a.m. OK Kotlin TESTS 24 249 4505600 1400
53799175 m1_k3 D May 5, 2019, 5:18 p.m. OK Mono C# TESTS 24 46 2662400 1400
49950354 NEvOl D Feb. 15, 2019, 1:47 p.m. OK Mono C# TESTS 24 46 2662400 1400
54864414 og.kostya D May 31, 2019, 5:10 a.m. OK Mono C# TESTS 24 46 2764800 1400
48927808 dadulet D Jan. 25, 2019, 11:19 a.m. OK Mono C# TESTS 24 61 1126400 1400
49193312 treasuryonly D Jan. 30, 2019, 9:11 a.m. OK Mono C# TESTS 24 62 1536000 1400
50626142 Mosyagin D March 1, 2019, 6:09 a.m. OK Mono C# TESTS 24 62 3891200 1400
49171394 maximzombi D Jan. 29, 2019, 6:20 p.m. OK Mono C# TESTS 24 62 6553600 1400
50494887 nemars D Feb. 25, 2019, 2:45 p.m. OK Mono C# TESTS 24 62 8192000 1400
49070676 SegaMegaDrive D Jan. 27, 2019, 8:31 p.m. OK Mono C# TESTS 24 62 10342400 1400
49977170 NEvOl D Feb. 16, 2019, 6:34 a.m. OK Mono C# TESTS 24 639 5939200 1400
56880719 vjudge1 D July 12, 2019, 10:18 a.m. OK MS C++ TESTS 24 15 204800 1400
49180105 vjudge3 D Jan. 30, 2019, 12:46 a.m. OK MS C++ TESTS 24 15 204800 1400
51320332 vjudge1 D March 15, 2019, 6:25 a.m. OK MS C++ TESTS 24 30 204800 1400
50781222 sdibt2 D March 4, 2019, 11:27 a.m. OK MS C++ TESTS 24 30 204800 1400
51292872 vjudge1 D March 14, 2019, 11:18 a.m. OK MS C++ TESTS 24 30 204800 1400
56777697 vjudge5 D July 10, 2019, 3:51 a.m. OK MS C++ TESTS 24 30 512000 1400
48909118 __zzz__ D Jan. 24, 2019, 11:59 p.m. OK MS C++ TESTS 24 30 512000 1400
49299700 vjudge2 D Feb. 1, 2019, 2 a.m. OK MS C++ TESTS 24 30 512000 1400
54858087 bhavita D May 30, 2019, 9:30 p.m. OK MS C++ TESTS 24 30 512000 1400
56146196 vjudge1 D June 27, 2019, 6:21 a.m. OK MS C++ TESTS 24 30 512000 1400
49533909 mohitpassan D Feb. 6, 2019, 3:01 p.m. OK MS C++ 2017 TESTS 24 31 204800 1400
66664525 vjudge5 D Dec. 12, 2019, 6:29 a.m. OK MS C++ 2017 TESTS 24 31 204800 1400
54494096 hwangganzi D May 22, 2019, 4:50 p.m. OK MS C++ 2017 TESTS 24 31 204800 1400
50156385 GordeyZhizhin D Feb. 19, 2019, 10:19 a.m. OK MS C++ 2017 TESTS 24 31 204800 1400
49185608 D_facwl D Jan. 30, 2019, 5:50 a.m. OK MS C++ 2017 TESTS 24 31 409600 1400
54879703 dragonliulong D May 31, 2019, 1:37 p.m. OK MS C++ 2017 TESTS 24 31 614400 1400
65528016 Mad112233 D Nov. 22, 2019, 11:14 a.m. OK MS C++ 2017 TESTS 24 31 614400 1400
49608138 Souseisaki D Feb. 7, 2019, 8:56 p.m. OK MS C++ 2017 TESTS 24 31 614400 1400
66648493 jagruthi D Dec. 11, 2019, 5:51 p.m. OK MS C++ 2017 TESTS 24 31 614400 1400
66089153 stupid_learner D Dec. 1, 2019, 6:33 a.m. OK MS C++ 2017 TESTS 24 31 614400 1400
48946229 Arkanec D Jan. 25, 2019, 7:16 p.m. OK PascalABC.NET TESTS 24 951 102400 1400
48923793 Nastya425 D Jan. 25, 2019, 9:15 a.m. OK PascalABC.NET TESTS 24 966 1126400 1400
50918960 Orunbaev D March 7, 2019, 8:04 a.m. OK PascalABC.NET TESTS 24 982 204800 1400
49936726 Stanislav666 D Feb. 15, 2019, 7:37 a.m. OK PascalABC.NET TESTS 24 982 307200 1400
51658981 mm944 D March 22, 2019, 12:44 a.m. OK PascalABC.NET TESTS 24 998 102400 1400
56714374 Quirinius D July 8, 2019, 2:01 p.m. OK PyPy 2 TESTS 24 156 8908800 1400
48992435 alessandrosolbiati D Jan. 26, 2019, 2:59 p.m. OK PyPy 2 TESTS 24 249 9625600 1400
49139488 kaymas D Jan. 29, 2019, 9:26 a.m. OK PyPy 3 TESTS 24 155 9420800 1400
48956521 homoeconomicus D Jan. 26, 2019, 4:54 a.m. OK PyPy 3 TESTS 24 170 9830400 1400
53979596 Kirillov_Alexey D May 11, 2019, 6:26 a.m. OK PyPy 3 TESTS 24 171 9420800 1400
61798206 paramk D Oct. 3, 2019, 5:59 p.m. OK PyPy 3 TESTS 24 171 9728000 1400
49689380 syzymon D Feb. 10, 2019, 10:13 a.m. OK PyPy 3 TESTS 24 171 11571200 1400
48929566 adityaramesh D Jan. 25, 2019, 12:01 p.m. OK PyPy 3 TESTS 24 171 12185600 1400
57379857 iamprayush D July 20, 2019, 2:08 p.m. OK PyPy 3 TESTS 24 186 9932800 1400
48948766 freemax D Jan. 25, 2019, 9:02 p.m. OK PyPy 3 TESTS 24 186 16076800 1400
55818711 tchr D June 20, 2019, 7:33 a.m. OK PyPy 3 TESTS 24 187 9625600 1400
66628335 essi D Dec. 11, 2019, 10:06 a.m. OK PyPy 3 TESTS 24 187 9728000 1400
51603613 gaidash D March 21, 2019, 6:03 a.m. OK Python 2 TESTS 24 249 1228800 1400
49383115 sampsonguo302 D Feb. 3, 2019, 4:25 a.m. OK Python 2 TESTS 24 249 4403200 1400
48927421 SoSooding D Jan. 25, 2019, 11:10 a.m. OK Python 2 TESTS 24 249 4608000 1400
51812369 allonsy_kim D March 25, 2019, 6:50 a.m. OK Python 2 TESTS 24 264 1536000 1400
49003527 kingmoshe D Jan. 26, 2019, 4:01 p.m. OK Python 2 TESTS 24 296 4300800 1400
50098133 Luxo D Feb. 18, 2019, 1:41 p.m. OK Python 2 TESTS 24 358 2867200 1400
48911405 orailly D Jan. 25, 2019, 2:29 a.m. OK Python 3 TESTS 24 155 2764800 1400
49212931 SweetyParmar D Jan. 30, 2019, 4:12 p.m. OK Python 3 TESTS 24 202 1331200 1400
49481321 LChaves D Feb. 4, 2019, 11 p.m. OK Python 3 TESTS 24 202 1536000 1400
50813428 susanthika D March 5, 2019, 10:11 a.m. OK Python 3 TESTS 24 202 1638400 1400
50889895 j30ng D March 6, 2019, 12:48 p.m. OK Python 3 TESTS 24 202 2560000 1400
49064196 Emma215 D Jan. 27, 2019, 4:53 p.m. OK Python 3 TESTS 24 218 1331200 1400
51245849 ludsoph D March 13, 2019, 5:06 a.m. OK Python 3 TESTS 24 218 1638400 1400
49309183 JaneCare D Feb. 1, 2019, 7:03 a.m. OK Python 3 TESTS 24 218 1740800 1400
51994671 kinte D March 30, 2019, 12:05 a.m. OK Python 3 TESTS 24 218 1843200 1400
49559044 hoochiemane D Feb. 7, 2019, 11:33 a.m. OK Python 3 TESTS 24 218 2150400 1400
48990369 pioneer17 D Jan. 26, 2019, 2:09 p.m. OK Ruby TESTS 24 264 29388800 1400
49161745 brooksm D Jan. 29, 2019, 3:34 p.m. OK Rust TESTS 24 46 1740800 1400
59971639 sansen D Sept. 4, 2019, 1:55 a.m. OK Rust TESTS 24 46 3993600 1400
48944881 hot_yoghurt D Jan. 25, 2019, 6:32 p.m. OK Scala TESTS 24 701 3891200 1400

remove filters

Back to search problems