[cf1610G]AmShZ Wins a Bet

The operation on $t $inserts a pair of parentheses in $t $, and the reverse process deletes a pair of parentheses In other words, $s $can be obtained by $t $if and only if $t $can be obtained by deleting several pairs of parentheses in $s $, that is, the problem is to find $\ min t$ Conclusion $\ min t can be obtained by deleting several legiti ...

Posted by Zilvermeeuw on Fri, 03 Dec 2021 09:15:53 -0800

[CF1007D] Ants (tree chain subdivision + 2-SAT)

Click here to see the problem There is a tree with \ (n \) points. You need to perform \ (m \) coloring operations. Each operation gives two point pairs \ ((x_1,y_1) \) and \ ((x_2,y_2) \), and you need to select a point pair to color all the edges in the path on the corresponding tree. It is required that the same edge cannot be dyed repeated ...

Posted by Andrei on Thu, 04 Nov 2021 10:57:34 -0700

Codeforces Round #753 (Div. 3)

There are three main situations: It's been a second since I took a look at my beard. The implementation is also very simple. I write casually / too lazy to write After a second, I felt that it would not be realized, so I went to look at other people's code I didn't understand the question A Direct simulation. B Simple math problems + find rul ...

Posted by morris on Wed, 03 Nov 2021 17:48:13 -0700

Codeforces Round #751 (Div. 2)(A - C)

A.Two Subsequences Topic Essentials Give you a string s. You need to find two non-empty strings a and b to satisfy the following conditions: (1) Strings a and b are subsequences of s. (2) For each index i, the character s [i] in the string s must exactly belong to one of the strings a or b. (3) String a is the smallest possible dictionary ...

Posted by rash on Sun, 31 Oct 2021 11:33:25 -0700

Codeforces Round #752 (Div. 2) A B C D

Codeforces Round #752 (Div. 2) Record high!! A. Era Idea: at first, I thought it was to find a maximum subscript, and then output the maximum minus the maximum subscript. Later, I dropped this idea with the data 1 1 5 1 6 hack, and it was obvious that as long as I enumerated it, I saved the largest memory ...

Posted by jaybeeb on Sat, 30 Oct 2021 11:24:42 -0700

[2021-9-23] supplementary question record

Educational Codeforces Round 54 (Rated for Div. 2) E. Vasya and a Tree Main idea of the topic: given a tree with 1 as the root node, each node value is 0, given several modifications, x,d,v, is the y value of X node and its dist (x, y) < = D, plus v, and finally outputs the value of each node; Solution: for offline modification, use the tree ...

Posted by daniel_lee_hill on Thu, 23 Sep 2021 01:05:23 -0700