码迷,mamicode.com
首页 >  
搜索关键字:travelling    ( 130个结果
Turn the corner
Problem Description Mr. West bought a new car! So he is travelling around the city.One day he comes to a vertical corner. The street he is currently i ...
分类:其他好文   时间:2016-04-23 11:51:06    阅读次数:233
HDU 3001 Travelling 3进制状压dp
题意:10个点,若干条边,边有花费,每个点最多走两次,求走过所有点,花费最少 分析:因为每个点最多走两次,所以联想到3进制,然后枚举状态,就行了(我也是照着网上大神的代码写的) #include <cstdio> #include <iostream> #include <cstring> #inc
分类:其他好文   时间:2016-02-29 23:24:26    阅读次数:363
ZOJ1027 Travelling Fee(DP+SPFA)
给一张有向无环图,边都有花费,从某点到某点走的那条路径上的那一条花费最多的边可以省掉,问从起点到终点的最少花费的多少, 往DP想的话,就可以写出这个状态dp[u][mx],表示到达u点已经省掉的花费为mx的最少花费。 用SPFA更新转移方程。。或者理解成队列+我为人人的转移。。其实这题这样子也能解有
分类:其他好文   时间:2016-02-27 17:53:52    阅读次数:176
Travelling
DescriptionAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists o...
分类:其他好文   时间:2015-11-29 19:31:48    阅读次数:131
Project Euler 86:Cuboid route 长方体路径
Cuboid routeA spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F, sits in the opposite corner. By travelling on the s...
分类:其他好文   时间:2015-11-27 20:01:21    阅读次数:231
三进制状压 HDOJ 3001 Travelling
题目传送门题意:从某个点出发,所有点都走过且最多走两次,问最小花费分析:数据量这么小应该是状压题,旅行商TSP的变形。dp[st][i]表示状态st,在i点时的最小花费,用三进制状压。以后任意进制状压都会了。#include using namespace std;const int INF = 0...
分类:其他好文   时间:2015-11-22 18:39:37    阅读次数:142
HDU 3001 Travelling (状压DP,3进制)
题意: 给出n 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #define pii pair11 #define INF 0x3f3f3f3f12...
分类:其他好文   时间:2015-10-07 20:16:06    阅读次数:254
Take for a ride
原文 I love travelling in the country, but I don‘t like losing my way. I went on an excursion recently, but my trip took me longer than I expected. "I‘m going to Woodford Green," I said to the cond...
分类:其他好文   时间:2015-09-17 13:42:40    阅读次数:212
hdu5402 Travelling Salesman Problem
当n,m有一个为奇数时,所有点都可被覆盖。当n,m全为偶数时,考虑从方格上的点(i,j)走到相邻点,其横纵坐标之和的奇偶性改变一次,因此从偶数点(1,1)走到偶数点(n,m),经过的偶数点比奇数点多一,由于表格上的奇数点数目和偶数点相同,因此至少有一个奇数点不被遍历,找出并绕过该点即可。路径经过构造...
分类:其他好文   时间:2015-09-11 16:00:22    阅读次数:214
HDU-4856 Tunnels (BFS+状压DP)
Problem DescriptionBob is travelling in Xi’an. He finds many secret tunnels beneath the city. In his eyes, the city is a grid. He can’t enter a grid w...
分类:其他好文   时间:2015-09-06 20:09:15    阅读次数:216
130条   上一页 1 ... 5 6 7 8 9 ... 13 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!