Pro.ID21642 TitleBang Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21642 AC0 Submit0 Ratio- 时间&空间限制描述In this problem, you are to simulate a famous wild west-theme card game. Its name is BANG The game is suitable for four to seven players gather around a table to have a good time. The game is famous partly because it's complicated. Don't worry. You are only to simulate a simplified version of the game. In our version of the game, only two players are involved. Let's suppose they are lames and Peipei. Each of them has four (4) hit points. A pile of cards is shuffled and placed on the table, facing down. The two players draw as many cards from the top of the pile as their hit points (i.e. lames draws the top most four cards, and then Peipei draws the next four cards). Then the game starts. The game is played in turns, alternatively. lames begins. Each player’s turn is divided into three phase: (1) Draw two (2) cards from the top of the pile; (2) Play any number of cards; (3) Discard some cards so that the number of cards in hand does not excess his hit point. A card, when played, is discarded. There are some kinds of cards in the game of BANG When played, each of them has its own effect. They are listed as follow: Bang: You (the player who play the card) shoot at your rival. If he failed to avoid it (plays a Miss card immediately), the bullet hits him and his hit point reduce by one. You can use no more than one of this card in one of your turn. Grenade: Your rival must play a Miss card immediately, or he loses one hit point. Ghost: Your rival must discard a Bang card immediately, or he loses one hit point. Knife: Your rival loses one hit point immediately. Miss: You can not play this card in your turn. The only usage of it is to avoid being shot; Parry: You can not play this card in your turn. But when you have to play a "Miss", you can also play this card to avoid being hurt. Each time you play this card, draw one card from the top of the pile immediately. When one of the players loses all his hit point, he loses. During the game, each player will flollow such strateges: a) In each turn, a player will play as many cards as he can; b) When his rival plays a "Bang"/"Ghost"/"Brenade", his would always play the specific card if he owns one; c) Play a "Ghost" card prior to all other cards; d) Play a "Parry" card prior to a "Miss" cards; e) Discard "Bang" cards first (if he has to), then "Miss" cards, then "Parry" cards. 输入Input contains no bore than 40 scenarios. Each of them contains multiple lines, each being one card in the pile, from top to bottom. Each scenarios is terminated by a line "===" (three equal mark). The whole input is terminated by a line contains a single period (.). It is guaranteed that there would be enough cards in the pile to run the game to the end. 输出Description In this problem, you are to simulate a famous wild west-theme card game. Its name is BANG The game is suitable for four to seven players gather around a table to have a good time. The game is famous partly because it's complicated. Don't worry. You are only to simulate a simplified version of the game. In our version of the game, only two players are involved. Let's suppose they are lames and Peipei. Each of them has four (4) hit points. A pile of cards is shuffled and placed on the table, facing down. The two players draw as many cards from the top of the pile as their hit points (i.e. lames draws the top most four cards, and then Peipei draws the next four cards). Then the game starts. The game is played in turns, alternatively. lames begins. Each player’s turn is divided into three phase: (1) Draw two (2) cards from the top of the pile; (2) Play any number of cards; (3) Discard some cards so that the number of cards in hand does not excess his hit point. A card, when played, is discarded. There are some kinds of cards in the game of BANG When played, each of them has its own effect. They are listed as follow: Bang: You (the player who play the card) shoot at your rival. If he failed to avoid it (plays a Miss card immediately), the bullet hits him and his hit point reduce by one. You can use no more than one of this card in one of your turn. Grenade: Your rival must play a Miss card immediately, or he loses one hit point. Ghost: Your rival must discard a Bang card immediately, or he loses one hit point. Knife: Your rival loses one hit point immediately. Miss: You can not play this card in your turn. The only usage of it is to avoid being shot; Parry: You can not play this card in your turn. But when you have to play a "Miss", you can also play this card to avoid being hurt. Each time you play this card, draw one card from the top of the pile immediately. When one of the players loses all his hit point, he loses. During the game, each player will flollow such strateges: a) In each turn, a player will play as many cards as he can; b) When his rival plays a "Bang"/"Ghost"/"Brenade", his would always play the specific card if he owns one; c) Play a "Ghost" card prior to all other cards; d) Play a "Parry" card prior to a "Miss" cards; e) Discard "Bang" cards first (if he has to), then "Miss" cards, then "Parry" cards. Input Input contains no bore than 40 scenarios. Each of them contains multiple lines, each being one card in the pile, from top to bottom. Each scenarios is terminated by a line "===" (three equal mark). The whole input is terminated by a line contains a single period (.). It is guaranteed that there would be enough cards in the pile to run the game to the end. Output For each scenario, if the player who makes the first move (i.e. Iamcs) wins or lose, output a line "WIN" or "LOSE" correspondingly. Sample Input Bang Sample Output LOSE Source 样例输入Bang 样例输出LOSE 作者 |