Analysis of Common Algorithms: Greedy Algorithms

1. Greedy strategy: The so-called greedy strategy is to make the best choice in the current situation at each step and get the global optimal solution by summing up the local optimal solutions. Of course, a topic may not be able to obtain a global optimal solution from a local optimal solution (a typical example is the shortest path problem), ...

Posted by jvrothjr on Tue, 14 Dec 2021 20:09:21 +0100

Explanation of the 2021 Zhejiang University of technology freshman competition

The order of questions in this article is the order of expected difficulty, not the order of competition questions All "better optimization" in this article are thoughts beyond the standard answer. You can pass the question without using this content Game expectations Total number of participants: 175 (the number of particip ...

Posted by a-mo on Thu, 09 Dec 2021 13:46:57 +0100

2021 IC M (suffix automata)

Given a string, find the leftmost position of the most lexically ordered substring in the substring of each prefix. Idea: in fact, when you see the substring and the dictionary order, it is easy to think of the J in Guilin. It is natural to reverse the string, build the suffix automata, and then build the parent tree. The edge right is a lot mo ...

Posted by vapokerpro on Mon, 22 Nov 2021 14:08:02 +0100

The 45th international undergraduate Programming Competition (ICPC) Asian regional competition (Nanjing) E.Evil Coordinate (classified discussion + simulation)

https://ac.nowcoder.com/acm/contest/21739/E There is a simpler way to solve this problem (enumerating all UDLR permutations). It took me 2 and a half hours to finally AC Idea: 1. First of all, we can think that given a sequence of walking methods, no matter how the sequence is arranged, its end point must be determined. Therefore, if the bo ...

Posted by vivekjain on Wed, 13 Oct 2021 16:42:16 +0200