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 |
---|---|---|---|---|---|---|
1974 | Codeforces Round 946 (Div. 3) | FINISHED | False | 8100 | 20964263 | May 20, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 15329 ) | D | Ingenuity-2 | PROGRAMMING | constructive algorithms greedy implementation | 1400 |
B"Let's imagine the surface of Mars as an infinite coordinate plane. Initially, the rover Perseverance-2 and the helicopter Ingenuity-2 are located at the point with coordinates (0, 0) . A set of instructions s consisting of n instructions of the following types was specially developed for them: Each instruction must be executed either by the rover or by the helicopter. Moreover, each device must execute at least one instruction. Your task is to distribute the instructions in such a way that after executing all n instructions, the helicopter and the rover end up at the same point, or determine that this is impossible. The first line of input contains t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of instructions. The second line of each test case contains a string s of length n consisting of the characters 'N', 'S', 'E', 'W' -- the sequence of instructions. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10 ^ 5 . For each test case, if the required distribution of instructions exists, output a string p of length n consisting of the characters 'R', 'H'. If the i -th operation should be executed by the rover, then p_i= text{R} , if the i -th operation should be executed by the helicopter, then p_i= text{H} . If there are multiple solutions, output any of them. Otherwise, output NO. Let's consider the first example: the string S = texttt{NENSNE} . One of the possible solutions, shown in the figure below, is p = texttt{RRHRRH} , using which both the rover and the helicopter will end up one meter north and one meter east. For WWW, the solution is impossible. "... |
Codeforces Round #946 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
262907822 | bati06 | D | May 27, 2024, 4:12 p.m. | OK | C# 10 | TESTS | 11 | 124 | 3072000 | 1400 | |
263689977 | renreni | D | June 2, 2024, 1:31 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263523322 | FV22 | D | May 31, 2024, 4:03 p.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263407194 | CNH_EzGame | D | May 31, 2024, 4:09 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263399497 | rishabh2763 | D | May 31, 2024, 2:18 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263232781 | ineverregret | D | May 30, 2024, 11:47 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263161938 | liza_denisova | D | May 29, 2024, 3:23 p.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263077839 | JCCJ | D | May 29, 2024, 2:24 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263031230 | Soumik_M | D | May 28, 2024, 3:17 p.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
262966336 | ASPDK | D | May 28, 2024, 6:18 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
262952465 | wbw121124 | D | May 28, 2024, 3:51 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 46 | 0 | 1400 | |
263671479 | Eclipsed1.1 | D | June 1, 2024, 6:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263671139 | Md.Salam_Uddin | D | June 1, 2024, 6:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263663787 | skmprohunt | D | June 1, 2024, 5:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263660322 | vjudge.9 | D | June 1, 2024, 4:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263658402 | kevinl2005 | D | June 1, 2024, 4:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263645631 | Wevton | D | June 1, 2024, 2:55 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263570660 | 2307guo | D | June 1, 2024, 3:57 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263560378 | bkifhr9 | D | June 1, 2024, 1:12 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263556905 | Murinh0 | D | May 31, 2024, 11:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263525138 | NguyenLeThaiDuong | D | May 31, 2024, 4:18 p.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 46 | 0 | 1400 | |
263696352 | SahajPurohit | D | June 2, 2024, 3:50 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263684568 | peeyush_j | D | June 1, 2024, 10:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263681520 | perrrC | D | June 1, 2024, 9:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263672313 | incognito_27 | D | June 1, 2024, 6:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263667928 | dominique_10 | D | June 1, 2024, 6:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263568701 | mochaowo | D | June 1, 2024, 3:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263412917 | NotShivam_382 | D | May 31, 2024, 5:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263407348 | qlf9 | D | May 31, 2024, 4:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263391300 | TonightV | D | May 30, 2024, 10:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
263367249 | DrStonee | D | May 30, 2024, 5:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 46 | 0 | 1400 | |
262607395 | MooNaz | D | May 25, 2024, 5:12 p.m. | OK | GNU C11 | TESTS | 11 | 749 | 307200 | 1400 | |
263700044 | lpychemistry | D | June 2, 2024, 4:54 a.m. | OK | Java 21 | TESTS | 11 | 264 | 307200 | 1400 | |
263017786 | WilliamFung | D | May 28, 2024, 1:29 p.m. | OK | Java 21 | TESTS | 11 | 265 | 614400 | 1400 | |
262976069 | fs_fz | D | May 28, 2024, 7:43 a.m. | OK | Java 21 | TESTS | 11 | 265 | 716800 | 1400 | |
262702415 | Mg718 | D | May 26, 2024, 12:20 p.m. | OK | Java 21 | TESTS | 11 | 265 | 716800 | 1400 | |
262906717 | mohit1510 | D | May 27, 2024, 4:02 p.m. | OK | Java 21 | TESTS | 11 | 265 | 1228800 | 1400 | |
262653148 | gaju_01 | D | May 26, 2024, 5:40 a.m. | OK | Java 21 | TESTS | 11 | 281 | 921600 | 1400 | |
262964200 | himneesh9 | D | May 28, 2024, 5:58 a.m. | OK | Java 21 | TESTS | 11 | 281 | 1331200 | 1400 | |
263157954 | A_R_I_F | D | May 29, 2024, 2:46 p.m. | OK | Java 21 | TESTS | 11 | 312 | 819200 | 1400 | |
262942795 | AC_or_suicide | D | May 28, 2024, 12:53 a.m. | OK | Java 21 | TESTS | 11 | 327 | 921600 | 1400 | |
263676081 | stolis | D | June 1, 2024, 7:40 p.m. | OK | Java 21 | TESTS | 11 | 327 | 1024000 | 1400 | |
263412862 | iam_ljk | D | May 31, 2024, 5:10 a.m. | OK | Java 8 | TESTS | 11 | 140 | 0 | 1400 | |
262797043 | vishal_2504 | D | May 26, 2024, 7:48 p.m. | OK | Java 8 | TESTS | 11 | 155 | 0 | 1400 | |
262901557 | .shinchan_ | D | May 27, 2024, 3:20 p.m. | OK | Java 8 | TESTS | 11 | 171 | 0 | 1400 | |
263627420 | devesh434 | D | June 1, 2024, 12:16 p.m. | OK | Java 8 | TESTS | 11 | 187 | 0 | 1400 | |
262903219 | Mr_A | D | May 27, 2024, 3:33 p.m. | OK | Java 8 | TESTS | 11 | 218 | 0 | 1400 | |
263388797 | DevanshArora2002 | D | May 30, 2024, 9:39 p.m. | OK | Java 8 | TESTS | 11 | 233 | 0 | 1400 | |
262851876 | only_forward_ | D | May 27, 2024, 8:40 a.m. | OK | Java 8 | TESTS | 11 | 234 | 0 | 1400 | |
262761933 | parulbajaj | D | May 26, 2024, 3:42 p.m. | OK | Java 8 | TESTS | 11 | 265 | 0 | 1400 | |
262761595 | cu.17bcs1685 | D | May 26, 2024, 3:41 p.m. | OK | Java 8 | TESTS | 11 | 296 | 2252800 | 1400 | |
262761111 | cu.17bcs1685 | D | May 26, 2024, 3:40 p.m. | OK | Java 8 | TESTS | 11 | 328 | 2252800 | 1400 | |
263055692 | Shkiper hssn | D | May 28, 2024, 6:55 p.m. | OK | Kotlin 1.9 | TESTS | 11 | 171 | 0 | 1400 | |
263506336 | arkzuse | D | May 31, 2024, 1:41 p.m. | OK | Kotlin 1.9 | TESTS | 11 | 234 | 0 | 1400 | |
262893574 | Siddhesh_17 | D | May 27, 2024, 2:18 p.m. | OK | PyPy 3 | TESTS | 11 | 390 | 13721600 | 1400 | |
263381355 | sauravagtl | D | May 30, 2024, 7:35 p.m. | OK | PyPy 3 | TESTS | 11 | 406 | 12288000 | 1400 | |
263152130 | vovesi4341 | D | May 29, 2024, 1:58 p.m. | OK | PyPy 3 | TESTS | 11 | 421 | 18227200 | 1400 | |
263056062 | singh.eureka | D | May 28, 2024, 6:59 p.m. | OK | PyPy 3-64 | TESTS | 11 | 140 | 9113600 | 1400 | |
262807112 | NitroSpear | D | May 26, 2024, 10:54 p.m. | OK | PyPy 3-64 | TESTS | 11 | 140 | 10137600 | 1400 | |
263073583 | MengxinWalkingGrass | D | May 29, 2024, 12:45 a.m. | OK | PyPy 3-64 | TESTS | 11 | 155 | 13926400 | 1400 | |
262848742 | poornaTheja | D | May 27, 2024, 8:13 a.m. | OK | PyPy 3-64 | TESTS | 11 | 217 | 8396800 | 1400 | |
262806617 | fightinggoose | D | May 26, 2024, 10:40 p.m. | OK | PyPy 3-64 | TESTS | 11 | 218 | 10649600 | 1400 | |
263596197 | kundan_1209 | D | June 1, 2024, 8:06 a.m. | OK | PyPy 3-64 | TESTS | 11 | 218 | 14643200 | 1400 | |
263498922 | dorecorn | D | May 31, 2024, 12:40 p.m. | OK | PyPy 3-64 | TESTS | 11 | 218 | 15462400 | 1400 | |
263173371 | DarkTemplarDrop | D | May 29, 2024, 5:47 p.m. | OK | PyPy 3-64 | TESTS | 11 | 234 | 8908800 | 1400 | |
263559091 | Martinien_ENSAF | D | June 1, 2024, 12:38 a.m. | OK | PyPy 3-64 | TESTS | 11 | 249 | 6963200 | 1400 | |
262823229 | jvatsal0709 | D | May 27, 2024, 4:42 a.m. | OK | PyPy 3-64 | TESTS | 11 | 249 | 9420800 | 1400 | |
262886020 | Shaurya_Anant | D | May 27, 2024, 1:18 p.m. | OK | Python 3 | TESTS | 11 | 109 | 102400 | 1400 | |
262619634 | zidro | D | May 25, 2024, 7:43 p.m. | OK | Python 3 | TESTS | 11 | 124 | 0 | 1400 | |
263619393 | REDGAR | D | June 1, 2024, 11:14 a.m. | OK | Python 3 | TESTS | 11 | 139 | 102400 | 1400 | |
263619005 | REDGAR | D | June 1, 2024, 11:11 a.m. | OK | Python 3 | TESTS | 11 | 139 | 102400 | 1400 | |
262514273 | harshkankhar1 | D | May 25, 2024, 1:27 p.m. | OK | Python 3 | TESTS | 11 | 139 | 102400 | 1400 | |
262954311 | vamsi_odyssey | D | May 28, 2024, 4:17 a.m. | OK | Python 3 | TESTS | 11 | 139 | 1433600 | 1400 | |
262842327 | cc_yuan | D | May 27, 2024, 7:23 a.m. | OK | Python 3 | TESTS | 11 | 140 | 102400 | 1400 | |
262716051 | OstrikovVA | D | May 26, 2024, 2:23 p.m. | OK | Python 3 | TESTS | 11 | 140 | 614400 | 1400 | |
262504177 | lqtrung1998 | D | May 25, 2024, 11:40 a.m. | OK | Python 3 | TESTS | 11 | 155 | 102400 | 1400 | |
263073813 | jdong | D | May 29, 2024, 12:52 a.m. | OK | Python 3 | TESTS | 11 | 155 | 3891200 | 1400 | |
263080551 | BetterThanNobita | D | May 29, 2024, 3:11 a.m. | OK | Rust 2021 | TESTS | 11 | 46 | 0 | 1400 | |
262809409 | DarkSky_0xFF | D | May 27, 2024, 12:07 a.m. | OK | Rust 2021 | TESTS | 11 | 46 | 0 | 1400 |
Back to search problems