[Ceoi2004]Journey】的更多相关文章

题目描述 给出N个点,及你的出发点K. 接下来N-1行描述有关边的开始点,结束点,边长.保证图中不会有环 接下来给出数字J,代表你要走多少个点. 接下来J个数字,代表你要走过的点的编号.当然你可以自己选择行进的路线 不一定按给定编号顺序前行,求走过的最短距离. 输入格式 第一行给出N,K.2 <= N<= 50000,1<=K<=N 接下来N-1行,每行三个数,进来描述这个地图中的边,边长距离<=1000 接下来给出一个数字J,1<=J <= N-1代表你希望走过…
C. Journey time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Recently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n showplaces in the city, numbe…
A Knight's Journey Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 41936   Accepted: 14269 Description Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey ar…
1.CF #374 (Div. 2)    C.  Journey 2.总结:好题,这一道题,WA,MLE,TLE,RE,各种姿势都来了一遍.. 3.题意:有向无环图,找出第1个点到第n个点的一条路径,经过的点数要最多. #include<bits/stdc++.h> #define F(i,a,b) for (int i=a;i<b;i++) #define FF(i,a,b) for (int i=a;i<=b;i++) #define mes(a,b) memset(a,b,…
题目链接:http://poj.org/problem?id=2488 A Knight's Journey Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 36695   Accepted: 12462 Description Background The knight is getting bored of seeing the same black and white squares again and again…
题目链接: C. Journey time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Recently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n showplaces in the city,…
A Knight's Journey Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 35564 Accepted: 12119 Description Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around…
A Knight's Journey Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Total Submission(s) : 51   Accepted Submission(s) : 17 Problem Description Background The knight is getting bored of seeing the same black and white…
1A~,但后来看人家的代码好像又写臭了,T^T... Problem A: Educational journey The University of Calgary team qualified for the 28th ACM International Collegiate Programming Contest World Finals in Prague, Czech Republic. Just by using the initials of team members they g…
Journey with Pigs Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3004   Accepted: 922 Description Farmer John has a pig farm near town A. He wants to visit his friend living in town B. During this journey he will visit n small villages…