5479.Missing Vowels

Time Limit: 1s Memory Limit: 256MB

There are many ways to write a word on paper. For example, some writing systems, like Arabic and Hebrew, omit most vowels, although they write some of them.

In this problem, we will only consider strings consisting of English letters and hyphens. Letters a, e, i, o, u, and y are considered to be vowels, while hyphens and all other letters are considered to be consonants. All comparisons are case-insensitive: uppercase and lowercase versions of the same letter are considered equal.

You are given two strings $s$ and $f$, called the $\textit{short}$ name and the $\textit{full}$ name, respectively. Your task is to check whether the short name $s$ can be obtained from the full name $f$ by omitting some vowels (possibly none).

Input Format(From the terminal/stdin)

The first line contains a single string $s$, denoting the short name.

The second line contains a single string $f$, denoting the full name.

Each string is non-empty and consists of at most $1000$ English letters and hyphens.

Output Format(To the terminal/stdout)

Print Same if the short name $s$ can be obtained from the long name $f$ by omitting some vowels, and Different otherwise.

Sample Input 1

Copy
Shrm-el-Shikh
Sharm-el-Sheikh
             \n
               \n

Sample Output 1

Copy
Same
    \n

Sample Input 2

Copy
Eilot
Eilat
     \n
     \n

Sample Output 2

Copy
Different
         \n

Sample Input 3

Copy
Saint-Petersburg
Saint-Petersburg
                \n
                \n

Sample Output 3

Copy
Same
    \n

Sample Input 4

Copy
Bcdfghjklmnpqrstvwxz
Abcdefghijklmnopqrstuvwxzyy
                    \n
                           \n

Sample Output 4

Copy
Same
    \n

Sample Input 5

Copy
Aa
aaaA
  \n
    \n

Sample Output 5

Copy
Same
    \n

Sample Input 6

Copy
Etis-Atis-Amatis
Etis-Atis-Animatis
                \n
                  \n

Sample Output 6

Copy
Different
         \n

Sample Input 7

Copy
will-the-wisp
will-o-the-wisp
             \n
               \n

Sample Output 7

Copy
Different
         \n

Sample Input 8

Copy
--a-very-short-name--
long-name
                     \n
         \n

Sample Output 8

Copy
Different
         \n
Source: NWRRC 2023

Submit

请先 登录

© 2025 FAQs