HDU 4284 Travel有N个城市,M条边和H个这个人(PP)必须要去的城市,在每个城市里他都必须要“打工”,打工需要花费Di,可以挣到Ci,每条边有一个花费,现在求PP可不可以从起点1走完所有的他必须要去的城市,打完所有的工,并且成功回到起点1由于H 3 #include 4 #inc...
分类:
其他好文 时间:
2014-08-03 15:07:05
阅读次数:
243
TIANKENG’s travel
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 408 Accepted Submission(s): 100
Problem Description
TIANKENG...
分类:
其他好文 时间:
2014-07-30 12:17:23
阅读次数:
212
判断是否共线用map记录下斜率;
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define N 1022
const int INF = 1<<30-1;
bool vis[2020];
int mat[1022][1022],lowcost[1022],pre[...
分类:
其他好文 时间:
2014-07-29 14:27:58
阅读次数:
257
题目链接:hdu 4885 TIANKENG’s travel
题目大意:给定N,L,表示有N个加油站,每次加满油可以移动距离L,必须走直线,但是可以为斜线。然后给出sx,sy,ex,ey,以及N个加油站的位置,问说最少经过几个加油站,路过不加油也算。
解题思路:一开始以为经过可以不算,所以o(n2)的复杂度建图,然后用bfs求最短距离,结果被FST了。
将点按照x坐标排序,这样在建...
分类:
其他好文 时间:
2014-07-28 15:49:33
阅读次数:
261
Time travel
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1366 Accepted Submission(s): 303
Problem Description
Agent K i...
分类:
其他好文 时间:
2014-07-22 00:06:34
阅读次数:
355
最近看了一篇文章,译名《简历危险》,原名《Resumes are dangerous》。 作者为Alex Maccaw,他有一篇文章曾经在网上流传甚广——《Traveling, Writing and Programming (2011)》(及其后续的《How to travel ar...
分类:
其他好文 时间:
2014-07-21 10:36:25
阅读次数:
231
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of
gas to travel from station i to ...
分类:
其他好文 时间:
2014-07-19 23:24:39
阅读次数:
223
今天整整一个上午都在和hibernate做斗争,早上一来,继续昨天的项目开发,发现spring项目不能启动,从错误中看是hibernate错误,多半是hibernate配置有错误,关键是错误提示中显示“com.mdnet.travel.core.dao.ValidCodeDAOImpl”不能注入,经...
分类:
系统相关 时间:
2014-07-17 14:12:42
阅读次数:
5489
Implement a function to check if a binary tree is a binary search tree./* The inorder travel of a BST is strictly increasing. We track the pre node of...
分类:
其他好文 时间:
2014-07-13 22:27:09
阅读次数:
344
BUYING FEED
时间限制:3000 ms | 内存限制:65535 KB
难度:4
描述
Farmer John needs to travel to town to pick up K (1 D*K cents.
The county feed lot has N (1 location X_i (0 <
X_i John as much as F_i (1
A...
分类:
其他好文 时间:
2014-07-12 20:27:31
阅读次数:
263