No.3714 Prefix Team Name
問題文最終更新日: 2026-09-18 21:22:16
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
yukicoder contest 514
(順位表)
の他の問題:
Problem Statement
$3$ players have formed a team. Their usernames are $X, Y, Z$, respectively.
Consider creating a team name by the following procedure.
- For each player's username, freely choose a prefix of length at least $1$. Concatenate them in any order.
Find the number of strings that can be the team name.
Constraints
- $X, Y, Z$ are strings of lowercase English letters with length between $1$ and $50$, inclusive
Input
The input is given from Standard Input in the following format.
$X$ $Y$ $Z$
Output
Print the number of strings that can be the team name.
Sample
Sample 1
Input
ab a b
Output
8
The following $8$ strings are possible: aab, aba, baa, abab, abba, aabb, baba, baab.
Sample 2
Input
yuusaan loop cafe
Output
672
Sample 3
Input
missisippi miss m
Output
163
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
ぽえ
kazuppa