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 188925863 Jan. 23, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12066 ) C Nice Garland PROGRAMMING brute force greedy math 1300

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 nice. A garland is called nice if any two lamps of the same color have distance divisible by three between them. I.e. if the obtained garland is t , then for each i, j such that t_i = t_j should be satisfied |i-j|~ mod~ 3 = 0 . The value |x| means absolute value of x , the operation x~ mod~ y means remainder of x when divided by y . For example, the following garlands are nice: "RGBRGBRG", "GB", "R", "GRBGRBG", "BRGBRGB". The following garlands are not nice: "RR", "RGBG". Among all ways to recolor the initial garland to make it nice 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 nice garland from the given one. In the second line of the output print one string t of length n -- a nice 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
49084521 MiohitoKiri5474 C Jan. 28, 2019, 7:05 a.m. OK Clang++17 Diagnostics TESTS 24 187 15155200 1300
49113526 andre548 C Jan. 28, 2019, 3:58 p.m. OK Clang++17 Diagnostics TESTS 24 218 17612800 1300
50809977 sakurakatana C March 5, 2019, 8:08 a.m. OK Clang++17 Diagnostics TESTS 24 249 15155200 1300
49887813 ruban C Feb. 13, 2019, 11:52 p.m. OK Delphi TESTS 24 77 19148800 1300
54723521 Denor C May 27, 2019, 6:45 p.m. OK Delphi TESTS 24 78 409600 1300
58703759 romanporsh C Aug. 13, 2019, 8:43 a.m. OK FPC TESTS 24 46 1433600 1300
51881415 chaorenhaha C March 27, 2019, 1:20 a.m. OK FPC TESTS 24 46 1433600 1300
51849856 chaorenhaha C March 26, 2019, 7:17 a.m. OK FPC TESTS 24 46 1433600 1300
51849866 chaorenhaha C March 26, 2019, 7:18 a.m. OK FPC TESTS 24 62 2560000 1300
51849839 chaorenhaha C March 26, 2019, 7:17 a.m. OK FPC TESTS 24 77 2560000 1300
51849843 chaorenhaha C March 26, 2019, 7:17 a.m. OK FPC TESTS 24 233 1433600 1300
50678404 DarkAvengerr C March 2, 2019, 10:22 a.m. OK FPC TESTS 24 577 1331200 1300
65049554 hkwalker C Nov. 15, 2019, 2:02 p.m. OK FPC TESTS 24 592 204800 1300
48936851 CallBoy C Jan. 25, 2019, 2:39 p.m. OK FPC TESTS 24 592 1433600 1300
60328098 BugLeave C Sept. 10, 2019, 3:38 a.m. OK GNU C11 TESTS 24 31 204800 1300
50621255 kaiboy C March 1, 2019, 1:44 a.m. OK GNU C11 TESTS 24 31 204800 1300
48913841 yueshaoqiang C Jan. 25, 2019, 4:16 a.m. OK GNU C11 TESTS 24 31 307200 1300
57165248 cs234_shrey C July 16, 2019, 10:02 p.m. OK GNU C11 TESTS 24 31 1433600 1300
50757425 nikunj16 C March 3, 2019, 5:49 p.m. OK GNU C11 TESTS 24 46 204800 1300
49200479 2018030401093 C Jan. 30, 2019, 12:14 p.m. OK GNU C11 TESTS 24 46 409600 1300
49200500 vjudge1 C Jan. 30, 2019, 12:15 p.m. OK GNU C11 TESTS 24 46 409600 1300
55751538 ktk54x C June 19, 2019, 1:02 p.m. OK GNU C11 TESTS 24 46 1433600 1300
49043740 Tanvir_Rasel C Jan. 27, 2019, 7:45 a.m. OK GNU C11 TESTS 24 46 1433600 1300
49214706 LLI_N_LLI C Jan. 30, 2019, 4:47 p.m. OK GNU C11 TESTS 24 46 1433600 1300
49302452 vjudge2 C Feb. 1, 2019, 4:01 a.m. OK GNU C++11 TESTS 24 30 614400 1300
48960453 zarif_2002 C Jan. 26, 2019, 6:15 a.m. OK GNU C++11 TESTS 24 30 921600 1300
69573038 luogu_bot4 C Jan. 26, 2020, 2:41 p.m. OK GNU C++11 TESTS 24 31 0 1300
69474345 lonely_person C Jan. 24, 2020, 3:37 p.m. OK GNU C++11 TESTS 24 31 0 1300
68692701 vjudge2 C Jan. 13, 2020, 6:50 a.m. OK GNU C++11 TESTS 24 31 0 1300
58154682 bagpipe C Aug. 2, 2019, 4:57 a.m. OK GNU C++11 TESTS 24 31 0 1300
51333490 vjudge1 C March 15, 2019, 1:07 p.m. OK GNU C++11 TESTS 24 31 0 1300
49974004 graceoflives C Feb. 16, 2019, 4:44 a.m. OK GNU C++11 TESTS 24 31 0 1300
49536847 lizhijian C Feb. 6, 2019, 4:23 p.m. OK GNU C++11 TESTS 24 31 0 1300
49188924 lhy0930 C Jan. 30, 2019, 7:23 a.m. OK GNU C++11 TESTS 24 31 0 1300
53530880 danya.smelskiy C April 29, 2019, 8:11 p.m. OK GNU C++14 TESTS 24 15 716800 1300
59879408 Ola.Abdallah C Sept. 2, 2019, 3:30 a.m. OK GNU C++14 TESTS 24 15 716800 1300
49539790 ParagonX97 C Feb. 6, 2019, 5:50 p.m. OK GNU C++14 TESTS 24 15 1024000 1300
58204936 nilshah117 C Aug. 3, 2019, 6:31 a.m. OK GNU C++14 TESTS 24 15 1536000 1300
49760020 vjudge3 C Feb. 11, 2019, 8:27 a.m. OK GNU C++14 TESTS 24 15 2969600 1300
49058023 GM_Targeted C Jan. 27, 2019, 2:09 p.m. OK GNU C++14 TESTS 24 15 5427200 1300
50073998 codezebra C Feb. 17, 2019, 7:40 p.m. OK GNU C++14 TESTS 24 30 0 1300
48946751 Robsob C Jan. 25, 2019, 7:34 p.m. OK GNU C++14 TESTS 24 30 204800 1300
52137339 RNS_CUS C April 1, 2019, 4:05 a.m. OK GNU C++14 TESTS 24 30 204800 1300
48932913 Panelatta C Jan. 25, 2019, 1:04 p.m. OK GNU C++14 TESTS 24 30 204800 1300
49176576 PlaneG C Jan. 29, 2019, 9:03 p.m. OK GNU C++17 TESTS 24 15 409600 1300
51209370 Time_lord C March 12, 2019, 6:59 a.m. OK GNU C++17 TESTS 24 15 512000 1300
65957322 NelsonGomesNeto C Nov. 29, 2019, 1:21 p.m. OK GNU C++17 TESTS 24 15 614400 1300
49687762 samirharry C Feb. 10, 2019, 8:44 a.m. OK GNU C++17 TESTS 24 15 819200 1300
60287036 dancooper C Sept. 9, 2019, 3:36 a.m. OK GNU C++17 TESTS 24 15 819200 1300
49078177 THOOR_001 C Jan. 28, 2019, 4:55 a.m. OK GNU C++17 TESTS 24 15 819200 1300
49028478 abdul135 C Jan. 26, 2019, 8:22 p.m. OK GNU C++17 TESTS 24 15 2662400 1300
51380643 LilMeyer C March 16, 2019, 4:04 p.m. OK GNU C++17 TESTS 24 30 204800 1300
51561260 vjudge1 C March 20, 2019, 8:02 a.m. OK GNU C++17 TESTS 24 30 204800 1300
62543513 justHusam C Oct. 14, 2019, 5:10 a.m. OK GNU C++17 TESTS 24 30 204800 1300
49115053 julyww C Jan. 28, 2019, 4:35 p.m. OK Go TESTS 24 592 0 1300
49237674 qinhang3 C Jan. 31, 2019, 8:49 a.m. OK Go TESTS 24 826 0 1300
64337705 Agnimandur C Nov. 5, 2019, 11:21 p.m. OK Java 8 TESTS 24 124 0 1300
69890497 luchy0120 C Jan. 31, 2020, 9:50 a.m. OK Java 8 TESTS 24 124 0 1300
59833080 nadaabdo588 C Sept. 1, 2019, 1:28 a.m. OK Java 8 TESTS 24 124 0 1300
58789379 vvenkai C Aug. 14, 2019, 1:32 a.m. OK Java 8 TESTS 24 124 0 1300
58209997 garnacha C Aug. 3, 2019, 8:29 a.m. OK Java 8 TESTS 24 124 0 1300
57147382 MaxHeap C July 16, 2019, 1:27 p.m. OK Java 8 TESTS 24 124 0 1300
56415918 Sleep C July 2, 2019, 4:34 a.m. OK Java 8 TESTS 24 124 0 1300
55907170 caoash C June 21, 2019, 9:49 p.m. OK Java 8 TESTS 24 124 0 1300
55747687 shinghalrishabh C June 19, 2019, 10:57 a.m. OK Java 8 TESTS 24 124 0 1300
53209027 MubtasimShahriar C April 24, 2019, 2:46 a.m. OK Java 8 TESTS 24 124 0 1300
50557292 SergeySh C Feb. 27, 2019, 8:45 a.m. OK JavaScript TESTS 24 46 10956800 1300
50646483 sayeh C March 1, 2019, 3:53 p.m. OK JavaScript TESTS 24 62 12185600 1300
49066027 Semih_ C Jan. 27, 2019, 5:46 p.m. OK JavaScript TESTS 24 77 22425600 1300
49239630 Killer45 C Jan. 31, 2019, 9:40 a.m. OK Kotlin TESTS 24 155 307200 1300
58107262 stepanovep C Aug. 1, 2019, 5:11 a.m. OK Kotlin TESTS 24 171 0 1300
49988605 glider.g C Feb. 16, 2019, 11:43 a.m. OK Kotlin TESTS 24 186 1228800 1300
59615431 rego97 C Aug. 28, 2019, 12:30 p.m. OK Kotlin TESTS 24 187 819200 1300
59685241 david_varela C Aug. 30, 2019, 12:42 a.m. OK Kotlin TESTS 24 187 921600 1300
59699103 Spheniscine C Aug. 30, 2019, 9:51 a.m. OK Kotlin TESTS 24 187 1024000 1300
49377106 Quaternion C Feb. 2, 2019, 8:48 p.m. OK Kotlin TESTS 24 233 1536000 1300
60215349 RIPBruh._. C Sept. 7, 2019, 11:39 a.m. OK Kotlin TESTS 24 811 0 1300
50508853 Mosyagin C Feb. 25, 2019, 9:45 p.m. OK Mono C# TESTS 24 46 1843200 1300
50508635 Mosyagin C Feb. 25, 2019, 9:35 p.m. OK Mono C# TESTS 24 61 1843200 1300
54841069 og.kostya C May 30, 2019, 12:51 p.m. OK Mono C# TESTS 24 61 2355200 1300
48938900 krark C Jan. 25, 2019, 3:33 p.m. OK Mono C# TESTS 24 61 2662400 1300
49232306 treasuryonly C Jan. 31, 2019, 6:09 a.m. OK Mono C# TESTS 24 62 1126400 1300
50508447 Mosyagin C Feb. 25, 2019, 9:25 p.m. OK Mono C# TESTS 24 62 2252800 1300
50494145 nemars C Feb. 25, 2019, 2:29 p.m. OK Mono C# TESTS 24 77 5529600 1300
48944733 Kuts C Jan. 25, 2019, 6:28 p.m. OK Mono C# TESTS 24 77 7168000 1300
53680123 m1_k3 C May 2, 2019, 6:34 p.m. OK Mono C# TESTS 24 78 5529600 1300
49944132 NEvOl C Feb. 15, 2019, 11:16 a.m. OK Mono C# TESTS 24 78 10240000 1300
63295169 vjudge1 C Oct. 24, 2019, 12:48 p.m. OK MS C++ TESTS 24 31 204800 1300
48965226 lyx20010116 C Jan. 26, 2019, 7:12 a.m. OK MS C++ TESTS 24 31 204800 1300
49650536 sodala C Feb. 9, 2019, 7:23 a.m. OK MS C++ TESTS 24 31 204800 1300
49770252 vjudge3 C Feb. 11, 2019, 1:22 p.m. OK MS C++ TESTS 24 31 204800 1300
50779411 sdibt1 C March 4, 2019, 10:36 a.m. OK MS C++ TESTS 24 31 204800 1300
50784235 sdibt5 C March 4, 2019, 12:43 p.m. OK MS C++ TESTS 24 31 204800 1300
50893029 vjudge2 C March 6, 2019, 1:54 p.m. OK MS C++ TESTS 24 31 204800 1300
51395486 vjudge4 C March 17, 2019, 4:09 a.m. OK MS C++ TESTS 24 31 204800 1300
53281477 vjudge3 C April 25, 2019, 12:10 p.m. OK MS C++ TESTS 24 31 409600 1300
48922207 SakaRenko C Jan. 25, 2019, 8:25 a.m. OK MS C++ TESTS 24 31 409600 1300
49531032 Satoshi-Windy C Feb. 6, 2019, 1:49 p.m. OK MS C++ 2017 TESTS 24 31 204800 1300
58859251 Y_JARVIS C Aug. 15, 2019, 10:54 a.m. OK MS C++ 2017 TESTS 24 31 204800 1300
50512566 tangbinjie C Feb. 26, 2019, 2:51 a.m. OK MS C++ 2017 TESTS 24 31 204800 1300
49569765 MishaSm C Feb. 7, 2019, 1:49 p.m. OK MS C++ 2017 TESTS 24 31 614400 1300
66089342 KyleZz C Dec. 1, 2019, 6:38 a.m. OK MS C++ 2017 TESTS 24 31 614400 1300
49672461 nkaskov C Feb. 9, 2019, 5:44 p.m. OK MS C++ 2017 TESTS 24 31 921600 1300
49558880 Nadeev C Feb. 7, 2019, 11:27 a.m. OK MS C++ 2017 TESTS 24 31 1126400 1300
68219963 shio C Jan. 5, 2020, 3:54 a.m. OK MS C++ 2017 TESTS 24 31 1126400 1300
50053789 holder94 C Feb. 17, 2019, 9:16 a.m. OK MS C++ 2017 TESTS 24 31 1638400 1300
52358463 skychocowhite C April 5, 2019, 6:11 p.m. OK MS C++ 2017 TESTS 24 31 1740800 1300
50916391 Orunbaev C March 7, 2019, 6:39 a.m. OK PascalABC.NET TESTS 24 514 102400 1300
51599435 mm944 C March 21, 2019, 2:04 a.m. OK PascalABC.NET TESTS 24 967 102400 1300
49936166 Stanislav666 C Feb. 15, 2019, 7:22 a.m. OK PascalABC.NET TESTS 24 982 0 1300
48945646 Arkanec C Jan. 25, 2019, 6:57 p.m. OK PascalABC.NET TESTS 24 982 307200 1300
48992404 alessandrosolbiati C Jan. 26, 2019, 2:59 p.m. OK PyPy 2 TESTS 24 139 2764800 1300
49224528 brurrito C Jan. 30, 2019, 9:26 p.m. OK PyPy 2 TESTS 24 140 2662400 1300
49171379 GuybrushThreepwood C Jan. 29, 2019, 6:20 p.m. OK PyPy 2 TESTS 24 140 6553600 1300
59496479 fastnoise C Aug. 25, 2019, 10:44 p.m. OK PyPy 2 TESTS 24 202 2867200 1300
50595800 III_Wolverine_III C Feb. 28, 2019, 10:06 a.m. OK PyPy 3 TESTS 24 155 6963200 1300
49784191 ZerocooL95 C Feb. 11, 2019, 6:55 p.m. OK PyPy 3 TESTS 24 155 11878400 1300
59577927 philipkonokhov C Aug. 27, 2019, 2:50 p.m. OK PyPy 3 TESTS 24 171 4915200 1300
56376304 snape_here C July 1, 2019, 6:41 a.m. OK PyPy 3 TESTS 24 171 4915200 1300
56395830 snape_here C July 1, 2019, 2:33 p.m. OK PyPy 3 TESTS 24 171 5939200 1300
49904585 sybergeek C Feb. 14, 2019, 11:19 a.m. OK PyPy 3 TESTS 24 171 6860800 1300
50241162 DomiKo C Feb. 20, 2019, 12:59 p.m. OK PyPy 3 TESTS 24 171 7065600 1300
56619394 SarveshDubey C July 6, 2019, 11:21 a.m. OK PyPy 3 TESTS 24 171 10137600 1300
67146652 WA-----Me-----AC C Dec. 18, 2019, 9:07 a.m. OK PyPy 3 TESTS 24 187 4608000 1300
67146622 ZeroooIQ C Dec. 18, 2019, 9:07 a.m. OK PyPy 3 TESTS 24 187 4608000 1300
48908461 scambret C Jan. 24, 2019, 11 p.m. OK Python 2 TESTS 24 280 4710400 1300
48927385 mshubham C Jan. 25, 2019, 11:09 a.m. OK Python 2 TESTS 24 295 5222400 1300
50036211 nealzane C Feb. 16, 2019, 8:55 p.m. OK Python 2 TESTS 24 358 10137600 1300
51694620 allonsy_kim C March 22, 2019, 3:27 p.m. OK Python 2 TESTS 24 389 10035200 1300
49388137 Xeronn C Feb. 3, 2019, 8:11 a.m. OK Python 2 TESTS 24 389 10956800 1300
49283367 Ex0d1a C Jan. 31, 2019, 5:08 p.m. OK Python 2 TESTS 24 389 10956800 1300
49291350 ehsanoo C Jan. 31, 2019, 7:30 p.m. OK Python 2 TESTS 24 405 9625600 1300
60604294 darsh065 C Sept. 15, 2019, 8:55 a.m. OK Python 2 TESTS 24 420 10752000 1300
50097758 Luxo C Feb. 18, 2019, 1:31 p.m. OK Python 2 TESTS 24 514 2048000 1300
52308346 blackscholar C April 4, 2019, 1:24 p.m. OK Python 2 TESTS 24 514 3686400 1300
53226111 Yads C April 24, 2019, 2:34 p.m. OK Python 3 TESTS 24 109 1024000 1300
49558710 IQuant C Feb. 7, 2019, 11:21 a.m. OK Python 3 TESTS 24 124 1638400 1300
55805161 tchr C June 19, 2019, 9:34 p.m. OK Python 3 TESTS 24 139 2560000 1300
49194046 SleepZzz C Jan. 30, 2019, 9:31 a.m. OK Python 3 TESTS 24 155 1740800 1300
49049658 Gol_D C Jan. 27, 2019, 10:26 a.m. OK Python 3 TESTS 24 171 1638400 1300
63977579 Annvv C Nov. 1, 2019, 9:01 a.m. OK Python 3 TESTS 24 171 2048000 1300
50888249 j30ng C March 6, 2019, 12:11 p.m. OK Python 3 TESTS 24 187 2457600 1300
49450177 brijmohan6499 C Feb. 4, 2019, 6:39 a.m. OK Python 3 TESTS 24 202 921600 1300
50117301 demony C Feb. 18, 2019, 4:23 p.m. OK Python 3 TESTS 24 202 1126400 1300
49194741 BeautyYu C Jan. 30, 2019, 9:52 a.m. OK Python 3 TESTS 24 202 2560000 1300
49283158 ehsanoo C Jan. 31, 2019, 5:05 p.m. OK Ruby TESTS 24 405 7782400 1300
59971477 sansen C Sept. 4, 2019, 1:44 a.m. OK Rust TESTS 24 31 1945600 1300
48940046 brooksm C Jan. 25, 2019, 4:04 p.m. OK Rust TESTS 24 46 512000 1300
49140294 Drewtato C Jan. 29, 2019, 9:51 a.m. OK Rust TESTS 24 46 819200 1300
48943258 hot_yoghurt C Jan. 25, 2019, 5:43 p.m. OK Scala TESTS 24 889 62464000 1300

remove filters

Back to search problems