码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
Mysql re-set password, mysql set encode utf8 mysql重置密码,mysql设置存储编码格式
There is a link about how to re-set password.http://database.51cto.com/art/201010/229528.htmwords in short,two lines mysql> UPDATE mysql.user SET p...
分类:数据库   时间:2014-07-19 19:12:31    阅读次数:410
HDU 1231
求最大连续子序列一开始想到的一种O(n^2)的算法,应该会超时运用动态规划的思想,想出了下面的方法#include using namespace std;struct DP{ int sum,sta,end; void init(int su,int st,int en){ sum=su; sta...
分类:其他好文   时间:2014-07-19 18:04:36    阅读次数:230
【leetcode刷题笔记】Sum Root to Leaf Numbers
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:其他好文   时间:2014-07-18 20:09:38    阅读次数:433
【leetcode刷题笔记】Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:其他好文   时间:2014-07-18 18:28:44    阅读次数:231
题目1001:A+B for Matrices
题目描述: This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns.输入: The input consist...
分类:其他好文   时间:2014-07-18 18:26:02    阅读次数:227
poj3468 A Simple Problem with Integers
DescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each ...
分类:其他好文   时间:2014-07-18 18:22:11    阅读次数:263
C# ValueTypes
【C# ValueTypes】1、哪些类型是ValueType?The value types consist of two main categories:StructsEnumerationsStructs fall into these categories:Numeric typesInte...
分类:其他好文   时间:2014-07-18 18:18:20    阅读次数:217
POJ2406 Power Strings 【KMP】
Power Strings Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 31388   Accepted: 13074 Description Given two strings a and b we define a*b to be their conca...
分类:其他好文   时间:2014-07-18 18:15:31    阅读次数:252
HDU 3047 Zjnu Stadium 带权并查集
题目来源:HDU 3047 Zjnu Stadium 题意:给你一些人 然后每次输入a b c 表示b在距离a的右边c处 求有多少个矛盾的情况  思路:用sum[a] 代表a点距离根的距离 每次合并时如果根一样 判断sum数组是否符合情况 根不一样 合并两棵树 这里就是带权并查集的精髓 sum[y] = sum[a]-sum[b]+x 这里y的没有合并前b的根  #include #in...
分类:其他好文   时间:2014-07-18 18:06:11    阅读次数:264
亲密数
题目:如果整数A的全部因子(包括1,不包括A本身)之和等于B,并且整数B的全部因子(包括1,不包括B本身)之和等于A,,则称整数A和B为亲密数。求解3000以内的全部亲密数。#include #include int factor_sum(int n) // 计算n的因子和{ int i; ...
分类:其他好文   时间:2014-07-18 17:32:55    阅读次数:216
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!