Codeforces Round 1061 (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
2156 Codeforces Round 1061 (Div. 2) FINISHED False 7200 15089123 Oct. 24, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 20608 ) B Strange Machine PROGRAMMING binary search brute force greedy implementation

You are given (n) machines arranged in a circle, where (n) is at most (20). Each machine is either of type A or type B . The machines are numbered clockwise from (1) to (n), and the type of the (i)-th machine is denoted by (s_i). Each machine takes an integer (x) and updates it according to its type: Type A : Decrease (x) by (1). Formally, update (x := x - 1). Type B : Replace (x) with the floor of half its value. Formally, update (x := \left\lfloor\frac{x}{2}\right\rfloor), where (\lfloor y\rfloor) denotes the floor of (y), which is the greatest integer less than or equal to (y). You are given (q) queries, each consisting of a single integer (a). In each query, you start at machine (1) holding an integer (a). Each second, the following two actions occur in order: The current machine updates (a) according to its type. Then, move one step clockwise to the next machine. Formally If you are at machine (i) where (1 \le i \le n - 1), move to machine (i + 1). If you are at machine (n), move to machine (1). If you are at machine (i) where (1 \le i \le n - 1), move to machine (i + 1). If you are at machine (n), move to machine (1). This process continues until your integer (a) becomes (0). For each query, determine the number of seconds required for (a) to reach (0). Note that all queries are independent of each other. 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 (q) ((1\le n\le 20), (1\le q\le 10^4)) — the number of machines, and the number of queries, respectively. The second line of each test case contains a string (s) ((|s| = n) and (s_i = \mathtt{A} \text{ or }\mathtt{B})) — the types of the machines. The third li

Tutorials

