题意:一条路上有n个地雷,告诉你这n个雷的位置,一个人初始在位置1,这个人每次可以走1个单位或者跳2个单位,概率分别为p和1-p,现在要求这个人安全通过这段路的概率思路:求出安全通过每个雷的概率,再把所有的乘起来即可。要安全通过某个雷(假设在place[i]这个位置),只有从place[i]-1跳两...
分类:
其他好文 时间:
2015-08-04 20:58:12
阅读次数:
105
f[1] = 'b', f[2] = 'a', f[i] = f[i - 1] + f[i - 2]斐波那契数列的字符串,给你n和m,前m位中,最长的前缀等于后缀的长度是多少。1≤n≤1000, 1≤m≤length(f[n])规律题,虽然我不知道为什么。 1 import java.io.*; 2...
分类:
其他好文 时间:
2015-08-04 20:59:19
阅读次数:
115
short、int 和 long 类型都表示整型值,存储空间的大小不同。一般, short 类型为半个机器字长,int 类型为一个机器字长,而 long 类型为一个或两个机器字长(在 32 位机器中 int 类型和 long 类型通常字长是相同的)。unsigned int 0~4294967295...
分类:
其他好文 时间:
2015-08-04 20:58:26
阅读次数:
108
给一个正整数n,将n分解为质因数。说明:n的质因数要么是n本身(n是素数),要么一定小于等于sqrt(n)。因此可以用小于等于sqrt(n)的数对n进行试除,一直除到不能除为止。这时候剩下的数如果不是1,那就是n最大的质因数。举例说明:100=2^2 * 5^2 ;模板代码: 1 #include ...
分类:
其他好文 时间:
2015-08-04 20:58:15
阅读次数:
115
1. firefox ie 设置单元格宽度 td width 有bug,不能正常工作。以下方式可以解决jqElement.css({ 'min-width': srcth1.width() + "px", 'width': srcth1.width() + "px" });2.不要使用CellSpa...
分类:
其他好文 时间:
2015-08-04 20:57:26
阅读次数:
443
高斯消元 求期望题意:数轴上有0~n-1 个点,你每次可能走k步,1#include #include #include #include #include #define eps 1e-8#define INF 1e9using namespace std;double P[500] ;int v...
分类:
其他好文 时间:
2015-08-04 20:56:26
阅读次数:
102
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6...
分类:
其他好文 时间:
2015-08-04 20:58:01
阅读次数:
110
1.http://www.cnblogs.com/puppyb2m/p/4702912.htmldispatch, 多线程, NSArray
分类:
其他好文 时间:
2015-08-04 20:57:01
阅读次数:
90
一、公钥加密假设一下,我找了两个数字,一个是1,一个是2。我喜欢2这个数字,就保留起来,不告诉你们(私钥),然后我告诉大家,1是我的公钥。我有一个文件,不能让别人看,我就用1加密了。别人找到了这个文件,但是他不知道2就是解密的私钥啊,所以他解不开,只有我可以用数字2,就是我的私钥,来解密。这样我就可...
分类:
其他好文 时间:
2015-08-04 20:57:21
阅读次数:
112
总算今天静下心来学算法。。DescriptionInnocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the entrance of the tomb while Dumb Zhang’s at the end of...
分类:
其他好文 时间:
2015-08-04 20:56:29
阅读次数:
146
Lua是一个小巧高效的解释型脚本语言,可以方便的嵌入到任意的语言中,很多应用程序、游戏使用LUA作为自己的嵌入式脚本语言,以此来实现可配置性、可扩展性。这其中包括魔兽世界、博德之门、愤怒的小鸟、VOCALOID3、太阳神三国杀等。下载和编译下载连接:http://www.lua.org/downlo...
分类:
其他好文 时间:
2015-08-04 20:55:40
阅读次数:
208
原文地址:http://blog.sina.com.cn/s/blog_605f5b4f0100x3ep.html首先声明:在VC++下编译printf不会自动做类型转换,比如int a=3; printf("%f",a);运行过程中会报错,runtime error R6002: floating...
分类:
其他好文 时间:
2015-08-04 20:55:29
阅读次数:
127
DescriptionMr. Tenant is going to buy a new house. In fact, he is going to buy a piece of land and build his new house on it. In order to decide which...
分类:
其他好文 时间:
2015-08-04 20:56:47
阅读次数:
135
DescriptionYour current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor bui...
分类:
其他好文 时间:
2015-08-04 20:55:14
阅读次数:
179
Problem Definition:The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the ...
分类:
其他好文 时间:
2015-08-04 20:55:04
阅读次数:
136
Basics of Ensemble Learning Explained in Simple EnglishIntroductionEnsemble modeling is a powerful way to improve performance of your model. It usuall...
分类:
其他好文 时间:
2015-08-04 20:55:50
阅读次数:
156
SeedingTime Limit: 2 Seconds Memory Limit: 65536 KBIt is spring time and farmers have to plant seeds in the field. Tom has a nice field, which is a r....
分类:
其他好文 时间:
2015-08-04 20:52:22
阅读次数:
128