Atto Round 1 (Codeforces Round 1041, 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
2127 Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) FINISHED False 10800 21828323 Aug. 7, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 13444 ) B Hamiiid, Haaamid... Hamid? PROGRAMMING games greedy

Mani has locked Hamid in a (1 \times n) grid. Initially, some cells of the grid contain walls and the rest are empty, and Hamid is in an empty cell. In each day, the following events happen in order: Mani selects an empty cell and builds a wall in that cell. Note that he can not build a wall in the cell which Hamid currently is at; Hamid selects a direction (left or right), then If there are no walls in that direction, he will escape the grid; Otherwise, he will move to the nearest wall in that direction and destroy that wall. Hamid is at the position of the destroyed wall after this day. If there are no walls in that direction, he will escape the grid; Otherwise, he will move to the nearest wall in that direction and destroy that wall. Hamid is at the position of the destroyed wall after this day. Here is an example of a possible sequence of actions when (n=6): Hamid is always aware of where the walls are. He wants to minimize the number of days that he needs to escape the grid, while Mani wants to maximize it. You have to determine the number of days Hamid needs to escape the grid if they both act optimally. 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 two integers (n) and (x) ((2 \leq n \leq 2 \cdot 10^5), (1 \leq x \leq n)) — the size of the grid and the initial position of Hamid. He is at the (x)-th cell from left to right initially. The second line contains a string (s) of length (n) ((s_i="#") or (".")) — the initial state of the grid. The (i)-th cell of the grid contains a wall if (s_i= "#"), and it is empty if (s_i="."). It is guaranteed that the (x)-th cell is empty, and there are at least two empty cells in the grid. It is guaranteed that the sum of (n) over all test cases does not excee

