ZOJ Problem Set - 2913 Bus Pass Time Limit: 5 Seconds Memory Limit: 32768 KB You travel a lot by bus and the costs of all the seperate tickets are starting to add up. Therefore you want to see if it might be advantageous for you to buy a bus pas
题目: [题目描述] 跳跳虎在外面出去玩忘了时间,现在他需要在最短的时间内赶回家. 跳跳虎所在的世界可以抽象成一个含有 n 个点的图(点编号从 1 到 n ),跳跳虎现在在 1 号点,跳跳虎的家在 n 号点. 图上一共有 m 条单向边,通过每条边有固定的时间花费. 同时,还存在若干个单向传送通道,传送通道也有其时间花费. 传送通道一般来说比普通的道路更快,但是跳跳虎最多只能使用 k 次. 跳跳虎想知道他回到家的最小时间消耗是多少. [输入格式] 第一行输入 4 个整数 n,m,q,k .( n
题目: 一个数轴上共有N个点,第一个点的坐标是度度熊现在位置,第N-1个点是度度熊的家.现在他需要依次的从0号坐标走到N-1号坐标.但是除了0号坐标和N-1号坐标,他可以在其余的N-2个坐标中选出一个点,并直接将这个点忽略掉,问度度熊回家至少走多少距离? #include<iostream> #include<algorithm> #include<cmath> using namespace std; int main(){ int n;cin>>n; ;