FZUProblem2151OOXXGame的数学问题如何解决?

2026-06-11 12:103阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计450个文字,预计阅读时间需要2分钟。

FZUProblem2151OOXXGame的数学问题如何解决?

题目链接:FZUProblem2151OOXXGa+ 题目链接:http://acm.fzu.edu.cn/problem.php?pid=2151

题目描述:胖子哥哥和迷宫在N*M(N行M列)的棋盘上玩一种特殊的(变态)游戏。初始时,棋盘上有N*M个硬币。

FZUProblem2151OOXXGa

题目链接:acm.fzu.edu.cn/problem.php?pid=2151

Problem Description

Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, there are N*M coins in this board with two symbol “O” or “X”. Then they take turns to choose a grid with symbol “O” and change it into “X”. The game ends when all the symbols in the board are “X”, and the one who cannot play in his (her) turns loses the game. Fat brother and Maze like this kind of OOXX game very much and play it day and night. They don’t even need a little rest after each game!

Here‘s the problem: Who will win the game if both use the best strategy? You can assume that Maze always goes first.

FZUProblem2151OOXXGame的数学问题如何解决?

Input

The first line of the date is an integer T, which is the number of the text cases.

Then T cases follow, each case contains two integers N and M indicate the size of the board. Then goes N line, each line with M character shows the state of the board.

1 <= T <=100, 1 <= n <=100, 1 <= m <=100

Output

For each case, output the case number first, and then output the winner’s name, either Fat brother or Maze. See the sample input and output for more details.

Sample Input

31 4OXXX2 4OOXXOOXX1 2XX

Sample Output

Case 1: MazeCase 2: Fat brotherCase 3: Fat brother

代码如下:

#include const int maxn = 117;char mm[maxn][maxn];int main(){ int n,m; int t; int cas = 0; scanf("%d", while(t--) { int k = 0; scanf("%d%d", for(int i = 0; i

FZU Problem 2151 OOXX Game (数学啊)

本文共计450个文字,预计阅读时间需要2分钟。

FZUProblem2151OOXXGame的数学问题如何解决?

题目链接:FZUProblem2151OOXXGa+ 题目链接:http://acm.fzu.edu.cn/problem.php?pid=2151

题目描述:胖子哥哥和迷宫在N*M(N行M列)的棋盘上玩一种特殊的(变态)游戏。初始时,棋盘上有N*M个硬币。

FZUProblem2151OOXXGa

题目链接:acm.fzu.edu.cn/problem.php?pid=2151

Problem Description

Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, there are N*M coins in this board with two symbol “O” or “X”. Then they take turns to choose a grid with symbol “O” and change it into “X”. The game ends when all the symbols in the board are “X”, and the one who cannot play in his (her) turns loses the game. Fat brother and Maze like this kind of OOXX game very much and play it day and night. They don’t even need a little rest after each game!

Here‘s the problem: Who will win the game if both use the best strategy? You can assume that Maze always goes first.

FZUProblem2151OOXXGame的数学问题如何解决?

Input

The first line of the date is an integer T, which is the number of the text cases.

Then T cases follow, each case contains two integers N and M indicate the size of the board. Then goes N line, each line with M character shows the state of the board.

1 <= T <=100, 1 <= n <=100, 1 <= m <=100

Output

For each case, output the case number first, and then output the winner’s name, either Fat brother or Maze. See the sample input and output for more details.

Sample Input

31 4OXXX2 4OOXXOOXX1 2XX

Sample Output

Case 1: MazeCase 2: Fat brotherCase 3: Fat brother

代码如下:

#include const int maxn = 117;char mm[maxn][maxn];int main(){ int n,m; int t; int cas = 0; scanf("%d", while(t--) { int k = 0; scanf("%d%d", for(int i = 0; i

FZU Problem 2151 OOXX Game (数学啊)