Codeforces Round #711 Planar Reflections - Compression DP
Solution Compression DP. Let the particles with lifetime $i$ pass through all the planes first. And then calculate the particles with lifetime $i-1$.…
Solution Compression DP. Let the particles with lifetime $i$ pass through all the planes first. And then calculate the particles with lifetime $i-1$.…
Solution: Since you can do any number of operations, in order to simplify the problem, we can specify $x$ as 1.…
A. Review Site Solution: Put all type 2 users a server. And put type 1 and type 3 users to another one. Then all type 3 users will upvote. Code:…
Solution Obviously we will immediately think of the Kruskal algorithm. Kruskal Let's consider the edge generated by GCD. We can found that:…
Define dp[i] as: after m operations, the length of result change from 1. So of course for 0<=i<=8, dp[i]=1.…
Solution: First notice this property: x&y<=x. Let's see if i=1, then we get a1=a2&a3&...…
Problem F is interesting because it need DP and Greedy at same time. Problem G is just brute force to build a prepared data. So not very funny. Problem a little bit complex to implement. Nothing special for other problems.…
Of course a DP problem. But the interesting thing is, this problem need Greedy at same time. It's very easy to define DP state like:…