Codeforces Round 1061 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
345640135 ksandr1v B Oct. 24, 2025, 6:26 p.m. OK C# 13 TESTS 10 124 512000
345685044 codesmith_69 B Oct. 25, 2025, 5:09 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345684004 leave_lover B Oct. 25, 2025, 4:58 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345677984 alanmamitov2003 B Oct. 25, 2025, 3:36 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345677221 jordy101 B Oct. 25, 2025, 3:25 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345676983 lixiangyu- B Oct. 25, 2025, 3:22 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345676346 wangjinkun B Oct. 25, 2025, 3:13 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345675894 _fccc B Oct. 25, 2025, 3:05 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345626835 Att4ckHelicopter B Oct. 24, 2025, 5:45 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345624351 Shivansh_rai B Oct. 24, 2025, 5:34 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
345688020 ADAMSCOLD B Oct. 25, 2025, 5:40 a.m. OK C++17 (GCC 7-32) TESTS 10 46 8089600
345689110 lalitt B Oct. 25, 2025, 5:49 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345687772 Faysal_Chowdhury B Oct. 25, 2025, 5:38 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345686054 ludYN109 B Oct. 25, 2025, 5:21 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345679696 SugarCubes69 B Oct. 25, 2025, 4 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345678893 SiberianKhatru B Oct. 25, 2025, 3:50 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345674917 _codingninja_ B Oct. 25, 2025, 2:49 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345672750 Wwwilliam B Oct. 25, 2025, 2:11 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345669300 zzhtlx B Oct. 25, 2025, 12:52 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345669225 snowythecat B Oct. 25, 2025, 12:50 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345659607 Mashuzo B Oct. 24, 2025, 9:07 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
345689952 eh_Sami B Oct. 25, 2025, 5:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345688146 rock3tfuse B Oct. 25, 2025, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345676539 _ZaVi B Oct. 25, 2025, 3:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345674778 Sceptile123 B Oct. 25, 2025, 2:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345673825 kaizen_01 B Oct. 25, 2025, 2:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345673277 Lonely_384 B Oct. 25, 2025, 2:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345671469 ReVoR B Oct. 25, 2025, 1:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345671234 mathsdevil B Oct. 25, 2025, 1:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345670577 Saiful241 B Oct. 25, 2025, 1:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345669789 IamDragonite B Oct. 25, 2025, 1:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
345689713 OcnStar B Oct. 25, 2025, 5:54 a.m. OK GNU C11 TESTS 10 77 0
345679102 SHAHRIAR_MAHI B Oct. 25, 2025, 3:53 a.m. OK GNU C11 TESTS 10 77 102400
345652971 tanis3050 B Oct. 24, 2025, 7:56 p.m. OK GNU C11 TESTS 10 92 102400
345688869 M1ndlessss B Oct. 25, 2025, 5:47 a.m. OK GNU C11 TESTS 10 93 0
345643216 Andrew_G6 B Oct. 24, 2025, 6:43 p.m. OK GNU C11 TESTS 10 93 0
345628396 Spaceeramaster B Oct. 24, 2025, 5:52 p.m. OK GNU C11 TESTS 10 93 0
345627504 tarun.gv2007 B Oct. 24, 2025, 5:48 p.m. OK GNU C11 TESTS 10 108 102400
345678135 CYCQAQ B Oct. 25, 2025, 3:38 a.m. OK GNU C11 TESTS 10 124 0
345615730 deepak3007_ B Oct. 24, 2025, 4:30 p.m. OK GNU C11 TESTS 10 124 204800
345631206 Chirag__G B Oct. 24, 2025, 6 p.m. OK GNU C11 TESTS 10 139 102400
345680685 uffhottie B Oct. 25, 2025, 4:15 a.m. OK Go TESTS 10 46 4608000
345660746 nobody05 B Oct. 24, 2025, 9:23 p.m. OK Go TESTS 10 77 1024000
345648629 fishy15 B Oct. 24, 2025, 7:19 p.m. OK Haskell TESTS 10 139 0
345625915 tekka_ity B Oct. 24, 2025, 5:41 p.m. OK Java 21 TESTS 10 264 409600
345629006 WrongAnswerOnTestCase2 B Oct. 24, 2025, 5:54 p.m. OK Java 21 TESTS 10 265 614400
345677675 akashtiwariaku B Oct. 25, 2025, 3:31 a.m. OK Java 21 TESTS 10 265 921600
345618685 Satyam_08 B Oct. 24, 2025, 4:34 p.m. OK Java 21 TESTS 10 280 921600
345613513 GODAJM B Oct. 24, 2025, 4:26 p.m. OK Java 21 TESTS 10 281 614400
345662003 sagbis B Oct. 24, 2025, 9:46 p.m. OK Java 21 TESTS 10 281 716800
345678887 mayurbhai B Oct. 25, 2025, 3:50 a.m. OK Java 21 TESTS 10 281 819200
345688933 4rshi7 B Oct. 25, 2025, 5:48 a.m. OK Java 21 TESTS 10 281 1433600
345676925 vanshpal921 B Oct. 25, 2025, 3:21 a.m. OK Java 21 TESTS 10 296 614400
345688114 SrapZark B Oct. 25, 2025, 5:41 a.m. OK Java 21 TESTS 10 296 716800
345677365 ycnetsisnoc B Oct. 25, 2025, 3:26 a.m. OK Java 8 TESTS 10 187 0
345674774 raghunandandev B Oct. 25, 2025, 2:47 a.m. OK Java 8 TESTS 10 249 0
345627129 Pranav_45 B Oct. 24, 2025, 5:46 p.m. OK Java 8 TESTS 10 264 39014400
345628916 Saumya1708 B Oct. 24, 2025, 5:54 p.m. OK Java 8 TESTS 10 296 0
345618249 yashu_rai B Oct. 24, 2025, 4:34 p.m. OK Java 8 TESTS 10 296 0
345612840 Neha1406 B Oct. 24, 2025, 4:25 p.m. OK Java 8 TESTS 10 358 0
345617465 bansal_Sushi B Oct. 24, 2025, 4:33 p.m. OK Java 8 TESTS 10 374 0
345647033 ayushyadavghazipur B Oct. 24, 2025, 7:07 p.m. OK PyPy 2 TESTS 10 327 3481600
345643067 roimt B Oct. 24, 2025, 6:42 p.m. OK PyPy 3 TESTS 10 249 7270400
345687766 krishnaprasadj2003 B Oct. 25, 2025, 5:38 a.m. OK PyPy 3 TESTS 10 281 7680000
345676524 Ravinder-codes B Oct. 25, 2025, 3:15 a.m. OK PyPy 3 TESTS 10 328 8396800
345615708 Hallowno4 B Oct. 24, 2025, 4:30 p.m. OK PyPy 3 TESTS 10 374 7475200
345687432 krishnaprasadj2003 B Oct. 25, 2025, 5:34 a.m. OK PyPy 3 TESTS 10 405 9318400
345613466 Bhavi_boomboom B Oct. 24, 2025, 4:26 p.m. OK PyPy 3 TESTS 10 530 8089600
345683806 RizzNotFound B Oct. 25, 2025, 4:55 a.m. OK PyPy 3-64 TESTS 10 124 4096000
345650552 mawo78 B Oct. 24, 2025, 7:35 p.m. OK PyPy 3-64 TESTS 10 124 5017600
345689871 LMeyling B Oct. 25, 2025, 5:55 a.m. OK PyPy 3-64 TESTS 10 139 5017600
345652792 explainer B Oct. 24, 2025, 7:54 p.m. OK PyPy 3-64 TESTS 10 140 5529600
345650241 Om_Singh_ B Oct. 24, 2025, 7:32 p.m. OK PyPy 3-64 TESTS 10 155 4812800
345647530 jvatsal0709 B Oct. 24, 2025, 7:11 p.m. OK PyPy 3-64 TESTS 10 155 5324800
345626866 PunyamPC B Oct. 24, 2025, 5:45 p.m. OK PyPy 3-64 TESTS 10 155 6144000
345644004 aa_despa B Oct. 24, 2025, 6:47 p.m. OK PyPy 3-64 TESTS 10 156 4505600
345660902 Sheikah B Oct. 24, 2025, 9:26 p.m. OK PyPy 3-64 TESTS 10 156 5939200
345626903 Natnael_Defaru B Oct. 24, 2025, 5:45 p.m. OK PyPy 3-64 TESTS 10 156 6348800
345623217 gitcoder2122 B Oct. 24, 2025, 5:29 p.m. OK Python 3 TESTS 10 171 1433600
345683505 surendravarma780 B Oct. 25, 2025, 4:52 a.m. OK Python 3 TESTS 10 171 1638400
345616452 Yaminiadda_03 B Oct. 24, 2025, 4:31 p.m. OK Python 3 TESTS 10 218 1740800
345612655 Swarna_17 B Oct. 24, 2025, 4:25 p.m. OK Python 3 TESTS 10 218 1740800
345634851 _Manuu_16 B Oct. 24, 2025, 6:03 p.m. OK Python 3 TESTS 10 249 1433600
345615656 prachiyadav B Oct. 24, 2025, 4:30 p.m. OK Python 3 TESTS 10 311 1433600
345613517 Prav_13 B Oct. 24, 2025, 4:27 p.m. OK Python 3 TESTS 10 358 1638400
345613057 PI2003 B Oct. 24, 2025, 4:26 p.m. OK Python 3 TESTS 10 358 1638400
345618066 BenignSaw B Oct. 24, 2025, 4:33 p.m. OK Python 3 TESTS 10 374 1945600
345664874 Rudrashis_231006 B Oct. 24, 2025, 10:41 p.m. OK Python 3 TESTS 10 406 1945600
345654879 DreadedHippy B Oct. 24, 2025, 8:15 p.m. OK Rust 2021 TESTS 10 109 0

remove filters

Back to search problems