摘要:
1 #include 2 #define maxn 1005 3 #include 4 #include 5 #include 6 using namespace std; 7 8 9 int f[maxn],v[maxn],p[maxn],numcount;10 int F[maxn];11 bool vis[maxn*100];12 int n,w,k,a,b;13 14 int maxx(int a,int b)15 {16 if (a>=b) return a;else return b;17 }18 int find(int x){19 if(x==f[x]) ... 阅读全文
posted @ 2013-10-02 16:43
little_w
阅读(313)
评论(0)
推荐(0)
摘要:
Description CX是要赶去上课,为了不迟到必须要以最短的路径到达教室,同时CX希望经过的路上能看到的学妹越多越好。现在把地图抽象成一个无向图,CX从1点出发,教室在N号点,告诉每个点上学妹的数量,每条边的长度。请你求出CX以最短路径赶到教室最多能看到多少学妹。Input 多组输入数据(最多20组),输入到文件结束。 每组数据第一行两个正整数N,M其中N代表点的个数(2 2 #include 3 #include 4 using namespace std; 5 typedef long long LL; 6 const int maxn=1000+5; 7 const long lo 阅读全文
posted @ 2013-10-02 16:21
little_w
阅读(256)
评论(0)
推荐(0)
摘要:
Description zzy今天刚买了两个水瓢A和B,容量都是为1升,童心未泯的他打算用这个水瓢来玩游戏。 首先zzy准备了一个容量可看作无穷大的水缸,刚开始水缸是空的,然后用水瓢A往水缸里加水,用水瓢B把水缸里的水舀出去,当使用 水瓢B把水舀出去时水缸里必须要至少有1升的水。这样子使用N次水瓢A,也使用N次水瓢B,最后水缸会依旧空的。Input 输入有多个例子,直到文件结束。 每个例子仅含一个数N(0 2 #include 3 #include 4 #define mod 1000000007 5 #define maxn 10000+10 6 #define LL long long 7 阅读全文
posted @ 2013-10-02 16:13
little_w
阅读(795)
评论(0)
推荐(0)

浙公网安备 33010602011771号