内存限制:256 MB
时间限制:1 S
题面:Markdown
评测方式:文本比较
上传者:
提交:11
通过:6
**Red** stands at the coordinate $(0,0)$ of the Cartesian coordinate system. She has a string of instructions: up, down, left, right (where \`right' increases the x-coordinate by $1$, and \`up' increases the y-coordinate by $1$).
Now **Red** wants to select a continuous substring of instructions and execute them. **Red** hopes that the final execution of the instructions can pass through the coordinate $(x,y)$. She wants to know how many selection options there are.
Output one integer representing the number of selection options for the continuous substring.
Choosing $"AWDD"$, $"WD"$, or $"WDD"$ are all valid.