问题描述: 用 n 条直线切割平面空间,求切割出的空间的最大数目。 问题描述: 用 n 条直线切割平面空间,求切割出的空间的最大数目。 解决方案: 当我们用 n 条直线去切割时,与前面的 n-1 条直线最多有 n-1 个不同的交点,那么最多新增 n 个空间。假定 n 条直线切割的空间最多为 Ln , ...
分类:
其他好文 时间:
2016-05-23 21:12:09
阅读次数:
138
Only a handful of source code lines is required to make a JAXB Marshaller object write a document tree as an XML file. First you obtain a Marshaller f ...
分类:
其他好文 时间:
2016-05-20 11:29:24
阅读次数:
192
Intersecting Lines Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13605 Accepted: 6049 Description We all know that a pair of distinct poi ...
分类:
其他好文 时间:
2016-05-19 22:57:52
阅读次数:
164
text-align:justify; word-break:break-all; stext-justify:distribute-all-lines; /*ie6-8*/ text-justify:inter-ideograph; -webkit-text-align-last:justify; ...
分类:
其他好文 时间:
2016-05-14 13:57:08
阅读次数:
109
题意:给一个长度为n(n<=200000)的序列,删掉某一个连续的序列,使得剩下的序列有一个长度最大的连续递增子序列。
思路:首先这里最容易想到,枚举任意两个点j,i,删掉从j到i的序列,求剩下最大连续递增的子序列长度.i,j可以O(n)预处理,求出j处结尾的最长连续递增序列长度l[j],和i处起始的最长连续递增序列的长度r[i].这样得到一个O(n^2)的算法。
然而,n 200000的大小,...
分类:
其他好文 时间:
2016-05-13 03:58:20
阅读次数:
204
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#pragma warning(disable:4996)
using std::cin;
using std::cout;
using std::endl;
using std::stringstre...
分类:
其他好文 时间:
2016-05-13 02:31:57
阅读次数:
134
快捷键的使用
向下复制一行
(Duplicate Lines) ctrl+down 修改变量名与方法名 alt+shift+R
向下移动行
(move line down) Alt+down 打开Module setting窗口 ctrl+shift+E
向上开始新的一行
(Start New Line before current) ctrl+shift+enter 查看类继承关系 F4
`向下...
分类:
其他好文 时间:
2016-05-12 22:00:34
阅读次数:
146
题目:给你平面上的两条直线,判断两直线关系,平行,重合,相交,如果相交求交点。
公式:p1xp2=x1*y2-x2*y1(外积)
判断q是否在线段p1-p2上面,根据(p1-q)x(p2-q)=0来判断q是否在直线p1-p2上。
两直线平行:(p1-p2)x(q1-q2)=0,为什么?把两条直线的斜率写出来并且令他们相等,这个等式就是这个公式。
p1-p2,q1-q2的交点:
(...
分类:
其他好文 时间:
2016-05-12 21:09:10
阅读次数:
200
D - Intersecting Lines
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d
& %I64u
Submit Status Practice POJ
1269
Appoint description:
System Crawler (2016-05-08)
...
分类:
其他好文 时间:
2016-05-12 16:27:21
阅读次数:
227
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2016-05-12 14:36:17
阅读次数:
134