### HDU 4333 – Revolving Digits [扩展KMP]

Link 传送门 Problem One day Silence is interested in revolving the digits of a positive integer. In the revolving operation, he can put several last digits to the front of the integer. Of course, he can put all the digits to the front, so he will ...

#### HDU 4333 – Revolving Digits [扩展KMP]

Link 传送门 Problem One day Silence is interested in revolving the digits of a positive integer. In the revolving operation, he can put several las...

### HDU 4760 – Good Firewall [Trie]

Link 传送门 Problem Professor X is an expert in network security. These days, X is planning to build a powerful network firewall, which is called Good Firewall (a.k.a., GFW). Network flows enter in the GFW will be forwarded or dropped according to...

#### HDU 4760 – Good Firewall [Trie]

Link 传送门 Problem Professor X is an expert in network security. These days, X is planning to build a powerful network firewall, which is called G...

### POJ 3678 – Katu Puzzle [2-SAT入门题]

Link 传送门 Problem Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a boolean operator op (one of AND, OR, XOR) and an integer c (0 ≤ c ≤ 1). One Katu is solvable if one can find each vertex Vi a value Xi (0 ...

#### POJ 3678 – Katu Puzzle [2-SAT入门题]

Link 传送门 Problem Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a boolean operator op (one of AND, OR, X...

### HDU 2089 – 不要62 [数位DP]

Link 传送门 Problem 杭州人称那些傻乎乎粘嗒嗒的人为62（音：laoer）。 杭州交通管理局经常会扩充一些的士车牌照，新近出来一个好消息，以后上牌照，不再含有不吉利的数字了，这样一来，就可以消除个别的士司机和乘客的心理障碍，更安全地服务大众。 不吉利的数字为...

### HDU 1158 – Employment Planning [DP]

Link 传送门 Problem A project manager wants to determine the number of the workers needed in every month. He does know the minimal number of the workers needed in each month. When he hires or fires a worker, there will be some extra cost. Once a w...

#### HDU 1158 – Employment Planning [DP]

Link 传送门 Problem A project manager wants to determine the number of the workers needed in every month. He does know the minimal number of the wo...

### HDU 5642 – King’s Order [数位DP]

Link 传送门 Problem After the king’s speech , everyone is encouraged. But the war is not over. The king needs to give orders from time to time. But sometimes he can not speak things well. So in his order there are some ones like this: “...

#### HDU 5642 – King’s Order [数位DP]

Link 传送门 Problem After the king’s speech , everyone is encouraged. But the war is not over. The king needs to give orders from time to tim...

### POJ 2151 – Check the difficulty of problems [概率DP]

Link 传送门 Problem Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satisfy the following two terms: 1. All of the teams solve at least one problem. 2...

#### POJ 2151 – Check the difficulty of problems [概率DP]

Link 传送门 Problem Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect t...

### CodeForces 651D – Watchmen [二分]

Link 传送门 Problem Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo, y...

#### CodeForces 651D – Watchmen [二分]

Link 传送门 Problem Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and righ...

### CodeForces 651C – Watchmen [规律+容斥]

Link 传送门 Problem Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arran...

#### CodeForces 651C – Watchmen [规律+容斥]

Link 传送门 Problem Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible....

### HDU 1402 – A * B Problem Plus [FFT模板]

Link 传送门 Problem Calculate A * B. Each line will contain two integers A and B. Process to end of file. Note: the length of each integer will not exceed 50000. For each case, output A * B in one line. Maen 计算A*B，A和B每个数最长50000位。 Analys...

#### HDU 1402 – A * B Problem Plus [FFT模板]

Link 传送门 Problem Calculate A * B. Each line will contain two integers A and B. Process to end of file. Note: the length of each integer will not...