MWC '15 #1 P5: Love Guru

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Hypnova is a love guru. He has a mathematical way to determine the compatibility of two people. His method is as follows:

1. Take the names of the two people and perform the following process:
• Take the value of each letter (a = 1, b = 2, c = 3, etc.) and put it to the power of its position in the name (starting from 1).
• Sum these values together and mod the number by into the range .
2. Add these two values together to get the compatibility out of .

Hypnova needs you to make a program that calculates two people's compatibility based on the criterion described above. The program should not be case sensitive.

Input Specification

Given names and , find their compatibility out of . The names are guaranteed to consist of only latin letters and letters in length.

Output Specification

A number in the range .

Sample Input

Romeo
Juliet

Sample Output

15

Romeo:
Juliet:
Compatibility:

Comments

• commented on Aug. 24, 2021, 1:59 a.m. edited

What does mod by 10 into the range [1,10] mean?

Edit: I believe I understand what the function mod means, however I don't really know what the question is asking. lol

• commented on Aug. 24, 2021, 4:15 a.m.

It means mod by 10 but if the result is 0, add 10 so your answer for that name should be between 1-10.

• commented on Aug. 24, 2021, 11:06 a.m.

Ok, thanks!

• commented on March 18, 2016, 3:56 a.m.

Hypnova sensei, I'm lonely can you set me up? pls <3 <3

• commented on March 18, 2016, 8:30 p.m.

Me too

• commented on March 16, 2016, 3:01 p.m.

Isn't 10 mod 10 0?

• commented on March 16, 2016, 9:29 p.m. edited

Yes, but the problem statement says:

...mod the number by into the range