問題一覧 > 通常問題

No.2737 Compound Word

レベル : / AI推定難易度 : 124 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 201
作問者 : ponjuice / テスター : kenken714 cho435 Nzt3 tassei903
お気に入りにしたユーザー ProblemId : 10834 / 自分の提出
問題文最終更新日: 2024-04-19 01:07:17
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
CPCTF 2024 : PPC (順位表) の他の問題:

Problem Statement

You are given $N$ strings $S_1, S_2 ,\cdots, S_N$.
Choose two different strings $S_i, S_j $ among them, and let $T$ be the string obtained by concatenating them in the order $S_iS_j$.
Find the number of distinct strings that $T$ can be.

Constraints

  • $N$ is an integer.
  • $2 \leq N \leq 50$
  • $S_i$ is a string consisting of lowercase English letters.
  • $1 \leq |S_i| \leq 100$
  • $S_i \ne S_j$ $(i\ne j)$
  • $\sum_{i=1}^{N} |S_i| \leq 300$

Input

The input is given from Standard Input in the following format.

$N$   
$S_1$     
$\vdots$  
$S_N$

Output

Output the answer.

Sample

Sample 1
Input
2
pon
juice
Output
2

The $2$ words ponjuice and juicepon can be made, so output 2.

Sample 2
Input
2
pon
ponpon
Output
1

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。