## VM7WC '16 #4 Gold - Restoring Reputation

View as PDF

Points: 10
Time limit: 0.6s
Memory limit: 64M

Authors:
Problem types
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

Due to the (lack of) quality in the previous test cases that Jeffrey generated, his test cases are now frowned upon to use by the other problem setters. In an effort to restore his destroyed reputation in the Case Creation Community (CCC), Jeffrey is going through all of the input files he has, word by word, to improve the quality of his test data!

Jeffrey knows that if he doesn't have good quality test cases this week, he will forever be shamed in the CCC and could never make it to the prestigious Case Creation Organization (CCO). However, it is also a commonly known fact in the CCC that Jeffrey is a slow and lazy typer! For a given word in the input file, , Jeffrey would like to transform it to a new word, . In Jeffrey's world (filled with angry typing, mechanical keyboards, VIM and Linux), he has three different operations to transform the word.

Jeffrey can…

• Delete a character from using seconds.
• Insert a character into using seconds.
• Replace a character in with a new character using seconds.

The difference in time for the different operations is obviously due to his loud mechanical keyboard.

Before Jeffrey starts going through all the words, he would like to know how long it will take for him to go through each word so he can find the total time to allocate out of his day. Of course, Jeffrey only wants to know the minimum amount of time he needs to fix each word, he needs all of the remaining time in his day to post dank memes online as a publicity stunt for maximum likes and comments. With this, he could gain enough popularity to be nominated to join the Case Creation Organization!

#### Input Specification

On the first line will be three space separated integers:

• : The amount of time in seconds required to delete a character
• : The amount of time in seconds required to insert a character
• : The amount of time in seconds required to replace a character

The next line will contain two space separated strings, and . It is guaranteed that the length of and will be less than or equal to .

#### Output Specification

Output the cheapest cost to transform word to word .

#### Sample Input

1 2 4
intention execution

#### Sample Output

12

• commented on Jan. 29, 2016, 6:05 a.m.

are the lengths of string A and B same ?

• commented on Jan. 29, 2016, 11:31 a.m.

Don't assume anything not explicitly stated in the problem.

• commented on Jan. 28, 2016, 8:25 p.m.

Submissions have been rejudged, sorry for the delay.

• commented on Jan. 28, 2016, 5:19 p.m.

The test cases can be string and nothing???

• commented on Jan. 28, 2016, 5:21 p.m. edited

Not sure what to do either.

Edit: they're not actually separated by a space

• commented on Jan. 28, 2016, 5:32 p.m.

Hey, Diana is bad at making test cases. Some cases have the strings separated by spaces, other cases have them separated by newlines. I'm getting this fixed right now.

• commented on Jan. 26, 2019, 2:43 p.m.

how ironic

• commented on Jan. 28, 2016, 5:32 p.m.

the strings are on separate lines ...