题意:求计算fab[n]需要的计算次数MOD B 的结果首先容易知道的是f[n]=f[n-1]+f[n-2]+1;1.有 S(n)=F[n+2]-1; S[n]斐波那契数列前n项和。F[n+2]就第n+2项斐波那契数。证明就直接累加法:因为A=A+An所以An=A-A则A=A-AnA=An-A......
分类:
其他好文 时间:
2014-09-17 11:58:52
阅读次数:
175
使用ci框架提供的类查询数据:$this->load->database();$query=$this->db->query($sql);程序运行一段时间之后,报错,告知数据库toomanyconnections很明显mysql数据库连接资源超过了max_connections设定值。立马在每个查询之后,添加资源释放脚本:$this->db-&g..
分类:
数据库 时间:
2014-09-17 10:28:32
阅读次数:
204
Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1.....
分类:
其他好文 时间:
2014-09-16 23:21:41
阅读次数:
169
Gold Balanced Lineup
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 12334
Accepted: 3618
Description
Farmer John's N cows (1 ≤ N ≤ 100,000) share many sim...
分类:
其他好文 时间:
2014-09-16 22:15:41
阅读次数:
329
刚开始没看出时卡特兰数列。直接套高精度版#include #include #include #include #include #include #include #include #include #include #include #include #include #include #inc...
分类:
其他好文 时间:
2014-09-16 20:26:11
阅读次数:
230
高精度推出大概600项fabi数,就包含了题目的数据范围,对于每组a,b,从1到600枚举res[i]即可可以直接JAVA大数。我自己时套了C++高精度的版JAVA 复制别人的import java.math.BigInteger;import java.util.Scanner;public cl...
分类:
其他好文 时间:
2014-09-16 18:54:31
阅读次数:
222
今天使用Wordpress的flash版文件上传功能的时候,总是提示接口错误,很是郁闷。换小文件发现没有问题,所以问题肯定出现在文件大小上,找了半天没有发现wordpress有限制上传文件大小的地方。切换到传统文件上传界面,重新上传一个大文件,这回出来错误提示了,413 Request Entity...
分类:
其他好文 时间:
2014-09-16 12:09:30
阅读次数:
214
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:
其他好文 时间:
2014-09-16 10:38:30
阅读次数:
236
How Many Fibs?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4295 Accepted Submission(s): 1689
Problem Description
Recall the ...
分类:
其他好文 时间:
2014-09-15 22:53:29
阅读次数:
193
bind-address:监听的IP地址max_connect_errors:最大允许错误次数(注:是访问协议错误,若某个IP错误次数达到该阈值,则被屏蔽)max_connections:最大连接数(能同时访问server的连接个数,若达到该阈值,则不能再连接到server)skip_name_re...
分类:
数据库 时间:
2014-09-15 22:46:39
阅读次数:
372