二分搜索思想:bool C(double x)可以得到长度为x的绳子//#define
LOCAL#include#includeint const MAX_N=10005;int const MAX_M=100;double const
INF=100000000;int N,K;double d...
分类:
其他好文 时间:
2014-05-17 00:13:44
阅读次数:
271
那天别人问了我一个问题,关于单例模式的,由于之前了解的都是蜻蜓点水,所以重新复习了一次重新总结。单例模式的写法总的来说有5种:懒汉,恶汉,枚举,双重校验锁,静态内部类懒汉
1 public class Signleton{ 2 private static Signleto...
分类:
其他好文 时间:
2014-05-16 23:33:42
阅读次数:
319
题意:给一个图,有些点之间已经连边,现在给每对点之间加边的概率是相同的,问使得整个图连通,加边条数的期望是多少。此题可以用概率DP+并查集+hash来做。用dp(i,j,k...)表示当前的每个联通分量的点数分别是i,j,k...(连通分量的个数不固定)时,加边的期望。这样以dp(i,j,k)为例分...
分类:
其他好文 时间:
2014-05-16 06:23:26
阅读次数:
312
题目: Givennpoints on a 2D plane, find the maximum
number of points that lie on the same straight line.解题思路:
第一反应:枚举两个点组成的直线,然后看其他的点在不在这条直线上,在此过程中统计最大.....
分类:
其他好文 时间:
2014-05-16 05:54:57
阅读次数:
193
枚举 索引从0开始sort 默认升序排列 Array.Sort(intSort);//复制数组
Array.Copy(intSort,intNew,3); intsort 源数组 intnew 目标数组
3长度声明类数组之后,在用到具体的元素时需要再重新声明一遍public c...
分类:
其他好文 时间:
2014-05-16 05:21:09
阅读次数:
247
----------------------
ASP.Net+Android+IOS开发、.Net培训、期待与您交流!
----------------------枚举:Java中的枚举类型采用关键字enum来定义,从jdk1.5才有的新类型,所有的枚举类型都是继承自Enum类型。枚举类型的定义也非...
分类:
其他好文 时间:
2014-05-16 04:47:45
阅读次数:
256
Cut the Sequence
Time Limit: 2000MS
Memory Limit: 131072K
Total Submissions: 8764
Accepted: 2576
Description
Given an integer sequence { an } of length N, you are to ...
分类:
其他好文 时间:
2014-05-13 16:04:29
阅读次数:
267
Sliding Window
Time Limit: 12000MS
Memory Limit: 65536K
Total Submissions: 36469
Accepted: 10803
Case Time Limit: 5000MS
Description
An array of size n ≤ 106 is gi...
分类:
其他好文 时间:
2014-05-13 15:36:47
阅读次数:
357
Description
Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= ...
分类:
其他好文 时间:
2014-05-13 14:53:40
阅读次数:
189
大意:给出数组a,内容为 a1 a2 a3 ... an。再给一个常数k。从i=1起,计算ai、a i+1、...、a i+k-1区间内的最小值和最大值。
线段树咯。...
分类:
其他好文 时间:
2014-05-13 14:11:41
阅读次数:
187