codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

1111A.md (1697B)


      1 Source: https://codeforces.com/problemset/problem/1111/A
      2 
      3 A. Superhero Transformation
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 We all know that a superhero can transform to certain other superheroes. But not all Superheroes can transform to any other superhero. A superhero with name $s$ can transform to another superhero with name $t$ if $s$ can be made equal to $t$ by changing any vowel in $s$ to any other vowel and any consonant in $s$ to any other consonant. Multiple changes can be made.
     22 
     23 In this problem, we consider the letters 'a', 'e', 'i', 'o' and 'u' to be vowels and all the other letters to be consonants.
     24 
     25 Given the names of two superheroes, determine if the superhero with name $s$ can be transformed to the Superhero with name $t$.
     26 
     27 Input
     28 
     29 The first line contains the string $s$ having length between $1$ and $1000$, inclusive.
     30 
     31 The second line contains the string $t$ having length between $1$ and $1000$, inclusive.
     32 
     33 Both strings $s$ and $t$ are guaranteed to be different and consist of lowercase English letters only.
     34 
     35 Output
     36 
     37 Output "Yes" (without quotes) if the superhero with name $s$ can be transformed to the superhero with name $t$ and "No" (without quotes) otherwise.
     38 
     39 You can print each letter in any case (upper or lower).
     40 
     41 Examples
     42 
     43 Input
     44 
     45 ```
     46 a
     47 u
     48 ```
     49 
     50 Output
     51 
     52 ```
     53 Yes
     54 ```
     55 
     56 Input
     57 
     58 ```
     59 abc
     60 ukm
     61 ```
     62 
     63 Output
     64 
     65 ```
     66 Yes
     67 ```
     68 
     69 Input
     70 
     71 ```
     72 akm
     73 ua
     74 ```
     75 
     76 Output
     77 
     78 ```
     79 No
     80 ```
     81 
     82 Note
     83 
     84 In the first sample, since both 'a' and 'u' are vowels, it is possible to convert string $s$ to $t$.
     85 
     86 In the third sample, 'k' is a consonant, whereas 'a' is a vowel, so it is not possible to convert string $s$ to $t$.