摘要: 这题题目不难,代码也不长,花了一个小时,主要是之前没用过结构体的构造函数,比较函数与优先队列/* * hdu1242/linux.cpp * Created on: 2011-9-4 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>#include <queue>using namespace std;typedef struct Node { int x, y 阅读全文
posted @ 2011-09-04 22:39 moonbay 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目简单,直接贴代码/* * hdu1241/linux.cpp * Created on: 2011-9-4 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int MAXN = 105;char map[MAXN][MAXN];int types[MAXN][MAXN], curtype;const int move[ 阅读全文
posted @ 2011-09-04 21:28 moonbay 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 直接二分查找答案即可,我的判断函数没有像大牛们那样优化,但是过是没问题的~/* * hdu4004/linux.cpp * Created on: 2011-9-4 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int MAXN = 500010;int stone[MAXN], L, N, M;int step(int 阅读全文
posted @ 2011-09-04 19:49 moonbay 阅读(435) 评论(0) 推荐(0) 编辑