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
/*找出字符串中出现次数最多的字符,和最大次数*/function countMax(str){ var max = 0; // 记录出现的最大次数 var maxChar = ""; // 记录出现最多次数的字符 var counts = new Array(127); // 记录中...
分类:
其他好文 时间:
2014-07-13 11:42:05
阅读次数:
172
var result = typeof(null);document.write("typeof null =" + result); // objectdocument.write("");上面result的结果是object var sum = "1" + 2 + 3;document.wri....
分类:
编程语言 时间:
2014-07-13 11:20:05
阅读次数:
209
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2014题目大意:去掉一个最高分和一个最低分求平均数。 1 #include 2 int main() 3 { 4 double n,a,i,s,max,min; 5 while(scanf...
分类:
其他好文 时间:
2014-07-13 11:01:58
阅读次数:
202
Python的函数:其实和C++非常类似,不过由于是弱类型的语言(用起来感觉是......),把那些类型声明都去掉了,传的是值不是引用(至少2.7是),有一点点小区别是前面必须加def来定义(好像宏定义的样子......),下面给出示例def sum(a, b): ...
分类:
编程语言 时间:
2014-07-13 10:49:00
阅读次数:
235
考试的时候想了好久都没想出正解 >_ 2 #include 3 #include 4 using namespace std; 5 #define N 500500 6 typedef long long LL; 7 8 int n,k; 9 int num[N];10 int sum[N];...
分类:
其他好文 时间:
2014-07-13 08:20:23
阅读次数:
207
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-07-13 08:13:53
阅读次数:
251