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 |
---|---|---|---|---|---|---|
1801 | Codeforces Round 857 (Div. 1) | FINISHED | False | 10800 | 58911863 | March 9, 2023, 9:35 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 429 ) | G | A task for substrings | PROGRAMMING | data structures string suffix structures strings |
B'To do this, he took the string t and a set of n strings s_1 , s_2 , s_3 , ..., s_n . Philip has m queries, in the i th of them, Philip wants to take a substring of the string t from l_i th to r_i th character, and count the number of its substrings that match some string from the set. More formally, Philip wants to count the number of pairs of positions a , b , such that l_i <= a <= b <= r_i , and the substring of the string t from a th to b th character coincides with some string s_j from the set. A substring of the string t from a th to b th character is a string obtained from t by removing the a - 1 character from the beginning and |t| - b characters from the end, where |t| denotes the length of the string t . Philip has already solved this problem, but can you? The first line contains two positive integers n and m ( 1 <= n, m <= 500 ,000 ) -- the number of rows in the set and the number of queries. The second line contains a single string t consisting of lowercase letters of the English alphabet ( 1 <= |t| <= 5 cdot 10^6 ). The following n lines describe the strings from the set. In the i th of them, a single string s_i is given, consisting of lowercase letters of the English alphabet. Denote by S the total length of all strings from the set. It is guaranteed that S <= 10^6 , as well as that all strings of s_i are different. In the following lines, queries are entered. The i th of them contains two positive integers l_i and r_i ( 1 <= l_i <= r_i <= |t| ) -- the left and right border of the substring t from the i -th query. In a single line, print m integers, i th of them should be equal to the answers to the i th query. In the first example, the first query requires the entire string to '... |
Codeforces Round #857 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
196667979 | just3500code | G | March 9, 2023, 2:02 p.m. | OK | GNU C++14 | TESTS | 239 | 3524 | 933785600 | ||
196654085 | LXH-cat | G | March 9, 2023, 12:22 p.m. | OK | GNU C++14 | TESTS | 239 | 3540 | 933785600 | ||
196730372 | Crystally | G | March 10, 2023, 2:28 a.m. | OK | GNU C++17 | TESTS | 239 | 2917 | 593715200 | ||
196736938 | JosthnaBattu_28 | G | March 10, 2023, 4:42 a.m. | OK | GNU C++17 | TESTS | 240 | 3088 | 832614400 | ||
196708394 | Galaxy_Forces | G | March 9, 2023, 7:27 p.m. | OK | GNU C++17 | TESTS | 239 | 3416 | 933785600 | ||
196729238 | 5ab | G | March 10, 2023, 2:01 a.m. | OK | GNU C++17 (64) | TESTS | 239 | 2791 | 529817600 | ||
196729420 | Pointy | G | March 10, 2023, 2:05 a.m. | OK | GNU C++17 (64) | TESTS | 239 | 2838 | 781312000 | ||
196729052 | Pointy | G | March 10, 2023, 1:56 a.m. | OK | GNU C++17 (64) | TESTS | 239 | 2838 | 785305600 | ||
196729156 | 5ab | G | March 10, 2023, 1:59 a.m. | OK | GNU C++17 (64) | TESTS | 239 | 3010 | 950067200 | ||
196735095 | BeyondHeaven | G | March 10, 2023, 4:10 a.m. | OK | GNU C++17 (64) | TESTS | 240 | 3057 | 984473600 | ||
196740003 | abhiratra510 | G | March 10, 2023, 5:29 a.m. | OK | GNU C++20 (64) | TESTS | 240 | 2261 | 718233600 | ||
196698227 | Aaeria | G | March 9, 2023, 5:55 p.m. | OK | GNU C++20 (64) | TESTS | 239 | 3993 | 764723200 |
Back to search problems