I. Imitater The Potato

Codeforces
IDCF10227I
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
If you have ever enjoyed the classic Plants vs Zombies to the very end of it, surely you have come across a special type of plant in this game: *Imitater*. If you choose this plant to be with you for a round, it can imitate any kind of plant you want, including its abilities, its stats and even its cost, so you'll have one more slot of that plant for the whole round, double the trouble! Lowie came across an Imitater and challenge it for a game of cards drawing. $N$ stack of cards are on the table. The $i$th stack on the table contains $A_i$ cards. In each move: - A player can draw one card from any stack on the table (if it's not empty). - A player can draw one card from each of every stack on the table (if no stack is empty). The winner is the one that drawn the last card on the table. Of course, as a master in game theory, Lowie knows the optimal strategy to win this game. But Imitater has copied Lowie, so that both are having exactly the same intelligence and the same winning tactics in their mind. So, given the state of the game, who would win, if Lowie gets to go first? First line: an integer $N$ ($1 <= N <= 1000$) - number of stacks. Second line: $N$ integers: $A_1, A_2,..., A_N$ ($1 <= A_i <= 1000$) - number of cards in each stacks. Output "_lowie_" if Lowie wins the game, or "_imitater_" if Imitater the Potato wins. ## Input First line: an integer $N$ ($1 <= N <= 1000$) - number of stacks.Second line: $N$ integers: $A_1, A_2,..., A_N$ ($1 <= A_i <= 1000$) - number of cards in each stacks. ## Output Output "_lowie_" if Lowie wins the game, or "_imitater_" if Imitater the Potato wins. [samples]
**Definitions** Let $ N \in \mathbb{Z}^+ $ be the number of stacks. Let $ A = (A_1, A_2, \dots, A_N) \in \mathbb{Z}^N $ be the vector of card counts per stack, where $ A_i \geq 1 $. **Moves** In a single move, a player may choose one of two actions: 1. Draw exactly one card from a single non-empty stack. 2. Draw exactly one card from every non-empty stack (only if all stacks are non-empty). **Objective** The player who draws the last card wins. Lowie moves first. Both players play optimally. **Game State** The game state is fully described by the multiset $ A $. The terminal state is $ A = (0, 0, \dots, 0) $. **Objective** Determine the winner under optimal play: output "lowie" if the first player wins, "imitater" otherwise.
API Response (JSON)
{
  "problem": {
    "name": "I. Imitater The Potato",
    "description": {
      "content": "If you have ever enjoyed the classic Plants vs Zombies to the very end of it, surely you have come across a special type of plant in this game: *Imitater*. If you choose this plant to be with you for ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10227I"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "If you have ever enjoyed the classic Plants vs Zombies to the very end of it, surely you have come across a special type of plant in this game: *Imitater*. If you choose this plant to be with you for ...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N \\in \\mathbb{Z}^+ $ be the number of stacks.  \nLet $ A = (A_1, A_2, \\dots, A_N) \\in \\mathbb{Z}^N $ be the vector of card counts per stack, where $ A_i \\geq 1 $.\n\n**Moves**  \nI...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments