Codeforces Round 1053 (Div. 1)

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
2150 Codeforces Round 1053 (Div. 1) FINISHED False 11700 17691923 Sept. 24, 2025, 11:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 11607 ) A Incremental Path PROGRAMMING data structures implementation

Hacks are disabled in this problem. There is a strip containing (10^9) cells, numbered from (1) to (10^9). Each cell is either black or white. Initially, (m) distinct cells (a_1, a_2, \ldots, a_m) are black, and the others are white. If a person is on some cell (x), he might be given two types of commands: (A): jump to the next cell, i.e. cell (x + 1); (B): jump to the next white cell, i.e. the minimum (y > x) such that cell (y) is white. There is a string (s) of length (n), consisting of (n) commands. For each (i) from (1) to (n) in order, a person starts from cell (1); executes the first (i) commands in the string; colors the last visited cell black (if it was already black, it remains black). You wonder which cells are black at the end of the process. Print them in increasing order. 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 (m) ((1 \leq n \leq 10^5), (1 \leq m \leq 10^5)) — the number of commands and the number of black cells at the beginning. The second line of each test case contains a string (s) of length (n), consisting of characters (A) and (B), representing the commands. The third line of each test case contains (m) integers (a_1, a_2, \ldots, a_m) ((1 \leq a_1 < a_2 < \ldots < a_m \leq 10^9)) — the initial black cells. It is guaranteed that the sum of (n) over all test cases does not exceed (10^5), and the sum of (m) over all test cases does not exceed (10^5). For each test case, print two lines: in the first line, print a single integer (k): the number of black cells at the end; in the second line, print the labels of the black cells, in increasing order. In the first test case, initially

Tutorials

