DWITE '10 R2 #1 - Pattern Matching

View as PDF

Submit solution

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

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
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

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


Comments


  • 1
    Peter  commented on Nov. 3, 2017, 2:33 p.m.

    Hey this program doesn't have a judge. Any chance one of the admins could set it up?