摘要:
点我看题目题意 : 一个司机要从1点到达n点,1点到n点中有一些点有宾馆,司机的最长开车时间不能超过10小时,所以要在10小时之内找到宾馆休息,但是为了尽快的走到n点,问最少可以经过几个宾馆。思路 : 这个题太狠了,简直不是人做的。。。。可以BFS一下,然后在B之前先D一下能走的路。当然也可以用SPFA+Floyd。#include #include #include #include #include using namespace std ;struct node{ int u,w ;}temp ;struct BFS{ int u,w,step ;}t,t1 ;const i... 阅读全文
posted @ 2014-04-01 19:43
枫、
阅读(224)
评论(0)
推荐(0)
摘要:
前两天比赛有一道题,有用到了vector的清空,用的是swap,我一开始还不太清楚,所以去查了下资料,转载一篇关于vector的清空的。1 vector vecInt;2 for (int i=0; i::iterator iter=vecInt.begin();2 for ( ;iter!=v... 阅读全文
posted @ 2014-04-01 14:53
枫、
阅读(1776)
评论(0)
推荐(0)
浙公网安备 33010602011771号