51nod 1405 树的距离之和 （树形dp）

Description 给定一棵无根树，假设它有n个节点，节点编号从1到n ，求任意两点之间的距离（最短路径）之和。  Input 第一行包含一个正整数n (n <= 100000)，表示节点个数。 后面(n - 1)行，每行两个整数表示树的边。  Output 每行一...

Description It’s almost summer time, and that means that it’s almost summer construction time! This year, the good people who are in charge of the ...

Codeforces 854 D. Jury Meeting（技巧）

Description Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Me...

Codeforces 851 D. Arpa and a list of numbers（技巧）

Description Arpa has found a list containing n numbers. He calls a list bad if and only if it is not empty and gcd (see notes section for more info...

Codeforces 852 G. Bathroom terminal（trie）

Description Smith wakes up at the side of a dirty, disused bathroom, his ankle chained to pipes. Next to him is tape-player with a hand-written mes...

Codeforces 849 D. Rooter's Song （技巧）

Description Wherever the destination is, whoever we meet, let’s render this song together. On a Cartesian coordinate plane lies a rectangular ...

Codeforces 849 C. From Y to Y （技巧）

Description From beginning till end, this message has been waiting to be conveyed. For a given unordered multiset of n lowercase English lette...

51nod 1109 01组成的N的倍数 （bfs）

Description 给定一个自然数 N ，找出一个 M ，使得 M > 0 且 M 是 N 的倍数，并且 M 的 10 进制表示只包含 0 或 1 ，求最小的 M 。 例如：N = 4，M = 100。  Input 输入 1 个数 N 。(1 <= N <...

POJ 3254 Corn Fields （状压dp）

Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow s...

Codeforces 842 D. Vitya and Strange Lesson （trie）

Description Today at the lesson Vitya learned a very interesting function — mex. Mex of a sequence of numbers is the minimum non-negative number th...

Codeforces 842 C. Ilya And The Tree （dfs）

Description Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1...

UPC 1053 Mysterious Treasure （记忆化搜索）

Description WNJXYK and DIDIDI is playing a game. DIDIDI draws a directed graph G on the paper which contains n points, m directed edges and no cycl...

HDU 6156 Palindrome Function （数位dp）

Description As we all know,a palindrome number is the number which reads the same backward as forward,such as 666 or 747.Some numbers are not the p...

HDU 6170 Two strings （dp）

Description Giving two strings and you should judge if they are matched. The first string contains lowercase letters and uppercase letters. ...

HDU 6154 CaoHaha's staff （数学）

Description “You shall not pass!” After shouted out that,the Force Staff appered in CaoHaha’s hand. As we all know,the Force Staff is a s...

HDU 6152 Friend-Graph （最大团）

Description It is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a ...

HDU 6150 Vertex Cover （构造）

Description As we know, minimumvertexcover is a classical NP-complete problem. There will not be polynomial time algorithm for it unless P=NP. ...

HDU 6153 A Secret （扩展KMP）

Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret an...

POJ 3321 Apple Tree （树状数组）

Description There is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he ...

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