# 51nod 1837 砝码称重 （规律）

Description 小 Q 有 n 个砝码，它们的质量分别为 1 克、 2 克、……、 n 克。 他给 i 克的砝码标上了编号 i (i = 1, 2, …, n)，但是编号被人打乱了，即编号为 i 的砝码不一定是 i 克，而是 a_i 克，这里 a 指的是 1 到 n 的一个排...

# POJ 2186 Popular Cows （缩点）

Description Every cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1...

# Codeforces 867 E. Buy Low Sell High （贪心）

Description You can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want t...

# Codeforces 847 H. Load Testing （技巧）

Description Polycarp plans to conduct a load testing of its new project Fakebook. He already agreed with his friends that at certain points in time...

# POJ 3683 Priest John's Busiest Day （2-SAT）

Description John is the only priest in his town. September 1st is the John’s busiest day in a year because there is an old legend in the town that ...

# POJ 3207 Ikki's Story IV - Panda's Trick （2-SAT）

Description liympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tir...

# HDU 1814 Peaceful Commission （2-SAT）

Description The Public Peace Commission should be legislated in Parliament of The Democratic Republic of Byteland according to The Very Important L...

# Codeforces 847 B. Preparing for Merge Sort （二分）

Description Ivan has an array consisting of n different integers. He decided to reorder all elements in increasing order. Ivan loves merge sort so ...

# Codeforces 847 C. Sum of Nestings （技巧）

Description Recall that the bracket sequence is considered regular if it is possible to insert symbols ‘+’ and ‘1’ into it so that the result is a ...

# Codeforces 855 C. Helga Hufflepuff’s Cup （树形dp）

Description Harry, Ron and Hermione have figured out that Helga Hufflepuff’s cup is a horcrux. Through her encounter with Bellatrix Lestrange, Herm...

# Codeforces 862 E. Fire （01背包）

Description Polycarp is in really serious trouble — his house is on fire! It’s time to save the most valuable items. Polycarp estimated that it wou...

# 51nod 1791 合法括号子段 （dp）

Description 有一个括号序列，现在要计算一下它有多少非空子段是合法括号序列。 合法括号序列的定义是： 空序列是合法括号序列。 如果 S 是合法括号序列，那么 (S) 是合法括号序列。 如果 A 和 B 都是合法括号序列，那么 AB 是合法括号序列。 ...

# HDU 6194 string string string （SAM）

Description Uncle Mao is a wonderful ACMER. One day he met an easy problem, but Uncle Mao was so lazy that he left the problem to you. I hope you c...

# HDU 4641 K-string （SAM）

Description Given a string S. K-string is the sub-string of S and it appear in the S at least K times.It means there are at least K different pairs...

# HDU 6201 transaction transaction transaction （树形dp）

Description Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens w...

# HDU 6208 The Dominator of Strings （SAM）

Description Here you have a set of strings. A dominator is a string of the set dominating all strings else. The string S is dominated by T if S is ...

# HDU 6214 Smallest Minimum Cut （最小割）

Description Consider a network G=(V,E) with source s and sink t. An s-t cut is a partition of nodes set V into two parts such that s and t belong t...

# Codeforces 862 C. Mahmoud and Ehab and the xor （技巧）

Description Mahmoud and Ehab are on the third stage of their adventures now. As you know, Dr. Evil likes sets. This time he won’t show them any set...

# HDU 5769 Substring （后缀数组）

Description ?? is practicing his program skill, and now he is given a string, he has to calculate the total number of its distinct substrings. ...

# SPOJ SUBST1 - New Distinct Substrings （后缀数组）

Description Given a string, we need to find the total number of its distinct substrings.  Input T - number of test cases. T<=20; Each test cas...

个人资料
等级：
访问量： 36万+
积分： 1万+
排名： 2019
欢迎关注 <千与梦随> 哦！
博客专栏
 那些年,我们一起追过的算法 文章：6篇 阅读：23920
最新评论