Codeforces Round 758 (Div.1 + Div. 2)

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
1608 Codeforces Round 758 (Div.1 + Div. 2) FINISHED False 7200 98049263 Dec. 11, 2021, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 170 ) G Alphabetic Tree PROGRAMMING binary search data structures dfs and similar hashing string suffix structures strings trees

B"You are given m strings and a tree on n nodes. Each edge has some letter written on it. You have to answer q queries. Each query is described by 4 integers u , v , l and r . The answer to the query is the total number of occurrences of str(u,v) in strings with indices from l to r . str(u,v) is defined as the string that is made by concatenating letters written on the edges on the shortest path from u to v (in order that they are traversed). The first line of the input contains three integers n , m and q ( 2 <= n <= 10^5 , 1 <= m,q <= 10^5 ). The i -th of the following n-1 lines contains two integers u_i, v_i and a lowercase Latin letter c_i ( 1 <= u_i, v_i <= n , u_i neq v_i ), denoting the edge between nodes u_i, v_i with a character c_i on it. It's guaranteed that these edges form a tree. The following m lines contain the strings consisting of lowercase Latin letters. The total length of those strings does not exceed 10^5 . Then q lines follow, each containing four integers u , v , l and r ( 1 <= u,v <= n , u neq v , 1 <= l <= r <= m ), denoting the queries. For each query print a single integer -- the answer to the query. "...

Tutorials

Editorial of Codeforces Round #758 (Div.1 + Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
138772420 djq_cpp G Dec. 11, 2021, 12:27 p.m. OK GNU C++14 TESTS 126 748 142643200
138774029 uttamkakadiya24 G Dec. 11, 2021, 12:39 p.m. OK GNU C++14 TESTS 126 795 142643200
138774625 PinkRabbit G Dec. 11, 2021, 12:44 p.m. OK GNU C++17 TESTS 126 1122 52940800
138773815 PinkRabbit G Dec. 11, 2021, 12:38 p.m. OK GNU C++17 TESTS 126 1466 99635200
138792020 kczno1 G Dec. 11, 2021, 3:36 p.m. OK GNU C++17 TESTS 126 1965 126976000
138781599 skip2004 G Dec. 11, 2021, 1:48 p.m. OK GNU C++17 (64) TESTS 126 935 252928000
138793644 18Michael G Dec. 11, 2021, 3:54 p.m. OK GNU C++17 (64) TESTS 126 951 227328000
138793300 18Michael G Dec. 11, 2021, 3:50 p.m. OK GNU C++17 (64) TESTS 126 1029 227328000
138775127 maroonrk G Dec. 11, 2021, 12:49 p.m. OK GNU C++17 (64) TESTS 126 1357 96563200
138821930 zx2003 G Dec. 12, 2021, 1:54 a.m. OK GNU C++17 (64) TESTS 126 1668 232755200
138781539 xay5421 G Dec. 11, 2021, 1:47 p.m. OK GNU C++17 (64) TESTS 126 1730 196915200
138785684 SSRS_ G Dec. 11, 2021, 2:25 p.m. OK GNU C++17 (64) TESTS 126 2042 100761600
138785566 SSRS_ G Dec. 11, 2021, 2:24 p.m. OK GNU C++17 (64) TESTS 126 2183 100761600
138793105 NPBot G Dec. 11, 2021, 3:48 p.m. OK GNU C++20 (64) TESTS 126 966 244428800

remove filters

Back to search problems