1. 1 #include 2 3 #define SPACE ' ' 4 #define NEWLINE '\n' 5 6 int main() 7 { 8 int spaces,newlines,others; 9 char ch;10 spaces = newli...
分类:
其他好文 时间:
2014-07-16 20:18:33
阅读次数:
139
# --*-- coding:utf-8 --*--import mathimport itertoolsdef Mean(t): """均值""" return float(sum(t)) / len(t)def E(x, p): """ 离散性随即变量的数学期望(也称为均...
分类:
其他好文 时间:
2014-07-16 20:18:01
阅读次数:
220
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each num...
分类:
其他好文 时间:
2014-07-16 19:53:49
阅读次数:
238
数组元素是非负整数,0可以化为任意正整数,要求时间复杂度为O(n)觉得很奇怪的题目,遍历一次找到最值相减得到极差就行了,如果极差小于数组长度n,则元素相邻,否则不相邻bool is_adjacent(int* a, int n){ int min = 65535, max = 0; fo...
分类:
其他好文 时间:
2014-07-16 19:48:49
阅读次数:
177
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.题解:思路比较简单,每条直线都可以表示为y=kx+b,所以对于任意三点,如果它们共线,那么它们中任意两点的...
分类:
其他好文 时间:
2014-07-14 10:02:12
阅读次数:
187
A,B:很水,注意边界,话说HACK都是这些原因。C:R[I][J]:表示反转I-J能改变冒泡排序的次数; DP方程:dp[i][k]=max(dp[j][k],dp[j][k-1]+dp[j][i]) (0#include#include#include#include#includeusing ...
分类:
其他好文 时间:
2014-07-14 10:00:59
阅读次数:
191
mysql默认最大连接数是100,增加加默认MYSQL连接数的方法有两个方法一:进入MYSQL安装目录 打开MYSQL配置文件 my.ini(windows) 或 my.cnf(linux环境)查找 max_connections=100 修改为 max_connections=1000 服务里重起...
分类:
数据库 时间:
2014-07-13 12:33:19
阅读次数:
241
array(array(‘username’, ‘required’),array(‘username’, ‘length’, ‘min’=>3, ‘max’=>12),array(‘password’, ‘compare’, ‘compareAttribute’=>’password2′, ‘on...
分类:
其他好文 时间:
2014-07-13 11:57:16
阅读次数:
431
1、在Unix系统中,尖括号告诉预处理器在一个或多个标准系统目录中寻找文件。双引号告诉预处理器先在当前目录(或文件名中指定的其他目录)中寻找文件,然后在标准位置寻找文件。2、#undef指令:取消定义一个给定的#define#define LIMIT 400#undef LIMIT3、条件编译#if...
分类:
其他好文 时间:
2014-07-13 11:42:50
阅读次数:
204