能力值:
( LV9,RANK:170 )
|
-
-
谁帮我个忙:写个太极链的CGI
是的.CGI的基本运行流程就是这样的,当有访问时,调入,解释,执行,退出.如果每次运行都需要上兆的数据需要从文件读入,效率就很低了.如果这部分数据能常驻内存,就能大大提高效率.
网上查到的关键字有 FastCGI, memcached 看起来都比较复杂
代码我M你
|
能力值:
( LV9,RANK:170 )
|
-
-
[求助]如何实现这样一个概率算法
这是一道好题!收入我的测试数据库
我的思路:
*设已给的数已经保存在数组A中,且已排序,A[0]<A[1]<A[2]<...<A[n]
*构建一个数组B,使 B[0]=1,B[1]=1+2,B[2]=1+2+3,...,B[n]=1+2+3+...+n
*用一个随机函数,得到0 to 1+2+3+...+N之间的一个随机小数X
*如果 B[m]<X<B[m+1],则这次取的数是A[m+1]。如果X<B[0],则是A[0]
|