码迷,mamicode.com
首页 >  
搜索关键字:path sum ii    ( 55953个结果
Codeforces Helpful Maths
Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation. The teacher has written down the sum of multiple numbers. Pupils should ca...
分类:其他好文   时间:2014-07-22 23:05:53    阅读次数:382
UVA 1484 - Alice and Bob's Trip(树形DP)
题目链接:1484 - Alice and Bob's Trip 题意:BOB和ALICE这对狗男女在一颗树上走,BOB先走,BOB要尽量使得总路径权和大,ALICE要小,但是有个条件,就是路径权值总和必须在[L,R]之间,求最终这条路径的权值。 思路:树形dp,dp[u]表示在u结点的权值,往下dfs的时候顺带记录下到根节点的权值总和,然后如果dp[v] + w + sum 在[l,r]内,...
分类:其他好文   时间:2014-07-22 23:05:33    阅读次数:486
UVa11030-Predator II
Problem D Predator II Time limit: 2 seconds   Oh No!!! The predator has entered the room again. But this time it is a different kind of room. The room is a square of size 1000...
分类:其他好文   时间:2014-07-22 23:03:13    阅读次数:358
asp.net,copy网页的代码去掉格式化代码前面的序号
string path = Server.MapPath("copycode/code.txt"); string[] allCodeLine = System.IO.File.ReadAllLines(path, System.Text.Encoding.UTF8); System.Text.StringBuilder strb = new Sys...
分类:Web程序   时间:2014-07-22 23:02:54    阅读次数:366
[伯努利数] poj 1707 Sum of powers
题目链接: http://poj.org/problem?id=1707 Language: Default Sum of powers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 735   Accepted: 354 D...
分类:其他好文   时间:2014-05-01 18:36:32    阅读次数:385
[ACM] hdu 1003 Max Sum(最大子段和模型)
Max Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 135262    Accepted Submission(s): 31311 Problem Description   Given a sequen...
分类:其他好文   时间:2014-04-30 22:21:40    阅读次数:280
用perl对字符串进行全角转半角操作
#全角转半角 #ljl use Encode; sub CheckSBC { my ($name)=@_; my @character; my $tmpname=$name; my $headname; my $k=0; for($ii=1; $ii 0) { my $he...
分类:其他好文   时间:2014-04-29 13:36:21    阅读次数:366
leetcode day6 -- String to Integer (atoi) && Best Time to Buy and Sell Stock I II III
1、 ?? String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yours...
分类:其他好文   时间:2014-04-29 13:22:22    阅读次数:341
heat笔记之为diskimage-builder编写elements生成一个lamp镜像
建立elements目录 mkdir -p elements/lamp/install.d/ vim 70-lamp #!/bin/bash set -eux install-packages wordpress mariadb-server httpd memcached 生成一个带wordpress的镜像 export ELEMENTS_PATH=...
分类:其他好文   时间:2014-04-29 13:14:21    阅读次数:475
Leetcode:Add Binary 二进制相加
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 思路同十进制的大数相加。代码如下: class Solution { public: string addBinary(string a, str...
分类:其他好文   时间:2014-04-29 13:12:20    阅读次数:328
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!