武大OJ 613. Count in Sama’s triangle
摘要:Description Today, the math teacher taught Alice Hui Yang’s triangle. However, the teacher came up with a new one, called Sama’s triangle (some of you
阅读全文
posted @
2018-08-29 12:12
怡红公子
阅读(251)
推荐(0)
武大OJ 612. Catch the sheep
摘要:Description Old Sama is a great and powerful magician in the word. One day, a little girl, Anny, touched Sama’s crystal and broke into his magic 2D sp
阅读全文
posted @
2018-08-28 19:37
怡红公子
阅读(331)
推荐(0)
[HAOI2011]防线修建
摘要:题目描述 近来A国和B国的矛盾激化,为了预防不测,A国准备修建一条长长的防线,当然修建防线的话,肯定要把需要保护的城市修在防线内部了。可是A国上层现在还犹豫不决,到底该把哪些城市作为保护对象呢?又由于A国的经费有限,所以希望你能帮忙完成如下的一个任务: 给出你所有的A国城市坐标 A国上层经过讨论,考
阅读全文
posted @
2018-08-27 15:20
怡红公子
阅读(159)
推荐(0)
1185: [HNOI2007]最小矩形覆盖
摘要:题目描述 给定一些点的坐标,要求求能够覆盖所有点的最小面积的矩形, 输出所求矩形的面积和四个顶点坐标 给定一些点的坐标,要求求能够覆盖所有点的最小面积的矩形, 输出所求矩形的面积和四个顶点坐标 输入 第一行为一个整数n(3<=n<=50000) 从第2至第n+1行每行有两个浮点数,表示一个顶点的x和
阅读全文
posted @
2018-08-26 19:23
怡红公子
阅读(775)
推荐(0)
POJ 1228 Grandpa's Estate
摘要:Description Being the only living descendant of his grandfather, Kamran the Believer inherited all of the grandpa's belongings. The most valuable one
阅读全文
posted @
2018-08-22 16:13
怡红公子
阅读(320)
推荐(0)
武大OJ 706.Farm
摘要:Farmer John has a farm. Betsy, a famous cow, loves running in farmer John's land. The noise she made makes John mad. So he wants to restrict the area
阅读全文
posted @
2018-08-22 14:56
怡红公子
阅读(294)
推荐(0)
最小堆的两种实现及其STL代码
摘要:pop_heap(a.begin(),a.end(),cmp) 的功能只是将第一个元素放到最后,然后忽略最后一个元素的情况下再维护一遍堆 一:最小堆的初始堆有两种方式建立: 1、for(int i=1;i<=m;++i) heap_up(i); 让上面的路走通 2、for(int i=m/2;i>=
阅读全文
posted @
2018-08-22 13:08
怡红公子
阅读(472)
推荐(0)