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 |
|---|---|---|---|---|---|---|
| 2048 | Codeforces Global Round 28 | FINISHED | False | 10800 | 41786723 | Dec. 19, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 102 ) | I1 | Kevin and Puzzle (Easy Version) | PROGRAMMING | constructive algorithms |
This is the easy version of the problem. The difference between the versions is that in this version, you need to find any one good array. You can hack only if you solved all versions of this problem. Kevin is visiting the Red Church, and he found a puzzle on the wall. For an array (a), let (c(l,r)) indicate how many distinct numbers are among (a_l, a_{l+1}, \ldots, a_r). In particular, if (l > r), define (c(l,r) = 0). You are given a string (s) of length (n) consisting of letters (L) and (R) only. Let a non-negative array (a) be called good , if the following conditions hold for (1 \leq i \leq n): if (s_i=\verb!L!), then (c(1,i-1)=a_i); if (s_i=\verb!R!), then (c(i+1,n)=a_i). If there is a good array (a), print any of the good arrays. Otherwise, report that no such arrays exists. Each test contains multiple test cases. The first line contains a single integer (t) ((1\le t \le 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer (n) ((2\leq n\leq 2\cdot 10^5)) — the length of string (s). The second line of each test case contains a string (s) with a length (n), containing only English uppercase letters (\verb!L!) and (\verb!R!). It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). For each test case, if a good array exists, print (n) non-negative integers: a good array (a). Otherwise, print a single integer (-1). If there are multiple arrays (a) satisfying the conditions, you can output any of them. In the first test case, the array (0,1,0) satisfies the conditions because: When (i=1), (s_i=\verb!L!), and (c(1,0)=0); When (i=2), (s_i=\verb!L!), and (c(1,1)=1), since there is only one distinct number in (a_1); When (i=3), (s_i=\verb!R!), |
| Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 297365128 | brun0matheus | I1 | Dec. 19, 2024, 9:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 77 | 5120000 | ||
| 297365243 | brun0matheus | I1 | Dec. 19, 2024, 9:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 93 | 5120000 | ||
| 297365008 | femboy-wannabe | I1 | Dec. 19, 2024, 9:17 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 124 | 4505600 | ||
| 297351389 | Radewoosh | I1 | Dec. 19, 2024, 6:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 140 | 9113600 | ||
| 297340576 | turmax | I1 | Dec. 19, 2024, 5:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 218 | 47104000 | ||
| 297350510 | Radewoosh | I1 | Dec. 19, 2024, 6:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 264 | 18841600 | ||
| 297344423 | hos.lyric | I1 | Dec. 19, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 98 | 327 | 19046400 | ||
| 297342460 | Nachia | I1 | Dec. 19, 2024, 5:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 77 | 7270400 | ||
| 297344435 | dorijanlendvaj | I1 | Dec. 19, 2024, 5:31 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 78 | 4096000 | ||
| 297367120 | Benq | I1 | Dec. 19, 2024, 10:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 93 | 7270400 | ||
| 297357779 | Endagorion | I1 | Dec. 19, 2024, 7:39 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 93 | 7270400 | ||
| 297369613 | mxj_helen | I1 | Dec. 19, 2024, 11:14 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 124 | 9113600 | ||
| 297379815 | tkacper | I1 | Dec. 20, 2024, 3:34 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 124 | 19865600 | ||
| 297390527 | Ion_Gravirei | I1 | Dec. 20, 2024, 5:57 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 156 | 8089600 | ||
| 297343688 | ksun48 | I1 | Dec. 19, 2024, 5:28 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 98 | 171 | 7884800 |
Back to search problems