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 |
---|---|---|---|---|---|---|
1476 | Educational Codeforces Round 103 (Rated for Div. 2) | FINISHED | False | 7200 | 125421911 | Jan. 29, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2414 ) | E | Pattern Matching | PROGRAMMING | bitmasks data structures dfs and similar graphs sortings strings |
B'You are given n patterns p_1, p_2, ... , p_n and m strings s_1, s_2, ... , s_m . Each pattern p_i consists of k characters that are either lowercase Latin letters or wildcard characters (denoted by underscores). All patterns are pairwise distinct. Each string s_j consists of k lowercase Latin letters. A string a matches a pattern b if for each i from 1 to k either b_i is a wildcard character or b_i=a_i . You are asked to rearrange the patterns in such a way that the first pattern the j -th string matches is p[mt_j] . You are allowed to leave the order of the patterns unchanged. Can you perform such a rearrangement? If you can, then print any valid order. The first line contains three integers n , m and k ( 1 <= n, m <= 10^5 , 1 <= k <= 4 ) -- the number of patterns, the number of strings and the length of each pattern and string. Each of the next n lines contains a pattern -- k characters that are either lowercase Latin letters or underscores. All patterns are pairwise distinct. Each of the next m lines contains a string -- k lowercase Latin letters, and an integer mt ( 1 <= mt <= n ) -- the index of the first pattern the corresponding string should match. Print "NO" if there is no way to rearrange the patterns in such a way that the first pattern that the j -th string matches is p[mt_j] . Otherwise, print "YES" in the first line. The second line should contain n distinct integers from 1 to n -- the order of the patterns. If there are multiple answers, print any of them. The order of patterns after the rearrangement in the first example is the following: Thus, the first string matches patterns ab__, _bcd, _b_d in that order, the first of them is ab__, that is indeed p[4] . The second string matches __b_ and ab__, the first of them is __b_, that is $$'... |
87356 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
105947195 | fishcathu. | E | Jan. 29, 2021, 5:29 p.m. | OK | GNU C++11 | TESTS | 48 | 93 | 16179200 | ||
105971428 | vjudge1 | E | Jan. 30, 2021, 1:42 a.m. | OK | GNU C++11 | TESTS | 48 | 93 | 16588800 | ||
105977361 | fishcathu. | E | Jan. 30, 2021, 4:11 a.m. | OK | GNU C++11 | TESTS | 48 | 108 | 15360000 | ||
105971928 | Mr_Eight | E | Jan. 30, 2021, 1:59 a.m. | OK | GNU C++11 | TESTS | 48 | 108 | 171929600 | ||
105937670 | qwqKanade | E | Jan. 29, 2021, 4:33 p.m. | OK | GNU C++11 | TESTS | 48 | 109 | 115609600 | ||
105975174 | zech | E | Jan. 30, 2021, 3:23 a.m. | OK | GNU C++11 | TESTS | 48 | 124 | 35430400 | ||
105969368 | little_brush | E | Jan. 30, 2021, 12:23 a.m. | OK | GNU C++11 | TESTS | 48 | 124 | 64614400 | ||
105943980 | Connected_failed | E | Jan. 29, 2021, 5:03 p.m. | OK | GNU C++11 | TESTS | 48 | 156 | 134246400 | ||
105943074 | Komeiji_Green | E | Jan. 29, 2021, 4:57 p.m. | OK | GNU C++11 | TESTS | 48 | 171 | 23449600 | ||
105972245 | xuziyuan | E | Jan. 30, 2021, 2:09 a.m. | OK | GNU C++11 | TESTS | 48 | 296 | 151756800 | ||
105940727 | terry_u16 | E | Jan. 29, 2021, 4:44 p.m. | OK | .NET Core C# | TESTS | 48 | 655 | 41676800 |
Back to search problems