No.1535 Go-Shichi-Go (5-7-5)
問題文最終更新日: 2021-06-07 15:41:57
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
ゅゅちゃんお誕生日コンテスト
(順位表)
の他の問題:
Problem Statement
Yuyu-chan loves finding and pointing out $a$-$b$-$c$.
There are now $N$ strings. The $i$-th string is $S_i$. How many $a$-$b$-$c$ can Yuyu-chan find among them?
Here, an $a$-$b$-$c$ is a pair $(L,R)\ (1\leq L\lt R\leq N)$ satisfying the following. ($len(S_i)$ denotes the length of the string $S_i$.)
- There exist integers $i,j\ (L\lt i\lt j \leq R)$ satisfying $\displaystyle \sum _{k=L}^{i-1} len(S_k)=a, \sum _{k=i}^{j-1} len(S_k)=b, \sum _{k=j}^{R} len(S_k)=c$.
Input
$N$ $a\ b\ c$ $S_1\ S_2\ \ldots\ S_N$
Output
Print a newline at the end.
Sample
Sample 1
Input
12 5 7 5 kaeru pyoko pyoko mi pyoko pyoko awasete pyoko pyoko mu pyoko pyoko
Output
5
The following $5$ are $5$-$7$-$5$.
Sample 2
Input
9 1 2 3 y u k i c o d e r
Output
4
The following $4$ are $1$-$2$-$3$.
Sample 3
Input
5 5 7 5 samidare wo atsumete hayashi mogamigawa
Output
0
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
とりゐ
57tggx
logx
Re_menal2