码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
CodeForces 229D
DPdp[i]表示对前i座塔进行操作后形成非递减序列所需要的最小操作步数;sum[i]表示第i个塔与之前塔的总高度h[i]dp最小的情况下表示合并后第I个塔的最小高度#include using namespace std;#define MAX 1e8int dp[5005],h[5005],su...
分类:其他好文   时间:2014-07-21 00:00:37    阅读次数:244
HDU 4608 I-number--简单模拟
I-number Time Limit: 5000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 The I-number of x is defined to be an integer y, which satisfied the the conditions below: 1.  y>x; 2.  the sum of each...
分类:其他好文   时间:2014-07-20 23:24:13    阅读次数:298
【leetcode】Sum Root to leaf Numbers
简单的二叉树的先根遍历模板的应用 class Solution: # @param root, a tree node # @return an integer def hehe(self, num, root): #再原来的基础上*10,再加上当前的root.val num = num * 10 + root.val ...
分类:其他好文   时间:2014-07-20 22:45:33    阅读次数:299
UVa 825 Walking on the Safe Side(DP)
Square City is a very easy place for people to walk around. The two-way streets run North-South or East-West dividing the city into regular blocks. Most street int...
分类:其他好文   时间:2014-07-20 22:33:53    阅读次数:295
Codeforces 450 C. Jzzhu and Chocolate
//area=(n*m)/ ((x+1)*(k-x+1)) //1: x==0; //2: x=n-1 //3: x=m-1 # include long long max(long long x,long long y) { return x>y?x:y; } int main() { long long n,m,k,sum,t,ans; scanf("%lld%lld%lld",&...
分类:其他好文   时间:2014-07-20 22:27:13    阅读次数:172
【Oracle】常用语句集合
1 oracle常用经典SQL查询 2 常用SQL查询: 3 4 1、查看表空间的名称及大小 5 6 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size 7 from dba_ta...
分类:数据库   时间:2014-07-20 22:21:32    阅读次数:373
【LeetCode】【Python题解】Same Tree
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 比较两个...
分类:编程语言   时间:2014-07-20 22:12:03    阅读次数:273
字符串的分割
//一般的字符串的解析 NSString *string = @"One,Two,Three,Four"; NSLog(@"string:%@",string); NSArray *array = [string componentsSeparatedByString:@","]; NSLo...
分类:其他好文   时间:2014-07-20 21:35:54    阅读次数:200
【leetcode刷题笔记】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:其他好文   时间:2014-07-20 21:32:55    阅读次数:250
hdu2476String painter (区间DP)
Problem Description There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can chan...
分类:其他好文   时间:2014-07-20 15:41:50    阅读次数:213
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!