406762: GYM102536 A The Slowden Files

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. The Slowden Filestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

You, Jacob Slowden, have been hired by the Children of Immortal Agents (CIA) to put a wrench into the Not So Advanced's (NSA's) operations.

Working at the pace of a wolf, which is ironically not that fast—only once every full moon—you go ahead and break into the NSA's system to slow them down. After all, if you are slow, then your enemies must be slowed down as well, keeping your name true to its meaning.

As the NSA was not very advanced, it was very easy for you to gain access to their system. Of course, this does not necessarily mean that you were able to do it fast. In any case, you were still surprised with what you saw. Unencrypted passwords. Basic network configuration. Even Ronald Gump's Tweeter had better security.

Their passwords were already unencrypted, so what else could you do? After thinking for a while, you decided on swapping the passwords between all of their user accounts.

Of course, it wouldn't be good if they suddenly got completely locked out of their account. Even they would be suspicious if that happened. So whenever they try to log in, you give a hint saying how close they are from the correct password. Specifically, you measure this in terms of how many "moves" it would take to turn it into the correct password: one addition, deletion, or replacement of one character counts as one "move". You seem to recall from your Cryptographic Secrets training that this was called the Leviathan distance or something. Or wait, was that a character from the game Decryption of the Aged?

After thinking about how to do this, you now go on to implement your hints:

  • If the entered password matches the correct password, print "You're logged in!"
  • If they are only one move apart, print "You almost got it. You're wrong in just one spot."
  • If it takes exactly two moves, print "You almost got it, but you're wrong in two spots."
  • If it takes exactly three moves, print "You're wrong in three spots."
  • Otherwise, print "What you entered is too different from the real password."

Note that passwords may contain spaces, and passwords are case-sensitive and space-sensitive.

Input

The first line of input starts with an integer $$$t$$$, the number of test cases.

Each test case consists of two lines.

The first line of each test case consists of a single string containing the entered password.

The second line of each test case consists of a single string containing the correct password.

Constraints

  • $$$1 \le t \le 10^4$$$
  • Each password string is nonempty.
  • Each password string consists of characters whose ASCII values are between 33 and 126.
  • Each password string is at most $$$10^5$$$ characters in length.
  • The total length of all strings in the input is $$$\le 2\cdot 10^6$$$.
Output

For each test case, output a single line containing (without the quotes)

  • " You're logged in!" if the entered password matches the correct password;
  • " You almost got it. You're wrong in just one spot." if they are only one move apart;
  • " You almost got it, but you're wrong in two spots." if it takes exactly two moves;
  • " You're wrong in three spots." if it takes exactly three moves;
  • " What you entered is too different from the real password." otherwise.
ExampleInput
5
password
password
password
passw0rd
password
pazzword
password
pazzw0rd
password
username
Output
You're logged in!
You almost got it. You're wrong in just one spot.
You almost got it, but you're wrong in two spots.
You're wrong in three spots.
What you entered is too different from the real password.

加入题单

算法标签: