4584专题

HDU 4584(2013杭州邀请赛I题-水)

http://acm.hdu.edu.cn/showproblem.php?pid=4584 题意:找出一条HC路线,要求HC的曼哈顿距离尽量小,H的x坐标尽量小,y坐标尽量小,C的x坐标尽量小,y坐标尽量小。 思路:直接在每条边去找出答案即可,我是直接排个序就找出答案。 代码: #include <stdio.h>#include <string.h>#include <stdl

HDU 4584

//也是简单题,因为n太小,故暴力之! #include<stdio.h> #include<math.h> #include<string.h> #define max 45 char map[max][max]; int dis(int x1,int y1,int x2,int y2){     return fabs(x1-x2*1.0)+fabs(y1