Codeforces Round 1029 (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
2117 Codeforces Round 1029 (Div. 3) FINISHED False 8100 27012323 June 8, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 37829 ) A False Alarm PROGRAMMING greedy implementation

Yousef is at the entrance of a long hallway with (n) doors in a row, numbered from (1) to (n). He needs to pass through all the doors from (1) to (n) in order of numbering and reach the exit (past door (n)). Each door can be open or closed. If a door is open, Yousef passes through it in (1) second. If the door is closed, Yousef can't pass through it. However, Yousef has a special button which he can use at most once at any moment. This button makes all closed doors become open for (x) seconds. Your task is to determine if Yousef can pass through all the doors if he can use the button at most once. The first line of the input contains an integer (t) ((1 \le t \le 1000)) — the number of test cases. The first line of each test case contains two integers (n, x) ((1 \le n, x \le 10)) — the number of doors and the number of seconds of the button, respectively. The second line of each test case contains (n) integers (a_1, a_2, ..., a_n) ((a_i \in \{0, 1\})) — the state of each door. Open doors are represented by '0' , while closed doors are represented by '1' . It is guaranteed that each test case contains at least one closed door. For each test case, output " YES " if Yousef can reach the exit, 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. In the first test case, the optimal way is as follows: At time (0), the door is open, so Yousef passes. At time (1), the door is closed, Yousef can use the button now and pass through the door. At time (2), the button's effect is still on, so Yousef can still pass. At time (3), the button's effect has finished, but the door is open. Yousef passes and reaches the exit. In the second test case, Yousef has a 3-second button, but he would need at least a 4-second button to reach the exit. Therefore, the answer is NO . In

Tutorials

