問題一覧 > 通常問題

No.3714 Prefix Team Name

レベル : / AI推定難易度 : 400 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 66
作問者 : 👑 loop0919 / テスター : ぽえ kazuppa
お気に入りにしたユーザー ProblemId : 12412 / 自分の提出
問題文最終更新日: 2026-09-18 21:22:16
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もしくは右上の雲マークをクリックしてアカウントを作成してください。