포럼
문제 COCI00452

Lozinke

설명

Recently, there has been a breach of user information from the mega-popular social network
Secret Network. Among the confidential information are the passwords of all users.
Mihael, a young student who has been exploring computer security lately, found the whole
thing really interesting. While experimenting with the social network, he found another
security breach! When you input any string of characters that contains a substring equal to
the actual password, the login will be successful. For example, if the user whose password is
abc inputs one of the strings abc, abcd or imaabcnema, the system will successfully log him
in, whereas the login will fail for axbc.
Mihael wants to know how many ordered pairs of different users exist such that the first user,
using their own password, can login as the second user.

제약

In test cases worth 40 points total, it will hold \(1 \le N \le 2000\).

입력 형식

The first line of input contains the positive integer \(N\) (\(1 \le N \le 20\,000\)), the number of users.
Each of the following \(N\) lines contains the user passwords. The passwords consist of at least
one and at most 10 lowercase letters of the English alphabet.

출력 형식

The first and only line of output must contains the number of ordered pairs from the task.

예제 1
입력
3
aaa
aa
abb
출력
1
예제 2
입력
3
x
x
xy
출력
4
예제 3
입력
5
mir
mirta
ta
ir
t
출력
6
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2017/2018 Contest 1

평가 및 의견

Lozinke

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Lozinke

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8