Kriptogram
의견: 0
\(4^{th}\) round, February \(18^{th}\), 2012
Mirko intercepted an encrypted message. Mirko knows only that specific sentence was part of the
original message. Find the first occurence of this sentence inside the encrypted message.
Message is encrypted by substituting every word from the original message with some (possibly the
same one) word. If some word appears more than once in the original message, it will be substituted
using the same word on each appearance. No two different words will have the same substitute word.
Words are space seperated sequences of lowercase letters. Sentence is a sequence of consecutive words.
The first line of input contains the encrypted message. This message will not contain more than 106
characters. There will be exactly one whitespace between adjacent words, and end of the line will be
marked with \(. Trailing \) is not considered to be a part of message.
The following line contains the sentence that appears in the original message, and which we must find
in the encrpyted message. This sentence won’t be longer than 106 characters, and will follow the same
format as described above.
The first and only line of output should contain the index in the encrypted message of the first word in
the first occurence of given original message sentence.
Solution will always exist.
a a a b c d a b c $
x y $3xyz abc abc xyz $
abc abc $2a b c x c z z a b c $
prvi dr prvi tr tr x $3평가 및 의견
Kriptogram
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Kriptogram