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 |
|---|---|---|---|---|---|---|
| 1993 | Codeforces Round 963 (Div. 2) | FINISHED | False | 7200 | 53623523 | Aug. 4, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1182 ) | F1 | Dyn-scripted Robot (Easy Version) | PROGRAMMING | brute force chinese remainder theorem constructive algorithms math number theory |
This is the easy version of the problem. The only difference is that in this version (k \le n). You can make hacks only if both versions of the problem are solved. Given a (w \times h) rectangle on the (Oxy) plane, with points ((0, 0)) at the bottom-left and ((w, h)) at the top-right of the rectangle. You also have a robot initially at point ((0, 0)) and a script (s) of (n) characters. Each character is either L , R , U , or D , which tells the robot to move left, right, up, or down respectively. The robot can only move inside the rectangle; otherwise, it will change the script (s) as follows: If it tries to move outside a vertical border, it changes all L characters to R 's (and vice versa, all R 's to L 's). If it tries to move outside a horizontal border, it changes all U characters to D 's (and vice versa, all D 's to U 's). Then, it will execute the changed script starting from the character which it couldn't execute. The script (s) will be executed for (k) times continuously. All changes to the string (s) will be retained even when it is repeated. During this process, how many times will the robot move to the point ((0, 0)) in total? Note that the initial position does NOT count . The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The first line of each test case contains four integers (n), (k), (w), and (h) ((1 \le n, w, h \le 10^6); (1 \le k \le n)). The second line contains a single string (s) of size (n) ((s_i \in \{L, R, U, D\})) — the script to be executed. It is guaranteed that the sum of (n) over all test cases does not exceed (10^6). For each test case, print a single integer — the number of times the robot reaches ((0, 0)) when executing script (s) for (k) times continuously. In the first test case, the robot only moves up and right. In the end, it |
| Editorial of Codeforces Round 963 (Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 274425037 | zrnstnsr | F1 | Aug. 4, 2024, 5:34 p.m. | OK | C# 10 | TESTS | 25 | 358 | 81203200 | ||
| 274416767 | LOOP0 | F1 | Aug. 4, 2024, 4:27 p.m. | OK | C++14 (GCC 6-32) | TESTS | 25 | 234 | 17817600 | ||
| 274455997 | omeganot | F1 | Aug. 5, 2024, 12:21 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 249 | 9932800 | ||
| 274480223 | GGapa | F1 | Aug. 5, 2024, 5:38 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 343 | 39116800 | ||
| 274418728 | bezime | F1 | Aug. 4, 2024, 4:31 p.m. | OK | C++14 (GCC 6-32) | TESTS | 25 | 436 | 22016000 | ||
| 274478669 | liujg | F1 | Aug. 5, 2024, 5:23 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 484 | 16076800 | ||
| 274477896 | liujg | F1 | Aug. 5, 2024, 5:15 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 484 | 16076800 | ||
| 274429116 | buburibu1234 | F1 | Aug. 4, 2024, 5:58 p.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 499 | 46387200 | ||
| 274467623 | chenjunxiu | F1 | Aug. 5, 2024, 3:07 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 546 | 7987200 | ||
| 274420344 | hcng | F1 | Aug. 4, 2024, 4:34 p.m. | OK | C++14 (GCC 6-32) | TESTS | 25 | 546 | 21811200 | ||
| 274458131 | luogu_bot1 | F1 | Aug. 5, 2024, 1:03 a.m. | OK | C++14 (GCC 6-32) | TESTS | 26 | 1140 | 16076800 | ||
| 274446074 | Lets_end_this_shall_we | F1 | Aug. 4, 2024, 8:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 186 | 32051200 | ||
| 274418922 | phsads | F1 | Aug. 4, 2024, 4:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 234 | 26828800 | ||
| 274424417 | Mahm2od | F1 | Aug. 4, 2024, 5:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 234 | 36659200 | ||
| 274415721 | mwen | F1 | Aug. 4, 2024, 4:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 296 | 18022400 | ||
| 274423901 | VasyaMer | F1 | Aug. 4, 2024, 5:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 296 | 22016000 | ||
| 274418166 | Dauren_Miras | F1 | Aug. 4, 2024, 4:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 296 | 27443200 | ||
| 274426051 | risel | F1 | Aug. 4, 2024, 5:39 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 311 | 17817600 | ||
| 274416582 | Imagine.2019 | F1 | Aug. 4, 2024, 4:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 311 | 17920000 | ||
| 274423840 | Ahmed_Salah7 | F1 | Aug. 4, 2024, 5:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 311 | 26009600 | ||
| 274420456 | alinp | F1 | Aug. 4, 2024, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 312 | 6348800 | ||
| 274432176 | diobrando97 | F1 | Aug. 4, 2024, 6:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 187 | 3481600 | ||
| 274418211 | rt3 | F1 | Aug. 4, 2024, 4:30 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 202 | 3584000 | ||
| 274461407 | whdywjd | F1 | Aug. 5, 2024, 1:54 a.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 203 | 167424000 | ||
| 274424134 | FXLY_awa | F1 | Aug. 4, 2024, 5:30 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 218 | 23654400 | ||
| 274425671 | Al-Khwarizmi_Fan | F1 | Aug. 4, 2024, 5:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 218 | 117657600 | ||
| 274417154 | ShiinaTaki | F1 | Aug. 4, 2024, 4:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 218 | 167424000 | ||
| 274426556 | yahia | F1 | Aug. 4, 2024, 5:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 233 | 36556800 | ||
| 274417615 | LEFt_bank | F1 | Aug. 4, 2024, 4:29 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 234 | 28876800 | ||
| 274426256 | yahia | F1 | Aug. 4, 2024, 5:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 234 | 36556800 | ||
| 274417863 | splay.tree | F1 | Aug. 4, 2024, 4:29 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 250 | 30617600 | ||
| 274418913 | yvbf | F1 | Aug. 4, 2024, 4:31 p.m. | OK | Java 8 | TESTS | 25 | 1015 | 38297600 | ||
| 274438284 | misorin | F1 | Aug. 4, 2024, 7:15 p.m. | OK | PyPy 3-64 | TESTS | 26 | 483 | 79360000 | ||
| 274427482 | burcuyy99 | F1 | Aug. 4, 2024, 5:48 p.m. | OK | PyPy 3-64 | TESTS | 25 | 499 | 80691200 | ||
| 274479343 | tan-jie-xi | F1 | Aug. 5, 2024, 5:30 a.m. | OK | PyPy 3-64 | TESTS | 26 | 733 | 129638400 | ||
| 274440960 | LMeyling | F1 | Aug. 4, 2024, 7:44 p.m. | OK | PyPy 3-64 | TESTS | 26 | 734 | 129638400 | ||
| 274451882 | Joris_Perrenet | F1 | Aug. 4, 2024, 10:35 p.m. | OK | PyPy 3-64 | TESTS | 26 | 765 | 130048000 | ||
| 274448165 | hxu10 | F1 | Aug. 4, 2024, 9:18 p.m. | OK | PyPy 3-64 | TESTS | 26 | 843 | 164044800 | ||
| 274477583 | smilences | F1 | Aug. 5, 2024, 5:12 a.m. | OK | PyPy 3-64 | TESTS | 26 | 858 | 137318400 | ||
| 274431267 | yyyy7089 | F1 | Aug. 4, 2024, 6:13 p.m. | OK | PyPy 3-64 | TESTS | 26 | 890 | 179404800 | ||
| 274429297 | dirac_de | F1 | Aug. 4, 2024, 5:59 p.m. | OK | PyPy 3-64 | TESTS | 26 | 968 | 153600000 | ||
| 274442536 | bronze_coder | F1 | Aug. 4, 2024, 8:03 p.m. | OK | PyPy 3-64 | TESTS | 26 | 1124 | 64307200 | ||
| 274435283 | SnowballSH | F1 | Aug. 4, 2024, 6:46 p.m. | OK | Rust 2021 | TESTS | 26 | 265 | 81715200 |
Back to search problems