DWITE '10 R2 #1 - Pattern Matching

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
DWITE Online Computer Programming Contest, November 2010, Problem 1

Creating a random name generator is not an easy task. There are so many factors to consider, like the origin of the name, the length of the name, etc… In fact, you would also like to know the structure of words used. Here, the 'structure' of a word is the pattern of vowels and consonants. For example, the structure of DWITE would be (consonant, consonant, vowel, consonant, vowel). Given pairs of names generated by the random name generator, determine if the names have the same structure or not.

The input will contain 5 lines, each having two strings, separated by a single space, and no more than 256 lowercase letters in length.

The output will contain 5 lines of output, the result of comparing the 'structure' of the pair of words. Either same or different.

Note: for the purposes of this question, Y is considered as a consonant.

Sample Input

green train
dwite rocks
november canada

Sample Output

same
different
different

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments

There are no comments at the moment.