Logo
(追記) (追記ここまで)

11307번 - String Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB69343156.364%

문제

Alice and Bob are playing the following game with strings of letters.

Before the game begins, an initial string and a target string are decided. The initial string is at least as long as the target string. Then, Alice and Bob take turns, starting with the initial string. Bob goes first. In each turn, the current player removes either the first or the last letter of the current string. Once the length of the current string becomes equal to the length of the target string, the game stops. If the string at the end of the game is equal to the target string, Alice wins the game; otherwise Bob wins.

Determine who will win the game if both players are playing optimally.

입력

Each test case starts with N, the number of inputs to process. Each input consists of one line, which contains the initial string, followed by a space, followed by the target string. Each string consists of only lowercase letters. The total input length will be less than 500000 characters.

출력

For each input, output the winner, which will either be Alice or Bob.

제한

예제 입력 1

5
aba b
bab b
aaab aab
xyz mnk
xyz xyz

예제 출력 1

Alice
Alice
Bob
Bob
Alice

힌트

출처

Contest > Waterloo's local Programming Contests > 27 September, 2015 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /