码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
C primer plus 练习题 第七章
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
2.10 用最少次数寻找数组中的最大值和最小值[find min max of array]
find min max of array
分类:其他好文   时间:2014-07-16 20:08:18    阅读次数:179
LeetCode: Combination Sum II
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之外,其他不重复,判断数组元素是否相邻
数组元素是非负整数,0可以化为任意正整数,要求时间复杂度为O(n)觉得很奇怪的题目,遍历一次找到最值相减得到极差就行了,如果极差小于数组长度n,则元素相邻,否则不相邻bool is_adjacent(int* a, int n){ int min = 65535, max = 0; fo...
分类:其他好文   时间:2014-07-16 19:48:49    阅读次数:177
【leetcode刷题笔记】Max Points on a Line
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
Topcoder Srm627 DIV 2
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最大连接数的2种方法
mysql默认最大连接数是100,增加加默认MYSQL连接数的方法有两个方法一:进入MYSQL安装目录 打开MYSQL配置文件 my.ini(windows) 或 my.cnf(linux环境)查找 max_connections=100 修改为 max_connections=1000 服务里重起...
分类:数据库   时间:2014-07-13 12:33:19    阅读次数:241
Yii CModel中rules验证规则
array(array(‘username’, ‘required’),array(‘username’, ‘length’, ‘min’=>3, ‘max’=>12),array(‘password’, ‘compare’, ‘compareAttribute’=>’password2′, ‘on...
分类:其他好文   时间:2014-07-13 11:57:16    阅读次数:431
《C Primer Plus》学习笔记——C预处理器和C库
1、在Unix系统中,尖括号告诉预处理器在一个或多个标准系统目录中寻找文件。双引号告诉预处理器先在当前目录(或文件名中指定的其他目录)中寻找文件,然后在标准位置寻找文件。2、#undef指令:取消定义一个给定的#define#define LIMIT 400#undef LIMIT3、条件编译#if...
分类:其他好文   时间:2014-07-13 11:42:50    阅读次数:204
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!