Codeforces Round 837 (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
1771 Codeforces Round 837 (Div. 2) FINISHED False 7200 66407063 Dec. 11, 2022, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2865 ) D Hossam and (sub-)palindromic tree PROGRAMMING brute force dfs and similar dp trees

B'Hossam has an unweighted tree G with letters in vertices. Hossam defines s(v, , u) as a string that is obtained by writing down all the letters on the unique simple path from the vertex v to the vertex u in the tree G . A string a is a subsequence of a string s if a can be obtained from s by deletion of several (possibly, zero) letters. For example, "dores", "cf", and "for" are subsequences of "codeforces", while "decor" and "fork" are not. A palindrome is a string that reads the same from left to right and from right to left. For example, "abacaba" is a palindrome, but "abac" is not. Hossam defines a sub-palindrome of a string s as a subsequence of s , that is a palindrome. For example, "k", "abba" and "abhba" are sub-palindromes of the string "abhbka", but "abka" and "cat" are not. Hossam defines a maximal sub-palindrome of a string s as a sub-palindrome of s , which has the maximal length among all sub-palindromes of s . For example, "abhbka" has only one maximal sub-palindrome -- "abhba". But it may also be that the string has several maximum sub-palindromes: the string "abcd" has 4 maximum sub-palindromes. Help Hossam find the length of the longest maximal sub-palindrome among all s(v, , u) in the tree G . Note that the sub-palindrome is a subsequence, not a substring. The first line contains one integer t ( 1 <= t <= 200 ) -- the number of test cases. The first line of each test case has one integer number n ( 1 <= n <= 2 cdot 10^3 ) -- the number of vertices in the graph. The second line contains a string s of length n , the i -th symbol of which denotes the letter on the vertex i . It is guaranteed that all characters in this string are lowercase English letters. The next n - 1 lines describe the edges of the tree. Each edge is given by two integers v and u ( 1 <= v, , u <= n , '...

Tutorials

Codeforces Round #837 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
184841137 Dream_Veid D Dec. 12, 2022, 3:57 a.m. OK GNU C++14 TESTS 51 46 16486400
184839977 Dream_Veid D Dec. 12, 2022, 3:39 a.m. OK GNU C++14 TESTS 51 62 16486400
184839289 Dream_Veid D Dec. 12, 2022, 3:28 a.m. OK GNU C++14 TESTS 51 62 16486400
184834499 Foldable D Dec. 12, 2022, 2:03 a.m. OK GNU C++14 TESTS 51 93 38604800
184825936 fofao_funk D Dec. 11, 2022, 10:13 p.m. OK GNU C++14 TESTS 51 124 16486400
184806318 FascTide D Dec. 11, 2022, 6:39 p.m. OK GNU C++14 TESTS 51 156 16486400
184812078 wuhudsm D Dec. 11, 2022, 7:11 p.m. OK GNU C++14 TESTS 51 156 32665600
184844353 bitter. D Dec. 12, 2022, 4:48 a.m. OK GNU C++14 TESTS 51 186 32870400
184811400 wuhudsm D Dec. 11, 2022, 7:06 p.m. OK GNU C++14 TESTS 51 187 49049600
184817365 Write_Hape_Code D Dec. 11, 2022, 8:09 p.m. OK GNU C++14 TESTS 51 202 106803200

remove filters

Back to search problems