Codeforces Global Round 29 (Div. 1 + 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
2147 Codeforces Global Round 29 (Div. 1 + Div. 2) FINISHED False 10800 18026723 Sept. 20, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 9658 ) C Rabbits PROGRAMMING 2-sat dp graphs greedy implementation

You have (n) flower pots arranged in a line numbered from (1) to (n) left to right. Some of the pots contain flowers, while others are empty. You are given a binary string (s) describing which pots contain flowers ((s_i = 1)) and which are empty ((s_i = 0)). You also have some rabbits, and you want to take a nice picture of rabbits and flowers. You want to put rabbits in every empty pot ((s_i = 0)), and for each rabbit, you can put it looking either to the left or to the right. Unfortunately, the rabbits are quite naughty, and they will try to jump, which will ruin the picture. Each rabbit will prepare to jump into the next pot in the direction they are looking, but they won't jump if there is a rabbit in that pot already or if there is another rabbit that prepares to jump into the same pot from the opposite side. Rabbits won't jump out of the borders (a rabbit at pot (1) looking to the left won't jump, same for a rabbit looking to the right at pot (n)). Your goal is to choose the directions of the rabbits so that they never jump, allowing you to take your time to take the picture. You need to determine if there is a valid arrangement of rabbits such that no rabbit ever jumps. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains an integer (n) ((1 \le n \le 2 \cdot 10^5)). The second line contains a binary string (s) of size (n), denoting the occupied and empty pots. It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, print " YES " if there exists a configuration of rabbits that satisfies the condition, and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. Visua

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
339615517 Alirezaam C Sept. 20, 2025, 7:09 p.m. OK C# 13 TESTS 13 124 1126400
339617730 samirpsalim C Sept. 20, 2025, 7:25 p.m. OK C# 13 TESTS 13 156 5836800
339596496 Alirezaam C Sept. 20, 2025, 5:12 p.m. OK C# 13 TESTS 13 218 1126400
339654645 ArtistByDay_LokiByNight C Sept. 21, 2025, 5:45 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339647376 bro-xie C Sept. 21, 2025, 4:14 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339645631 _xguagua_Firefly_ C Sept. 21, 2025, 3:42 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339645609 13201862045npy C Sept. 21, 2025, 3:42 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339644457 SibyH2 C Sept. 21, 2025, 3:20 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339642376 tub0214 C Sept. 21, 2025, 2:40 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339641471 aryan26aa C Sept. 21, 2025, 2:21 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339640427 tfinn C Sept. 21, 2025, 1:56 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339638324 shreyansharma1 C Sept. 21, 2025, 1:02 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339635834 aditya1064 C Sept. 20, 2025, 11:41 p.m. OK C++17 (GCC 7-32) TESTS 13 46 0
339653507 miracat C Sept. 21, 2025, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339653389 __Kiavash__ C Sept. 21, 2025, 5:31 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339653194 DarthVishnu8 C Sept. 21, 2025, 5:28 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339647257 om_galande C Sept. 21, 2025, 4:11 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339644761 blackrabbit-zmk C Sept. 21, 2025, 3:26 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339637262 ClickBait325 C Sept. 21, 2025, 12:29 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339636614 lrx___ C Sept. 21, 2025, 12:05 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339634463 Galaxy_Ivan C Sept. 20, 2025, 10:51 p.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339629860 Majdaldeen C Sept. 20, 2025, 9:22 p.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339629591 Majdaldeen C Sept. 20, 2025, 9:18 p.m. OK C++20 (GCC 13-64) TESTS 13 46 0
339655322 Mandar.Parihar C Sept. 21, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339655314 akashtiwari0704 C Sept. 21, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339654704 prathammuley19106 C Sept. 21, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339653193 pand_hosein C Sept. 21, 2025, 5:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339652359 mridulChhipa C Sept. 21, 2025, 5:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339650553 a_ho C Sept. 21, 2025, 5:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339650460 S133PY C Sept. 21, 2025, 5 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339649307 linmle313131 C Sept. 21, 2025, 4:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339649173 ComplexityMaestro C Sept. 21, 2025, 4:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339648709 Deep_Sea_Explorer C Sept. 21, 2025, 4:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
339619667 Gassa C Sept. 20, 2025, 7:41 p.m. OK D TESTS 13 77 2764800
339618715 Gassa C Sept. 20, 2025, 7:33 p.m. OK D TESTS 13 78 2662400
339591234 AttractorsTheory C Sept. 20, 2025, 4:57 p.m. OK GNU C11 TESTS 13 124 307200
339601878 Balu2907 C Sept. 20, 2025, 5:29 p.m. OK Java 21 TESTS 13 249 716800
339594285 fire12324344 C Sept. 20, 2025, 5:06 p.m. OK Java 21 TESTS 13 249 921600
339616986 thevyomanaut C Sept. 20, 2025, 7:19 p.m. OK Java 21 TESTS 13 265 614400
339592096 hs1663531 C Sept. 20, 2025, 4:59 p.m. OK Java 21 TESTS 13 265 819200
339589990 raghavendravelpugonda8 C Sept. 20, 2025, 4:53 p.m. OK Java 21 TESTS 13 265 819200
339646758 sangeet_04 C Sept. 21, 2025, 4:03 a.m. OK Java 21 TESTS 13 265 15564800
339648986 NpHardcore_05 C Sept. 21, 2025, 4:37 a.m. OK Java 21 TESTS 13 265 51712000
339597782 GuLLu05 C Sept. 20, 2025, 5:16 p.m. OK Java 21 TESTS 13 280 409600
339651491 ccj123 C Sept. 21, 2025, 5:12 a.m. OK Java 21 TESTS 13 280 7372800
339591518 cstemp C Sept. 20, 2025, 4:57 p.m. OK Java 21 TESTS 13 280 13619200
339597814 khemkaaditya48 C Sept. 20, 2025, 5:16 p.m. OK Java 8 TESTS 13 187 0
339640594 NeelmaniPandey09 C Sept. 21, 2025, 2 a.m. OK Java 8 TESTS 13 217 0
339630067 jatin310 C Sept. 20, 2025, 9:24 p.m. OK Java 8 TESTS 13 218 0
339591754 jsomya2004 C Sept. 20, 2025, 4:58 p.m. OK Java 8 TESTS 13 234 0
339595420 devsac12 C Sept. 20, 2025, 5:09 p.m. OK Java 8 TESTS 13 280 0
339591191 Windrower C Sept. 20, 2025, 4:57 p.m. OK Java 8 TESTS 13 281 0
339616799 amre_8800 C Sept. 20, 2025, 7:18 p.m. OK Java 8 TESTS 13 483 43008000
339590252 ktobarsuk C Sept. 20, 2025, 4:54 p.m. OK Kotlin 1.9 TESTS 13 296 0
339596969 L-S-S C Sept. 20, 2025, 5:14 p.m. OK Kotlin 2.2 TESTS 13 203 0
339593917 quad_recip C Sept. 20, 2025, 5:05 p.m. OK Kotlin 2.2 TESTS 13 593 7372800
339622370 siddheart2209 C Sept. 20, 2025, 8:04 p.m. OK PyPy 3 TESTS 13 186 7065600
339643425 archittect C Sept. 21, 2025, 3 a.m. OK PyPy 3 TESTS 13 264 8704000
339603128 ThirdAttempt C Sept. 20, 2025, 5:32 p.m. OK PyPy 3 TESTS 13 327 9932800
339591861 quantiset C Sept. 20, 2025, 4:58 p.m. OK PyPy 3 TESTS 13 437 9318400
339618792 shrigs03 C Sept. 20, 2025, 7:34 p.m. OK PyPy 3 TESTS 13 515 9625600
339616596 AsianCoder01 C Sept. 20, 2025, 7:16 p.m. OK PyPy 3 TESTS 13 624 9728000
339651548 Horse-chan C Sept. 21, 2025, 5:12 a.m. OK PyPy 3-64 TESTS 13 124 3788800
339611136 minuki646 C Sept. 20, 2025, 6:43 p.m. OK PyPy 3-64 TESTS 13 139 3993600
339631306 pierrot C Sept. 20, 2025, 9:41 p.m. OK PyPy 3-64 TESTS 13 140 6144000
339612301 minuki646 C Sept. 20, 2025, 6:48 p.m. OK PyPy 3-64 TESTS 13 155 4096000
339601334 cko C Sept. 20, 2025, 5:27 p.m. OK PyPy 3-64 TESTS 13 155 4300800
339618703 Luciefer_x C Sept. 20, 2025, 7:33 p.m. OK PyPy 3-64 TESTS 13 171 7577600
339635442 ronakkagarwall C Sept. 20, 2025, 11:27 p.m. OK PyPy 3-64 TESTS 13 171 8396800
339591461 Lets_Try_ C Sept. 20, 2025, 4:57 p.m. OK PyPy 3-64 TESTS 13 171 9011200
339621359 alexwice C Sept. 20, 2025, 7:55 p.m. OK PyPy 3-64 TESTS 13 171 9113600
339599348 porcelli C Sept. 20, 2025, 5:21 p.m. OK PyPy 3-64 TESTS 13 186 7680000
339629337 Saugata123 C Sept. 20, 2025, 9:15 p.m. OK Python 3 TESTS 13 124 1843200
339613326 good_angel C Sept. 20, 2025, 6:54 p.m. OK Python 3 TESTS 13 139 3891200
339612177 davidmiheev C Sept. 20, 2025, 6:48 p.m. OK Python 3 TESTS 13 140 1024000
339602107 _14112005 C Sept. 20, 2025, 5:29 p.m. OK Python 3 TESTS 13 155 9318400
339644492 __akash24_13 C Sept. 21, 2025, 3:21 a.m. OK Python 3 TESTS 13 156 716800
339590993 kumarshrid06 C Sept. 20, 2025, 4:56 p.m. OK Python 3 TESTS 13 156 819200
339592009 maaya2526 C Sept. 20, 2025, 4:59 p.m. OK Python 3 TESTS 13 156 8396800
339591052 cadenq1 C Sept. 20, 2025, 4:56 p.m. OK Python 3 TESTS 13 156 14950400
339601721 vaibhav_fusion C Sept. 20, 2025, 5:28 p.m. OK Python 3 TESTS 13 171 45056000
339599919 Fonty02 C Sept. 20, 2025, 5:22 p.m. OK Python 3 TESTS 13 187 5836800

remove filters

Back to search problems