13 1 2 1 3 1 1 1 3 1 2 2 3 1 3 1 3 2 3 1 3 2 2 2 3 2 1
3
1 1 1 0 0 1 0 1
The sample output corresponds to the following actions:
* Find potions of types $2,3,1$ in this order. Pick up all of them.
* Find potions of types $3,2$ in this order. Do not pick up any of them.
* Encounter a type-$3$ monster. Use one type-$3$ potion to defeat it.
* Find a type-$3$ potion. Pick it up.
* Find a type-$3$ potion. Do not pick it up.
* Encounter a type-$3$ monster. Use one type-$3$ potion to defeat it.
* Find a type-$3$ potion. Pick it up.
* Encounter a type-$2$ monster. Use one type-$2$ potion to defeat it.
* Encounter a type-$3$ monster. Use one type-$3$ potion to defeat it.
* Encounter a type-$1$ monster. Use one type-$1$ potion to defeat it.
In this sequence of actions, the value of $K$ is $3$.
There is no way to avoid defeat with $K\leq 2$, so the sought value of $K _ {\min}$ is $3$. There are multiple sequences of actions that satisfy $K=3$ and allow him to avoid defeat; you may print any of them.4 2 3 1 4 2 1 1 2
\-1 He will inevitably be defeated by the first monster he encounters.
30 1 25 1 2 1 10 1 18 2 18 1 11 2 11 1 21 1 6 2 2 2 10 1 11 1 24 1 11 1 3 1 2 1 18 2 25 1 8 1 10 1 11 2 18 2 10 1 10 2 2 1 24 1 10 2 10 1 25 2 6
4 1 1 1 1 1 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0
{
"problem": {
"name": "Takahashi Quest",
"description": {
"content": "Takahashi will embark on an adventure. During the adventure, $N$ events will occur. The $i$\\-th event $(1\\leq i\\leq N)$ is represented by a pair of integers $(t _ i,x _ i)$ $(1\\leq t _ i\\leq 2,1\\leq x",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc333_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Takahashi will embark on an adventure.\nDuring the adventure, $N$ events will occur. The $i$\\-th event $(1\\leq i\\leq N)$ is represented by a pair of integers $(t _ i,x _ i)$ $(1\\leq t _ i\\leq 2,1\\leq x...",
"is_translate": false,
"language": "English"
}
]
}