Codeforces Round 859 (Div. 4)

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
1807 Codeforces Round 859 (Div. 4) FINISHED False 8100 58028663 March 19, 2023, 2:55 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 31279 ) C Find and Replace PROGRAMMING greedy implementation strings

B'You are given a string s consisting of lowercase Latin characters. In an operation, you can take a character and replace all occurrences of this character with texttt{0} or replace all occurrences of this character with texttt{1} . Is it possible to perform some number of moves so that the resulting string is an alternating binary string ^{ dagger} ? For example, consider the string texttt{abacaba} . You can perform the following moves: ^{ dagger} An alternating binary string is a string of texttt{0} s and texttt{1} s such that no two adjacent bits are equal. For example, texttt{01010101} , texttt{101} , texttt{1} are alternating binary strings, but texttt{0110} , texttt{0a0a0} , texttt{10100} are not. The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains an integer n ( 1 <= q n <= q 2000 ) -- the length of the string s . The second line of each test case contains a string consisting of n lowercase Latin characters -- the string s . For each test case, output "YES" (without quotes) if you can make the string into an alternating binary string, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer). The first test case is explained in the statement. In the second test case, the only possible binary strings you can make are texttt{00} and texttt{11} , neither of which are alternating. In the third test case, you can make texttt{1} , which is an alternating binary string. '...

Tutorials

