这道题有好几种做法,这里用的是bellman。从起始币种src出发计算所有币种可兑换起始币种的最大值。用cin读取字符串貌似非常耗时,用了900+ms,差点超时。只是稍微用%s改下输入,就只用了32ms#include<iostream>#include<stdio.h>#include<string.h>#include<queue>#include<vector>#define MAXD 32#define INF 0x3f3f3f3fusing namespace std;int N,M;double graph[MAXD][M Read More
posted @ 2012-12-31 21:18 longlongago Views(138) Comments(0) Diggs(0) Edit