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

建议使用的浏览器:

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

6500:Problem A. Game with string

题目描述
Alice and Bob are playing a game with string. Given a string S = $S_1$...$S_n$.
They choose m substrings from S, the ith substring is $S_{L_i}$...$S{R_i}$.
Alice and Bob play alternately, with Alice going first.
On a player’s turn, this player can add a character into one of those m substrings, but the character should be added in the front or in the end, and the new string should still be a substring of S.
The player unable to make a valid move loses the game. Who will be the winner if both players move optimally?
输入解释
Input is given from Standard Input in the following format:
S
m
$L_1$ $R_1$
$L_2$ $R_2$
...
...
...
$L_m$ $R_m$
Constraints
1 ≤ |S| ≤ 100000
1 ≤ m ≤ 100000
1 ≤ $L_i$ ≤ $R_i$≤ |S|(1 ≤ i ≤ m)
characters in S are lowercase
输出解释
Print one line denotes the answer.
If Alice can win, output “Alice”, otherwise “Bob”.
输入样例
abc
1
1 2
输出样例
Alice
来自杭电HDUOJ的附加信息
Recommend

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

源链接: HDU-6500

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

共提交 0

通过率 --%
时间上限 内存上限
5000/2500MS(Java/Others) 262144/262144K(Java/Others)