题目传送门 本题知识点:深度优先搜索 + 暴力枚举 + 回溯 本题题意比较简单,要求把棋盘的棋子翻成同一颜色的,如果可以就输出最少步数,否则“Impossible”。 样例4步最快的就是把棋子都翻成white('w'),此时我犯了一个严重的错误。 在草稿纸上我的四步是这样走的: 第一步 ...
POJ ,题目链接http: poj.org problem id ,翻译一下整个题目的大概意思:有 的正方形,每个格子要么是黑色,要么是白色,当把一个格子的颜色改变 黑 gt 白或者白 gt 黑 时,其周围上下左右 如果存在的话 的格子的颜色也被反转,问至少反转几个格子可以使 的正方形变为纯白或者纯黑 主要思路如下: .对于每个格子,它要么反转 次,要么反转 次 当然,它的邻格子也跟着反转 ,因 ...
2012-04-27 19:44 2 21386 推荐指数:
题目传送门 本题知识点:深度优先搜索 + 暴力枚举 + 回溯 本题题意比较简单,要求把棋盘的棋子翻成同一颜色的,如果可以就输出最少步数,否则“Impossible”。 样例4步最快的就是把棋子都翻成white('w'),此时我犯了一个严重的错误。 在草稿纸上我的四步是这样走的: 第一步 ...
对我来说,此题不易。此题是BFS+状态位压缩。参考:http://blog.csdn.net/hackbuteer1/article/details/73922451. BFS也可以用来求最优解。2. ...
Flip Game Time Limit: 1000MS Memory Limit: 65536K ...
Problem Description: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you ...
Problem Description: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you ...
题目: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend ...
http://poj.org/problem?id=1222 http://poj.org/problem?id=1830 http://poj.org/problem?id=1681 http://poj.org/problem?id=1753 http://poj ...
题目链接 A Sample Stone Game 题目大意:给定n,k,表示最初时有n个石头,两个人玩取石子游戏,第一个人第一次可以取1~n-1个石头,后面每个人最多可以拿走前面一个人拿走的个数的K倍,当有一个人可以一次性全部拿走时获胜。问两人都在不失误的情况下,先拿着有没有必胜局势。有的话 ...