1. span class=”co2″>import java.util.Arrays;
  2. /**
  3. * Created by IntelliJ IDEA.
  4. * User: zhangjiayin
  5. * Date: Jan 13, 2010
  6. * Time: 7:15:50 PM
  7. * To change this template use File | Settings | File Templates.
  8. *//**
  9. * get min value of a and b
  10. * @param a
  11. * @param b
  12. * @return
  13. *//**
  14. * “vector o p1″ cross “vector o p2″
  15. * @param o
  16. * @param p1
  17. * @param p2
  18. * @return
  19. *//**
  20. *  ”vector p1″ cross “vector p2″
  21. * @param p1
  22. * @param p2
  23. * @return
  24. *//**
  25. * distance of two tree p2 and p1
  26. * @param p1
  27. * @param p2
  28. * @return
  29. *//**
  30. * sort by angle in polar coordinate system
  31. * if the angle is the same, then sort by their length
  32. * @param p1
  33. * @param p2
  34. * @return
  35. *//**
  36. *  determine if o -> p1 -> p2 are convex  (refer to the origin)
  37. * @param o
  38. * @param p1
  39. * @param p2
  40. * @return
  41. *//**
  42. * instance of this algorithm
  43. * @param trees
  44. * @return
  45. */// the special case
  46. // sort all trees by their angle in polar coordinate system
  47. // start from each possible tree
  48. // get a proper hull by the graham’s scan
  49. // calculate the distance of the hull
  50. // record the minimal distance
  51. ans = min(ans, length);
  52. }
  53. // print solution, don’t forget to plus 2
  54. import java.util.Arrays;
  55. /** * Created by IntelliJ IDEA. * User: zhangjiayin * Date: Jan 13, 2010 * Time: 7:15:50 PM * To change this template use File | Settings | File Templates. *//**     * get min value of a and b     * @param a     * @param b     * @return     *//**     * “vector o p1″ cross “vector o p2″     * @param o     * @param p1     * @param p2     * @return     *//**     *  ”vector p1″ cross “vector p2″     * @param p1     * @param p2     * @return     *//**     * distance of two tree p2 and p1     * @param p1     * @param p2     * @return     *//**     * sort by angle in polar coordinate system     * if the angle is the same, then sort by their length     * @param p1     * @param p2     * @return     *//**     *  determine if o -> p1 -> p2 are convex  (refer to the origin)     * @param o     * @param p1     * @param p2     * @return     *//**     * instance of this algorithm     * @param trees     * @return     */// the special case        if (treesCount == 0) {            return 2.0;        }
  56.  
  57. // sort all trees by their angle in polar coordinate system        Arrays.sort(trees);
  58. // start from each possible tree        for (i=0; i<treesCount; ++i) {
  59. // get a proper hull by the graham’s scan            k = 0;            for (j=0; j< treesCount; ++j) {                int p = (i+j) % treesCount;                while (k >= 2 && !convex(trees[hulls[k-2]], trees[hulls[k-1]], trees[p])) k–;                hulls[k++] = p;            }
  60. // calculate the distance of the hull            double length = getDistance(trees[i], origin) + getDistance(trees[(i-1+treesCount)%treesCount], origin);            for (j=0; j<k-1; ++j)                length += getDistance(trees[hulls[j]], trees[hulls[j+1]]);
  61. // record the minimal distance            ans = min(ans, length);
  62. }
  63. // print solution, don’t forget to plus 2

看了这位仁兄的 配置 自己也配置了一下
http://blog.cuoluo.cn/2009/12/install-pptp-vpn-in-linode-vps/

1, 安装pptpd

apt-get install pptpd

2. 编辑 /etc/pptpd.conf文件

 添加 (或去掉注释,原来文件内容这两行 被注释掉了)
localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245

3修改/etc/ppp/chap-secrets 添加用户

格式这个文件里面有 基本上是

用户名 pptpd  密码    ip(可用 *)           

4手动配置 登陆后的dns  编辑文件/etc/ppp/options  添加

ms-dns 8.8.8.8
ms-dns 8.8.4.4

5 开启ipv4 forward

修改 etc/sysctl.conf, 添加
net.ipv4.ip_forward = 1

运行下面的命令让配置生效。
sysctl -p
重启pptpd服务
/etc/init.d/pptpd restart
开启iptables转发
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE