# FZU 2219 StarCraft （哈夫曼树）

Description ZB loves playing StarCraft and he likes Zerg most! One day, when ZB was playing SC2, he came up with an idea: He wants to c...

# Codeforces 890 D. Boxes And Balls （哈夫曼）

Description Ivan has n different boxes. The first of them contains some balls of n different colors. Ivan wants to play a strange game. He wan...

# Codeforces 861 D. Polycarp's phone book （trie）

Description There are n phone numbers in Polycarp’s contacts on his phone. Each number is a 9-digit integer, starting with a digit different from 0...

# 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 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...

# 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 ...

# HDU 6059 Kanade's trio （字典树）

Description Give you an array A[1..n]A[1..n] ，you need to calculate how many tuples (i,j,k)(i,j,k) satisfy that (i<j<k)(i<j<k) and ((A[...

# HDU 6041 I Curse Myself （仙人掌图）

Description There is a connected undirected graph with weights on its edges. It is guaranteed that each edge appears in at most one simple cycle. ...

# codevs 2370 小机房的树 （LCA）

Description 小机房有棵焕狗种的树，树上有N个节点，节点标号为0到N-1，有两只虫子名叫飘狗和大吉狗，分居在两个不同的节点上。有一天，他们想爬到一个节点上去搞基，但是作为两只虫子，他们不想花费太多精力。已知从某个节点爬到其父亲节点要花费 c 的能量（从父亲节点爬到此节点也相同），他们...

# codevs 1036 商务旅行 （LCA）

Description 某首都城市的商人要经常到各城镇去做生意，他们按自己的路线去做，目的是为了更好的节约时间。 假设有N个城镇，首都编号为1，商人从首都出发，其他各城镇之间都有道路连接，任意两个城镇之间如果有直连道路，在他们之间行驶需要花费单位时间。该国公路网络发达，从首都出发能到...

# POJ 1470 Closest Common Ancestors (LCA)

Description Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the close...

# POJ 1330 Nearest Common Ancestors (LCA)

Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, ...

# 『数据结构』RMQ 问题

RMQ (Range Minimum/Maximum Query)，即区间最值问题 对于长度为 n 的数列，回复若干次查询，返回某个区间的最大（小）值

# POJ 2442 Sequence （堆）

Description Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m inte...

# POJ 3253 Fence Repair （哈夫曼）

Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20...

# POJ 1611 The Suspects (并查集)

Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 20...

# POJ 2001：Shortest Prefixes

A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca&qu...

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