7016.Shortest Subsequence

Time Limit: 1s Memory Limit: 512MB

You are given a DNA sequence consisting of characters A, C, G, and T.

Your task is to find the shortest DNA sequence that is not a subsequence of the original sequence.

Input Format(From the terminal/stdin)

The only input line contains a DNA sequence with $n$ characters.

  • $1 \le n \le 10^6$

Output Format(To the terminal/stdout)

Print the shortest DNA sequence that is not a subsequence of the original sequence. If there are several solutions, you may print any of them.

Sample Input

Copy
ACGTACGT
        \n

Sample Output special judge

Copy
AAA
   \n
Source: CSES, Additional Problems I, 1087

Submit

请先 登录

© 2025 FAQs