Tutorials

Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
332959905 Gononajontro_Biggani B Aug. 8, 2025, 6:02 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332959008 Dikshith_200 B Aug. 8, 2025, 5:53 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332957914 godoflegend B Aug. 8, 2025, 5:42 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332956549 sammy.rote.3210 B Aug. 8, 2025, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332955370 mannuz B Aug. 8, 2025, 5:14 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332955366 tin-tin B Aug. 8, 2025, 5:14 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332954782 Valar_Codeghulis B Aug. 8, 2025, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332954370 M_OBAID_MAJEED B Aug. 8, 2025, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332954369 abdullah_EL B Aug. 8, 2025, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332954209 iamvinish B Aug. 8, 2025, 5 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
332958539 nani_444 B Aug. 8, 2025, 5:49 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332957301 Maxwell2005 B Aug. 8, 2025, 5:36 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332957070 kiero B Aug. 8, 2025, 5:34 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332956709 lesunhan2022 B Aug. 8, 2025, 5:30 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332956140 sakshamrathi21 B Aug. 8, 2025, 5:23 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332955807 _Orpheus_ B Aug. 8, 2025, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332955486 Anura_SinghH_ B Aug. 8, 2025, 5:15 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332954750 fry10me B Aug. 8, 2025, 5:07 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332954624 szyac B Aug. 8, 2025, 5:05 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332953671 Labib_Rafid B Aug. 8, 2025, 4:54 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
332936720 BananaCream B Aug. 8, 2025, 12:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 30 0
332959379 abdulrhman.dev B Aug. 8, 2025, 5:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332957387 YsKoushikreddy B Aug. 8, 2025, 5:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332955629 shruvat B Aug. 8, 2025, 5:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332955053 verselet B Aug. 8, 2025, 5:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332954621 krishna_verma_c B Aug. 8, 2025, 5:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332953685 Aryan_Sriv45 B Aug. 8, 2025, 4:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332953623 Praveen_2112 B Aug. 8, 2025, 4:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332953260 I_Love_11062004 B Aug. 8, 2025, 4:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332952730 Retudal B Aug. 8, 2025, 4:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
332918329 __blank__171 B Aug. 7, 2025, 7:08 p.m. OK GNU C11 TESTS 10 62 307200
332953923 nahida520 B Aug. 8, 2025, 4:57 a.m. OK GNU C11 TESTS 10 92 307200
332955317 __blank__171 B Aug. 8, 2025, 5:13 a.m. OK GNU C11 TESTS 10 93 102400
332914755 Seeker25 B Aug. 7, 2025, 6:39 p.m. OK GNU C11 TESTS 10 93 102400
332930294 hategreedy B Aug. 7, 2025, 10:03 p.m. OK Java 21 TESTS 10 203 512000
332921447 BiggestFish06 B Aug. 7, 2025, 7:38 p.m. OK Java 21 TESTS 10 218 512000
332957731 sulabhambule02 B Aug. 8, 2025, 5:41 a.m. OK Java 21 TESTS 10 233 1228800
332951768 iamalizaidi B Aug. 8, 2025, 4:30 a.m. OK Java 21 TESTS 10 234 1024000
332902290 daulat_309 B Aug. 7, 2025, 5:24 p.m. OK Java 21 TESTS 10 249 307200
332915196 Ayush_Raj_2027 B Aug. 7, 2025, 6:42 p.m. OK Java 21 TESTS 10 249 409600
332915797 bharadwaj_manu B Aug. 7, 2025, 6:46 p.m. OK Java 21 TESTS 10 249 716800
332940031 punitpunde B Aug. 8, 2025, 1:57 a.m. OK Java 21 TESTS 10 249 1024000
332938815 punitpunde B Aug. 8, 2025, 1:37 a.m. OK Java 21 TESTS 10 249 1126400
332927597 kartik__sethi B Aug. 7, 2025, 9:02 p.m. OK Java 21 TESTS 10 250 921600
332900904 Pranav_45 B Aug. 7, 2025, 5:20 p.m. OK Java 8 TESTS 10 156 39219200
332946162 warframe B Aug. 8, 2025, 3:18 a.m. OK Java 8 TESTS 10 171 0
332897932 y_a_s B Aug. 7, 2025, 5:13 p.m. OK Java 8 TESTS 10 171 0
332954900 Mr.Curious B Aug. 8, 2025, 5:09 a.m. OK Java 8 TESTS 10 234 0
332898519 maverick_575 B Aug. 7, 2025, 5:14 p.m. OK Java 8 TESTS 10 234 0
332898592 code_demon18 B Aug. 7, 2025, 5:14 p.m. OK Kotlin 1.7 TESTS 10 483 15667200
332920216 L-S-S B Aug. 7, 2025, 7:25 p.m. OK Kotlin 1.9 TESTS 10 187 307200
332904882 gopikrishna9968 B Aug. 7, 2025, 5:30 p.m. OK PyPy 3 TESTS 10 233 7577600
332902042 GreenKitty B Aug. 7, 2025, 5:23 p.m. OK PyPy 3 TESTS 10 311 9728000
332928657 yejordan8888 B Aug. 7, 2025, 9:23 p.m. OK PyPy 3-64 TESTS 10 93 6144000
332930561 AbdissaD B Aug. 7, 2025, 10:10 p.m. OK PyPy 3-64 TESTS 10 125 5427200
332919834 SrEy_P-0-7 B Aug. 7, 2025, 7:22 p.m. OK PyPy 3-64 TESTS 10 140 6451200
332915432 porcelli B Aug. 7, 2025, 6:44 p.m. OK PyPy 3-64 TESTS 10 155 8396800
332905973 LordAlpha B Aug. 7, 2025, 5:32 p.m. OK PyPy 3-64 TESTS 10 171 7270400
332932689 Emikooh B Aug. 7, 2025, 11:19 p.m. OK PyPy 3-64 TESTS 10 171 8704000
332927898 el-classico-way B Aug. 7, 2025, 9:08 p.m. OK PyPy 3-64 TESTS 10 171 12185600
332940863 KerryWang9408 B Aug. 8, 2025, 2:09 a.m. OK PyPy 3-64 TESTS 10 171 13926400
332915282 cleanup B Aug. 7, 2025, 6:43 p.m. OK PyPy 3-64 TESTS 10 186 6758400
332952430 Patronus2002 B Aug. 8, 2025, 4:38 a.m. OK PyPy 3-64 TESTS 10 186 8806400
332917258 Nemesis2004 B Aug. 7, 2025, 6:58 p.m. OK Python 3 TESTS 10 78 819200
332945735 Shiro_O B Aug. 8, 2025, 3:13 a.m. OK Python 3 TESTS 10 93 921600
332939132 qos B Aug. 8, 2025, 1:43 a.m. OK Python 3 TESTS 10 108 716800
332898481 fellowtext B Aug. 7, 2025, 5:14 p.m. OK Python 3 TESTS 10 108 819200
332945437 musafeer B Aug. 8, 2025, 3:09 a.m. OK Python 3 TESTS 10 108 921600
332929939 ayushdreams147 B Aug. 7, 2025, 9:53 p.m. OK Python 3 TESTS 10 108 1433600
332913665 eugalt B Aug. 7, 2025, 6:32 p.m. OK Python 3 TESTS 10 109 921600
332916236 10000SUNS_DEATH B Aug. 7, 2025, 6:50 p.m. OK Python 3 TESTS 10 109 2252800
332929292 omprakashrathod2024 B Aug. 7, 2025, 9:37 p.m. OK Python 3 TESTS 10 109 2355200
332922431 Adit_Patel B Aug. 7, 2025, 7:50 p.m. OK Python 3 TESTS 10 124 921600

remove filters

Back to search problems