当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5169:Flipping coins

题目描述
Alice and Bob are playing a game , everyone has a string made of 0/1, Alice's one called A , and Bob's one called B.
There is an uniform coin and an empty string $S$. When the game start, every round they toss the coin , if the coin face up, add a '0' to the bottom of $S$, otherwise add a '1'.
At the end of every round, they check if A or B becomes a substring of $S$, if A is the substring of $S$ , Alice wins, and if B is the substring of $S$ , Bob wins. In order to avoid the two person win at the same time. A will not be a suffix of B, and B will not be a suffix of A either.
Now we get A and B , we want to know whether the game is fair. if it's unfair , who will more going to be winner?
输入解释
There is a number T shows there are T test cases below. ($T \leq 50$)
For each test case contains a line , including the string A and B.
$1 \leq |A|,|B| \leq 100$
输出解释
For each case output, if the game is fair , output "Fair" , otherwise output "A" or "B" who has more chance to win.
输入样例
2
0 1
011 110
输出样例
Fair
A
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #28

源链接: HDU-5169

最后修改于 2020-10-25T23:20:22+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)