Codeforces Round 1029 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
323619205 User0009 A June 9, 2025, 10:51 a.m. OK C# 10 TESTS 3 124 614400
323713536 og.kostya A June 10, 2025, 5:13 a.m. OK C# 13 TESTS 3 62 0
323709909 ylh_ A June 10, 2025, 4:28 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
323699106 ETO-leaders A June 10, 2025, 1:30 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
323698151 kurobalt A June 10, 2025, 1:05 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
323665674 Pollock A June 9, 2025, 4:43 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
323609293 Ding114 A June 9, 2025, 9:38 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
323584174 samaltered A June 9, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
323672472 Biswadev A June 9, 2025, 5:38 p.m. OK C++17 (GCC 7-32) TESTS 3 30 102400
323655596 intakhab123 A June 9, 2025, 3:23 p.m. OK C++17 (GCC 7-32) TESTS 3 30 102400
323651493 tEnma_ A June 9, 2025, 2:49 p.m. OK C++17 (GCC 7-32) TESTS 3 30 102400
323636838 cycha A June 9, 2025, 1:02 p.m. OK C++17 (GCC 7-32) TESTS 3 30 102400
323707408 leviathanX A June 10, 2025, 3:53 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323699097 mayank94 A June 10, 2025, 1:30 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323698716 artiehumphreys A June 10, 2025, 1:19 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323691886 hassanxx A June 9, 2025, 9:44 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323671252 becastal A June 9, 2025, 5:27 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323661553 Dimasik2010 A June 9, 2025, 4:11 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323660765 FIAZE_AHAMED A June 9, 2025, 4:05 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323651732 thuctapsinh A June 9, 2025, 2:51 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323636181 Hungtang A June 9, 2025, 12:58 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323617406 ylb_Ac2003 A June 9, 2025, 10:36 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
323668753 Tahmim_Hossain A June 9, 2025, 5:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323666041 hundunlilun1 A June 9, 2025, 4:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323664965 Devansh2021250 vianshu21298 NS_69b A June 9, 2025, 4:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323660812 khealer A June 9, 2025, 4:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323636484 Pritam_19 A June 9, 2025, 1 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323629951 AdnanZaman A June 9, 2025, 12:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323627629 Terminator_01 A June 9, 2025, 11:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323581672 satvikmittal638 A June 9, 2025, 5:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
323704161 codingthunder123 A June 10, 2025, 3:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 102400
323697476 Mrinall A June 10, 2025, 12:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 102400
323630245 korch A June 9, 2025, 12:15 p.m. OK GNU C11 TESTS 3 15 0
323649974 jds115 A June 9, 2025, 2:38 p.m. OK GNU C11 TESTS 3 15 102400
323676821 DrobyshDmitry A June 9, 2025, 6:15 p.m. OK GNU C11 TESTS 3 30 102400
323658032 Sneha_06 A June 9, 2025, 3:42 p.m. OK GNU C11 TESTS 3 31 0
323699315 rabbithacker A June 10, 2025, 1:35 a.m. OK GNU C11 TESTS 3 31 102400
323703720 wangchenjie A June 10, 2025, 2:56 a.m. OK GNU C11 TESTS 3 46 0
323643085 jashwanthreddy51 A June 9, 2025, 1:48 p.m. OK GNU C11 TESTS 3 46 0
323628740 eatyumi A June 9, 2025, 12:04 p.m. OK GNU C11 TESTS 3 46 0
323615032 ayan.b A June 9, 2025, 10:18 a.m. OK GNU C11 TESTS 3 46 0
323681474 prabhanshu421 A June 9, 2025, 6:59 p.m. OK GNU C11 TESTS 3 46 102400
323703605 Freedom_lifelong A June 10, 2025, 2:54 a.m. OK Java 21 TESTS 3 202 614400
323620061 jaganravi4 A June 9, 2025, 10:57 a.m. OK Java 21 TESTS 3 218 512000
323636542 ramen_shinshila_karimov A June 9, 2025, 1 p.m. OK Java 21 TESTS 3 233 204800
323625930 vansh_oberoi07 A June 9, 2025, 11:42 a.m. OK Java 21 TESTS 3 233 614400
323657872 sohilphilip2022 A June 9, 2025, 3:41 p.m. OK Java 21 TESTS 3 233 921600
323642723 GODAJM A June 9, 2025, 1:45 p.m. OK Java 21 TESTS 3 233 921600
323711902 Ashish_Sinsinwal A June 10, 2025, 4:55 a.m. OK Java 21 TESTS 3 233 1228800
323656053 winkhatri292004 A June 9, 2025, 3:26 p.m. OK Java 21 TESTS 3 234 0
323582460 Skayu A June 9, 2025, 5:44 a.m. OK Java 21 TESTS 3 234 0
323712526 Q_R_Y A June 10, 2025, 5:03 a.m. OK Java 21 TESTS 3 249 0
323714776 kartikdhande772 A June 10, 2025, 5:27 a.m. OK Java 8 TESTS 3 140 0
323681505 naman_9045 A June 9, 2025, 6:59 p.m. OK Java 8 TESTS 3 171 0
323678719 awasthijanhvi88 A June 9, 2025, 6:31 p.m. OK Java 8 TESTS 3 171 0
323667635 _neeraj__ A June 9, 2025, 4:58 p.m. OK Java 8 TESTS 3 171 0
323652957 kalpesh05 A June 9, 2025, 3:01 p.m. OK Java 8 TESTS 3 171 0
323636571 darkshadow03 A June 9, 2025, 1 p.m. OK Java 8 TESTS 3 171 0
323630418 knit2206.ac.in A June 9, 2025, 12:16 p.m. OK Java 8 TESTS 3 171 0
323630195 jroy.karnati A June 9, 2025, 12:15 p.m. OK Java 8 TESTS 3 171 0
323614896 manitejapattem A June 9, 2025, 10:17 a.m. OK Java 8 TESTS 3 171 0
323688684 Sumitsingh7 A June 9, 2025, 8:38 p.m. OK Java 8 TESTS 3 171 6656000
323679744 unknow754389 A June 9, 2025, 6:40 p.m. OK PyPy 3 TESTS 3 156 4608000
323683881 upior A June 9, 2025, 7:28 p.m. OK PyPy 3 TESTS 3 171 5120000
323716995 Dias1177 A June 10, 2025, 5:52 a.m. OK PyPy 3 TESTS 3 186 4403200
323665318 sushmanth.dampur8780 A June 9, 2025, 4:40 p.m. OK PyPy 3-64 TESTS 3 93 1638400
323648943 Sujata24 A June 9, 2025, 2:31 p.m. OK PyPy 3-64 TESTS 3 108 2355200
323628514 Tishow__Liuche A June 9, 2025, 12:03 p.m. OK PyPy 3-64 TESTS 3 108 2662400
323622794 lean_shorty A June 9, 2025, 11:18 a.m. OK PyPy 3-64 TESTS 3 109 1843200
323617627 PythonicVarun A June 9, 2025, 10:38 a.m. OK PyPy 3-64 TESTS 3 109 2560000
323605903 DivyamAwasthy A June 9, 2025, 9:15 a.m. OK PyPy 3-64 TESTS 3 109 2560000
323645802 benji_dunn A June 9, 2025, 2:08 p.m. OK PyPy 3-64 TESTS 3 124 2150400
323694063 rzougaBo A June 9, 2025, 10:46 p.m. OK PyPy 3-64 TESTS 3 124 2252800
323674369 _Kuayi A June 9, 2025, 5:53 p.m. OK PyPy 3-64 TESTS 3 124 2355200
323626627 swastithakur18 A June 9, 2025, 11:47 a.m. OK PyPy 3-64 TESTS 3 124 2457600
323639146 Amogh_0562 A June 9, 2025, 1:19 p.m. OK Python 3 TESTS 3 61 0
323681899 ShadiBaker A June 9, 2025, 7:04 p.m. OK Python 3 TESTS 3 61 204800
323663146 elistark A June 9, 2025, 4:23 p.m. OK Python 3 TESTS 3 61 204800
323648095 urjatendolkar A June 9, 2025, 2:25 p.m. OK Python 3 TESTS 3 61 204800
323609543 ___a_s_1_2___ A June 9, 2025, 9:40 a.m. OK Python 3 TESTS 3 61 204800
323700359 kishan_kumar_s_d A June 10, 2025, 1:50 a.m. OK Python 3 TESTS 3 61 307200
323654728 iamca A June 9, 2025, 3:16 p.m. OK Python 3 TESTS 3 61 307200
323647311 pundruvarshith17 A June 9, 2025, 2:20 p.m. OK Python 3 TESTS 3 61 307200
323669784 mohitrai99999 A June 9, 2025, 5:15 p.m. OK Python 3 TESTS 3 62 0
323611514 scorpion A June 9, 2025, 9:55 a.m. OK Python 3 TESTS 3 62 0
323693623 Xeramian A June 9, 2025, 10:32 p.m. OK Rust 2021 TESTS 3 46 0
323667867 Ab_Ir A June 9, 2025, 4:59 p.m. OK Rust 2021 TESTS 3 46 0
323611094 acitrus A June 9, 2025, 9:52 a.m. OK Rust 2021 TESTS 3 46 0
323665745 kokatsu A June 9, 2025, 4:43 p.m. OK Rust 2021 TESTS 3 46 102400
323626019 cinkozzz A June 9, 2025, 11:43 a.m. OK Rust 2021 TESTS 3 61 0
323610107 acitrus A June 9, 2025, 9:44 a.m. OK Rust 2021 TESTS 3 62 0

remove filters

Back to search problems