#P13307. 域名判断

    ID: 11588 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>字符串洛谷原创O2优化洛谷月赛

域名判断

Description

To distinguish between genuine and fake educational websites, you need to write a program to judge website domain names.

In this problem, a website domain name must satisfy the following requirements:

  • It is a string composed of uppercase and lowercase letters, digits, and ..

  • No two . are adjacent, and the string does not start or end with a ..

  • There is at least one ..

Additionally, in this problem, an educational website domain name must satisfy the following requirements:

  • It is a valid website domain name.

  • Let the domain name be in the format T1.T2.  .Tm1.TmT_1.T_2.\ \dots\ .T_{m-1}.T_m, where mm is a positive integer with m3m\geq 3, and TiT_i represents the ii-th maximal contiguous segment consisting only of letters and digits.

  • In the above condition, Tm1T_{m-1} must be equivalent to edu\texttt{edu}, and TmT_m must be equivalent to cn\texttt{cn} (in this problem, two strings are equivalent if they are equal when case is ignored for letters).

You are given a string SS of length nn, guaranteed to conform to the website domain name format described above.

Let SiS_i denote the substring of SS from the first character to the ii-th character. For all positive integers ii satisfying 1in1\leq i\leq n, you need to determine whether SiS_i is an educational website domain name, i.e., whether it satisfies the educational website domain name format. Output all such positive integers ii in ascending order.

You do not need to verify whether the given domain name actually exists.

Input Format

A single line containing the string SS, guaranteed to conform to the website domain name format described in the problem.

Output Format

A single line containing all positive integers ii that satisfy the conditions, listed in ascending order.

h5.zxx.edu.CN

13

FeOI.Round3.5.on.1u0gu.0r9


A.Edu.Cn1.Edu.Cn2

8 16

Hint

Sample Explanation #1

S13=h5.zxx.edu.CNS_{13}=\texttt{h5.zxx.edu.CN}. For S13S_{13}, m=4m=4, T1=h5T_1=\texttt{h5}, T2=zxxT_2=\texttt{zxx}, T3=eduT_3=\texttt{edu}, T4=CNT_4=\texttt{CN}.

Here, T3T_3 is equivalent to edu\texttt{edu}, and T4T_4 is equivalent to cn\texttt{cn}, so S13S_{13} is an educational website domain name.

Sample Explanation #2

None of the SiS_i substrings are educational website domain names.

Constraints

This problem uses bundled tests.

For all test data: 3n1063\leq n\leq 10^6.

  • Subtask 1 (20 points): n6n\leq 6.

  • Subtask 2 (40 points): n1000n\leq 1000.

  • Subtask 3 (40 points): No additional constraints.

By Deepseek V3.