码迷,mamicode.com
首页 >  
搜索关键字:numbering paths    ( 1424个结果
[USACO09DEC]牛收费路径Cow Toll Paths
题目大意:给定一个无向图,求出一条路径,使得边权和加上点权和最小,多组询问 n<=250 m<=10000 多组询问,数据范围这么小,很显然就是floyd了,但是这个点权着实让人讨厌哇。。。 我们重新回想一遍floyd算法的原理:i到j有两种可能:直接到和借助中间接口k,所以取一个min就行了 我们 ...
分类:其他好文   时间:2019-04-13 21:39:43    阅读次数:140
Codeforces 1144F Graph Without Long Directed Paths (DFS染色+构造)
<题目链接> 题目大意:给定一个无向图,该无向图不含自环,且无重边。现在要你将这个无向图定向,使得不存在任何一条路径长度大于等于2。然后根输入边的顺序,输出构造的有向图。如果构造的边与输入的方向一致,就输出1,方向不一致就输出0。 解题分析:因为定向后的图不能存在长度大于等于2的路径,所以我们直接对 ...
分类:其他好文   时间:2019-04-12 00:39:26    阅读次数:160
63.Unique Paths II
``` class Solution { public: int uniquePathsWithObstacles(vector & obstacleGrid) { if (obstacleGrid.empty() || obstacleGrid[0].empty() || obstacleGrid ...
分类:其他好文   时间:2019-04-09 11:12:24    阅读次数:138
62.Unique Paths
``` class Solution { public: int uniquePaths(int m, int n) { vector dp(n, 1); for (int i = 1; i ...
分类:其他好文   时间:2019-04-09 11:03:45    阅读次数:128
Java--输入与输入
输入 java.util.Scanner java.lang.System java.io.Console 输出 输出 java.util.Scanner java.io.PrintWriter java.nio.file.Paths System.out.printf("%tc",new Date ...
分类:编程语言   时间:2019-04-07 13:00:36    阅读次数:163
Lintcode376-Binary Tree Path Sum-Easy
376. Binary Tree Path Sum 中文English Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target. A valid pat ...
分类:其他好文   时间:2019-04-04 20:39:04    阅读次数:211
LeetCode 63 _ Unique Paths II 全部不同路径2
Description: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or r ...
分类:其他好文   时间:2019-04-04 20:25:49    阅读次数:147
LeetCode 62 _ Unique Paths 全部不同路径
Description: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or r ...
分类:其他好文   时间:2019-04-04 17:08:21    阅读次数:174
Codeforces Round #550 (Div. 3) F. Graph Without Long Directed Paths
F. Graph Without Long Directed Paths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output F. ...
分类:其他好文   时间:2019-04-03 22:39:29    阅读次数:154
Codeforces Round #550 (Div. 3) F. Graph Without Long Directed Paths
F. Graph Without Long Directed Paths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output F. ...
分类:其他好文   时间:2019-04-01 18:52:38    阅读次数:253
1424条   上一页 1 ... 17 18 19 20 21 ... 143 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!