Codeforces Round 575 (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
1196 Codeforces Round 575 (Div. 3) FINISHED False 7200 167844299 July 24, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10582 ) D1 RGB Substring (easy version) PROGRAMMING implementation 1500

B'The only difference between easy and hard versions is the size of the input. You are given a string s consisting of n characters, each character is 'R ', 'G ' or 'B '. You are also given an integer k . Your task is to change the minimum number of characters in the initial string s so that after the changes there will be a string of length k that is a substring of s , and is also a substring of the infinite string "RGBRGBRGB ...". A string a is a substring of string b if there exists a positive integer i such that a_1 = b_i , a_2 = b_{i + 1} , a_3 = b_{i + 2} , ..., a_{|a|} = b_{i + |a| - 1} . For example, strings "GBRG", "B", "BR" are substrings of the infinite string "RGBRGBRGB ..." while "GR", "RGR" and "GGG" are not. You have to answer q independent queries. The first line of the input contains one integer q ( 1 <= q <= 2000 ) -- the number of queries. Then q queries follow. The first line of the query contains two integers n and k ( 1 <= k <= n <= 2000 ) -- the length of the string s and the length of the substring. The second line of the query contains a string s consisting of n characters 'R ', 'G ' and 'B '. It is guaranteed that the sum of n over all queries does not exceed 2000 ( sum n <= 2000 ). For each query print one integer -- the minimum number of characters you need to change in the initial string s so that after changing there will be a substring of length k in s that is also a substring of the infinite string "RGBRGBRGB ...". In the first example, you can change the first character to 'R ' and obtain the substring "RG", or change the second character to 'R ' and obtain "BR", or change the third, fourth or fifth character to 'B ' and obtain "GB". In the second example, the substring is "BRG". '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57845056 arounderstands D1 July 27, 2019, 10:46 a.m. OK Clang++17 Diagnostics TESTS 12 46 0 1500
66026590 vjudge3 D1 Nov. 30, 2019, 8:53 a.m. OK Clang++17 Diagnostics TESTS 12 62 1331200 1500
58053825 Manirathnamgodi D1 July 31, 2019, 3:57 a.m. OK Clang++17 Diagnostics TESTS 12 249 8396800 1500
58155689 hatsuyuki15 D1 Aug. 2, 2019, 5:30 a.m. OK D TESTS 12 31 1638400 1500
57860359 ruban D1 July 27, 2019, 5:27 p.m. OK Delphi TESTS 12 30 137318400 1500
60401830 Denor D1 Sept. 11, 2019, 4:59 p.m. OK Delphi TESTS 12 31 102400 1500
58193477 Craspedacusta D1 Aug. 2, 2019, 9:24 p.m. OK FPC TESTS 12 31 1024000 1500
57807627 TranKha D1 July 26, 2019, 3:49 p.m. OK FPC TESTS 12 46 921600 1500
57839852 cs234_shrey D1 July 27, 2019, 8:54 a.m. OK GNU C11 TESTS 12 30 0 1500
57810016 kakashi207 D1 July 26, 2019, 4:50 p.m. OK GNU C11 TESTS 12 30 0 1500
59803632 ishanmodi13 D1 Aug. 31, 2019, 11:08 a.m. OK GNU C11 TESTS 12 31 0 1500
59572491 shenlihong D1 Aug. 27, 2019, 1:03 p.m. OK GNU C11 TESTS 12 31 0 1500
59572285 luogu_bot1 D1 Aug. 27, 2019, 12:59 p.m. OK GNU C11 TESTS 12 31 0 1500
59572272 luogu_bot3 D1 Aug. 27, 2019, 12:59 p.m. OK GNU C11 TESTS 12 31 0 1500
59572232 luogu_bot1 D1 Aug. 27, 2019, 12:58 p.m. OK GNU C11 TESTS 12 31 0 1500
59571249 lcr2580 shenlihong wh0816 D1 Aug. 27, 2019, 12:39 p.m. OK GNU C11 TESTS 12 31 0 1500
58052842 mounika.nandyala2000 D1 July 31, 2019, 3:24 a.m. OK GNU C11 TESTS 12 31 0 1500
62594304 razi2001 D1 Oct. 15, 2019, 12:13 a.m. OK GNU C11 TESTS 12 31 0 1500
59878240 AlphaBetaTheta D1 Sept. 2, 2019, 2:18 a.m. OK GNU C++11 TESTS 12 15 0 1500
58913520 priyanshu07 D1 Aug. 16, 2019, 2 p.m. OK GNU C++11 TESTS 12 15 0 1500
58302724 shishin D1 Aug. 4, 2019, 6:28 p.m. OK GNU C++11 TESTS 12 15 0 1500
58269392 luogu_bot5 D1 Aug. 4, 2019, 4:12 p.m. OK GNU C++11 TESTS 12 15 0 1500
58179796 ruchamp D1 Aug. 2, 2019, 2:41 p.m. OK GNU C++11 TESTS 12 15 0 1500
57916180 iamtyy D1 July 29, 2019, 1:30 a.m. OK GNU C++11 TESTS 12 15 0 1500
57743756 Debasish1610177113 D1 July 25, 2019, 12:18 p.m. OK GNU C++11 TESTS 12 15 0 1500
67980033 slowman D1 Dec. 30, 2019, 6:45 p.m. OK GNU C++11 TESTS 12 15 0 1500
61752144 sake_poem D1 Oct. 3, 2019, 3:56 a.m. OK GNU C++11 TESTS 12 15 0 1500
57737889 dohonghuan D1 July 25, 2019, 10:30 a.m. OK GNU C++11 TESTS 12 15 102400 1500
67456562 rasa D1 Dec. 23, 2019, 7:09 a.m. OK GNU C++14 TESTS 12 15 0 1500
68702192 vjudge3 D1 Jan. 13, 2020, 9:50 a.m. OK GNU C++14 TESTS 12 15 0 1500
69206899 KoroVishu D1 Jan. 20, 2020, 6:18 p.m. OK GNU C++14 TESTS 12 15 0 1500
69233412 sachin208 D1 Jan. 21, 2020, 10:22 a.m. OK GNU C++14 TESTS 12 15 0 1500
69435454 ...nEhrA D1 Jan. 23, 2020, 6:47 p.m. OK GNU C++14 TESTS 12 15 0 1500
69465781 deathbloom D1 Jan. 24, 2020, 12:48 p.m. OK GNU C++14 TESTS 12 15 0 1500
69857796 3.0 D1 Jan. 30, 2020, 5:31 p.m. OK GNU C++14 TESTS 12 15 0 1500
67415009 vishisht_2 D1 Dec. 22, 2019, 9:35 a.m. OK GNU C++14 TESTS 12 15 0 1500
67254343 abhinavvv306 D1 Dec. 19, 2019, 8:51 p.m. OK GNU C++14 TESTS 12 15 0 1500
67386168 jhots D1 Dec. 21, 2019, 5:54 p.m. OK GNU C++14 TESTS 12 15 0 1500
66662166 Semal10 D1 Dec. 12, 2019, 5:11 a.m. OK GNU C++17 TESTS 12 15 0 1500
69283804 emoseW D1 Jan. 22, 2020, 7:13 a.m. OK GNU C++17 TESTS 12 15 0 1500
68243681 harshita.nit D1 Jan. 5, 2020, 1:45 p.m. OK GNU C++17 TESTS 12 15 0 1500
68078220 kg1910 D1 Jan. 2, 2020, 1:24 p.m. OK GNU C++17 TESTS 12 15 0 1500
67658514 Falak19 D1 Dec. 26, 2019, 2:49 p.m. OK GNU C++17 TESTS 12 15 0 1500
67614962 _WorstCase_ D1 Dec. 25, 2019, 4:51 p.m. OK GNU C++17 TESTS 12 15 0 1500
67504441 vjudge5 D1 Dec. 24, 2019, 6:33 a.m. OK GNU C++17 TESTS 12 15 0 1500
67307954 vjudge3 D1 Dec. 20, 2019, 11:10 p.m. OK GNU C++17 TESTS 12 15 0 1500
67195827 H_M_Vaghasiya D1 Dec. 19, 2019, 9 a.m. OK GNU C++17 TESTS 12 15 0 1500
66937132 _fl0P_ D1 Dec. 15, 2019, 8:47 a.m. OK GNU C++17 TESTS 12 15 0 1500
59698793 reanimatorzon D1 Aug. 30, 2019, 9:43 a.m. OK Go TESTS 12 31 0 1500
62839192 sighduck D1 Oct. 18, 2019, 1:20 a.m. OK Go TESTS 12 31 0 1500
57795161 serhiimazurok D1 July 26, 2019, 11:08 a.m. OK Go TESTS 12 46 0 1500
57937871 jmazon D1 July 29, 2019, 11:29 a.m. OK Haskell TESTS 12 46 102400 1500
64348160 Rajkin_Hossain D1 Nov. 6, 2019, 7:16 a.m. OK Java 8 TESTS 12 93 0 1500
57823466 sameer_hack D1 July 27, 2019, 1:26 a.m. OK Java 8 TESTS 12 108 0 1500
62849397 dyhu083 D1 Oct. 18, 2019, 6:43 a.m. OK Java 8 TESTS 12 108 0 1500
57791938 In_The_Name_Of_Love D1 July 26, 2019, 9:48 a.m. OK Java 8 TESTS 12 108 0 1500
58173596 Ziklon D1 Aug. 2, 2019, 12:16 p.m. OK Java 8 TESTS 12 108 0 1500
58340246 sergioRG D1 Aug. 5, 2019, 12:57 p.m. OK Java 8 TESTS 12 109 0 1500
59334275 robinz62 D1 Aug. 23, 2019, 3:31 a.m. OK Java 8 TESTS 12 109 0 1500
59097847 marcose18 D1 Aug. 19, 2019, 2:52 p.m. OK Java 8 TESTS 12 109 0 1500
58867181 PaoloP D1 Aug. 15, 2019, 1:50 p.m. OK Java 8 TESTS 12 109 0 1500
58787365 DaGr8Nave D1 Aug. 14, 2019, 12:01 a.m. OK Java 8 TESTS 12 109 0 1500
57743071 bohuss D1 July 25, 2019, 12:05 p.m. OK Kotlin TESTS 12 140 0 1500
57728084 kkyuggu D1 July 25, 2019, 7:46 a.m. OK Kotlin TESTS 12 155 204800 1500
58226741 Spheniscine D1 Aug. 3, 2019, 2:47 p.m. OK Kotlin TESTS 12 170 1433600 1500
60194527 Benq D1 Sept. 7, 2019, 12:26 a.m. OK Kotlin TESTS 12 171 204800 1500
57730620 Flame239 D1 July 25, 2019, 8:29 a.m. OK Kotlin TESTS 12 186 1228800 1500
57948232 thuutin D1 July 29, 2019, 3:14 p.m. OK Kotlin TESTS 12 186 1331200 1500
58028274 og.kostya D1 July 30, 2019, 4:20 p.m. OK Mono C# TESTS 12 46 102400 1500
58083982 TRR D1 July 31, 2019, 2:51 p.m. OK Mono C# TESTS 12 46 204800 1500
58111937 treasuryonly D1 Aug. 1, 2019, 7:32 a.m. OK Mono C# TESTS 12 61 204800 1500
57936394 batraz D1 July 29, 2019, 10:56 a.m. OK Mono C# TESTS 12 62 204800 1500
57789348 NEvOl D1 July 26, 2019, 8:55 a.m. OK Mono C# TESTS 12 62 3993600 1500
57790162 NEvOl D1 July 26, 2019, 9:10 a.m. OK Mono C# TESTS 12 77 4096000 1500
57746908 aliaksei.smaliuk D1 July 25, 2019, 1:21 p.m. OK Mono C# TESTS 12 93 4710400 1500
65475292 vjudge5 D1 Nov. 21, 2019, 9:49 a.m. OK MS C++ TESTS 12 15 5017600 1500
57769668 VIMINAREMAX D1 July 25, 2019, 11:22 p.m. OK MS C++ TESTS 12 30 0 1500
69647274 vjudge2 D1 Jan. 28, 2020, 2:28 a.m. OK MS C++ TESTS 12 30 0 1500
61552905 vjudge2 D1 Sept. 30, 2019, 1:05 p.m. OK MS C++ TESTS 12 30 0 1500
58496757 vjudge2 D1 Aug. 9, 2019, 12:30 p.m. OK MS C++ TESTS 12 30 0 1500
57775188 vjudge1 D1 July 26, 2019, 3:07 a.m. OK MS C++ TESTS 12 30 0 1500
58160287 vjudge5 D1 Aug. 2, 2019, 7:11 a.m. OK MS C++ TESTS 12 30 1228800 1500
68859385 vjudge3 D1 Jan. 15, 2020, 11:35 a.m. OK MS C++ TESTS 12 31 0 1500
66026878 vjudge1 D1 Nov. 30, 2019, 8:57 a.m. OK MS C++ TESTS 12 31 0 1500
68859608 vjudge4 D1 Jan. 15, 2020, 11:39 a.m. OK MS C++ TESTS 12 31 0 1500
57744187 liuhb D1 July 25, 2019, 12:27 p.m. OK MS C++ 2017 TESTS 12 15 0 1500
57801953 yp0417180230 D1 July 26, 2019, 1:37 p.m. OK MS C++ 2017 TESTS 12 15 0 1500
58064330 yyoooo D1 July 31, 2019, 8:27 a.m. OK MS C++ 2017 TESTS 12 15 0 1500
57748640 pmitkov D1 July 25, 2019, 1:57 p.m. OK MS C++ 2017 TESTS 12 15 3379200 1500
57776455 Kostyanchik D1 July 26, 2019, 3:49 a.m. OK MS C++ 2017 TESTS 12 30 0 1500
58005164 ultras D1 July 30, 2019, 3:03 p.m. OK MS C++ 2017 TESTS 12 30 0 1500
61597219 nacl_jht D1 Oct. 1, 2019, 9:20 a.m. OK MS C++ 2017 TESTS 12 31 0 1500
60569893 Taraxacum ahav _Artyom_ D1 Sept. 14, 2019, 3:23 p.m. OK MS C++ 2017 TESTS 12 31 0 1500
60171190 HelloWorld1024 Yanhui Cuc-center D1 Sept. 6, 2019, 12:57 p.m. OK MS C++ 2017 TESTS 12 31 0 1500
66027093 vjudge5 D1 Nov. 30, 2019, 9:01 a.m. OK MS C++ 2017 TESTS 12 31 0 1500
57795512 mayakin D1 July 26, 2019, 11:15 a.m. OK PHP TESTS 12 46 0 1500
57765732 mayakin D1 July 25, 2019, 8:17 p.m. OK PHP TESTS 12 311 0 1500
57765802 mayakin D1 July 25, 2019, 8:20 p.m. OK PHP TESTS 12 327 0 1500
57766215 IngaleAnkur10 D1 July 25, 2019, 8:36 p.m. OK PyPy 2 TESTS 12 170 2662400 1500
58515581 Quirinius D1 Aug. 9, 2019, 10:53 p.m. OK PyPy 2 TESTS 12 186 2355200 1500
57945589 thuutin D1 July 29, 2019, 2:12 p.m. OK PyPy 2 TESTS 12 217 3584000 1500
57840345 hoangphuoc25 D1 July 27, 2019, 9:04 a.m. OK PyPy 2 TESTS 12 217 4812800 1500
57741783 Saurabh66 D1 July 25, 2019, 11:40 a.m. OK PyPy 2 TESTS 12 233 2355200 1500
58829455 wolffd D1 Aug. 14, 2019, 5:17 p.m. OK PyPy 2 TESTS 12 233 4812800 1500
59587281 iprakhar22 D1 Aug. 27, 2019, 6:34 p.m. OK PyPy 2 TESTS 12 249 6041600 1500
57896836 yumtam D1 July 28, 2019, 1:57 p.m. OK PyPy 2 TESTS 12 264 29798400 1500
57897646 petya47 D1 July 28, 2019, 2:16 p.m. OK PyPy 3 TESTS 12 171 2969600 1500
57829030 shubham0290 D1 July 27, 2019, 5:15 a.m. OK PyPy 3 TESTS 12 171 3481600 1500
57735331 MalleAbile D1 July 25, 2019, 9:47 a.m. OK PyPy 3 TESTS 12 171 3481600 1500
57804758 sm1ley D1 July 26, 2019, 2:42 p.m. OK PyPy 3 TESTS 12 171 4300800 1500
58405487 Jon D1 Aug. 6, 2019, 8:18 p.m. OK PyPy 3 TESTS 12 171 4505600 1500
57802723 Vovkaez D1 July 26, 2019, 1:54 p.m. OK PyPy 3 TESTS 12 171 5120000 1500
57833923 essi D1 July 27, 2019, 6:55 a.m. OK PyPy 3 TESTS 12 186 3276800 1500
57800901 Pokeylope D1 July 26, 2019, 1:14 p.m. OK PyPy 3 TESTS 12 186 3891200 1500
57798083 yfo D1 July 26, 2019, 12:12 p.m. OK PyPy 3 TESTS 12 186 4198400 1500
58536538 v1adimir D1 Aug. 10, 2019, 12:09 p.m. OK PyPy 3 TESTS 12 186 4710400 1500
58136598 soumyasarkar1998 D1 Aug. 1, 2019, 4:21 p.m. OK Python 2 TESTS 12 171 102400 1500
57818697 xbbjames1 D1 July 26, 2019, 9:20 p.m. OK Python 2 TESTS 12 171 102400 1500
59587224 iprakhar22 D1 Aug. 27, 2019, 6:32 p.m. OK Python 2 TESTS 12 186 0 1500
58179965 renjied D1 Aug. 2, 2019, 2:46 p.m. OK Python 2 TESTS 12 202 0 1500
58554543 daniel.carlos D1 Aug. 11, 2019, 12:13 a.m. OK Python 2 TESTS 12 841 102400 1500
57903385 Helli.code D1 July 28, 2019, 4:36 p.m. OK Python 2 TESTS 12 1044 102400 1500
66192719 ttchengab D1 Dec. 2, 2019, 5:08 p.m. OK Python 2 TESTS 12 1107 0 1500
57897318 petya47 D1 July 28, 2019, 2:09 p.m. OK Python 3 TESTS 12 109 0 1500
57727394 echikawa D1 July 25, 2019, 7:34 a.m. OK Python 3 TESTS 12 109 307200 1500
58135626 bytilda D1 Aug. 1, 2019, 3:59 p.m. OK Python 3 TESTS 12 124 0 1500
57850755 adishreemaz09 D1 July 27, 2019, 1:02 p.m. OK Python 3 TESTS 12 124 0 1500
57808854 kp_2141 D1 July 26, 2019, 4:20 p.m. OK Python 3 TESTS 12 124 0 1500
57763018 nothing10 D1 July 25, 2019, 6:48 p.m. OK Python 3 TESTS 12 124 0 1500
58127661 renjied D1 Aug. 1, 2019, 1:10 p.m. OK Python 3 TESTS 12 124 102400 1500
67920498 sureshsinghspd D1 Dec. 29, 2019, 4:15 p.m. OK Python 3 TESTS 12 124 307200 1500
57861610 asvasil D1 July 27, 2019, 6:09 p.m. OK Python 3 TESTS 12 124 307200 1500
58254941 maslov.alex1580 D1 Aug. 4, 2019, 9:33 a.m. OK Python 3 TESTS 12 124 409600 1500
60935307 nemi_zzz D1 Sept. 20, 2019, 3:05 p.m. OK Ruby TESTS 12 62 204800 1500
59140944 Andrey_R D1 Aug. 20, 2019, 2:24 p.m. OK Ruby TESTS 12 889 0 1500
57975117 hello-noob D1 July 30, 2019, 7:25 a.m. OK Scala TESTS 12 467 0 1500

remove filters

Back to search problems