摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1045题意:题目给出一个n和一幅N*N的图,图中包含'.','X'两种字符,要求在上面放上碉堡,碉堡能攻击他所在的行和列,但不能攻击墙,求最多能放多少个碉堡.开始每放一个,就把那一位置所在的行列标记,直到遇到墙或边界停止.这种方法很笨,但由于数据量小,也能AC.View Code 1 #include <iostream> 2 using namespace std; 3 const int MAX = 5; 4 char map[MAX][MAX]; 5 int 阅读全文
posted @ 2012-08-30 20:25 zx雄 阅读(2367) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1181题意:给我若干个单词,若单词A的结尾与单词B的开头相同,则表示A能变成B,判断能不能从b开头变成m结尾. 如: big-got-them第一次使用动态数组vectorView Code 1 #include <iostream> 2 #include <vector> 3 #include <queue> 4 using namespace std; 5 const int MAX = 30; 6 7 int main() 8 { 9 vector <int&g 阅读全文
posted @ 2012-08-30 10:52 zx雄 阅读(294) 评论(0) 推荐(0) 编辑