114143

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
198289707 bluemegane C March 19, 2023, 11:06 p.m. OK C# 8 TESTS 4 62 819200
198308040 anau11 C March 20, 2023, 4:20 a.m. OK C# 8 TESTS 4 77 3174400
198299912 PHANHUUTUANKIET C March 20, 2023, 1:54 a.m. OK Clang++20 Diagnostics TESTS 4 61 5427200
198293661 yxyxyx C March 20, 2023, 12:45 a.m. OK Clang++20 Diagnostics TESTS 4 155 5222400
198273112 3nteel_Handasa C March 19, 2023, 7:05 p.m. OK Clang++20 Diagnostics TESTS 4 233 12595200
198306366 2100031057 C March 20, 2023, 3:54 a.m. OK GNU C11 TESTS 4 15 1024000
198274338 moriarty_L C March 19, 2023, 7:17 p.m. OK GNU C11 TESTS 4 31 0
198287457 shark1992 C March 19, 2023, 10:15 p.m. OK GNU C11 TESTS 4 31 0
198280867 Dipu_1 C March 19, 2023, 8:30 p.m. OK GNU C11 TESTS 4 31 0
198267669 ahsanhabibsadik123 C March 19, 2023, 6:23 p.m. OK GNU C11 TESTS 4 78 0
198309165 Carsoncyc C March 20, 2023, 4:35 a.m. OK GNU C++14 TESTS 4 0 0
198302185 karen0603 C March 20, 2023, 2:42 a.m. OK GNU C++14 TESTS 4 0 0
198300095 wsyhb C March 20, 2023, 1:58 a.m. OK GNU C++14 TESTS 4 0 0
198293563 D1stance C March 20, 2023, 12:42 a.m. OK GNU C++14 TESTS 4 0 0
198292659 bagpipe C March 20, 2023, 12:20 a.m. OK GNU C++14 TESTS 4 0 0
198278615 Rawan_Almashad C March 19, 2023, 8:01 p.m. OK GNU C++14 TESTS 4 0 0
198313606 AbrarTo_o C March 20, 2023, 5:27 a.m. OK GNU C++14 TESTS 4 0 204800
198276953 ahmmed_asaad C March 19, 2023, 7:42 p.m. OK GNU C++14 TESTS 4 0 1945600
198312367 JorgeMartinez C March 20, 2023, 5:12 a.m. OK GNU C++14 TESTS 4 15 0
198316452 CoolLife C March 20, 2023, 6:01 a.m. OK GNU C++14 TESTS 4 15 0
198303604 0Recoil C March 20, 2023, 3:08 a.m. OK GNU C++17 TESTS 4 0 0
198301569 himanshupatil45h C March 20, 2023, 2:29 a.m. OK GNU C++17 TESTS 4 0 0
198300871 TiagoPDS C March 20, 2023, 2:15 a.m. OK GNU C++17 TESTS 4 0 0
198315301 xiongere C March 20, 2023, 5:48 a.m. OK GNU C++17 TESTS 4 0 0
198294160 shendy_2003 C March 20, 2023, 12:58 a.m. OK GNU C++17 TESTS 4 0 0
198315469 Imranka C March 20, 2023, 5:50 a.m. OK GNU C++17 TESTS 4 0 0
198298788 Aicu C March 20, 2023, 1:28 a.m. OK GNU C++17 TESTS 4 0 0
198311292 paphangkon009 C March 20, 2023, 5 a.m. OK GNU C++17 TESTS 4 0 0
198310124 surajmisal18 C March 20, 2023, 4:47 a.m. OK GNU C++17 TESTS 4 0 0
198309495 djay24 C March 20, 2023, 4:39 a.m. OK GNU C++17 TESTS 4 0 0
198286695 AGG C March 19, 2023, 10 p.m. OK GNU C++17 (64) TESTS 4 0 0
198305270 vioalbert C March 20, 2023, 3:38 a.m. OK GNU C++17 (64) TESTS 4 0 0
198304472 Sakif C March 20, 2023, 3:24 a.m. OK GNU C++17 (64) TESTS 4 0 0
198292244 MaGnsi0 C March 20, 2023, 12:10 a.m. OK GNU C++17 (64) TESTS 4 0 0
198275596 MarcosK C March 19, 2023, 7:28 p.m. OK GNU C++17 (64) TESTS 4 0 0
198265653 Toka_hamdy C March 19, 2023, 6:11 p.m. OK GNU C++17 (64) TESTS 4 0 0
198265551 TAM C March 19, 2023, 6:10 p.m. OK GNU C++17 (64) TESTS 4 0 0
198263433 Abu_ALchayeD C March 19, 2023, 5:57 p.m. OK GNU C++17 (64) TESTS 4 0 0
198278102 ahmed99125 C March 19, 2023, 7:55 p.m. OK GNU C++17 (64) TESTS 4 0 102400
198279075 Yogeek C March 19, 2023, 8:06 p.m. OK GNU C++17 (64) TESTS 4 0 102400
198309982 happymore C March 20, 2023, 4:45 a.m. OK GNU C++20 (64) TESTS 4 0 0
198308324 OwlZzz C March 20, 2023, 4:24 a.m. OK GNU C++20 (64) TESTS 4 0 0
198308288 cold7 C March 20, 2023, 4:23 a.m. OK GNU C++20 (64) TESTS 4 0 0
198307525 cowgoodsheep C March 20, 2023, 4:12 a.m. OK GNU C++20 (64) TESTS 4 0 0
198307444 _wjy C March 20, 2023, 4:10 a.m. OK GNU C++20 (64) TESTS 4 0 0
198315432 zoesads C March 20, 2023, 5:49 a.m. OK GNU C++20 (64) TESTS 4 0 0
198316179 Kido.new C March 20, 2023, 5:58 a.m. OK GNU C++20 (64) TESTS 4 0 0
198316276 sbdlg C March 20, 2023, 5:59 a.m. OK GNU C++20 (64) TESTS 4 0 0
198312967 litachloveyou C March 20, 2023, 5:19 a.m. OK GNU C++20 (64) TESTS 4 0 0
198312817 zzer C March 20, 2023, 5:18 a.m. OK GNU C++20 (64) TESTS 4 0 0
198282894 ETHANHUNTMI5 C March 19, 2023, 8:56 p.m. OK Java 11 TESTS 4 155 0
198315634 vijender_8601 C March 20, 2023, 5:52 a.m. OK Java 11 TESTS 4 156 0
198272101 etian6795 C March 19, 2023, 6:57 p.m. OK Java 11 TESTS 4 186 0
198310331 yenaya C March 20, 2023, 4:48 a.m. OK Java 11 TESTS 4 187 0
198306880 erasmas C March 20, 2023, 4:02 a.m. OK Java 11 TESTS 4 202 0
198294036 Try14022001Baar C March 20, 2023, 12:55 a.m. OK Java 11 TESTS 4 202 0
198271475 sjgody2245 C March 19, 2023, 6:52 p.m. OK Java 11 TESTS 4 217 0
198270895 sjgody2245 C March 19, 2023, 6:47 p.m. OK Java 11 TESTS 4 218 0
198264437 ttannishh C March 19, 2023, 6:03 p.m. OK Java 11 TESTS 4 218 0
198282266 jaegarr C March 19, 2023, 8:47 p.m. OK Java 11 TESTS 4 264 0
198288287 j4cobi C March 19, 2023, 10:34 p.m. OK Java 17 TESTS 4 187 307200
198293795 arpurush C March 20, 2023, 12:49 a.m. OK Java 17 TESTS 4 187 409600
198274303 adityasen167 C March 19, 2023, 7:16 p.m. OK Java 17 TESTS 4 187 512000
198309950 yogesg_25 C March 20, 2023, 4:45 a.m. OK Java 17 TESTS 4 202 0
198267092 massvinod C March 19, 2023, 6:19 p.m. OK Java 17 TESTS 4 233 307200
198283732 hulk4justice C March 19, 2023, 9:08 p.m. OK Java 17 TESTS 4 248 409600
198308064 goalboy C March 20, 2023, 4:20 a.m. OK Java 17 TESTS 4 296 614400
198301021 ksvijayan06 C March 20, 2023, 2:18 a.m. OK Java 17 TESTS 4 685 716800
198273763 anubhavRoy_1305 C March 19, 2023, 7:12 p.m. OK Java 17 TESTS 4 748 716800
198269910 Ziran3234 C March 19, 2023, 6:40 p.m. OK Java 8 TESTS 4 93 0
198264262 Hinnawi24 C March 19, 2023, 6:02 p.m. OK Java 8 TESTS 4 93 0
198314164 tejasS-27 C March 20, 2023, 5:34 a.m. OK Java 8 TESTS 4 108 0
198269695 Bagel_ C March 19, 2023, 6:38 p.m. OK Java 8 TESTS 4 108 0
198313588 anukul16 C March 20, 2023, 5:27 a.m. OK Java 8 TESTS 4 124 0
198303619 p_ghan C March 20, 2023, 3:08 a.m. OK Java 8 TESTS 4 124 0
198285460 MustafaMahmoud15 C March 19, 2023, 9:35 p.m. OK Java 8 TESTS 4 124 0
198273440 SuchayK C March 19, 2023, 7:09 p.m. OK Java 8 TESTS 4 124 0
198262259 banurr C March 19, 2023, 5:51 p.m. OK Java 8 TESTS 4 124 0
198272560 prachijha46212 C March 19, 2023, 7:01 p.m. OK Java 8 TESTS 4 280 0
198274373 Golovanov399 C March 19, 2023, 7:17 p.m. OK Kotlin 1.7 TESTS 4 374 22425600
198284765 Abdallas C March 19, 2023, 9:23 p.m. OK MS C++ 2017 TESTS 4 15 0
198278759 Xsif C March 19, 2023, 8:02 p.m. OK MS C++ 2017 TESTS 4 15 0
198289999 jithomp C March 19, 2023, 11:13 p.m. OK MS C++ 2017 TESTS 4 30 0
198306293 IITeens C March 20, 2023, 3:53 a.m. OK MS C++ 2017 TESTS 4 124 0
198315413 Luopei2022 C March 20, 2023, 5:49 a.m. OK MS C++ 2017 TESTS 4 468 0
198267159 Sushi0077 C March 19, 2023, 6:20 p.m. OK MS C++ 2017 TESTS 4 498 0
198267138 b-baka C March 19, 2023, 6:20 p.m. OK PyPy 3 TESTS 4 93 1945600
198277049 MaoLiser C March 19, 2023, 7:43 p.m. OK PyPy 3 TESTS 4 93 2560000
198299560 dhaivatdshah C March 20, 2023, 1:46 a.m. OK PyPy 3 TESTS 4 108 2252800
198291936 alpy123 C March 20, 2023, 12:02 a.m. OK PyPy 3 TESTS 4 108 2252800
198287255 smilence C March 19, 2023, 10:11 p.m. OK PyPy 3-64 TESTS 4 46 1740800
198270831 _Papaya_ C March 19, 2023, 6:47 p.m. OK PyPy 3-64 TESTS 4 61 2560000
198294618 voicon C March 20, 2023, 1:09 a.m. OK PyPy 3-64 TESTS 4 61 3993600
198271143 3laa3adel_13 C March 19, 2023, 6:49 p.m. OK PyPy 3-64 TESTS 4 62 204800
198262530 Quick-One C March 19, 2023, 5:52 p.m. OK PyPy 3-64 TESTS 4 62 204800
198280845 kavandoctor C March 19, 2023, 8:29 p.m. OK PyPy 3-64 TESTS 4 62 1843200
198284368 oneku16 C March 19, 2023, 9:17 p.m. OK PyPy 3-64 TESTS 4 62 1945600
198301653 vishnesh C March 20, 2023, 2:31 a.m. OK PyPy 3-64 TESTS 4 62 2150400
198284287 oneku16 C March 19, 2023, 9:16 p.m. OK PyPy 3-64 TESTS 4 62 2252800
198281140 oneku16 C March 19, 2023, 8:33 p.m. OK PyPy 3-64 TESTS 4 62 2662400
198303119 duresa C March 20, 2023, 2:59 a.m. OK Python 3 TESTS 4 61 102400
198273975 iv.osipov2004 C March 19, 2023, 7:13 p.m. OK Python 3 TESTS 4 61 204800
198276973 Kentyxa C March 19, 2023, 7:42 p.m. OK Python 3 TESTS 4 62 204800
198271905 naolz C March 19, 2023, 6:55 p.m. OK Python 3 TESTS 4 62 307200
198310853 Dk_Evil233 C March 20, 2023, 4:54 a.m. OK Python 3 TESTS 4 77 204800
198299015 govufpb C March 20, 2023, 1:34 a.m. OK Python 3 TESTS 4 77 204800
198282067 Moutyque C March 19, 2023, 8:45 p.m. OK Python 3 TESTS 4 77 204800
198270860 Doorbz_27 C March 19, 2023, 6:47 p.m. OK Python 3 TESTS 4 77 204800
198295296 Manav_Garg C March 20, 2023, 1:23 a.m. OK Python 3 TESTS 4 93 204800
198286209 AbdallaE C March 19, 2023, 9:49 p.m. OK Python 3 TESTS 4 93 204800
198299665 Kither C March 20, 2023, 1:48 a.m. OK Rust 2021 TESTS 4 15 512000
198311190 novice.li C March 20, 2023, 4:59 a.m. OK Rust 2021 TESTS 4 30 716800

remove filters

Back to search problems