Editorial of Codeforces Round 1053 (Div. 1, Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
340149819 KumaTachiRen A Sept. 24, 2025, 11:41 a.m. OK C# 13 TESTS 10 374 24985600
340152500 lindelof A Sept. 24, 2025, 11:45 a.m. OK C++17 (GCC 7-32) TESTS 10 93 0
340156329 kangleni A Sept. 24, 2025, 11:51 a.m. OK C++17 (GCC 7-32) TESTS 10 93 819200
340237199 AIGAL30H7WM97CI A Sept. 24, 2025, 5:39 p.m. OK C++17 (GCC 7-32) TESTS 10 108 0
340153270 0xF1 A Sept. 24, 2025, 11:46 a.m. OK C++17 (GCC 7-32) TESTS 10 108 0
340157169 lhcdx A Sept. 24, 2025, 11:52 a.m. OK C++17 (GCC 7-32) TESTS 10 108 512000
340154129 linyf A Sept. 24, 2025, 11:47 a.m. OK C++17 (GCC 7-32) TESTS 10 108 12595200
340158351 Vassu05 A Sept. 24, 2025, 11:54 a.m. OK C++17 (GCC 7-32) TESTS 10 109 716800
340279227 NanamiChiaki_ A Sept. 25, 2025, 3:07 a.m. OK C++17 (GCC 7-32) TESTS 10 109 2560000
340160371 Hackerzoe A Sept. 24, 2025, 11:59 a.m. OK C++17 (GCC 7-32) TESTS 10 109 3788800
340157632 20069763bl A Sept. 24, 2025, 11:53 a.m. OK C++17 (GCC 7-32) TESTS 10 109 6451200
340272966 chenjinghao A Sept. 25, 2025, 1:31 a.m. OK C++20 (GCC 13-64) TESTS 10 62 3276800
340295430 Fysty A Sept. 25, 2025, 5:57 a.m. OK C++20 (GCC 13-64) TESTS 10 77 0
340153004 SirTechnical A Sept. 24, 2025, 11:45 a.m. OK C++20 (GCC 13-64) TESTS 10 77 0
340152815 fast_photon A Sept. 24, 2025, 11:45 a.m. OK C++20 (GCC 13-64) TESTS 10 77 1638400
340253765 Noobish_Monk A Sept. 24, 2025, 7:39 p.m. OK C++20 (GCC 13-64) TESTS 10 78 0
340166241 ineedwater A Sept. 24, 2025, 12:13 p.m. OK C++20 (GCC 13-64) TESTS 10 78 2867200
340155761 Sin_Watt A Sept. 24, 2025, 11:50 a.m. OK C++20 (GCC 13-64) TESTS 10 78 12083200
340155098 besho_O A Sept. 24, 2025, 11:48 a.m. OK C++20 (GCC 13-64) TESTS 10 92 0
340158911 jjh0730 A Sept. 24, 2025, 11:56 a.m. OK C++20 (GCC 13-64) TESTS 10 92 1024000
340156983 dldlzjfs A Sept. 24, 2025, 11:52 a.m. OK C++20 (GCC 13-64) TESTS 10 92 2150400
340154048 Ignut A Sept. 24, 2025, 11:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
340273046 FakeDuck A Sept. 25, 2025, 1:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
340152266 Brinton A Sept. 24, 2025, 11:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 0
340156000 Crying_Obsidian A Sept. 24, 2025, 11:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 409600
340154618 CP-enjoyer A Sept. 24, 2025, 11:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 1433600
340152621 sangph2612 A Sept. 24, 2025, 11:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 2355200
340153632 maroonrk A Sept. 24, 2025, 11:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 3481600
340274912 Isoeasy A Sept. 25, 2025, 1:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 4096000
340152890 N.N_2004 A Sept. 24, 2025, 11:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 5939200
340153653 sidat A Sept. 24, 2025, 11:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 78 1433600
340161425 Ritwin A Sept. 24, 2025, 12:01 p.m. OK GNU C11 TESTS 10 937 2252800
340267368 kpiyush1024 A Sept. 25, 2025, 12:03 a.m. OK Java 21 TESTS 10 452 18227200
340267614 kpiyush1024 A Sept. 25, 2025, 12:08 a.m. OK Java 21 TESTS 10 452 18636800
340152796 nathanballman A Sept. 24, 2025, 11:45 a.m. OK Java 21 TESTS 10 499 12288000
340217976 ccj123 A Sept. 24, 2025, 3:51 p.m. OK Java 21 TESTS 10 499 16691200
340154343 alexey.enkov A Sept. 24, 2025, 11:47 a.m. OK Kotlin 1.9 TESTS 10 374 20275200
340148612 arvindf232 A Sept. 24, 2025, 11:39 a.m. OK Kotlin 2.2 TESTS 10 530 15667200
340264907 ShauryaJain09 A Sept. 24, 2025, 11:03 p.m. OK PyPy 3 TESTS 10 421 16384000
340154328 anango A Sept. 24, 2025, 11:47 a.m. OK PyPy 3-64 TESTS 10 202 21606400
340152536 Pulkit_gupta A Sept. 24, 2025, 11:45 a.m. OK PyPy 3-64 TESTS 10 202 21708800
340155988 987 A Sept. 24, 2025, 11:50 a.m. OK PyPy 3-64 TESTS 10 202 26009600
340162331 Mukundan314 A Sept. 24, 2025, 12:03 p.m. OK PyPy 3-64 TESTS 10 217 28672000
340160800 DarkTemplarDrop A Sept. 24, 2025, noon OK PyPy 3-64 TESTS 10 218 23244800
340153797 toam A Sept. 24, 2025, 11:46 a.m. OK PyPy 3-64 TESTS 10 233 25190400
340153528 Alex239 A Sept. 24, 2025, 11:46 a.m. OK PyPy 3-64 TESTS 10 233 25600000
340154889 LMeyling A Sept. 24, 2025, 11:48 a.m. OK PyPy 3-64 TESTS 10 234 23961600
340162362 Z_actuary A Sept. 24, 2025, 12:03 p.m. OK PyPy 3-64 TESTS 10 234 32256000
340163767 smilences A Sept. 24, 2025, 12:07 p.m. OK PyPy 3-64 TESTS 10 249 22118400
340150326 OpGm A Sept. 24, 2025, 11:42 a.m. OK Python 3 TESTS 10 390 52736000
340159584 sansen A Sept. 24, 2025, 11:57 a.m. OK Rust 2021 TESTS 10 155 7782400
340149287 Egor A Sept. 24, 2025, 11:40 a.m. OK Rust 2024 TESTS 10 93 1126400

remove filters

Back to search problems