是男人就过 8 题--Pony.AI A AStringGame

链接:https://www.nowcoder.com/acm/contest/92/A
来源:牛客网

AStringGame
时间限制:C/C++ 2秒,其他语言4秒
空间限制:C/C++ 262144K,其他语言524288K
64bit IO Format: %lld

题目描述

Recently Alice and Bob are playing a game about strings. Before starting the game, they should prepare n strings s 1, s 2, ..., s n and a target string t. It's promised that each of these n strings is a substring of t.

When the game begins, they do the following things alternately while Alice starts first:
  • Choose a string si from the n strings;
  • Append one letter to the chosen string;
  • The new string must also be a substring of t.
If the above things cannot be completed, the player loses the game. Suppose Alice and Bob both use optimal strategy, find who will win the game.

输入描述:

The input consists of multiple test cases.

Each test case begins with the non-empty target string t, whose length will not exceed 100000. The second line contains an integer n (1 ≤ n ≤ 100), the number of strings they prepared. Then n lines follow. The i-th line of the following n lines is the string s
i
. The input guarantees that each of the n strings must be a non-empty substring of t.

The total length of all strings will not exceed 30000000.

输出描述:

For each test case, output the winner "Alice" or "Bob" (without quotes) in one line.
示例1

输入

aaaa
1
a
abcabd
1
a

输出

Alice
Bob

听说要sa要做sg函数

看一看学习学习

转载于:https://www.cnblogs.com/BobHuang/p/8874510.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值