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 |
---|---|---|---|---|---|---|
1666 | 2021-2022 ICPC, NERC, Northern Eurasia Onsite (Unrated, Online Mirror, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 81986099 | April 13, 2022, 8:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 111 ) | A | Admissible Map | PROGRAMMING |
B'A map is a matrix consisting of symbols from the set of 'U ', 'L ', 'D ', and 'R '. A map graph of a map matrix a is a directed graph with n cdot m vertices numbered as (i, j) ( 1 <= i <= n; 1 <= j <= m ), where n is the number of rows in the matrix, m is the number of columns in the matrix. The graph has n cdot m directed edges (i, j) to (i + di_{a_{i, j}}, j + dj_{a_{i, j}}) , where (di_U, dj_U) = (-1, 0) ; (di_L, dj_L) = (0, -1) ; (di_D, dj_D) = (1, 0) ; (di_R, dj_R) = (0, 1) . A map graph is valid when all edges point to valid vertices in the graph. An admissible map is a map such that its map graph is valid and consists of a set of cycles. A description of a map a is a concatenation of all rows of the map -- a string a_{1,1} a_{1,2} ldots a_{1, m} a_{2, 1} ldots a_{n, m} . You are given a string s . Your task is to find how many substrings of this string can constitute a description of some admissible map. A substring of a string s_1s_2 ldots s_l of length l is defined by a pair of indices p and q ( 1 <= p <= q <= l ) and is equal to s_ps_{p+1} ldots s_q . Two substrings of s are considered different when the pair of their indices (p, q) differs, even if they represent the same resulting string. In the only input line, there is a string s , consisting of at least one and at most 20 ,000 symbols 'U ', 'L ', 'D ', or 'R '. Output one integer -- the number of substrings of s that constitute a description of some admissible map. In the first example, there are two substrings that can constitute a description of an admissible map -- "RDUL" as a matrix of size 2 x 2 (pic. 1) and "DU" as a matrix of size 2 x 1 (pic. 2). In the second example, no substring can constitute a description of an admissible map. E. g. if we try to look at the string "RDRU" as a matrix of size 2 x '... |
Tutorial (PDF) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
153563056 | kukudexing | A | April 13, 2022, 1:14 p.m. | OK | GNU C++14 | TESTS | 107 | 1560 | 716800 | ||
153590027 | Meijer | A | April 13, 2022, 8:06 p.m. | OK | GNU C++14 | TESTS | 107 | 2293 | 409600 | ||
153554857 | fanache99 lumibons | A | April 13, 2022, 11:48 a.m. | OK | GNU C++17 | TESTS | 107 | 2433 | 716800 | ||
153552189 | SpyCheese | A | April 13, 2022, 11:20 a.m. | OK | GNU C++17 (64) | TESTS | 107 | 2589 | 50790400 | ||
153549952 | dario2994 Batrr mhq | A | April 13, 2022, 10:56 a.m. | OK | GNU C++17 (64) | TESTS | 107 | 2964 | 204800 | ||
153584679 | zidder | A | April 13, 2022, 6:16 p.m. | OK | GNU C++20 (64) | TESTS | 107 | 577 | 204800 | ||
153557643 | Froggay Alan233 tzxydby | A | April 13, 2022, 12:17 p.m. | OK | GNU C++20 (64) | TESTS | 107 | 2714 | 50995200 |
Back to search problems