1 #include 2 #include 3 using namespace std; 4
5 int main() 6 { 7 int n; 8 double max,min,sum,aver; 9 double a[110] = {0};10
while...
分类:
其他好文 时间:
2014-05-16 22:47:35
阅读次数:
452
-- 查找重复记录select names,num from test where rowid !=
(select max(rowid) from test b where b.names = test.names and b.num =
test.num)或者使用select names,n.....
分类:
数据库 时间:
2014-05-16 18:51:53
阅读次数:
278
题目: 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
1 #include 2 #include 3 using namespace std; 4
5 int main() 6 { 7 string str=""; 8 string str2=""; 9 char max;10 while
(getline(ci...
分类:
其他好文 时间:
2014-05-15 16:20:41
阅读次数:
258
http_load学习心得:测试网站每秒所能承受的平均访问量(吞吐量)http_load
-parallel 5 -fetches
1000urls.txt这段命令行是同时使用5个进程,随机访问urls.txt中的网址列表,总共访问1000次。运行之后的结果:1000 fetches, 5
max ...
分类:
Web程序 时间:
2014-05-15 16:13:33
阅读次数:
407
第一、任意一个比较排序算法在最好情况下的时间复杂度也是O(nlogN);
第二、计数排序
假设n个输入元素的每一个都是介于0到k之间的整数,计数排序可用,需要临时存储空间O(K),时间复杂度是O(n).
#include
using namespace std;
void countingSort(int *A,int len,int max)
{
if(A==NULL || len<...
分类:
其他好文 时间:
2014-05-14 23:58:58
阅读次数:
382
/proc/sys/net/ipv4/tcp_max_tw_buckets
默认的太小了net.ipv4.tcp_syncookies = 0这个参数是怎么得来的?其实是通过ab 简单的压力测试,/var/log/message
里面会有内核的报错信息。
分类:
其他好文 时间:
2014-05-14 22:56:49
阅读次数:
349
题意:最大连续子序列和,在一个数组中找到和最大的连续子数组
思路:dp, 对于第i个数,有两种选择:把它加入在子数组里,不加入子数组(子数组到此结束)
加不加入子数组,要比较它加入前后子数组的总和是变大了还是变小了,如果变大则加入,变小则不加入
所以,我们需要记录以i-1结尾的子数组的总和,最后的结果在这些总和中取最大的那个
f[i] = max(f[i-1]+a[i],f[i-1]);
max({f[i]})
实现时用两个变量,一个保存f[i-1],一个保存目前为止最大的f[i]
复杂度:时间O(n),空...
分类:
其他好文 时间:
2014-05-14 21:53:14
阅读次数:
250
mysql5.6.14配置my.cnf多实例,mysql_install_db初始化不读取my.cnf配置文件
[ERROR] InnoDB: auto-extending data file ./ibdata1 is of a differentsize 768 pages (rounded down to MB) than specified in the .cnf file: initial65536 pages, max 0 (relevant if non-zero) pages!
2014-0...
分类:
数据库 时间:
2014-05-14 14:20:48
阅读次数:
412
观察可以发现,0,1,2,……,n结尾的分组中,maxsum a[0] = a[0]maxsum
a[1] = max( a[0] + a[1] ,a[1]) = max( maxsum a[0] + a[1] ,a[1])maxsum a[2] =
max( max ( a[0] + a[1] +...
分类:
其他好文 时间:
2014-05-14 08:38:58
阅读次数:
323