Codeforces Round 608 (Div. 2)

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
1271 Codeforces Round 608 (Div. 2) FINISHED False 7200 155421899 Dec. 15, 2019, 9:15 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11408 ) B Blocks PROGRAMMING greedy math 1300

B'There are n blocks arranged in a row and numbered from left to right, starting from one. Each block is either black or white. You may perform the following operation zero or more times: choose two adjacent blocks and invert their colors (white block becomes black, and vice versa). You want to find a sequence of operations, such that they make all the blocks having the same color. You don 't have to minimize the number of operations, but it should not exceed 3 cdot n . If it is impossible to find such a sequence of operations, you need to report it. The first line contains one integer n ( 2 <= n <= 200 ) -- the number of blocks. The second line contains one string s consisting of n characters, each character is either "W" or "B". If the i -th character is "W", then the i -th block is white. If the i -th character is "B", then the i -th block is black. If it is impossible to make all the blocks having the same color, print -1 . Otherwise, print an integer k ( 0 <= k <= 3 cdot n ) -- the number of operations. Then print k integers p_1, p_2, ... , p_k (1 <= p_j <= n - 1) , where p_j is the position of the left block in the pair of blocks that should be affected by the j -th operation. If there are multiple answers, print any of them. In the first example, it is possible to make all blocks black in 3 operations. Start with changing blocks 6 and 7 , so the sequence is "BWWWWBBB". Then change blocks 2 and 3 , so the sequence is "BBBWWBB". And finally, change blocks 4 and 5 , so all blocks are black. It is impossible to make all colors equal in the second example. All blocks are already white in the third example. In the fourth example it is possible to make all blocks white in two operations: first operation is to change blocks 2 and 3 (so the sequence is "BBW"), and then change blocks 1 and 2 '...

Tutorials

