3662专题

Telephone Linse(POJ-3662)

Problem Description Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm

《挑战程序设计竞赛》3.1.4 二分搜索-最小化第k大的值 POJ2010 3662(2)

POJ2010 http://poj.org/problem?id=2010 题意 给出n个数,要求将这n个数两两相减,把这些相减得到的数排序后,输出位置在中间的那个数。 思路 如果两两相减再排序复杂度太高,肯定超时了,二分法求解复杂度将大大降低。 枚举最中间的那个数,然后判断一下相减得到的数有多少个大于等于枚举的数。 如何判断上面所说的那句呢,其实不用把每个数相减,只需要排序一下,

HDU 3662 3D Convex Hull(三维凸包表面多边形个数)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3662 这个题目我的三维凸包模板竟然有问题,改后AC,模板题留个模板吧! #include<iostream>#include<cmath>#include<cstring>#include<cstdlib>#include<algorithm>#include <stdio.h

POJ - 3662(dijkstra+二分)

Telephone Lines Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to