码迷,mamicode.com
首页 >  
搜索关键字:minimum path sum    ( 52602个结果
hdu Minimum Transport Cost(按字典序输出路径)
http://acm.hdu.edu.cn/showproblem.php?pid=1385 求最短路,要求输出字典序最小的路径。 spfa:拿一个pre[]记录前驱,不同的是在松弛的时候,要考虑和当前点的dis值相等的情况,解决的办法是dfs找出两条路径中字典序较小的,pre[]去更新。把路径当做字符串处理。 我只用之前的pre去更新当前点,并没考虑到起点到当前点的整个路径...
分类:其他好文   时间:2014-05-19 22:49:45    阅读次数:383
linux 判断指定用户对指定目录具有的权限
脚本名:power.sh脚本内容:Shell代码 #!/bin/sh username3=$1 dir_name2=$2 # get existing directory file_path=$dir_name2 while true do if [ -d $fil...
分类:系统相关   时间:2014-05-18 18:49:24    阅读次数:319
字典树-百度之星-Xor Sum
分析:暴力要超时,所以把每个数字转换为长度为32的0-1字符串,用字典树。因为其公共前缀的特性,空间上可以承受。因为是二叉树,用node[SIZE][2]存放。不知道new速度是否会慢很多,所以没用指针。...
分类:其他好文   时间:2014-05-18 18:37:37    阅读次数:218
WinSock实现的大文件传输
class file_send { public: SOCKET send_s; //The socket that used for sending which is established previously char * filename; //The full path of the file that the client...
分类:Windows程序   时间:2014-05-18 08:58:26    阅读次数:479
2014百度之星第三题Xor Sum
Xor Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 4445    Accepted Submission(s): 652 Problem Description Zeus 和 Prometheus 做了一个游戏,...
分类:其他好文   时间:2014-05-18 05:21:59    阅读次数:277
leetcode -day17 Path Sum I II & Flatten Binary Tree to Linked List & Minimum Depth of Binary Tree
1、 ?? 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. For example: Given the below...
分类:其他好文   时间:2014-05-18 03:25:06    阅读次数:301
【LeetCode】Triangle
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 fol...
分类:其他好文   时间:2014-05-18 02:11:19    阅读次数:302
CSU 1425 Prime Summation
原题链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1425 DP题。 f[i][j]表示当前数字为i,分解式中最大质数为j的方案数,那么,状态转移方程为: f[i][j] = sum(f[i-j][k]) 其中...
分类:其他好文   时间:2014-05-17 20:41:17    阅读次数:296
hdu1166敌兵布阵
1 //Accepted 250MS 2480K 2 #include 3 #include 4 const int MAXN = 50005; 5 struct node 6 { 7 int l,r; 8 int add,sum; 9 }f[3*MAXN];10 int n;...
分类:其他好文   时间:2014-05-17 20:36:37    阅读次数:316
JAVA坏境变量中的JAVA_HOME path classpath 的设置与作用。
以下为置JAVA_HOME,CLASSPATH,PATH的目的: 1,设置JAVA_HOME: 一、为了方便引用,比如,你JDK安装在C:\Program Files\Java\jdk1.6.0目录里,则设置JAVA_HOME为该目录路径, 那么以后你要使用这个路径的时候, 只需输入%JAVA_HO...
分类:编程语言   时间:2014-05-17 19:20:06    阅读次数:306
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!