72247

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66948775 daut-dlang B Dec. 15, 2019, 9:44 a.m. OK D TESTS 56 31 0 1300
66958100 roman_povolotskii B Dec. 15, 2019, 10:32 a.m. OK Delphi TESTS 56 31 102400 1300
66948730 ruban B Dec. 15, 2019, 9:44 a.m. OK Delphi TESTS 56 31 23347200 1300
67483499 calonmaster B Dec. 23, 2019, 4:42 p.m. OK FPC TESTS 56 31 102400 1300
66949196 dblark B Dec. 15, 2019, 9:46 a.m. OK FPC TESTS 56 31 102400 1300
66955841 PAG B Dec. 15, 2019, 10:19 a.m. OK FPC TESTS 56 31 102400 1300
66950789 LaSWeeG B Dec. 15, 2019, 9:52 a.m. OK FPC TESTS 56 31 307200 1300
68607608 canhtoantpvp B Jan. 11, 2020, 2:35 p.m. OK FPC TESTS 56 31 307200 1300
66981956 Just_Matvey B Dec. 15, 2019, 4:44 p.m. OK FPC TESTS 56 31 409600 1300
67009163 dblark B Dec. 16, 2019, 9:10 a.m. OK FPC TESTS 56 31 409600 1300
66946320 Fidisk B Dec. 15, 2019, 9:36 a.m. OK FPC TESTS 56 46 204800 1300
66950922 Dbvivi B Dec. 15, 2019, 9:53 a.m. OK FPC TESTS 56 46 409600 1300
66974672 XLeVi_AcKeRmAnX B Dec. 15, 2019, 2:15 p.m. OK GNU C11 TESTS 56 30 0 1300
67045898 FE40536 B Dec. 16, 2019, 10:16 p.m. OK GNU C11 TESTS 56 31 0 1300
67158501 gayatrirama B Dec. 18, 2019, 1:14 p.m. OK GNU C11 TESTS 56 31 0 1300
67160988 pajenegod B Dec. 18, 2019, 1:57 p.m. OK GNU C11 TESTS 56 31 0 1300
67282534 TheGodofTVSeries B Dec. 20, 2019, 1:27 p.m. OK GNU C11 TESTS 56 31 0 1300
67286377 vksingh.iitk28 B Dec. 20, 2019, 2:24 p.m. OK GNU C11 TESTS 56 31 0 1300
67451446 rahulgoel B Dec. 23, 2019, 4:31 a.m. OK GNU C11 TESTS 56 31 0 1300
67598496 ratul_supertramp B Dec. 25, 2019, 11:04 a.m. OK GNU C11 TESTS 56 31 0 1300
67631105 harsha.pathuri B Dec. 26, 2019, 4 a.m. OK GNU C11 TESTS 56 31 0 1300
67683039 lishb B Dec. 27, 2019, 7:25 a.m. OK GNU C11 TESTS 56 31 0 1300
67145534 adamchase B Dec. 18, 2019, 8:41 a.m. OK GNU C++11 TESTS 56 30 0 1300
66950451 yurzhang B Dec. 15, 2019, 9:51 a.m. OK GNU C++11 TESTS 56 30 0 1300
66953710 _dark_side B Dec. 15, 2019, 10:07 a.m. OK GNU C++11 TESTS 56 30 0 1300
66967896 is_ffacs B Dec. 15, 2019, 12:22 p.m. OK GNU C++11 TESTS 56 30 0 1300
66968343 vjudge4 B Dec. 15, 2019, 12:28 p.m. OK GNU C++11 TESTS 56 30 0 1300
69186757 TianwenAC B Jan. 20, 2020, 12:12 p.m. OK GNU C++11 TESTS 56 31 0 1300
69289787 The.Last.Wizard B Jan. 22, 2020, 9:45 a.m. OK GNU C++11 TESTS 56 31 0 1300
69416133 CodeSlayer007 B Jan. 23, 2020, 1:09 p.m. OK GNU C++11 TESTS 56 31 0 1300
69554836 bhardwajarpit1998 B Jan. 26, 2020, 8:19 a.m. OK GNU C++11 TESTS 56 31 0 1300
69557557 Reno_Jarrison B Jan. 26, 2020, 9:24 a.m. OK GNU C++11 TESTS 56 31 0 1300
67005993 arctic_bee B Dec. 16, 2019, 7:58 a.m. OK GNU C++14 TESTS 56 15 0 1300
68382857 kuhuu B Jan. 8, 2020, 3:16 a.m. OK GNU C++14 TESTS 56 15 0 1300
67325167 Y33T_M5TR B Dec. 21, 2019, 9:30 a.m. OK GNU C++14 TESTS 56 15 0 1300
67324841 naman_jain_2202 B Dec. 21, 2019, 9:23 a.m. OK GNU C++14 TESTS 56 15 0 1300
67317175 Saubhik_Pandey B Dec. 21, 2019, 6:34 a.m. OK GNU C++14 TESTS 56 15 0 1300
67149186 Edge11 B Dec. 18, 2019, 10:04 a.m. OK GNU C++14 TESTS 56 15 0 1300
67051169 mikeleven B Dec. 17, 2019, 4:10 a.m. OK GNU C++14 TESTS 56 15 0 1300
67032991 _NaMiKaze_ B Dec. 16, 2019, 4:27 p.m. OK GNU C++14 TESTS 56 15 0 1300
67030199 YosTauil B Dec. 16, 2019, 3:38 p.m. OK GNU C++14 TESTS 56 15 0 1300
66943798 kien672002 B Dec. 15, 2019, 9:28 a.m. OK GNU C++14 TESTS 56 15 0 1300
69288037 deepakgokhru11 B Jan. 22, 2020, 9:02 a.m. OK GNU C++17 TESTS 56 15 0 1300
66977769 oshawott_cute B Dec. 15, 2019, 3:18 p.m. OK GNU C++17 TESTS 56 15 0 1300
66991005 rising_from_the_ashes B Dec. 15, 2019, 8:23 p.m. OK GNU C++17 TESTS 56 15 0 1300
67041714 GuptaGaurang B Dec. 16, 2019, 7:36 p.m. OK GNU C++17 TESTS 56 15 0 1300
67179278 eugeninic B Dec. 18, 2019, 9:18 p.m. OK GNU C++17 TESTS 56 15 0 1300
67313199 at_kansal B Dec. 21, 2019, 4:27 a.m. OK GNU C++17 TESTS 56 15 0 1300
67314261 darth_coder B Dec. 21, 2019, 5:07 a.m. OK GNU C++17 TESTS 56 15 0 1300
67439206 DynamicNabil B Dec. 22, 2019, 6:30 p.m. OK GNU C++17 TESTS 56 15 0 1300
67785275 we_are_267 B Dec. 28, 2019, 12:31 p.m. OK GNU C++17 TESTS 56 15 0 1300
67076608 SmartvV B Dec. 17, 2019, 2:41 p.m. OK GNU C++17 TESTS 56 15 1024000 1300
68010840 amarjeetanand B Dec. 31, 2019, 3:41 p.m. OK Go TESTS 56 31 0 1300
67286023 Temurbek B Dec. 20, 2019, 2:18 p.m. OK Go TESTS 56 31 0 1300
67140384 Recoder B Dec. 18, 2019, 6:29 a.m. OK Go TESTS 56 31 0 1300
67136462 WeHaveInt B Dec. 18, 2019, 4:33 a.m. OK Go TESTS 56 31 0 1300
66959077 maguroguma B Dec. 15, 2019, 10:39 a.m. OK Go TESTS 56 46 0 1300
66944214 caidodo0_0 B Dec. 15, 2019, 9:29 a.m. OK Go TESTS 56 46 0 1300
66995028 Russell_Emerine B Dec. 16, 2019, 12:16 a.m. OK Haskell TESTS 56 31 102400 1300
68949735 Tardimgg B Jan. 16, 2020, 5:31 p.m. OK Java 11 TESTS 56 171 0 1300
67437641 pushpraj17307 B Dec. 22, 2019, 5:52 p.m. OK Java 11 TESTS 56 187 0 1300
69273020 Bhavesh13 B Jan. 21, 2020, 10:58 p.m. OK Java 11 TESTS 56 202 0 1300
67270998 TheDarkKnight03 B Dec. 20, 2019, 8:18 a.m. OK Java 11 TESTS 56 202 0 1300
67181567 kamesh.joshi B Dec. 18, 2019, 11:57 p.m. OK Java 11 TESTS 56 202 0 1300
67134305 -Faker B Dec. 18, 2019, 2:59 a.m. OK Java 11 TESTS 56 202 0 1300
67056036 Gautam_009 B Dec. 17, 2019, 6:54 a.m. OK Java 11 TESTS 56 202 0 1300
67000775 potatmen B Dec. 16, 2019, 5:35 a.m. OK Java 11 TESTS 56 202 0 1300
66995995 CodAR B Dec. 16, 2019, 1:29 a.m. OK Java 11 TESTS 56 202 0 1300
66983612 its_aks_ulure B Dec. 15, 2019, 5:16 p.m. OK Java 11 TESTS 56 202 0 1300
69073578 dipankar12 B Jan. 19, 2020, 12:54 a.m. OK Java 8 TESTS 56 109 0 1300
68666681 manan_0104 B Jan. 12, 2020, 3:23 p.m. OK Java 8 TESTS 56 109 0 1300
67614205 Xylenox B Dec. 25, 2019, 4:34 p.m. OK Java 8 TESTS 56 109 0 1300
67494500 Mann_27__ B Dec. 23, 2019, 9:26 p.m. OK Java 8 TESTS 56 109 0 1300
67488709 rohanakar B Dec. 23, 2019, 6:29 p.m. OK Java 8 TESTS 56 109 0 1300
67475779 kritika_29 B Dec. 23, 2019, 2:19 p.m. OK Java 8 TESTS 56 109 0 1300
67445425 gouh9qn B Dec. 22, 2019, 9:51 p.m. OK Java 8 TESTS 56 109 0 1300
67328487 niteshgowda B Dec. 21, 2019, 10:41 a.m. OK Java 8 TESTS 56 109 0 1300
67282204 devesh08 B Dec. 20, 2019, 1:21 p.m. OK Java 8 TESTS 56 109 0 1300
67264781 insane_28 B Dec. 20, 2019, 5:37 a.m. OK Java 8 TESTS 56 109 0 1300
67448371 a11eca B Dec. 23, 2019, 1:09 a.m. OK Kotlin TESTS 56 140 0 1300
67133502 slemus B Dec. 18, 2019, 2:15 a.m. OK Kotlin TESTS 56 140 614400 1300
66959540 butoff B Dec. 15, 2019, 10:42 a.m. OK Kotlin TESTS 56 155 0 1300
66959312 AsuraPro B Dec. 15, 2019, 10:40 a.m. OK Kotlin TESTS 56 155 102400 1300
66953775 wbars B Dec. 15, 2019, 10:07 a.m. OK Kotlin TESTS 56 156 0 1300
67193679 hcmdgh B Dec. 19, 2019, 8:09 a.m. OK Kotlin TESTS 56 156 409600 1300
66957389 agent-10 B Dec. 15, 2019, 10:28 a.m. OK Kotlin TESTS 56 171 1024000 1300
68160453 Spheniscine B Jan. 4, 2020, 10:38 a.m. OK Kotlin TESTS 56 186 0 1300
67254663 djincs B Dec. 19, 2019, 9:05 p.m. OK Mono C# TESTS 56 46 102400 1300
69456768 TRR B Jan. 24, 2020, 8:58 a.m. OK Mono C# TESTS 56 62 0 1300
67050652 kolokolo21kolo B Dec. 17, 2019, 3:46 a.m. OK Mono C# TESTS 56 62 0 1300
68238472 k1llama B Jan. 5, 2020, 11:54 a.m. OK Mono C# TESTS 56 62 0 1300
67410101 nastya1199 B Dec. 22, 2019, 8 a.m. OK Mono C# TESTS 56 62 0 1300
66952767 Giangvp B Dec. 15, 2019, 10:02 a.m. OK Mono C# TESTS 56 62 3584000 1300
68027923 camypaper B Jan. 1, 2020, 7:16 a.m. OK Mono C# TESTS 56 62 53760000 1300
66941588 kichi2004 B Dec. 15, 2019, 9:23 a.m. OK Mono C# TESTS 56 77 3686400 1300
66944655 plasma-effect B Dec. 15, 2019, 9:31 a.m. OK Mono C# TESTS 56 78 3686400 1300
66943606 mban259 B Dec. 15, 2019, 9:28 a.m. OK Mono C# TESTS 56 93 3686400 1300
66995789 vjudge2 B Dec. 16, 2019, 1:15 a.m. OK MS C++ TESTS 56 30 0 1300
67362543 vjudge1 B Dec. 21, 2019, 12:44 p.m. OK MS C++ TESTS 56 31 0 1300
68640829 vjudge2 B Jan. 12, 2020, 7:28 a.m. OK MS C++ TESTS 56 31 0 1300
68652928 vjudge2 B Jan. 12, 2020, 11:20 a.m. OK MS C++ TESTS 56 31 0 1300
68686086 vjudge4 B Jan. 13, 2020, 3:29 a.m. OK MS C++ TESTS 56 31 0 1300
67151699 vjudge4 B Dec. 18, 2019, 11:02 a.m. OK MS C++ TESTS 56 31 0 1300
68890665 vjudge3 B Jan. 16, 2020, 2:03 a.m. OK MS C++ TESTS 56 31 0 1300
67067263 lsattackcool B Dec. 17, 2019, 11:33 a.m. OK MS C++ TESTS 56 31 0 1300
66998572 Gleb_Dubosarskii B Dec. 16, 2019, 4:08 a.m. OK MS C++ TESTS 56 31 0 1300
67202326 seh631638554 B Dec. 19, 2019, 11:19 a.m. OK MS C++ TESTS 56 31 0 1300
66947905 c.u B Dec. 15, 2019, 9:41 a.m. OK MS C++ 2017 TESTS 56 31 0 1300
69234263 Mad112233 B Jan. 21, 2020, 10:40 a.m. OK MS C++ 2017 TESTS 56 31 0 1300
67523456 lcjWA B Dec. 24, 2019, 1:11 p.m. OK MS C++ 2017 TESTS 56 31 0 1300
66950516 Tangerine B Dec. 15, 2019, 9:51 a.m. OK MS C++ 2017 TESTS 56 31 0 1300
66948986 breaknow B Dec. 15, 2019, 9:45 a.m. OK MS C++ 2017 TESTS 56 31 0 1300
66944455 youx B Dec. 15, 2019, 9:30 a.m. OK MS C++ 2017 TESTS 56 31 0 1300
68120644 ZA139 B Jan. 3, 2020, 1:11 p.m. OK MS C++ 2017 TESTS 56 31 307200 1300
68493462 vjudge5 B Jan. 10, 2020, 12:33 p.m. OK MS C++ 2017 TESTS 56 31 307200 1300
68981092 hakobdilif B Jan. 17, 2020, 10:45 a.m. OK MS C++ 2017 TESTS 56 31 307200 1300
69062665 meanman B Jan. 18, 2020, 5:13 p.m. OK MS C++ 2017 TESTS 56 31 307200 1300
67009266 shivam1420 B Dec. 16, 2019, 9:12 a.m. OK Node.js TESTS 56 171 409600 1300
68639257 anonymous0314 B Jan. 12, 2020, 6:59 a.m. OK PyPy 2 TESTS 56 124 0 1300
67185029 aaa_bbb_ccc B Dec. 19, 2019, 3:55 a.m. OK PyPy 2 TESTS 56 124 0 1300
66944257 MVP B Dec. 15, 2019, 9:29 a.m. OK PyPy 2 TESTS 56 140 0 1300
66952434 11fingers B Dec. 15, 2019, 10 a.m. OK PyPy 2 TESTS 56 140 0 1300
66944638 Mukundan314 B Dec. 15, 2019, 9:30 a.m. OK PyPy 2 TESTS 56 140 0 1300
66942906 ContextLogic B Dec. 15, 2019, 9:26 a.m. OK PyPy 2 TESTS 56 140 0 1300
66942737 injust B Dec. 15, 2019, 9:25 a.m. OK PyPy 2 TESTS 56 140 0 1300
68326042 shehebe B Jan. 6, 2020, 4:54 p.m. OK PyPy 2 TESTS 56 140 1228800 1300
66999519 YouKnowNothing_JonSnow B Dec. 16, 2019, 4:47 a.m. OK PyPy 2 TESTS 56 155 0 1300
66945661 pa.n.ik B Dec. 15, 2019, 9:34 a.m. OK PyPy 2 TESTS 56 171 1228800 1300
68480321 supersangjin B Jan. 10, 2020, 7:28 a.m. OK PyPy 3 TESTS 56 140 0 1300
68289194 WA-----Me-----AC B Jan. 5, 2020, 8:02 p.m. OK PyPy 3 TESTS 56 140 0 1300
68143519 CY_Noob B Jan. 4, 2020, 1:58 a.m. OK PyPy 3 TESTS 56 140 0 1300
67777144 Mkay6122 B Dec. 28, 2019, 9:27 a.m. OK PyPy 3 TESTS 56 140 0 1300
67625904 malylesio B Dec. 25, 2019, 9:45 p.m. OK PyPy 3 TESTS 56 140 0 1300
67623033 III_Wolverine_III B Dec. 25, 2019, 7:50 p.m. OK PyPy 3 TESTS 56 140 0 1300
67607558 23sergey03 B Dec. 25, 2019, 2:09 p.m. OK PyPy 3 TESTS 56 140 0 1300
67448971 ehsanmath B Dec. 23, 2019, 2 a.m. OK PyPy 3 TESTS 56 140 0 1300
67324875 megabluejay B Dec. 21, 2019, 9:24 a.m. OK PyPy 3 TESTS 56 140 0 1300
67212299 yumtam B Dec. 19, 2019, 2:30 p.m. OK PyPy 3 TESTS 56 140 0 1300
67131161 eightants B Dec. 18, 2019, 12:23 a.m. OK Python 2 TESTS 56 171 0 1300
67036597 the_skinny_one B Dec. 16, 2019, 5:35 p.m. OK Python 2 TESTS 56 187 0 1300
66967730 grayGoose B Dec. 15, 2019, 12:20 p.m. OK Python 2 TESTS 56 187 0 1300
66947619 ekali B Dec. 15, 2019, 9:40 a.m. OK Python 2 TESTS 56 187 102400 1300
66956441 coderbd B Dec. 15, 2019, 10:22 a.m. OK Python 2 TESTS 56 217 0 1300
66944533 ram_lalla_hum_aagaye B Dec. 15, 2019, 9:30 a.m. OK Python 2 TESTS 56 218 0 1300
66942343 EvilEve B Dec. 15, 2019, 9:24 a.m. OK Python 2 TESTS 56 296 5324800 1300
66967908 ashashwat B Dec. 15, 2019, 12:22 p.m. OK Python 2 TESTS 56 311 5324800 1300
67176113 LintuStorm B Dec. 18, 2019, 7:20 p.m. OK Python 3 TESTS 56 109 0 1300
67165737 enraged B Dec. 18, 2019, 3:29 p.m. OK Python 3 TESTS 56 109 0 1300
67135876 binh.tran B Dec. 18, 2019, 4:10 a.m. OK Python 3 TESTS 56 109 0 1300
66990074 ShashankGoel.IITD B Dec. 15, 2019, 7:53 p.m. OK Python 3 TESTS 56 109 0 1300
66989300 juniorcompressor B Dec. 15, 2019, 7:32 p.m. OK Python 3 TESTS 56 109 0 1300
66985216 Erzed B Dec. 15, 2019, 5:50 p.m. OK Python 3 TESTS 56 109 0 1300
66971992 sruthi_1729 B Dec. 15, 2019, 1:29 p.m. OK Python 3 TESTS 56 109 0 1300
67203946 spellstaker B Dec. 19, 2019, 11:50 a.m. OK Python 3 TESTS 56 109 102400 1300
69283697 DrTrue B Jan. 22, 2020, 7:10 a.m. OK Python 3 TESTS 56 109 307200 1300
68943831 srijib_kesh B Jan. 16, 2020, 3:22 p.m. OK Python 3 TESTS 56 109 307200 1300
67183376 nemi_zzz B Dec. 19, 2019, 2:17 a.m. OK Ruby TESTS 56 62 204800 1300
67159195 gearjack B Dec. 18, 2019, 1:26 p.m. OK Rust TESTS 56 31 0 1300
66947191 sansen B Dec. 15, 2019, 9:39 a.m. OK Rust TESTS 56 31 0 1300
66943937 terraformer B Dec. 15, 2019, 9:29 a.m. OK Rust TESTS 56 31 0 1300
66950666 akiradeveloper B Dec. 15, 2019, 9:52 a.m. OK Rust TESTS 56 31 204800 1300
67030757 Kaa B Dec. 16, 2019, 3:47 p.m. OK Rust TESTS 56 46 0 1300
66943061 yakamoto B Dec. 15, 2019, 9:26 a.m. OK Scala TESTS 56 483 0 1300

remove filters

Back to search problems