题目地址:Ural 1303
先按每个线段的左端点排序,然后设置一个起点s,每次都从起点小于等于s的线段中找到一个右端点最大的。并将该右端点作为新的起点s,然后继续找。从左到右扫描一遍即可。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#incl...
分类:
其他好文 时间:
2014-10-26 21:18:43
阅读次数:
194
HDU 2489 Minimal Ratio Tree (dfs+Prim最小生成树)...
分类:
其他好文 时间:
2014-10-23 20:52:25
阅读次数:
236
本文LVS的实现方式采用NAT模式,关于NAT的拓扑图请参照我的上一篇文章,本文纯粹实验,NAT在生产环境中不推荐使用,原因是Load Balancer容易成为瓶颈!
1.VMware9上安装CentOS-6.5-x86_64-minimal版
2.安装完成后将其hostname设置为LVS-master
hostname LVS-master
sudo -i
3.之后copy两份...
分类:
系统相关 时间:
2014-10-22 22:01:07
阅读次数:
304
Minimal coverage
The Problem
Given several segments of line (int the X axis) with coordinates [Li,Ri]. You are to choose the minimal amount of them, such they would completely cover the segment [0,...
分类:
其他好文 时间:
2014-10-14 23:52:09
阅读次数:
247
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=961贪心,排序,对左端点贪,找最大右端点。 1 #include 2 #include 3 #inclu.....
分类:
其他好文 时间:
2014-10-12 16:22:08
阅读次数:
179
Problem Description
Given a 3-dimension ellipsoid(椭球面)
your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two points...
分类:
其他好文 时间:
2014-10-04 18:05:26
阅读次数:
242
Problem Description
The light travels in a straight line and always goes in the minimal path between two points, are the basic laws of optics.
Now, our problem is that, if a branch of light goes...
分类:
其他好文 时间:
2014-10-03 04:12:15
阅读次数:
162
简述CentOS中通过源码的方式安装MySQL-5.5.38的方法以及注意事项...
分类:
数据库 时间:
2014-09-29 15:41:51
阅读次数:
280
简述了CentOS中配置Apache-2.2.29实现请求转发的功能...
分类:
其他好文 时间:
2014-09-29 11:10:00
阅读次数:
156
上篇简单介绍了CentOS 7 在服务和网络方面的一点变化,先前很多烂熟于心的操作指令已经不适用了,不管是否习惯,总要接受、熟悉这些变化。写上篇的时候还没有最小安装的ISO(CentOS-7.0-1406-x86_64-Minimal.iso),后来安装了首先发现ifconfig、netstat、r...
分类:
其他好文 时间:
2014-09-29 01:49:07
阅读次数:
440