Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-06-09 23:14:45
阅读次数:
264
【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to...
分类:
其他好文 时间:
2014-06-08 17:52:45
阅读次数:
235
Find the contiguous subarray within an array (containing at least one number) which has the largest sum....
分类:
其他好文 时间:
2014-06-08 15:54:08
阅读次数:
258
题目来源:Light OJ 1278 Sum of Consecutive Integers
题意:N拆分成连续整数和的方案数
思路:奇因数的个数
#include
#include
#include
#include
using namespace std;
//筛素数
const int maxn = 10000010;
bool vis[maxn];
int prime[10...
分类:
其他好文 时间:
2014-06-08 15:34:09
阅读次数:
295
const int maxn = 100010;
int n, m;
vector G[maxn*2];
bool mark[maxn*2];
int S[maxn*2], c;
int a[maxn], b[maxn], sum;
bool dfs(int x)
{
if(mark[x^1])
return false;
if(mark[x])
return true;
mark...
分类:
其他好文 时间:
2014-06-08 10:31:01
阅读次数:
198
在有关TCP连接的很多配置中,有很多选项有的配置
net.ipv4.tcp_rmem:这个参数定义了TCP接收缓冲(用于TCP接收滑动窗口)的最小值、默认值、最大值
net.ipv4.tcp_wmem:这个参数定义了TCP发送缓冲(用于TCP发送滑动窗口)的最小值、默认值、最大值
netdev_max_backlog:当网卡接收数据包的速度大于内核处理的速度时,会有一个队列保存这些数据包...
分类:
其他好文 时间:
2014-06-08 10:01:51
阅读次数:
523
随机数的事
总结随机数的那点事,不断总结中......
1.产生一个随机数
srand(time(0));
x=rand();//0~RAND_MAX-1
2.生成一个[a,b]之间的随机数
x=rand()%(b-a+1)+a;
3.以概率为Px%,Py%,Pz%(Px、Py、Pz均为整数且Px+Py+Pz=100)生成三个随机数
// This functio...
分类:
其他好文 时间:
2014-06-08 09:05:21
阅读次数:
304
题目链接 Given a m x n grid filled with non-negative
numbers, find a path from top left to bottom right which minimizes the sum of
all numbers along its p...
分类:
其他好文 时间:
2014-06-07 21:59:08
阅读次数:
344
a题,就不说了吧b题,直接从大到小排序1-limit的所有数的lowbit,再从大到小贪心组成sum就行了 1 #include 2 #include 3
#include 4 #include 5 #define N 200000 6 using namespace std; ...
分类:
其他好文 时间:
2014-06-07 21:49:57
阅读次数:
272
解决方法,在my.ini里的[mysqld]增加如下部分[mysqld]
需要注意的是前面还有:[client]和[mysql],这两部分增加无效,那个是客户端读取的参数。max_allowed_packet=64M(大小自定义)重启MYSQL服务windows
下:services.msc重启MY...
分类:
数据库 时间:
2014-06-07 21:05:20
阅读次数:
392