- 博客(7)
- 收藏
- 关注
原创 没有上司的舞会
描述 某大学有N个职员,编号为1~N。他们之间有从属关系,也就是说他们的关系就像一棵以校长为根的树,父结点就是子结点的直接上司。现在有个周年庆宴会,宴会每邀请来一个职员都会增加一定的快乐指数Ri,但是呢,如果某个职员的上司来参加舞会了,那么这个职员就无论如何也不肯来参加舞会了。所以,请你编程计算,邀请哪些职员可以使快乐指数最大,求最大...
2018-12-20 16:30:08 57
原创 石子合并
描述 有n堆石子排成一行,每次选择相邻的两堆石子,将其合并为一堆,该次合并的消费为两堆石子个数之和。已知每堆石子的石子个数,求当所有石子合并为一堆时,最小的消费。 输入 有多组测试数据,输入到文件结束。每组测试数据第一行有一个整数n,表示有n堆石子。接下来的一行有n(0< n <200)个数,分别表示这n堆石子的数目,用...
2018-12-20 16:25:40 64
原创 Intervals
传送门Poj1201描述 You are given n closed, integer intervals [ai, bi] and n integers c1, …, cn.Write a program that:reads the number of intervals, their end points and intege...
2018-12-20 15:20:01 95
原创 House Man
传送门 Poj2983描述 In Fuzhou, there is a crazy super man. He can’t fly, but he could jump from housetop to housetop. Today he plans to use N houses to hone his house hopping...
2018-12-20 13:35:04 105
原创 Is the Information Reliable?(判负环)
传送门 Poj2983描述 The galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense called Grot. Grot is a str...
2018-12-20 13:35:04 56
原创 World Exhibition
传送门 HDU3592描述 Nowadays, many people want to go to Shanghai to visit the World Exhibition. So there are always a lot of people who are standing along a straight line wai...
2018-12-20 13:17:33 79
原创 heap
建堆 插入元素 删除元素 堆排序 判断堆 寻找第一个不符合堆的位置 ——algorithm 建堆 make_heap默认建大根堆,O(n)1 2 3 4 5 6 7 8 9 10 11 bool cmp(int a,int b){ return a>b; //注意是大于 ...
2018-12-09 14:47:52 93
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人