4085. I 这就是神奇的赛尔号

I 这就是神奇的赛尔号

题目描述

我没有太多的兴趣争论光明和黑暗的比重,如果我倾向黑暗,那光明就要湮灭,如果我倾向光明,那黑暗就要燃烧。不过要建立新生,就必须要毁灭,毁灭就让整个宇宙,有趣了许多。”——《永夜纪年》

Alice和Bob同学非常喜欢玩赛尔号,尤其喜欢赛尔号中的一只精灵——天启帝君。(上文是永夜纪年对天启帝君的描述)

它有如下技能:

1:轮回之狱:选择一个精灵编号区间[l,  r]并选择一个数x,若x为质数则恢复己方该区间精灵体力x,反之则扣除对方该区间精灵体力x

2:终焉时刻:选择一个精灵编号区间[l, r]并选择一个数x,恢复己方该区间体力最小的精灵体力x,并扣除对方该区间所有精灵体力x(如果有多个体力最小的精灵则选择编号最小的)

3: 纵横三千界:恢复己方全体精灵异或上114514点体力,降低对方全体精灵同或上114514点体力

4:天君启示录:将己方体力等于0的精灵全部复活

今天Alice同学和Bob同学开启了一场精灵对战,想询问你最后谁能取得胜利呢(获胜条件为另一方所有精灵体力先降为0)由于Alice,Bob同学天启帝君的等级不够,所以无法发动3,4技能但是Alice同学是尊贵的VIP所以每次她先出手

注:恢复精灵体力时可以超出体力上限

I This is the magical Cell

"I don't have much interest in arguing about the proportion of light and darkness, and if I lean toward darkness, the light will be annihilated, and if I am inclined to light, the darkness will burn. However, in order to establish a new life, it is necessary to destroy, and destruction makes the whole universe much more interesting. —The Chronicle of the Eternal Night

 

Alice and Bob love playing the Cell, especially one of the elves in the Cell, the Emperor of the Apocalypse. (The above is the description of the Emperor of the Apocalypse in the Chronicle of the Eternal Night)

 

It has the following skills:

 

1: Hell of Reincarnation: Select a sprite number interval [l, r] and select a number x, if x is a prime number, restore your own elf stamina x in that range, otherwise deduct the opponent's elf stamina in that interval x

 

2: Final Moment: Select a sprite number range [l, r] and select a number x to restore your own elven stamina with the smallest stamina in that range x, and deduct all the elven stamina of the opponent in that interval x (if there are multiple elves with the smallest stamina, choose the one with the smallest number).

 

3: Across the Three Thousand Realms: Restore the physical strength of all your elves to 114514 AND reduce the physical strength of all the opponent's elves to 114514 OR

 

4: Apocalypse of the Heavenly King: Resurrect all elves whose physical strength is equal to 0

 

Today, Alice and Bob have started an elf battle, and I want to ask you who will win in the end (the winning condition is that all elf stamina on the other side is reduced to 0 first).

 

Because Alice and Bob's level of the Apocalypse Emperor is not enough, she can't activate 3,4 skills, but Alice is a distinguished VIP, so she strikes first every time

Note: When recovering the elf's health, you can exceed the maximum health

输入描述

第一行输入2个整数 n(1<=n<=1e^5),m(1<=m<=1e^5) (n为各自的精灵数量,m为回合数)

第二行输入n个整数a1,a2...an-1,an,为Alice精灵初始体力值

第三行输入n个整数b1,b2...bn-1,bn,为Bob精灵初始体力值

对于任意的ai,bi有1<=ai,bi<=10^9

接下来2*m行每行四个整数op,l,r,x为每回合Alice,Bob同学的出招op={1,2}; 1<=l<=r<n; 1<=x<=10^6

输出描述

如果在m个回合中Alice获胜则输出"Alice",Bob获胜则输出"Bob",平局则输出"draw"

样例输入

6 2

100 200 300 400 500 600

100 200 300 400 500 600

1 1 6 100

2 1 2 50

1 2 3 3

1 1 1 6

样例输出

draw

样例输入

6 1

1 2 3 4 5 5

3 4 5 6 7 8

1 1 6 100

2 1 2 3

样例输出

Alice


难度等级: 0
总通过次数: 1
总提交次数: 71