Codeforces Round 1043 (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
2132 Codeforces Round 1043 (Div. 3) FINISHED False 8100 20618723 Aug. 21, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 511 ) G Famous Choreographer PROGRAMMING hashing strings

As all programmers know, there are (n \times m) ballerinas performing in a ballet, and their arrangement can be represented as a table with (n) rows and (m) columns. Each ballerina performs one of (26) movements, which can be described by one of the English letters. Choreographer Vadim wants to dispel this myth. To do this, he wants to stage a show in which all the ballerinas gracefully move to the opposite side of the stage from their starting positions. Programmers will find it easier to understand this movement as a (180^{\circ}) rotation of the table. To maintain the sequence of visual storytelling in the ballet, the ballerinas perform this movement instantaneously, without stopping their movements, and the final arrangement is identical to the initial one. Unfortunately, Vadim understands that with the current performance and the already planned arrangement of the ballerinas, such a maneuver will not be possible. Therefore, he is ready to invite more ballerinas to the performance. They can perform any movement and occupy any position, but they cannot stand between those already participating in a ballet. The most important thing is that in the end, a rectangular table is formed, possibly larger than the original one. Additionally, it is essential that at least one ballerina from the original arrangement moves to the position of one of the other ballerinas from the original arrangement or remains in her place. Please advise Vadim on the smallest number of ballerinas he will need to invite. Each test consists of several test cases. The first line contains a single integer (t) ((1 \le t \le 10^5)) — the number of test cases. The following lines describe the test cases. In the first line of each set, two integers (n) and (m) are given — the number of rows and the number of columns of the table ((1 \le n, m \le 10^6, 1 \le n \cdot m \le 10^6)). The next (n) lines of length (m) describe the movements of the ba

Tutorials

Codeforces Round 1043 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
335122093 yuzhouren2000 G Aug. 23, 2025, 6:58 a.m. OK C++17 (GCC 7-32) TESTS 97 265 124313600
335244691 youmeus G Aug. 24, 2025, 4:31 a.m. OK C++17 (GCC 7-32) TESTS 98 421 140390400
335196997 dkdk G Aug. 23, 2025, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 98 531 110387200
335075254 MEZBAH-UDDIN G Aug. 22, 2025, 6:09 p.m. OK C++17 (GCC 7-32) TESTS 97 765 82022400
335225115 babybro G Aug. 23, 2025, 9:48 p.m. OK C++17 (GCC 7-32) TESTS 98 827 109772800
335195449 quannnn G Aug. 23, 2025, 4:34 p.m. OK C++17 (GCC 7-32) TESTS 98 921 92262400
335181526 santoshvp G Aug. 23, 2025, 2:36 p.m. OK C++17 (GCC 7-32) TESTS 98 937 37171200
335108513 1414783020 G Aug. 23, 2025, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 97 953 110284800
335166751 Az3ar G Aug. 23, 2025, 12:44 p.m. OK C++17 (GCC 7-32) TESTS 98 1093 144179200
335225199 babybro G Aug. 23, 2025, 9:49 p.m. OK C++17 (GCC 7-32) TESTS 98 1202 109772800
335146266 yoshi_likes_e5 G Aug. 23, 2025, 10:05 a.m. OK C++20 (GCC 13-64) TESTS 98 140 9011200
335147135 yoshi_likes_e5 G Aug. 23, 2025, 10:11 a.m. OK C++20 (GCC 13-64) TESTS 98 140 9318400
335145658 yoshi_likes_e5 G Aug. 23, 2025, 10 a.m. OK C++20 (GCC 13-64) TESTS 98 202 17100800
335243878 Adp_D G Aug. 24, 2025, 4:28 a.m. OK C++20 (GCC 13-64) TESTS 98 499 29081600
335122684 AIF_is_carving G Aug. 23, 2025, 7:04 a.m. OK C++20 (GCC 13-64) TESTS 97 531 194662400
335152704 Ybalance G Aug. 23, 2025, 10:55 a.m. OK C++20 (GCC 13-64) TESTS 98 546 177049600
335022961 uuku G Aug. 22, 2025, 11:08 a.m. OK C++20 (GCC 13-64) TESTS 96 671 130662400
335035383 AAAAAZBX G Aug. 22, 2025, 12:58 p.m. OK C++20 (GCC 13-64) TESTS 97 717 177152000
335192650 Ybalance G Aug. 23, 2025, 4:10 p.m. OK C++20 (GCC 13-64) TESTS 98 765 161075200
335074947 NotFound G Aug. 22, 2025, 6:06 p.m. OK C++20 (GCC 13-64) TESTS 97 827 231731200
335147216 yoshi_likes_e5 G Aug. 23, 2025, 10:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 98 171 9318400
335144285 yoshi_likes_e5 G Aug. 23, 2025, 9:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 98 296 17100800
335149506 yoshi_likes_e5 G Aug. 23, 2025, 10:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 98 311 10035200
335080886 UFEQ G Aug. 22, 2025, 7:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 97 343 154112000
335069018 Hoang_Thien_De G Aug. 22, 2025, 5:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 97 358 88473600
335217377 GStnt G Aug. 23, 2025, 7:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 98 374 216780800
335143681 yoshi_likes_e5 G Aug. 23, 2025, 9:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 98 421 76492800
335185390 OutsiderZz G Aug. 23, 2025, 3:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 98 452 177254400
335018437 shiqiDqi G Aug. 22, 2025, 10:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 96 467 209305600
335080233 Shahod G Aug. 22, 2025, 7 p.m. OK C++23 (GCC 14-64, msys2) TESTS 97 468 152780800
335147277 cpp10 G Aug. 23, 2025, 10:12 a.m. OK Java 21 TESTS 98 2577 139468800
335146709 cpp10 G Aug. 23, 2025, 10:08 a.m. OK Java 21 TESTS 98 2812 138240000
335255312 IcyGirl G Aug. 24, 2025, 5:41 a.m. OK PyPy 3-64 TESTS 98 2936 185139200

remove filters

Back to search problems