QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 64 MB مجموع النقاط: 100

#18079. 애너그램 피하기

الإحصائيات

두 문자열 중 하나를 문자의 순서를 바꾸어 다른 하나로 만들 수 있다면, 이 두 문자열은 애너그램(anagram) 관계라고 한다. 예를 들어, “listen”과 “silent”는 애너그램 관계이지만, “master”와 “nearest”는 그렇지 않다.

문자열 $s = s_1s_2 \dots s_n$의 부분 수열은 $1 \le a_1 < a_2 < \dots < a_k \le n$일 때 $s_{a_1}s_{a_2} \dots s_{a_k}$로 나타내는 문자열이다.

문자열 $s$가 주어졌을 때, 결과 리스트에 포함된 어떤 두 문자열도 서로 애너그램 관계가 되지 않도록 나열할 수 있는 부분 수열의 최대 개수를 구하시오.

입력

최대 60개의 소문자 라틴 문자로 구성된 문자열 $s$가 한 줄에 주어진다.

출력

정답인 숫자 하나를 출력한다.

예제

입력 1

jojo

출력 1

8

입력 2

uralchampionship

출력 2

20735

참고

첫 번째 예제에서 결과 리스트에 포함될 수 있는 문자열의 예는 다음과 같다: “j”, “o”, “jj”, “jo”, “oo”, “jjo”, “joo”, “jojo”.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.