摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 25int n;bool map[maxn][maxn][maxn];void input(){ memset(map, 0, sizeof(map)); for (int i = 1; i <= n; i++) { int a; int j = 1; while (scanf("%d", 阅读全文
posted @ 2011-08-21 12:53 undefined2024 阅读(184) 评论(0) 推荐(0)
摘要: 题意:给定一个国际象棋棋盘,左下角为原点建立坐标系,第一象限的左下角为黑色,格宽度为s,给定一个棋子坐标,给定棋子每次移动x,y的变化量。求多就可以跳入白色格子。分析:在黑色格子中的时候,我们只需要记录其关于当前黑色格子的相对位置(以此格子的左下角为原点),并观察这个相对位置是否被访问过,如果是,那么证明无解。本题特殊之处在于落在边界不算跳入白色。也就是说对于黑色格子的相对位置可能是边界,所以就要区分左右上下边界,这个是难点。View Code #include <iostream>#include <cstdio>#include <cstdlib>#in 阅读全文
posted @ 2011-08-21 11:27 undefined2024 阅读(282) 评论(0) 推荐(0)