submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s343626168 | p00017 | Accepted | import sys
a=lambda x: [''.join([chr(97+(ord(i)-97+j)%26) if i.islower() else i for i in x]) for j in range(26)]
value=['this','that','the']
for s in sys.stdin:
for i in a(s):
if sum(map(i.count,value))>0:
print(i[:-1]) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s722582320 | p00017 | Accepted |
import sys
import re
def shift(lis):
a = lis.pop()
lis.insert(0, a)
return lis
class Caesar:
def __init__(self, n):
a = list("abcdefghijklmnopqrstuvwxyz")
b = list("abcdefghijklmnopqrstuvwxyz")
for i in range(n):
b = shift(b)
# self.table = map((lambda x, y: (x, y)), a, b)
self.table = zip(a, b)
def lookup(self, c):
for p in self.table:
if c == p[0]:
c = p[1]
break
return c
def decrypt(self, str):
result = map(self.lookup, str)
return "".join(result)
#input_file = open(sys.argv[1], "r")
r = re.compile("the|this|that")
#for line in input_file:
for line in sys.stdin:
line = line.rstrip("\r\n")
for n in range(1,27):
caesar = Caesar(n)
result = caesar.decrypt(line)
m = r.findall(result)
if not len(m) == 0:
# print m
break
print result | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s436076669 | p00017 | Accepted | def rot(s):
x=""
for c in s:
tmp = ord(c)-ord("a")
if "a"<=c<="z":
x += chr((tmp+1) % 26 + ord("a"))
else:
x += c
return x
while True:
try:
s = raw_input()
f = False
for i in range(26):
for word in s.split():
if word=="the" or word=="this" or word=="that":
f=True
break
if f: break
else: s=rot(s)
print s
except:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s584345536 | p00017 | Accepted | def rot(s):
x=""
for c in s:
tmp = ord(c)-ord("a")
if "a"<=c<="z":
x += chr((tmp+1) % 26 + ord("a"))
else:
x += c
return x
def check(s):
for word in s.split():
if word=="the" or word=="this" or word=="that":
return True
else: return False
while True:
try:
s = raw_input()
f = False
for i in range(26):
if check(s):break
else: s=rot(s)
print s
except:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s739206385 | p00017 | Accepted | while True:
try:
s = raw_input()
for i in range(26):
r = ''
for c in s:
if c.islower():
n = ord(c) - ord('a') + i
n = n % 26
r += chr(n + ord('a'))
else:
r += c
if 'the' in r or 'this' in r or 'that' in r:
print r
break
except EOFError:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s893529899 | p00017 | Accepted | #!/usr/bin/python
import sys
itoa = {
1:'a', 2:'b', 3:'c', 4:'d', 5:'e',
6:'f', 7:'g', 8:'h', 9:'i',10:'j',
11:'k',12:'l',13:'m',14:'n',15:'o',
16:'p',17:'q',18:'r',19:'s',20:'t',
21:'u',22:'v',23:'w',24:'x',25:'y',
26:'z'
}
atoi = {
'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5,
'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j':10,
'k':11, 'l':12, 'm':13, 'n':14, 'o':15,
'p':16, 'q':17, 'r':18, 's':19, 't':20,
'u':21, 'v':22, 'w':23, 'x':24, 'y':25,
'z':26
}
def main():
for crypt in sys.stdin:
for i in xrange(1, 27):
decrypt = decryptor(crypt.strip(), i)
if (decrypt.find('the') != -1
or decrypt.find('this') != -1
or decrypt.find('that') != -1):
print decrypt
break
def decryptor(crypt, offset):
global atoi
global itoa
decrypt = ''
for c in crypt:
if (c == ' ' or c == ',' or c == '.' or c == "\n"):
decrypt += c
else:
code = atoi[c]
code -= offset
if (code <= 0 ):
code = 26 + code
decrypt += str(itoa[code])
return decrypt
main() | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s074053326 | p00017 | Accepted | b = ["the", "this", "that"]
while 1:
try:
a = raw_input()
except EOFError:
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s104504110 | p00017 | Accepted | import sys,string
t = string.maketrans('abcdefghijklmnopqrstuvwxyz','bcdefghijklmnopqrstuvwxyza')
for s in sys.stdin:
s = s.strip()
while not ('the' in s or 'this' in s or 'that' in s):
s = s.translate(t)
print s | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s897629844 | p00017 | Accepted | import sys
lineNumber = 0
#for line in [ "xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt." ]:
for line in sys.stdin.readlines():
lineNumber += 1
# get data
# List = map(float, line.strip().split(","))
s = line.strip()
for i in xrange(1, 26+1):
for idx in xrange( len(s) ):
n = ord(s[idx])
if n < 97 or n >= 97+26: continue
n += - 97 + 1
n %= 26
s = s[:idx] + chr(n + 97) + s[idx+1:]
if "this" in s or "that" in s or "the" in s: break
print s | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s765022221 | p00017 | Accepted | alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sign = [" ", ".", "," ,":"]
while True:
try:
word = raw_input()
for key in range(26):
for i in range(len(word)):
if not word[i] in sign:
ref = alpha.index(word[i])
word = word[:i]+alpha[(ref+1)%26]+word[i+1:]
if word.count("the ")>=1 or word.count("that")>=1 or word.count("this")>=1:
print word
except:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s667379500 | p00017 | Accepted | import sys
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def shift(arg):
tmp = arg.rstrip()
while True:
res = ''
for c in tmp:
if c in alphabet:
if c == 'a': res += 'z'
else: res += chr(ord(c)-1)
else: res += c
if 'the' in res or 'this' in res or 'that' in res:
return res
tmp = res
for trg in sys.stdin:
print shift(trg) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s160966121 | p00017 | Accepted | import sys
def decode(s):
x=""
for c in s:
if not (c==" " or c=="."):
x+=chr(ord(c)+1)
else:
x+=c
return x.replace(chr(ord("z")+1),"a")
for s in sys.stdin.readlines():
for i in xrange(ord("z")-ord("a")+1):
if "the" in s or "that" in s or "this" in s:
print s[:-1]
break
s=decode(s) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s794051472 | p00017 | Accepted | import sys
def decode(s):
x=""
for c in s:
if c in " .":
x+=c
else:
x+=chr(ord(c)+1)
return x.replace(chr(ord("z")+1),"a")
for s in sys.stdin.readlines():
for i in xrange(ord("z")-ord("a")+1):
if "the" in s or "that" in s or "this" in s:
print s[:-1]
break
s=decode(s) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s558698966 | p00017 | Accepted | import sys
def decode(s):
x=""
for c in s:
if c in " .": x+=c
else: x+=chr(ord(c)+1)
return x.replace(chr(ord("z")+1),"a")
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=decode(s)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s787236741 | p00017 | Accepted | import sys
A="abcdefghijklmnopqrstuvwxyza"
def decode(s):
x=""
for c in s:
if c in A: x+=A[A.index(c)+1]
else: x+=c
return x
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=decode(s)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s752235799 | p00017 | Accepted | import sys
A="abcdefghijklmnopqrstuvwxyza"
def rot(s):
x=""
for c in s:
if c in A:x+=A[A.index(c)+1]
else:x+=c
return x
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=rot(s)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s884482593 | p00017 | Accepted | import sys,string
A="abcdefghijklmnopqrstuvwxyz"
tbl=string.maketrans(A,A[1:]+A[0])
for s in sys.stdin.readlines():
while not("the" in s or "that" in s or "this" in s):
s=s.translate(tbl)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s649990865 | p00017 | Accepted | import sys
A="abcdefghijklmnopqrstuvwxyza"
def rot(s):
x=""
for c in s:
if c in A: x+=A[A.index(c)+1]
else: x+=c
return x
for s in sys.stdin.readlines():
while not("the" in s or "that" in s or "this" in s):
s=rot(s)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s265240234 | p00017 | Accepted | import sys,string
A="abcdefghijklmnopqrstuvwxyza"
tbl=string.maketrans(A[:-1],A[1:])
for s in sys.stdin.readlines():
while not("the" in s or "that" in s or "this" in s):
s=s.translate(tbl)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s495643015 | p00017 | Accepted | import sys,string
A="abcdefghijklmnopqrstuvwxyza"
tbl=string.maketrans(A[:-1],A[1:])
for s in sys.stdin:
while not("the" in s or "that" in s or "this" in s):
s=s.translate(tbl)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s616290235 | p00017 | Accepted | import string, sys
alpha = 'abcdefghijklmnopqrstuvwxyza'
tbl = string.maketrans(alpha[:-1], alpha[1:])
for s in sys.stdin:
while not('the' in s or 'that' in s or 'this' in s):
s = s.translate(tbl)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s897193738 | p00017 | Accepted | import sys,string
A = 'abcdefghijklmnopqrstuvwxyza'
rot = string.maketrans(A[1:], A[:-1])
for line in sys.stdin:
line = line[:-1]
while 1:
if line.count("the") or line.count("this") or line.count("that"):
print line
break
line = line.translate(rot) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s935066119 | p00017 | Accepted | def decode(string, num):
a, z = ord('a'), ord('z')
return ''.join([chr(((ord(s) - a) + num) % 26 + a) if a <= ord(s) <= z else s for s in string])
while 1:
try:
line = raw_input()
for i in range(26):
tmp = decode(line, i)
for x in tmp.split():
x = x.strip('.')
if 'this' in x or 'the' in x or 'that' in x:
print tmp
break
except:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s637327223 | p00017 | Accepted | a = [['the'], ['this'], ['that']]
for i in range(25):
for b in a:
s = ''
for c in b[-1]:
s += chr((ord(c) - ord('a') + 1) % 26 + ord('a'))
b.append(s)
def f(s):
for b in a:
for i in range(26):
if s.find(b[i]) != -1:
t = ''
for c in s:
if c.isalpha():
t += chr((ord(c) - ord('a') - i + 26) % 26 + ord('a'))
else:
t += c
return t
return None
try:
while True:
print f(raw_input())
except:
pass | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s029217443 | p00017 | Accepted | import string, sys
alpha = 'abcdefghijklmnopqrstuvwxyza'
tbl = string.maketrans(alpha[:-1], alpha[1:])
for s in sys.stdin:
while not('the' in s or 'that' in s or 'this' in s):
s = s.translate(tbl)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s837024975 | p00017 | Accepted | a = 'abcdefghijklmnopqrstuvwxyz'
while True:
try:
s = input()
except:
break
for n in range(1, 27):
t = s.translate(str.maketrans(a, a[n:] + a[:n]))
if 'the' in t or 'this' in t or 'that' in t: break
print(t) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s975746586 | p00017 | Accepted | import sys
a = 'abcdefghijklmnopqrstuvwxyz'
for s in sys.stdin:
for n in range(1, 27):
t = s[:-1].translate(str.maketrans(a, a[n:] + a[:n]))
if 'the' in t or 'this' in t or 'that' in t: break
print(t) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s327240013 | p00017 | Accepted | while True :
try :
string = input()
except EOFError :
break
for i in range(26) :
new_string = []
for j in range(len(string)) :
if 97 <= ord(string[j]) <= 122 :
x = ord(string[j]) + i
if x > 122 :
x -= 26
new_string.append(chr(x))
else :
new_string.append(string[j])
new_string = ''.join(new_string)
if 'the' in new_string or 'this' in new_string or 'that' in new_string :
print(new_string)
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s646383138 | p00017 | Accepted | def rot(s, n):
anslet = ''
for let in s:
if let in alp:
anslet = anslet + chr(ord('a') + (ord(let) - ord('a') + n) % 26)
else:
anslet = anslet + let
return anslet
alp = 'abcdefghijklmnopqrstuvwxyz'
while True:
try:
letlst = input()
except:
break
for i in range(27):
word = rot(letlst, i)
if ('this' in word) or('that' in word) or ('the' in word):
num = i
letlst = rot(letlst, num)
print(letlst)
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s791284598 | p00017 | Accepted | def slide(c):
c = ord(c) + 1
if c > ord('z'):
c = ord('a')
return chr(c)
while 1:
try:
s = input()
ans = ""
while 1:
if "the" in s or "this" in s or "that" in s:
print(s)
break
for i in range(0,len(s)):
if ord(s[i]) >= ord('a') and ord(s[i]) <= ord('z'):
ans += slide(s[i])
else:
ans += s[i]
s = ans
ans = ""
except:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s274357987 | p00017 | Accepted | ca = ord('a')
def convert(s, d):
res = []
for c in s:
if c not in ' .':
c = chr(((ord(c) - ca + d) % 26) + ca)
res.append(c)
return "".join(res)
for line in open(0).readlines():
s = line.strip()
for d in range(26):
s0 = convert(s, d)
if "the" in s0 or "this" in s0 or "that" in s0:
print(s0)
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s095396366 | p00017 | Accepted |
def cipher(s, k):
l = list(s)
r = []
for i in l:
if i.islower():
i = chr((ord(i) - ord('a') + k)%26 + ord('a'))
r.append(i)
return "".join(r)
while True:
wordset = { "this", "that", "the" }
try:
s = input()
except EOFError:
break
for i in range(0,26):
t = cipher(s,i)
w = set(t.split())
if len(w & wordset ) > 0:
print(t)
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s467219555 | p00017 | Accepted | if __name__ == '__main__':
A = "abcdefghijklmnopqrstuvwxyz"
while True:
try:
line = input()
for d in range(1,27):
t = line.translate(str.maketrans(A,A[d:] + A[:d]))
if 'the' in t or 'this' in t or 'that' in t:
print(t)
break
except EOFError:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s882516830 | p00017 | Accepted | while True:
try:
strings=input()
for i in range(26):
_strings=""
for s in strings:
if ord('a')<=ord(s) and ord(s)<=ord('z'):
_strings+=chr((ord(s)-ord('a')+1)%26+ord('a'))
else:
_strings+=s
strings=_strings
if "the" in strings or "this" in strings or "that" in strings:
print(strings)
break
except EOFError:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s243604969 | p00017 | Accepted | letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
while True:
try:
s = input()
except:
break
l = len(s)
for i in range(26):
t = ""
for j in range(len(s)):
c = s[j]
if 'a' <= c and c <= 'z':
x = letters.index(c)
cc = letters[(x + i) % 26]
t += cc
else:
t += c
if ("the" in t) or ("this" in t) or ("that" in t):
print(t)
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s461399297 | p00017 | Accepted | while True:
try:
caesar = input()
except EOFError:
break
for i in range(26):
raw_letters = []
for j in range(len(caesar)):
if caesar[j] == " " or caesar[j] == ".":
raw_letters.append(caesar[j])
else:
letter = ord(caesar[j])+(i+1)
# 122 is ASCII 'z'
if letter > 122:
raw_letters.append(chr(letter-26))
else:
raw_letters.append(chr(letter))
raw_strings = "".join(raw_letters)
if ('the' in raw_strings) or ('this' in raw_strings) or ('that' in raw_strings):
print(raw_strings)
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s411567997 | p00017 | Accepted | import sys
def caesar(c, n):
cint = ord(c)
return chr((cint+n-97)%26+97)
keyword = ['the', 'this', 'that']
for line in sys.stdin:
slist = line.split()
indx = 1
while True:
decodelist = []
for i in range(0, len(slist)):
word = ''
for j in range(0, len(slist[i])):
if slist[i][j] == '.': word = word+'.'
else: word = word+caesar(slist[i][j], indx)
decodelist.append(word)
anotherlist = []
for i in range(0, len(decodelist)):
word = ''
for j in range(0, len(decodelist[i])):
if slist[i][j] == '.':
anotherlist.append(word)
word = ''
else: word = word + decodelist[i][j]
anotherlist.append(word)
flag = False
for i in range(0, 3):
if keyword[i] in decodelist or keyword[i] in anotherlist:
ans = decodelist[0]
for j in range(1, len(decodelist)):
ans = ans + ' ' + decodelist[j]
print ans
flag = True
break
if flag: break
indx += 1
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s776585216 | p00017 | Accepted | import sys
def get_shifted_char(shift_count, ch):
if ord(ch) >= ord('a') and ord(ch) <= ord('z'):
return chr(((ord(ch)-71-shift_count) %26 + 97))
else:
return ch
for enc_text in sys.stdin:
text_list = list(filter(lambda s:len(s)==3 or len(s)==4,enc_text.strip().split()))
shift_count = 1
while(shift_count < 27):
flg = False
for text in text_list:
decoded = ''.join(list(map(lambda c:get_shifted_char(shift_count,c),text)))
if decoded == "the" or decoded == "this" or decoded == "that":
flg = True
if flg:
break
shift_count += 1
print(''.join(list(map(lambda c:get_shifted_char(shift_count,c),enc_text.strip()))))
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s906926649 | p00017 | Accepted | import string
while(1):
try:
text = input()
words = text.split()
stop = 0
for i in range(26):
if stop == 1:
break
a = []
b = []
for j in words:
a.append("".join([chr((ord(k) + i - ord("a")) % 26 + ord("a")) if ord(k) >= ord("a") else k for k in j]))
b.append("".join([chr((ord(k) + i - ord("a")) % 26 + ord("a")) for k in j if ord(k) >= ord("a")]))
for j in b:
if j in ["this","that","the"]:
print(" ".join(a))
stop = 1
break
except EOFError:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s989491787 | p00017 | Accepted | import re
caesar_trans = str.maketrans("abcdefghijklmnopqrstuvwxyz", "zabcdefghijklmnopqrstuvwxy")
while True:
try:
i = input()
while True:
if re.search("(^| )(the|this|that)(\.| |$)", i) is not None:
print(i)
break
i = i.translate(caesar_trans)
except EOFError:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s499310748 | p00017 | Accepted | while(1):
try:
slist = list(map(str, input().split()))
except:
break
rot = 0
for i in range(26):
for s in slist:
ch = ""
for c in s:
if "a" <= c <= "z":
g = chr((ord(c) - ord("a") + i) % 26 + ord("a"))
else:
g = c
ch += g
if ch == "this" or ch == "that" or ch == "the":
rot = i
break
if rot != 0:
break
for i, s in enumerate(slist):
ch = ""
for c in s:
if "a" <= c <= "z":
g = chr((ord(c) - ord("a") + rot) % 26 + ord("a"))
else:
g = c
ch += g
if i == len(slist) - 1:
print(ch)
else:
print(ch + " ", end="")
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s071009027 | p00017 | Accepted | A = 'abcdefghijklmnopqrstuvwxyz'
while True:
try: s = input()
except: exit()
for x in range(1, 27):
ans = s[:-1].translate(str.maketrans(A, A[x:] + A[:x]))
if 'the' in ans or 'this' in ans or 'that' in ans:
print(ans + '.')
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s249138797 | p00017 | Accepted | import re
def code_shift(c, n_shift):
return ord('a') + (ord(c) + n_shift - ord('a')) % 26
def get_candidate_plain(cipher, sym_ids, n_shift):
plain = []
for i, c in enumerate(cipher):
if i not in sym_ids:
plain.append(chr(code_shift(c, n_shift)))
else:
plain.append(c)
plain = ''.join(plain)
return plain
def decrypt(cipher):
sym_ids = [m.start() for m in re.finditer(r'[\.\n\s]', cipher)]
keyword = ['the', 'this', 'that']
n_shift = 0
while True:
plain = get_candidate_plain(cipher, sym_ids, n_shift)
for k in keyword:
if plain.find(k) != -1:
return plain
n_shift += 1
if __name__ == '__main__':
while True:
try:
cipher = input()
print(decrypt(cipher))
except:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s872044700 | p00017 | Accepted | def rot_n(c, n):
if 'a' <= c and c <= 'z':
return chr((ord(c) - ord('a') + int(n)) % 26 + ord('a'))
if 'A' <= c and c <= 'Z':
return chr((ord(c) - ord('A') + int(n)) % 26 + ord('A'))
return c
def rot(s, n):
c = (rot_n(c, n) for c in s)
return "".join(c)
while(True):
try:
s = input()
for i in range(1,28):
d = rot(s,i)
if "this" in d.split() or "the" in d.split() or "that" in d.split():
print(d)
except:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s941903079 | p00017 | Accepted | import sys
idx2alpha = {idx:s for idx,s in enumerate('abcdefghijklmnopqrstuvwxyz .\n')}
alpha2idx = {s:idx for idx,s in enumerate('abcdefghijklmnopqrstuvwxyz .\n')}
def rotate(s):
idx = [next_w(alpha2idx.get(w)) for w in s]
new_s = [idx2alpha.get(i) for i in idx]
return ''.join(new_s)
def next_w(w_idx):
if 25 < w_idx:
return w_idx
w_idx += 1
return w_idx % 26
def decrypt(s):
for _ in range(26):
if 'the' in s or 'this' in s or 'that' in s:
return s
else:
s = rotate(s)
return 'Failed to decript!'
def run():
for line in sys.stdin:
print(decrypt(line.strip()))
if __name__ == '__main__':
run()
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s342031384 | p00017 | Accepted | # Caesar Cipher
s = input()
while 1:
for diff in range(0,26):
dec = []
for c in s:
chn = ord(c)
if 97 <= chn < 97+26:
chn -= 97 + diff
chn = (chn % 26) + 97
dec.append(chr(chn))
else: dec.append(c)
ss = ''.join(dec)
if 'the' in ss or 'that' in ss or 'this' in ss:
print(ss)
break
try: s = input()
except EOFError: break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s622383419 | p00017 | Runtime Error | b = raw_input()
import string
t = string.maketrans("abcdefghijklmnopqrstuvwxyz","bcdefghijklmnopqrstuvwxyza")
while not ('the' in s or 'this' in s or 'that' in s):
b = b.translate(t)
print b
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s954468403 | p00017 | Runtime Error | b = ""
try:
b += raw_input()
except:
break
import string
t = string.maketrans("abcdefghijklmnopqrstuvwxyz","bcdefghijklmnopqrstuvwxyza")
while not ('the' in b or 'this' in b or 'that' in b):
b = b.translate(t)
print b
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s906024923 | p00017 | Runtime Error | import sys
while True:
input = raw_input()
for i in range(0, 26):
str = ""
for c in input:
if c.isalpha():
c = chr(ord(c) + i)
if ord(c) > ord('z'):
c = chr(ord('a') - ord('z') + ord(c) - 1)
str += c
for word in ["this", "that", "the"]:
if (str.find(word) != -1):
print str
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s263577224 | p00017 | Runtime Error | d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+6) % 26 + c)
print "".join([d.get(c, c) for c in text]) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s409791231 | p00017 | Runtime Error | # -*- coding: utf-8 -*-
def convert_alphabets_to_numlist(word_string):
"wordを受け取り番号リストに変換する"
temp=[]
for char in word_string:
for num in range(26):
if char==string[num]:
temp.append(num)
return temp
def plus1_to_num_list(ls):
"数字化した各単語に1を足す"
for n in range(len(ls)):
if ls[n]!=25:
ls[n] +=1
elif ls[n]==25:
ls[n]=0
return ls
def decipher(word_nums):
"[19, 7, 4]などを受け取る"
temp=""
for k in word_nums:
temp += string[int(k)]
return temp
string = 'abcdefghijklmnopqrstuvwxyz'
hint=['the','this','that']
hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]]
while True:
cryp=raw_input().split()
for word in cryp:
word_nums= convert_alphabets_to_numlist(str(word))
n=0
while word_nums not in hint_num and n<26:
plus1_to_num_list(word_nums)
n+=1
# すべてをn回ずらす
temp = []
for word in cryp:
word_nums=convert_alphabets_to_numlist(str(word))
for k in range(n):
plus1_to_num_list(word_nums)
temp.append(decipher(word_nums))
if '.' not in cryp[-1]:
print " ".join(temp)
else:
temp[-1] += '.'
print " ".join(temp) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s692955023 | p00017 | Runtime Error | def convert_alphabets_to_numlist(word_string):
temp=[]
for char in word_string:
for num in range(26):
if char==string[num]:
temp.append(num)
return temp
def plus1_to_num_list(ls):
"plus 1 each item in ls"
for n in range(len(ls)):
if ls[n]!=25:
ls[n] +=1
elif ls[n]==25:
ls[n]=0
return ls
def decipher(word_nums):
"[19, 7, 4]"
temp=""
for k in word_nums:
temp += string[int(k)]
return temp
string = 'abcdefghijklmnopqrstuvwxyz'
hint=['the','this','that']
hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]]
while True:
cryp=raw_input().split()
for word in cryp:
word_nums= convert_alphabets_to_numlist(str(word))
n=0
while word_nums not in hint_num and n<26:
plus1_to_num_list(word_nums)
n+=1
temp = []
for word in cryp:
word_nums=convert_alphabets_to_numlist(str(word))
for k in range(n):
plus1_to_num_list(word_nums)
temp.append(decipher(word_nums))
if '.' not in cryp[-1]:
print " ".join(temp)
else:
temp[-1] += '.'
print " ".join(temp)
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s808962251 | p00017 | Runtime Error | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s951966289 | p00017 | Runtime Error | import sys
def this(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord('this'[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def that(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("that"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def the(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("the"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2]):
return t[0]
return 30
for string in sys.stdin:
for word in string.split(" "):
if(len(word)==3):
if the(word) < 30:
x=the(word)
break
if(len(word)==4):
if this(word) <30:
x=this(word)
break
if that(word) <30:
x=that(word)
break
alpha = 'abcdefghijklmnopqrstuvwx'
result=""
for c in string:
if c in alpha:
result+=alpha[alpha.find(c)-x]
else:
result+=c
print result | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s837410238 | p00017 | Runtime Error | import sys
def this(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord('this'[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def that(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("that"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def the(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("the"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2]):
return t[0]
return 30
for string in sys.stdin:
for word in string.split(" "):
if(len(word)==3):
if the(word) < 30:
x=the(word)
break
if(len(word)==4):
if this(word) <30:
x=this(word)
break
if that(word) <30:
x=that(word)
break
alpha = 'abcdefghijklmnopqrstuvwxyz'
result=""
for c in string:
if c in alpha:
result+=alpha[alpha.find(c)-x]
else:
result+=c
print result[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s745600514 | p00017 | Runtime Error | s=input()
for _ in range(26):
if "this " in s or "that " in s or "the " in s:
print(s)
break
s=list(s)
for i in range(len(s)):
if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"):
if s[i] != "a":
s[i] = chr(ord(s[i])-1)
else:
s[i] = "z"
s="".join(s) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s279652082 | p00017 | Runtime Error | s = raw_input()
li = s.split()
for i in li:
if len(i) == 4 or len(i) == 3:
a = ord(i[0]) - ord(i[1])
b = ord(i[1]) - ord(i[2])
c = ord(i[2]) - ord(i[3])
if a == 12 and b == -1 and c == -10:
n = ord(i[0]) - ord("t")
break
elif a == 12 and b == 3:
n = ord(i[0]) - ord("t")
break
elif a == 12 and b == 7 and c == -19:
n = ord(i[0]) - ord("t")
break
o = ""
for c in s:
if ord(c) >= 97 and ord(c) <= 122:
o += chr(ord(c) - n)
else:
o += c
print(o) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s609436857 | p00017 | Runtime Error | import sys
def check1():
for string in string_lis:
char0 = string[0]
if char0 < 't':
# +
length = (alpha.find('t')+1) - (alpha.find(char0)+1)
plus(string, length)
# -
length = (alpha.find(char0)+1) + 6
minus(string, length)
elif 't' < char0:
# +
length = 26 - (alpha.find(char0)+1) + 20
print alpha.find(char0)+1
new_str = plus(string, length)
check(new_str, length, '+')
# -
print(1)
length = (alpha.find(char0)+1) - 20
new_str = minus(string, length)
print new_str
check(new_str, length, '-')
def plus(string, length):
new_str = ''
for char in string:
index = alpha.find(char) + length
if index <= 25:
new_str += alpha[index]
else:
index = index - 26
new_str += alpha[index]
return new_str
def minus(string, length):
new_str = ''
for char in string:
index = alpha.find(char) - length
if index >= 0:
new_str += alpha[index]
else:
index = 25 + index + 1
new_str += alpha[index]
return new_str
def check(new_str, length, flag):
result_lis = []
print new_str
if new_str == 'the' or new_str == 'this' or new_str == 'that':
print 1
if flag == '+':
for string in string_lis:
result_lis.append(plus(string, length))
elif flag == '-':
for string in string_lis:
result_lis.append(minus(string, length))
print ' '.join(result_lis)
sys.exit()
if __name__ == '__main__':
for input_line in sys.stdin:
input_line = raw_input()
input_line = input_line.rstrip('.\n')
print input_line
alpha = 'abcdefghijklmnopqrstuvwxyz'
string_lis = input_line.split()
print string_lis
check1() | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s607514218 | p00017 | Runtime Error | strs='abcdefghijklmnopqrstuvwxyz' #use a string like this, instead of ord()
def shifttext(shift):
inp=input('')
data=[]
for i in inp: #iterate over the text not some list
if i.strip() and i in strs: # if the char is not a space ""
data.append(strs[(strs.index(i) + shift) % 26])
else:
data.append(i) #if space the simply append it to data
output = ''.join(data)
return output
print(shifttext(int(input()))) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s765895237 | p00017 | Runtime Error | import string
import sys
def check_exists(word_set, rotate_dict, search):
for word in word_set:
rotated_word = ''.join(rotate_dict[s] for s in word)
if rotated_word == search:
return True
return False
for line in sys.stdin:
s0 = line.strip()
alphabets = string.ascii_lowercase
frequency = [t[1] for t in sorted([(s0.count(s), ord(s)) for s in alphabets], reverse=True)]
freq_chr_offset = (4, 0, 19, 8, 14)
ss = s0.strip('.').split()
sl3, sl4 = set(s for s in ss if len(s) == 3), set(s for s in ss if len(s) == 4)
i, rotate_dict = 0, None
for order in frequency:
for offset in freq_chr_offset:
i = 97 + offset - order
rotate_dict = {a: b for a, b in zip(alphabets, alphabets[i:] + alphabets[:i])}
if (check_exists(sl3, rotate_dict, 'the')
+ check_exists(sl4, rotate_dict, 'this')
+ check_exists(sl4, rotate_dict, 'that')) > 0:
break
else:
continue
break
print(''.join(rotate_dict[s] if s.isalpha() else s for s in s0)) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s911026622 | p00017 | Runtime Error | while True:
try:
b = input()
except:
break
if 'the' in c or 'this' in c or 'that' in b:
print(c)
for i in range(1,26):
c = ''
for j in b:
if(j == 'z'):
c += ('a')
elif(str.isalpha(j) == 1):
c += (chr(ord(j) + 1))
else:
c += j
if 'the' in c or 'this' in c or 'that' in c:
print(c)
break
b = c | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s764512079 | p00017 | Runtime Error | def ascii_char(c):
if c<97:
c+=26
elif c>122:
c-=26
return c#type int
def judge_the(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('e')-ord(word[2])==length:
return True
else:
return False
def judge_this(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('i')-ord(word[2])==ord('s')-ord(word[3])==length:
return True
else:
return False
def judge_that(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('a')-ord(word[2])==ord('t')-ord(word[3])==length:
return True
else:
return False
def change(string,l):
string1=""
for i in range(len(string)):
C=ord(string[i])+l
if C<97:
C+=26
elif C>122:
C-=26
string1+=chr(C) if string[i]!='.'
return string1
while True:
try:
A=list(map(str,input().split()))
l=int()
for i in A:
if len(i)==3:
if judge_the(i):
l=ord('e')-ord(i[2])
break
elif len(i)==4:
if judge_this(i):
l=ord('i')-ord(i[2])
break
elif judge_that(i):
l=ord('a')-ord(i[2])
break
else:
break#while?????????
Ans=[""]*len(A)
for i in range(len(A)):
Ans[i]=change(A[i],l)
print(" ".join(Ans))
except EOFError:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s897166106 | p00017 | Runtime Error | def judge_the(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('e')-ord(word[2])==length:
return True
else:
return False
def judge_this(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('i')-ord(word[2])==ord('s')-ord(word[3])==length:
return True
else:
return False
def judge_that(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('a')-ord(word[2])==ord('t')-ord(word[3])==length:
return True
else:
return False
def change(string,l):
string1=""
for i in range(len(string)):
C=ord(string[i])+l
if C<97:
C+=26
elif C>122:
C-=26
string1+=chr(C) if string[i]!='.'
return string1
while True:
try:
A=list(map(str,input().split()))
l=int()
for i in A:
if len(i)==3:
if judge_the(i):
l=ord('e')-ord(i[2])
break
elif len(i)==4:
if judge_this(i):
l=ord('i')-ord(i[2])
break
elif judge_that(i):
l=ord('a')-ord(i[2])
break
else:
break#while?????????
Ans=[""]*len(A)
for i in range(len(A)):
Ans[i]=change(A[i],l)
print(" ".join(Ans))
except EOFError:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s603013779 | p00017 | Runtime Error | #encoding=utf-8
def inp(i):
split_word = i.split()
return split_word
def rot(split_word):
for i in xrange(len(split_word)):
tako = ""
if len(split_word[i]) == 4 or len(split_word[i]) == 3:
num = ord(split_word[i][0]) - ord("t")
for j in xrange(len(split_word[i])):
tako += chr(ord(split_word[i][j]) - num)
if tako == "that" or tako == "the" or tako == "this":
return proce(split_word, num)
else:
pass
num = 0
def proce(split_word, num):
ans = ""
for i in xrange(len(split_word)):
for j in xrange(len(split_word[i])):
if split_word[i][j] < ord("a") or ord("z") < split_word[i][j]:
ans += split_word[i][j]
else:
ans += str(chr(ord(split_word[i][j]) - num))
ans += " "
return ans
if __name__ == "__main__":
import sys
for i in sys.stdin:
word = inp(i)
ans = rot(word)
print ans[0:(len(ans) - 1)] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s151511559 | p00017 | Runtime Error | while 1:
try:
n=float('inf')
s=raw_input().strip('.').split()
for i in xrange(26):
for j in s:
r=[]
for k in j:
if ord(k)+i<123:
r.append(chr(ord(k)+i))
else:
r.append(chr(97+ord(k)+i-123))
if "".join(r)=="this" or "".join(r)=="that" or "".join(r)=="the":
n=i
if n!=float('inf'):
break
ans=[]
for i in s:
splitans=[]
for j in i:
if ord(j)+n<123:
splitans.append(chr(ord(j)+n))
else:
splitans.append(chr(97+ord(j)+n-122))
ans.append(''.join(splitans))
print(' '.join(ans)+'.') | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s138749093 | p00017 | Runtime Error | #!/usr/bin/env python2
# coding: utf-8
def casar(s, n):
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+n) % 26 + c)
return "".join([d.get(c, c) for c in s])
try:
while True:
encrypttxt = raw_input()
for i in range(26):
t = casar(encrypttxt, i)
if "the" in t or "this" in t or "that" in t:
print t
except EOFError:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s871753823 | p00017 | Runtime Error | import sys
def restore(n,text):
text_list=list(text)
for i,j in enumerate(text_list):
if ord(j)!=46 and ord(j)!=32:
nw=ord(j)-n
if nw<97:
nw=ord(j)-n+26
text_list[i]=chr(nw)
for i in text_list:
print(i,end='')
print('\n')
def textsa(str):
str_list=list(str)
n=len(str_list)
sa=[]
for i in range(n-1):
sa.append((ord(str_list[i+1])-ord(str_list[i]))%26)
sa.append((ord(str_list[0])-ord(str_list[n-1]))%26)
return sa
for text in sys.stdin:
str=list(map(str,text.split()))
for i in str:
if textsa(i)==[14,1,10,1] or textsa(i)==[14,19,19,0]:
n=ord(list(i)[0])-ord('t')
if textsa(i)==[14,23,15]:
n=ord(list(i)[0])-ord('t')
restore(n,text) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s193698065 | p00017 | Runtime Error | import string
import sys
example = string.ascii_lowercase
def make(x, y, z, a, b, c = True) :
if x - a < 0 : y = 26 + (x - a)
else : y = x - a
if x - b < 0 : z = 26 + (z - b)
else : z = x - b
if c != True :
if x - c < 0 : n = 26 + (x - c)
else : n = x - c
if c != 0 : return (example[x] + example[y] + example[z])
else : return (example[x] + example[y] + example[z])
def solve(temp, number) :
new_temp = []
if number > 19 : number = number - 19
else : number = 19 - number
for _ in temp :
if _ == ' ' or _ == '.' : new_temp.append(_)
elif _ - number < 0 : new_temp.append(26 + (_ - number))
else : new_temp.append(_ - number)
temp = ''
for _ in new_temp :
if _ == ' ' or _ == '.' : temp += _
else : temp += example[_]
return temp
for input_string in sys.stdin :
test = input_string
temp = []
for _ in test :
if _ == ' ' or _ == '.' : temp.append(_)
else : temp.append(example.index(_))
check = 0
the = []
for _ in range(26) : the.append(make(_, _, _, 12, 15))
for number, _ in enumerate(the) :
if _ in test :
print(solve(temp, number))
check = 1
if check == 1 :
this = []
for _ in range(26) : this.append(make(_, _, _, 12, 13, 24))
for number, _ in enumerate(this) :
if _ in test :
print(solve(temp, number))
check = 1
if check == 1 :
that = []
for _ in range(26) : this.append(make(_, _, _, 12, 13, 24))
for number, _ in enumerate(this) :
if _ in test : print(solve(temp, number)) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s554837937 | p00017 | Runtime Error | def main():
ex =[ord(".")]
answer = ""
while True:
try:
words = input().split()
except:
break
bl = False
for i in range(1,26):
ans = ""
for word in words:
s = ""
for string in word:
os = ord(string)
if os in ex:
s = s + string
else:
if os - i < 97:
s += chr(122 - (97 - (os - i)))
else:
s += chr(os - i)
if s in ("the", "this", "that", "the.", "this.", "that."):
bl = True
ans += " " + s
if bl:
break
answer.append(ans[1::])
print(*answer, sep="\n")
if __name__ == "__main__":
main() | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s463886041 | p00017 | Runtime Error | def ascii2num(ascii):
return ord(ascii) - 96
def num2ascii(num):
return chr(num + 96)
def slide(word,num):
return ''.join([num2ascii((ascii2num(ascii) + num) % 26) if ascii != '.' else '.' for ascii in word])
def includekeyword(words):
for word in words:
if word in keywords:
return True
return False
keywords = ['the', 'this', 'that']
decode = []
for row in stdin:
words = row.split()
for num in range(1,27):
tmp = [slide(word,num) for word in words]
if includekeyword(tmp):
decode = tmp
print(' '.join(decode)) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s749205516 | p00017 | Runtime Error | import string
d = {c:ord(c)-97 for c in string.ascii_lowercase}
b = {v:k for k, v in d.items()}
while True:
try:
s = input()
except:
break
t = 0
for token in list(filter(lambda x: len(x) in [3, 4], s[:-1].split())):
t = d[token[0]]%26-19
word = ''.join([b[d[c]%26-t] for c in token])
if word in ['the', 'that', 'this']:
break
ans = [' ' if c == ' ' else b[d[c]%26-t] for c in s[:-1]]+['.']
print(''.join(ans)) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s559276375 | p00017 | Runtime Error |
import string
def CaesarCipher():
low=str.ascii_lowercase
for cry in sys.stdin:
for i in range(1,27):
dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
if 'this' in dec or 'that' in dec or 'the' in dec:
print(dec)
CaesarCipher() | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s923341033 | p00017 | Runtime Error |
import string
def CaesarCipher():
low=string.ascii_lowercase
for cry in sys.stdin:
for i in range(1,27):
dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
if 'this' in dec or 'that' in dec or 'the' in dec:
print(dec)
CaesarCipher() | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s440369861 | p00017 | Runtime Error | # coding: utf-8
def contain_the(char):
for i in range(len(char)):
try:
if char[i] == 't' and char[i+1] == 'h' and (char[i+2] == 'e' or (char[i+2] == 'i' and char[i+3] == 's') or (char[i+2] == 'a' and char[i+3] == 't')):
return 1
except IndexError:
return 0
while True:
try:
data = raw_input()
delta = 1
while True:
char = ""
for i in range(len(data)):
if data[i] != '.' and data[i] != ' ':
char += chr(ord(data[i]) - delta)
else:
char += data[i]
if (contain_the(char) == 1):
print(char)
break
else:
delta += 1
except EOFError:
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s926758746 | p00017 | Runtime Error | # coding: utf-8
def contain_the(char):
for i in range(len(char)):
try:
if char[i] == 't' and char[i+1] == 'h' and (char[i+2] == 'e' or (char[i+2] == 'i' and char[i+3] == 's') or (char[i+2] == 'a' and char[i+3] == 't')):
return 1
except IndexError:
return 0
while True:
try:
data = raw_input()
delta = 1
while True:
char = ""
for i in range(len(data)):
if data[i] != '.' and data[i] != ' ':
char += chr(ord(data[i]) - delta)
else:
char += data[i]
if (contain_the(char) == 1):
print(char)
break
else:
delta += 1
print("*")
except EOFError: #なぜかEOFErrorにならない
print("**")
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s308295619 | p00017 | Runtime Error | # coding: utf-8
def contain_the(char):
for i in range(len(char)):
try:
if char[i] == 't' and char[i+1] == 'h' and (char[i+2] == 'e' or (char[i+2] == 'i' and char[i+3] == 's') or (char[i+2] == 'a' and char[i+3] == 't')):
return 1
except IndexError:
return 0
while True:
try:
data = raw_input()
delta = 1
while True:
char = ""
for i in range(len(data)):
if data[i] != '.' and data[i] != ' ':
char += chr(ord(data[i]) - delta)
else:
char += data[i]
if (contain_the(char) == 1):
print(char)
break
else:
delta += 1
print("*")
except EOFError:
print("**")
break
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s544321620 | p00017 | Runtime Error | import sys
def l(s,n):
o=ord(s)+n
if not 97<=ord(s)<=122:
return s
if 97<=o<=122:
return chr(o)
elif o>123:
return chr(o-26)
for t in sys.stdin:
s=t[:-1]
for i in range(1,26):
e=lambda s:l(s,i)
if "".join(map(e,"this")) in s:
break
if "".join(map(e,"that")) in s:
break
if "".join(map(e,"the")) in s:
break
print("".join(map(lambda x:l(x,-i),s)))
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s349633138 | p00017 | Runtime Error | import sys
def l(s,n):
o=ord(s)+n
if not 97<=ord(s)<=122:
return s
if 97<=o<=122:
return chr(o)
elif o>123:
return chr(o-26)
for t in sys.stdin:
s=t[:-1]
for i in range(1,26):
e=lambda s:l(s,i)
if "".join(map(e,"this")) in s:
break
if "".join(map(e,"that")) in s:
break
if "".join(map(e,"the")) in s:
break
print("".join(map(lambda x:l(x,-i),s)))
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s165872654 | p00017 | Runtime Error | import sys
def l(s,n):
o=ord(s.lower())
if not 97<=o<=122:
return s
if 97<=o+n<=122:
if 97<=ord(s)<=122:
return chr(o+n)
else:
return chr(o+n).upper()
elif o+n>122:
if 97<=ord(s)<=122:
return chr(o+n-26)
else:
return chr(o+n-26).upper()
for t in sys.stdin:
s=t[:-1]
for i in range(0,26):
cv=lambda y:"".join(map(lambda x:l(x,i),y))
if cv("this") in s or cv("that") in s or cv("the") in s:
break
print("".join(map(lambda x:l(x,-i),s)))
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s435615000 | p00017 | Runtime Error | import sys
def l(s,n):
o=ord(s.lower())
if not 97<=o<=122:
return s
if 97<=o+n<=122:
if 97<=ord(s)<=122:
return chr(o+n)
else:
return chr(o+n).upper()
elif o+n>122:
if 97<=ord(s)<=122:
return chr(o+n-26)
else:
return chr(o+n-26).upper()
for t in sys.stdin:
s=t[:-1]
u=s.lower()
for i in range(0,26):
cv=lambda y:"".join(map(lambda x:l(x,i),y))
if cv("this") in u or cv("that") in u or cv("the") in u:
break
print("".join(map(lambda x:l(x,-i),s)))
| xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s159319607 | p00017 | Runtime Error | alpha = 'abcdefghijklmnopqrstuvwxyz'
alp_num = dict(zip(alpha,range(26)))
num_alp = dict(zip(range(26),alpha))
alp_num[' ']=' ' ; num_alp[' ']=' ' ; alp_num['.']='.' ; num_alp['.']='.'
while True:
cipher = raw_input()
if len(cipher) != 0:
numcipher = [alp_num[val] for val in cipher]
while True:
cipher = ''
for val in numcipher: cipher += str(num_alp[val])
if 'the'in cipher or 'this'in cipher or 'that'in cipher:
print cipher; break
else:
numcipher2 = []
for val in numcipher:
if val == ' ': numcipher2.append(' ')
elif val == '.': numcipher2.append('.')
elif val == 25: numcipher2.append(0)
else: numcipher2.append(val+1)
numcipher = numcipher2
continue
else: break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s045321410 | p00017 | Runtime Error | a = raw_input().split()
b = [i for i in a if len(i)==3 or len(i)==4]
c = [i for i in b if ord(i[0])-ord(i[1]) == 12]
s = [ord('t')-ord(c[0][0]),1] if c[0][0]<'t' else [ord(c[0][0])-ord('t'),0]
q=''
for g,i in enumerate(a):
if g==0:pass
else: q+=' '
for j in i:
if j=='.':
q+='.'
elif s[1] == 0:
q+=chr(ord(j)-s[0])
elif s[0] == 1:
q+=chr(ord(j)+s[0])
print q | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s462365640 | p00017 | Runtime Error | while True:
try:
a = raw_input().split()
b = [i for i in a if len(i)==3 or len(i)==4]
c = [i for i in b if ord(i[0])-ord(i[1]) == 12]
s = [ord('t')-ord(c[0][0]),1] if c[0][0]<'t' else [ord(c[0][0])-ord('t'),0]
q=''
for g,i in enumerate(a):
if g==0:pass
else: q+=' '
for j in i:
if j=='.':
q+='.'
elif s[1] == 0:
q+=chr(ord(j)-s[0])
elif s[0] == 1:
q+=chr(ord(j)+s[0])
print q
except EOFError:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s770098368 | p00017 | Runtime Error | dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input()
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s241939522 | p00017 | Runtime Error | # coding: utf-8
#Q003 Largest prime factor
#import math#,sys,time
#import numpy as np
#start_time = time.clock()
dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input()
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x)
#print time.clock() - start_time, "seconds" | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s920145498 | p00017 | Runtime Error | dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input().strip('\n')
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s570921546 | p00017 | Runtime Error | import sys
dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input().strip('\n')
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s675387003 | p00017 | Runtime Error | def rot(s):
x=""
for c in s:
tmp = ord(c)-ord("a")
if "a"<=c<="z":
x += chr((tmp+1) % 26 + ord("a"))
else:
x += c
return x
def check(s):
for word in s.split():
if word=="the" or word=="this" or word=="that":
return True
else return False
while True:
try:
s = raw_input()
f = False
for i in range(26):
if check(s):break
else: s=rot(s)
print s
except:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s649149642 | p00017 | Runtime Error | b = ["the", "this", "that"]
while 1:
try:
a = raw_input()
except IndexError:
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
print a
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s540203941 | p00017 | Runtime Error | b = ["the", "this", "that"]
while 1:
try:
a = raw_input()
except IndexError:
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s534857213 | p00017 | Runtime Error | b = ["the", "this", "that"]
while 1:
a = raw_input()
if a == "":
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s132414253 | p00017 | Runtime Error | alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while True:
try:
sent = ""
word = map(str, raw_input().split())
for i in range(len(word))
for j in range(len(word[i])
for al in alpha:
if al == word[i]:
word[i] = al
sent += word + " "
sent = sent(:lent(sent)-1)
print sent
except:
break | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s794248160 | p00017 | Runtime Error | import sys
def rot(s):
A="abcdefghijklmnopqrstuvwxyza"
x=""
for c in s:
try:x+=A[A.index(c)+1]
except:x+=c
return x
w=["the","that","this"]
for l in sys.stdin.readlines():
c=0
f=1
while f:
for i in range(3):
if w[i] in s:
f=0
break
else:w[i]=rot(w[i])
else:c+=1
while c-26:
s=rot(s)
c+=1
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s772567795 | p00017 | Runtime Error | import sys
def decode(s):
x=""
for c in s:
if c in " .":
x+=c
else:
x+=chr(ord(c)+1)
return x.replace(chr(ord("z")+1),"a")
for s in sys.stdin.readlines():
for i in xrange(ord("z")-ord("a")+1):
if "the" in s or "that" in s or "this" in s:
print s[:-1]
break
s=decode(s) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s436506531 | p00017 | Runtime Error | import sys
A="abcdefghijklmnopqrstuvwxyza"
def decode(s):
x=""
for c in s:
if c in " .": x+=c
else: x+=A[A.index(c)+1)
return x
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=decode(s)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s345693217 | p00017 | Runtime Error | import sys
A="abcdefghijklmnopqrstuvwxyza"
def decode(s):
x=""
for c in s:
if c in " .": x+=c
else: x+=A[A.index(c)+1]
return x
for s in sys.stdin.readlines():
for i in range(26):
if "the" in s or "that" in s or "this" in s:break
s=decode(s)
print s[:-1] | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s630811059 | p00017 | Runtime Error | alpha = list('abcdefghijklmnopqrstuvwxyz') * 2
def create_caesar(word, num):
new_word = ""
for s in word:
new_word += alpha[alpha.index(s) + num]
return new_word
check_the = [create_caesar('the', i) for i in range(26)]
check_this = [create_caesar('this', i) for i in range(26)]
check_that = [create_caesar('that', i) for i in range(26)]
set_the = set(check_the)
set_this = set(check_this)
set_that = set(check_that)
while True:
sentence = raw_input().split()
sentence[-1] = sentence[-1].replace('.', '')
ans = []
set_sentence = set(sentence)
if len(set_sentence & set_the)!= 0:
num = check_the.index(list(set_sentence & set_the)[0])
elif len(set_sentence & set_this)!= 0:
num = check_this.index(list(set_sentence & set_this)[0])
elif len(set_sentence & set_that)!= 0:
num = check_that.index(list(set_sentence & set_that)[0])
for s in sentence:
ans.append(create_caesar(s, -num))
print " ".join(ans) + "." | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s306304841 | p00017 | Runtime Error | alpha = list('abcdefghijklmnopqrstuvwxyz') * 2
def create_caesar(word, num):
new_word = ""
if num < 0: num = 26 + num
for s in word:
new_word += alpha[alpha.index(s) + num]
return new_word
check_the = [create_caesar('the', i) for i in range(26)]
check_this = [create_caesar('this', i) for i in range(26)]
check_that = [create_caesar('that', i) for i in range(26)]
set_the = set(check_the)
set_this = set(check_this)
set_that = set(check_that)
while True:
sentence = raw_input().split()
sentence[-1] = sentence[-1].replace('.', '')
ans = []
set_sentence = set(sentence)
if len(set_sentence & set_the)!= 0:
num = check_the.index(list(set_sentence & set_the)[0])
tmp = check_the[num]
elif len(set_sentence & set_this)!= 0:
num = check_this.index(list(set_sentence & set_this)[0])
elif len(set_sentence & set_that)!= 0:
num = check_that.index(list(set_sentence & set_that)[0])
for s in sentence:
ans.append(create_caesar(s, -num))
print " ".join(ans) + "." | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s000114250 | p00017 | Runtime Error | import string, sys
rot1 = string.maketrans("abcdefghijklmnopqrstuvwxyz. ",\
"bcdefghijklmnopqrstuvwxyza. ")
for line in sys.stdin
while 1:
if line.count("the") or line.count("this") or line.count("that"):
print line
break
line = text.translate(rot1) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
s987727695 | p00017 | Runtime Error | import sys,string
rot1 = string.maketrans("abcdefghijklmnopqrstuvwxyz. ",\
"bcdefghijklmnopqrstuvwxyza. ")
for line in sys.stdin:
while 1:
if line.count("the") or line.count("this") or line.count("that"):
print line
break
line = text.translate(rot1) | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
| this is the picture that i took in the trip.
|
<H1>Caesar Cipher</H1>
<p>
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
<pre>
this is a pen
</pre>
<p>
is would become:
</p>
<pre>
uijt jt b qfo
</pre>
<p>
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
</p>
<H2>Input</H2>
<p>
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
</p>
<p>
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
</p>
<p>
The number of datasets is less than or equal to 20.
</p>
<H2>Output</H2>
<p>
Print decoded texts in a line.
</p>
<H2>Sample Input</H2>
<pre>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
</pre>
<H2>Output for the Sample Input</H2>
<pre>
this is the picture that i took in the trip.
</pre>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.