4 1 1 3 2
3
The operations are described below. After all the operations have been performed, $P$ equals $3$.
* The operations for $i=1$:
1. Put a piece on Square $0$. Now, Square $0$ has a piece.
2. Advance every piece on the squares $1$ square ahead. After these moves, Square $1$ has a piece.
* The operations for $i=2$:
1. Put a piece on Square $0$. Now, Squares $0$ and $1$ have a piece.
2. Advance every piece on the squares $1$ square ahead. After these moves, Squares $1$ and $2$ have a piece.
* The operations for $i=3$:
1. Put a piece on Square $0$. Now, Squares $0$, $1$, and $2$ have a piece.
2. Advance every piece on the squares $3$ squares ahead.
Here, for the pieces on Squares $1$ and $2$, the destination squares do not exist (since $1+3=4$ and $2+3=5$), so remove these pieces and add $2$ to $P$. $P$ now equals $2$. After these moves, Square $3$ has a piece.
* The operations for $i=4$:
1. Put a piece on Square $0$. Now, Squares $0$ and $3$ have a piece.
2. Advance every piece on the squares $2$ squares ahead.
Here, for the piece on Square $3$, the destination square does not exist (since $3+2=5$), so remove this piece and add $1$ to $P$. $P$ now equals $3$.
After these moves, Square $2$ has a piece.3 1 1 1
0 The value of $P$ may not be updated by the operations.
10 2 2 4 1 1 1 4 2 2 1
8
{
"problem": {
"name": "Batters",
"description": {
"content": "> Takahashi is trying to create a game inspired by baseball, but he is having difficulty writing the code. > Write a program for Takahashi that solves the following problem. There are $4$ squares c",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc256_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "> Takahashi is trying to create a game inspired by baseball, but he is having difficulty writing the code. \n> Write a program for Takahashi that solves the following problem.\n\nThere are $4$ squares c...",
"is_translate": false,
"language": "English"
}
]
}