码迷,mamicode.com
首页 >  
搜索关键字:random walk    ( 8169个结果)
HDU - 4758 Walk Through Squares (AC自动机+DP)
Description   On the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Engineering Institute before, queue phalanx is a spe...
分类:其他好文   时间:2014-10-16 19:41:32    阅读次数:236
Javascript 随机数函数 学习之二:产生服从正态分布随机数
一、为什么需要服从正态分布的随机函数一般我们经常使用的随机数函数 Math.random() 产生的是服从均匀分布的随机数,能够模拟等概率出现的情况,例如 扔一个骰子,1到6点的概率应该相等,但现实生活中更多的随机现象是符合正态分布的,例如20岁成年人的体重分布等。假如我们在制作一个游戏,要随机设定...
分类:编程语言   时间:2014-10-16 17:53:52    阅读次数:404
C random C ++rand函数应用
random函数不是ANSI C标准,不能在gcc,vc等编译器下编译通过。但在C语言中int random(num)能够这样使用,它返回的是0至num-1的一个随机数。可改用C++下的rand函数来实现。rand()%n 范围 0~n-1rand()主要是实现 产生随机数,其它我们在这里能够无视他...
分类:其他好文   时间:2014-10-16 15:46:22    阅读次数:160
jQuery获取区间随机数
1.自定义函数function getRandom(min,max){ //x上限,y下限 var x = max; var y = min; if(x<y){ x=min; y=max; } var rand = parseInt(Math.random() * (x - y + 1) + y);...
分类:Web程序   时间:2014-10-16 14:25:22    阅读次数:1867
ZOJ 3822 概率DP
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3822 记得比赛之前,看到WALK那道概率DP的题,然后就觉得应该可能出概率DP,十一还专门看了以前做的, 现场的时候,真的出了,然后好激动的样子,开始推得二维,然后感觉好难推,发现n只有50,所以就去推三维,然后发现k 也发现了自己的问题:1、平时学的东西掌握的不够扎...
分类:其他好文   时间:2014-10-15 23:18:52    阅读次数:215
【Lua】使用随机数(转)
游戏中创建角色有个随机取名功能,用到了随机数,网上找了篇在lua中使用随机数的文章,mark一下。Lua 生成随机数需要用到两个函数:math.randomseed(xx), math.random([n [, m]])1. math.randomseed(n) 接收一个整数 n 作为随机序列种子。...
分类:其他好文   时间:2014-10-15 19:57:31    阅读次数:189
LeetCode——Copy List with Random Pointer(带random引用的单链表深拷贝)
问题: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep ...
分类:其他好文   时间:2014-10-15 15:40:50    阅读次数:262
JAVA获取随机数
在Java中我们能够使用java.util.Random类来产生一个随机数发生器。它有两种形式的构造函数,各自是Random()和Random(long seed)。Random...
分类:编程语言   时间:2014-10-15 14:06:09    阅读次数:228
python turtle,random,math
#Listimportshere:importturtleimportrandomimportmath#Listconstantshere(NOMAGICNUMBERS!):NUMBER_DARTS=1000LEFT_BOUND=-2RIGHT_BOUND=2TOP_BOUND=-2BOTTOM_B...
分类:编程语言   时间:2014-10-15 12:35:40    阅读次数:636
multithreading多线程,多进程
1 import random 2 import threading 3 4 results = [] 5 6 def compute(): 7 #random.randint(1,100) 返回一个随机值 8 results.append(sum([random.randin...
分类:编程语言   时间:2014-10-15 01:20:29    阅读次数:219
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!