submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s877431615
p00017
Wrong Answer
# Aizu Problem 0017: Caesar Cipher # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") def caesar_decrypt(N, cipher): text = "" for char in cipher: if 'a' <= char <= 'z': k = (ord(char) - 97 - N) % 26 text += chr(97 + k) else: text += char return text cipher = input() for k in range(26): decrypted = caesar_decrypt(k, cipher) if "this" in decrypted and "the" in decrypted and "that" in decrypted: print(decrypted) 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>
s373865740
p00017
Wrong Answer
# Aizu Problem 0017: Caesar Cipher # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") def caesar_decrypt(N, cipher): text = "" for char in cipher: if 'a' <= char <= 'z': k = (ord(char) - 97 - N) % 26 text += chr(97 + k) else: text += char return text cipher = input() for k in range(26): decrypted = caesar_decrypt(k, cipher) if "this" in decrypted or "the" in decrypted or "that" in decrypted: print(decrypted) 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>
s372036253
p00017
Wrong Answer
s = list(input()) while True: for i, c in enumerate(s): char_code = ord(c) if 97 <= char_code <= 122: char_code = char_code+1 if char_code < 122 else 97 s[i] = chr(char_code) _s = "".join(s) if "this" in _s or "the" in _s or "that" in _s: print(_s) exit()
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>
s923760543
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'): y[j]=x[j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: break; else: i=i+s+1 else: i=i+s+1 print(dif1) for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],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>
s120941730
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'): y[j]=x[j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') or ord(y[2])-dif1==ord('i'): break else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],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>
s671378225
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'): y[j]=x[j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+s+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],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>
s657091907
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'): y[j]=x[j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+s+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],end="") print("\n")
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>
s326795624
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'): y[j]=x[j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+s+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)-1): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],end="") print(x[len(x)-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>
s620128416
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'): y[j]=x[j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+s+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],end="") print(" ",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>
s587051788
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[i+j]!=' ')and (x[i+j]!='.')and (x[i+j]!='\n'): y[j]=x[i+j] s=j else: s=j break if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+s+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],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>
s654320123
p00017
Wrong Answer
x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[i+j]!=' ')and (x[i+j]!='.')and (x[i+j]!='\n'): y[j]=x[i+j] else: s=j break k=i while(1): if s != 0: break else: if (x[i]==' ') or (x[i]=='.')or (x[i]=='\n'): k=i-k break i=i+1 if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+k+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+k+1 else: i=i+k+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],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>
s825134436
p00017
Wrong Answer
while 1: try: x=[i for i in input()] i=0 y=[0 for i in range(4)] dif1=0 while(i<len(x)-1): s=0 for j in range(4): if (x[i+j]!=' ')and (x[i+j]!='.')and (x[i+j]!='\n'): y[j]=x[i+j] else: s=j break k=i while(1): if s != 0: break else: if (x[i]==' ') or (x[i]=='.')or (x[i]=='\n'): k=i-k break i=i+1 if s==3 or s==2: dif1=ord(y[0])-ord('t') dif2=ord(y[1])-ord('h') if dif1==dif2: if s==2 and ord(y[2])-dif1==ord('e'): break else: if ord(y[2])-dif1==ord('a') : if y[0]==y[3]: break else: i=i+k+1 elif ord(y[2])-dif1==ord('i'): if ord(y[3])-dif1==ord('s'): break else: i=i+k+1 else: i=i+k+1 else: i=i+s+1 else: i=i+s+1 for i in range(len(x)): if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'): print(chr(int(ord(x[i]))-dif1),end="") else: print(x[i],end="") 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>
s155966580
p00017
Wrong Answer
x = [i for i in input()] s=0 while(s<len(x)): k=s while(x[k]!='.' and x[k]!='\n'): k=k+1 k=k+1 n=[ i for i in range(k-s)] p=122-ord(x[s]) m=ord(x[s])-97 flag=0 for i in range(p+1): for j in range(s,k): if x[j]==' ' or x[j]=='.': n[j-s]=x[j] else: n[j-s]=chr(ord(x[j])+i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : flag=1 print(moji,end="") if flag==0: for i in range(m+1): for j in range(s,k-1): if x[j]==' ' or x[j]=='.': n[j-s]=x[j] else: n[j-s]=chr(ord(x[j])-i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : print(moji,end="") s=s+k print("")
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>
s123925275
p00017
Wrong Answer
x = [i for i in input()] s=0 while(s<len(x)): k=s while(x[k]!='.' and x[k]!='\n'): k=k+1 k=k+1 n=[ i for i in range(k-s)] p=122-ord(x[s]) m=ord(x[s])-97 flag=0 for i in range(p+1): for j in range(s,k): if x[j]==' ' or x[j]=='.': n[j-s]=x[j] else: n[j-s]=chr(ord(x[j])+i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : flag=1 print(moji,end="") if flag==0: for i in range(m+1): for j in range(s,k): if x[j]==' ' or x[j]=='.': n[j-s]=x[j] else: n[j-s]=chr(ord(x[j])-i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : print(moji,end="") s=k print("")
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>
s741140814
p00017
Wrong Answer
while(1): try: x = [i for i in input()] s=0 while(s<len(x)): k=s while(x[k]!='.' and x[k]!='\n'): k=k+1 k=k+1 n=[ i for i in range(k-s)] p=122-ord(x[s]) m=ord(x[s])-97 flag=0 for i in range(p+1): for j in range(s,k): if x[j]==' ' or x[j]=='.': n[j-s]=x[j] else: n[j-s]=chr(ord(x[j])+i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : flag=1 print(moji,end="") if flag==0: for i in range(m+1): for j in range(s,k): if x[j]==' ' or x[j]=='.': n[j-s]=x[j] else: n[j-s]=chr(ord(x[j])-i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : print(moji,end="") s=k print("") 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>
s021001819
p00017
Wrong Answer
while(1): try: x = [i for i in input()] n=[ i for i in range(len(x))] p=ord('z')-ord(x[0]) m=ord(x[0])-ord('a') flag=0 for i in range(p+1): for j in range(len(x)): if x[j]==' ' or x[j]=='.' or x[j]=='\n': n[j]=x[j] else: n[j]=chr(ord(x[j])+i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : flag=1 print(moji,end="") if flag==0: for i in range(1,m+1): for j in range(len(x)): if x[j]==' ' or x[j]=='.': n[j]=x[j] else: n[j]=chr(ord(x[j])-i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : print(moji,end="") print("") 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>
s841446237
p00017
Wrong Answer
while(True): try: x = [i for i in input()] n=[ i for i in range(len(x))] p=ord('z')-ord(x[0]) m=ord(x[0])-ord('a') flag=0 for i in range(p+1): for j in range(len(x)): if x[j]==' ' or x[j]=='.' or x[j]=='\n': n[j]=x[j] else: n[j]=chr(ord(x[j])+i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : flag=1 print(moji,end="") if flag==0: for i in range(1,m+1): for j in range(len(x)): if x[j]==' ' or x[j]=='.': n[j]=x[j] else: n[j]=chr(ord(x[j])-i) moji='' for mk in n: moji += mk if moji.find('that')!=-1 or moji.find('this')!=-1 or moji.find('the')!=-1 : print(moji,end="") print("") 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>
s332938224
p00017
Wrong Answer
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])) print(t) 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>
s142760999
p00017
Wrong Answer
s = input() alphabet = 'abcdefghijklmnopqrstuvwxyz' for i in range(26): decoded_s = '' for j in range(len(s)): if s[j] not in alphabet: decoded_s += s[j] continue decoded_s += alphabet[alphabet.index(s[j]) - i] if 'the' in decoded_s or 'this' in decoded_s or 'that' in decoded_s: break print(decoded_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>
s906336207
p00017
Wrong Answer
s = input() for i in range(26): ans = "" for j in range(len(s)): ch = s[j] if "a" <= ch <= "z": ans += chr((ord(ch) - ord("a") + i)%26 + ord("a")) else: ans += ch if "this" in ans or "that" in ans or"the" in ans: break print(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>
s653295617
p00017
Wrong Answer
s = input() for i in range(1,27): ans = "" for j in range(len(s)): ch = s[j] if "a" <= ch <= "z": ans += chr((ord(ch) - ord("a") + i)%26 + ord("a")) else: ans += ch if "this" in ans or "that" in ans or"the" in ans: break print(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>
s075505964
p00017
Wrong Answer
s = input() for i in range(27): ans = "" for j in range(len(s)): ch = s[j] if "a" <= ch <= "z": ans += chr((ord(ch) - ord("a") + i)%26 + ord("a")) else: ans += ch if "this" in ans or "that" in ans or"the" in ans: break print(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>
s442342798
p00017
Wrong Answer
s = input() for i in range(27): ans = "" for j in range(len(s)): ch = s[j] if "a" <= ch <= "z": ans += chr((ord(ch) - ord("a") + i)%26 + ord("a")) else: ans += ch if "this" in ans or "that" in ans or"the" 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>
s123051557
p00017
Wrong Answer
import string strings = string.ascii_lowercase clues = [(19, 7, 8, 18), (19, 7, 0, 19), (19, 7, 4)] while True: try: data = input() except: break for word in data.split(): if len(word) == 4 or 3: dif = 19 - (ord(word[0]) - 97) enc = ["" for _ in range(26)] for k, v in zip([i for i in range(dif, dif+26)], strings): enc[k%26] = v candidate = tuple(enc.index(c) for c in word) try: clues.index(candidate) except: continue break ans = "" for c in data: try: ans += strings[enc.index(c)] except: ans += " " print(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>
s973047810
p00017
Wrong Answer
a='abcdefghijklmnopqrstuvwxy' b=input() for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the'in c,'this'in c,'that'in c)):print(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>
s904245103
p00017
Wrong Answer
a='abcdefghijklmnopqrstuvwxy' b=input() for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c);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>
s228627615
p00017
Wrong Answer
a='abcdefghijklmnopqrstuvwxy' b=input() for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the 'in c,'this 'in c,'that 'in c)):print(c);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>
s738187532
p00017
Wrong Answer
import sys a='abcdefghijklmnopqrstuvwxy' for b in sys.stdin: b=input() for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the'in c,'this'in c,'that'in c)):print(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>
s676241478
p00017
Wrong Answer
import sys a='abcdefghijklmnopqrstuvwxy' for b in sys.stdin: for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the'in c,'this'in c,'that'in c)):print(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>
s045947079
p00017
Wrong Answer
import sys a='abcdefghijklmnopqrstuvwxy' for b in sys.stdin: b=b.strip() for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the'in c,'this'in c,'that'in c)):print(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>
s999913004
p00017
Wrong Answer
alp=['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'] alp.sort() def jumper(x): if x.isalpha(): return alp[alp.index(x)-4] else: return x x=map(jumper,list(raw_input())) print ''.join(x)+'\n'
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>
s644433778
p00017
Wrong Answer
l = 'abcdefghijklmnopqrstuvwxyz' while True: try: s = input() except: exit() for d in range(1,27): t = s[:-1].translate(str.maketrans(l,l[d:] + l[:d])) if 'that' in t or 'this' in t or 'that' in t: 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>
s874905814
p00017
Wrong Answer
def dec(text,d): r=[] for i in text: c=ord(i) if c<65:r.append(i) elif c<91:r.append(chr((c-65+d)%26+65)) else:r.append(chr((c-97+d)%26+97)) return "".join(r) raw=input() for i in range(25): d=dec(raw,i+1) if sum([1 for i in ["the","this","that"] if i in d])>0:break print(d)
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>
s424503347
p00017
Wrong Answer
def dec(text,d): r=[] for i in text: c=ord(i) if c<65:r.append(i) elif c<91:r.append(chr((c-65+d)%26+65)) else:r.append(chr((c-97+d)%26+97)) return "".join(r) while True: try:raw=input() except:break if raw=="":break for i in range(25): d=dec(raw,i+1) if sum([1 for i in ["the","this","that"] if i in d])>0:break print(d)
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>
s128682177
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i -1] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if "the" in s or "that" in s or "this" in s: print(s) 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>
s992091979
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i -1] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if "the " in s or "that " in s or "this " in s: print(s) 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>
s347901449
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i - 25] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if "the " in s or "that " in s or "this " in s: print(s) 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>
s942182228
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i - 24] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if "the " in s or "that " in s or "this " in s: print(s) 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>
s528103287
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i - 1] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if "the" in s or "that" in s or "this" in s: print(s) 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>
s035159154
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i - 1] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if "the " in s or "that " in s or "this " in s: print(s) 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>
s896669005
p00017
Wrong Answer
s = input() a = "".join([chr(97 + i) for i in range(26)]) #b = "".join([a[i -1] for i in range(26)]) #x = str.maketrans(a, b) while True: s = s.replace("a", "#") for i in range(1, 26): s = s.replace(a[i], a[i - 1]) s = s.replace("#", "z") # s = s.translate(x) if "the" in s or "that" in s or "this" in s: print(s) 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>
s383704967
p00017
Wrong Answer
s = input() a = "abcdefghijklmnopqrstuvwxyz" i = 1 while True: t = s.translate(str.maketrans(a, a[i:] + a[:i])) if "the" in t or "that" in t or "this" in t: print(t) break 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>
s203420421
p00017
Wrong Answer
import sys def rp(char,n): p=ord(char)+n if 97 <= p-n <= 122: if p<=122: return chr(p) elif p>122: return chr(p-122+96) else: return char def find(str): for j in range(1,26): l="".join([rp(i,j) for i in str]) if "this" in l or "the" in l or "that" in l: return l [print(i) for i in [find(text) for text in sys.stdin] if i]
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>
s300280940
p00017
Wrong Answer
import sys def l(s,n): o=ord(s)+n if 97<=o<=122: return chr(o) elif o>123: return chr(o-26) else: return s 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>
s486712126
p00017
Wrong Answer
dic = ['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'] inp = map(str, raw_input()) out = [ '' for x in range(len(inp))] for j in range(len(dic)): for i in range(len(inp)): if inp[i] in dic: out[i] = dic[(dic.index(inp[i])+j)%26] else: out[i] = inp[i] for x in range(len(out)-3): if out[x]=='t' and out[x+1]=='h' and out[x+2]=='e' and out[x+3]==' ' or\ out[x]=='t' and out[x+1]=='h' and out[x+2]=='a' and out[x+3]=='t' or\ out[x]=='t' and out[x+1]=='h' and out[x+2]=='i' and out[x+3]=='s': print ''.join(out) 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>
s319913925
p00017
Wrong Answer
dic = ['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'] inp = map(str, raw_input()) out = [ '' for x in range(len(inp))] for j in range(26): for i in range(len(inp)): if inp[i] in dic: out[i] = dic[(dic.index(inp[i])+j)%26] else: out[i] = inp[i] for x in range(len(out)-4): if out[x]==' ' and out[x+1]=='t' and out[x+2]=='h' and out[x+3]=='e' and out[x+4]==' ': print ''.join(out), break else: for y in range(len(out)-5): if out[x]==' ' and out[x+1]=='t' and out[x+2]=='h' and out[x+3]=='i' and out[x+4]=='s' and out[x+5]==' ' or\ out[x]==' ' and out[x+1]=='t' and out[x+2]=='h' and out[x+3]=='a' and out[x+4]=='t' and out[x+5]==' ': print ''.join(out), 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>
s818588490
p00017
Wrong Answer
dic = ['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'] inp = map(str, raw_input()) out = [ '' for x in range(len(inp))] for j in range(26): for i in range(len(inp)): if inp[i] in dic: out[i] = dic[(dic.index(inp[i])+j)%26] else: out[i] = inp[i] for x in range(len(out)): try: if (out[x+1]=='t' and out[x+2]=='h' and out[x+3]=='i' and out[x+4]=='s') and (out[x]not in dic and out[x+5] not in dic)or\ (out[x+1]=='t' and out[x+2]=='h' and out[x+3]=='a' and out[x+4]=='t') and (out[x]not in dic and out[x+5] not in dic)or\ (out[x+1]=='t' and out[x+2]=='h' and out[x+3]=='e') and (out[x]not in dic and out[x+4] not in dic) : print ''.join(out) break except IndexError: continue
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>
s652618961
p00017
Wrong Answer
def transform(s): s="".join(map(chr,[i+1 for i in map(ord,s)])) return s.replace("{","a") s=raw_input() cnt=0 the,this,that="the","this","that" while True: if (the in s) or (this in s) or (that in s): break else: the,this,that=transform(the),transform(this),transform(that) cnt+=1 s1="" for c in s: t=c for i in range(26-cnt): if t.isalpha(): t=chr(ord(t)+1) t=t.replace("{","a") else: break s1+=t print s1
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>
s384901475
p00017
Wrong Answer
def trans(s): s1="" for c in s: if c.isalpha(): s1+=chr(ord(c)+1) else: s1+=c return s1.replace("{","a") s=raw_input() cnt=0 the,this,that="the","this","that" while True: if (the in s) or (this in s) or (that in s): print s break else: s=trans(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>
s600316011
p00017
Wrong Answer
import sys def decode(s): result="" for c in s: if not (c==" " or c=="."): result+=chr(ord(c)+1) else: result+=c return result.replace(chr(ord("z")+1),"a") for line in sys.stdin.readlines(): s=line.strip() for i in xrange(ord("z")-ord("a")): if "the" in s or "that" in s or "this" in s: print s 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>
s877673285
p00017
Wrong Answer
def f(x): if x.isalpha(): return chr(((ord(x) - ord("a") - 1) % 26) + ord("a")); return x; while True: try: print "".join(map(f, raw_input().strip())) 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>
s160145470
p00017
Wrong Answer
def ces(n): def f(x): if x.isalpha(): return chr(((ord(x) - ord("a") - n) % 26) + ord("a")); return x; return f while True: try: inp = raw_input().strip(); for i in range(1, 26): s = "".join(map(ces(i), inp)) print s, i if (s.find("this") != -1 or s.find("the") != -1 or s.find("that") != -1): print s 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>
s502740681
p00017
Wrong Answer
def ces(n): def f(x): if x.isalpha(): return chr(((ord(x) - ord("a") - n) % 26) + ord("a")); return x; return f while True: try: inp = raw_input().strip(); for i in range(1, 26): s = "".join(map(ces(i), inp)) if (s.find("this") != -1 or s.find("the") != -1 or s.find("that") != -1): print s 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>
s258869783
p00017
Wrong Answer
''' Created on Mar 22, 2013 @author: wukc ''' from sys import stdin def shift(s): return ["".join([chr(97+(ord(x)-97+t)%26) if x.islower() else x for x in s]) for t in range(26)] s=stdin.readline() for x in zip(*map(shift,s.split())): if "this" in x or "the" in x or "that" in x: 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>
s374393206
p00017
Wrong Answer
''' Created on Mar 22, 2013 @author: wukc ''' from sys import stdin def shift(s): return ["".join([chr(97+(ord(x)-97+t)%26) if x.islower() else x for x in s]) for t in range(26)] target=["this","the","that"] s=stdin.readline() for x in shift(s): if sum(map(x.count,target))>0: print(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>
s470974508
p00017
Wrong Answer
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: for n in range(1,26): caesar = Caesar(n) result = caesar.decrypt(line) m = r.findall(result) if 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>
s181564732
p00017
Wrong Answer
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: for n in range(1,26): caesar = Caesar(n) result = caesar.decrypt(line) m = r.findall(result) if not len(m) == 0: 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>
s415498076
p00017
Wrong Answer
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: for n in range(1,26): caesar = Caesar(n) result = caesar.decrypt(line) m = r.findall(result) if not len(m) == 0: 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>
s275219538
p00017
Wrong Answer
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: for n in range(1,26): caesar = Caesar(n) result = caesar.decrypt(line) m = r.findall(result) if not len(m) == 0: 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>
s470912676
p00017
Wrong Answer
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: for n in range(1,26): caesar = Caesar(n) result = caesar.decrypt(line) m = r.findall(result) if not len(m) == 0: 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>
s924759159
p00017
Wrong Answer
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,26): 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>
s982834790
p00017
Wrong Answer
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,26): 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>
s697906091
p00017
Wrong Answer
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() s = raw_input() 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>
s147893064
p00017
Wrong Answer
s = raw_input().strip() for i in range(26): if "the" in s or "this" in s or "that" in s: break x = "" for j,c in enumerate(s): tmp = ord(c)-ord("a") if "a"<=c and c<="z": x+= chr((tmp+1) % 26 + ord("a")) else: x+=c s=x print 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>
s198497130
p00017
Wrong Answer
import sys for line in iter(sys.stdin.readline, ""): s = line.strip() for i in range(26): if "the" in s or "this" in s or "that" in s: break x = "" for j,c in enumerate(s): tmp = ord(c)-ord("a") if "a"<=c and c<="z": x+= chr((tmp+1) % 26 + ord("a")) else: x+=c s=x print 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>
s414085762
p00017
Wrong Answer
import sys for line in iter(sys.stdin.readline, ""): s = line.strip() for i in range(26): if "the" in s or "this" in s or "that" in s: break x = "" for j,c in enumerate(s): tmp = ord(c)-ord("a") if "a"<=c and c<="z": x+= chr((tmp+1) % 26 + ord("a")) else: x+=c s=x print 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>
s919228014
p00017
Wrong Answer
s = raw_input() for i in range(26): r = '' for c in s: if ord('a') <= ord(c) <= ord('z'): n = ord(c) - ord('a') n = (n + i) % 26 r += chr(n + ord('a')) else: r += c if 'the' in r or 'this' in r or 'thats' in r: print r 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>
s526258979
p00017
Wrong Answer
s = raw_input() for i in range(26): r = '' for c in s: if ord('a') <= ord(c) <= ord('z'): n = ord(c) - ord('a') n = (n + i) % 26 r += chr(n + ord('a')) else: r += c if 'the' in r or 'this' in r or 'that' in r: print r 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>
s069111875
p00017
Wrong Answer
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
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>
s666347430
p00017
Wrong Answer
#!/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, 26): decrypt = decryptor(crypt.strip(), i) if (decrypt.find('the') != -1 or decrypt.find('this') != -1 or decrypt.find('then') != -1): print decrypt continue def decryptor(crypt, offset): decrypt = '' crypt = crypt.lower() for c in crypt: if (c == ' ' or c == ',' or c == '.'): 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>
s796585982
p00017
Wrong Answer
#!/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, 26): decrypt = decryptor(crypt, i) if (decrypt.find('the') != -1 or decrypt.find('this') != -1 or decrypt.find('then') != -1): print decrypt continue def decryptor(crypt, offset): decrypt = '' crypt = crypt.lower() 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>
s091427366
p00017
Wrong Answer
#!/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, 26): decrypt = decryptor(crypt.strip(), i) if (decrypt.find('the') != -1 or decrypt.find('this') != -1 or decrypt.find('that') != -1): print decrypt continue def decryptor(crypt, offset): 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>
s163644469
p00017
Wrong Answer
#!/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, 26): 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): 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>
s180052992
p00017
Wrong Answer
#!/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, 25): 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): 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>
s135395726
p00017
Wrong Answer
a = raw_input() b = ["the", "this", "that"] for y in range(26): for x in b: if x in a: A = a 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) print(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>
s416574339
p00017
Wrong Answer
a = raw_input() b = ["the", "this", "that"] 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>
s707440677
p00017
Wrong Answer
# -*- coding: utf-8 -*- import sys from math import * 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): 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>
s000024944
p00017
Wrong Answer
# -*- coding: utf-8 -*- import sys from math import * 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:] print s 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>
s918975347
p00017
Wrong Answer
# -*- coding: utf-8 -*- 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>
s525731344
p00017
Wrong Answer
# -*- coding: utf-8 -*- 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: 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>
s191542590
p00017
Wrong Answer
# -*- coding: utf-8 -*- 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: 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>
s626970814
p00017
Wrong Answer
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: raw_word = raw_input() for key in range(26): word = raw_word for i in range(len(word)): for al in range(26): if word[i] == alpha[al]: word = word[:i]+alpha[(al+key)%26]+word[i+1:] break 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>
s472951499
p00017
Wrong Answer
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() word.lower() 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>
s066956085
p00017
Wrong Answer
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 s in sys.stdin: 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
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>
s304866348
p00017
Wrong Answer
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 s in sys.stdin: 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>
s445727743
p00017
Wrong Answer
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 s 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>
s540638208
p00017
Wrong Answer
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(): s=l.strip() 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
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>
s385007413
p00017
Wrong Answer
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>
s968008094
p00017
Wrong Answer
import sys input_words = [] while True: try: input_words = raw_input().split() assume_list = [list(str) for str in input_words if len(str) == 4 or len(str) == 3] for word in assume_list: shift = ord('t') - ord(word[0]) word = ''.join([chr(ord(c) + shift) for c in word if c.isalpha()]) if word in ["this", "that", "the"]: break else: print "unknown crypt" sys.exit() decrypt_list = [list(str) for str in input_words] for i in range(len(decrypt_list)): for j in range(len(decrypt_list[i])): if decrypt_list[i][j].isalpha(): decrypt_list[i][j] = chr(ord(decrypt_list[i][j]) + shift) decrypt_list[i] = ''.join([c for c in decrypt_list[i]]) #decrypt_list[i] = ''.join([chr(ord(c) + shift) for c in decrypt_list[i] if c.isalpha()]) decrypt_list = ' '.join(decrypt_list) print decrypt_list 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>
s595128654
p00017
Wrong Answer
import sys input_words = [] while True: try: input_words = raw_input().split() assume_list = [list(str) for str in input_words if len(str) == 4 or len(str) == 3] for word in assume_list: shift = ord('t') - ord(word[0]) word = ''.join([chr(ord(c) + shift) for c in word if c.isalpha()]) if word in ["this", "that", "the"]: break else: print "unknown crypt" sys.exit() decrypt_list = [list(str) for str in input_words] for i in range(len(decrypt_list)): for j in range(len(decrypt_list[i])): if decrypt_list[i][j].isalpha(): c = chr(ord(decrypt_list[i][j]) + shift) if ord(c) > ord('z'): c = chr(ord('a') - ord('z') + ord(c) - 1) decrypt_list[i][j] = c decrypt_list[i] = ''.join([c for c in decrypt_list[i]]) decrypt_list = ' '.join(decrypt_list) print decrypt_list 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>
s644961207
p00017
Wrong Answer
import sys input_words = [] while True: try: input_words = raw_input().split() assume_list = [list(str) for str in input_words if len(str) == 4 or len(str) == 3] for word in assume_list: shift = ord('t') - ord(word[0]) word = ''.join([chr(ord(c) + shift) for c in word if c.isalpha()]) if word in ["this", "that", "the"]: break else: print "unknown crypt" sys.exit() decrypt_list = [list(str) for str in input_words] for i in range(len(decrypt_list)): for j in range(len(decrypt_list[i])): if decrypt_list[i][j].isalpha(): c = chr(ord(decrypt_list[i][j]) + shift) if ord(c) > ord('z'): c = chr(ord('a') - ord('z') + ord(c) - 1) elif ord(c) < ord('a'): c = chr(ord('z') + ord('a') - ord(c) - 1) decrypt_list[i][j] = c decrypt_list[i] = ''.join([c for c in decrypt_list[i]]) decrypt_list = ' '.join(decrypt_list) print decrypt_list 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>
s471579374
p00017
Wrong Answer
import string rot1 = string.maketrans("abcdefghijklmnopqrstuvwxyz. ",\ "bcdefghijklmnopqrstuvwxyza. ") text = raw_input() while 1: if text.count("the") or text.count("this") or text.count("that"): print text break text = 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>
s921967052
p00017
Wrong Answer
def decode(strings, num): ret = [] for string in strings: ret.append(''.join([chr(((ord(s) - ord('a')) + num) % 26 + ord('a')) for s in string])) return ret while 1: try: line = raw_input().strip('.').split() print line for i in range(26): tmp = decode(line, i) if 'this' in tmp or 'the' in tmp or 'that' in tmp: print ' '.join(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>
s482196293
p00017
Wrong Answer
def decode(strings, num): ret = [] for string in strings: ret.append(''.join([chr(((ord(s) - ord('a')) + num) % 26 + ord('a')) for s in string])) return ret while 1: try: line = raw_input().strip('.').split() for i in range(26): tmp = decode(line, i) if 'the' in tmp or 'this' in tmp or 'that' in tmp: print ' '.join(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>
s343880155
p00017
Wrong Answer
def decode(strings, num): ret = [] for string in strings: ret.append(''.join([chr(((ord(s) - ord('a')) + num) % 26 + ord('a')) for s in string])) return ret while 1: try: line = raw_input().strip('.').split() for i in range(26): tmp = decode(line, i) if ('the' in tmp) or ('this' in tmp) or ('that' in tmp): print ' '.join(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>
s469379959
p00017
Wrong Answer
def slide_char(char, num): if char == '.': return char if ord('A') <= ord(char) <= ord('Z'): if (ord(char) + num) <= ord('Z'): return chr(ord(char) + num) else: return chr(ord('A') + ord(char) + num - ord('Z') - 1) else: if (ord(char) + num) <= ord('z'): return chr(ord(char) + num) else: return chr(ord('a') + ord(char) + num - ord('z') - 1) def main(): check_words = ('the', 'this', 'that') caesar_chipher_text = tuple(map(str, raw_input().split())) for i in range(26): after_text = [] flag = False for word in caesar_chipher_text: after_word = [] for char in word: char = slide_char(char, i) after_word.append(char) after_text.append(after_word) if ''.join(after_word) in check_words: flag = True if flag: anser = [] for text in after_text: anser.append(''.join(text)) print(' '.join(anser)) break 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>
s004484665
p00017
Wrong Answer
a = 'abcdefghijklmnopqrstuvwxyz' s = input() 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>
s249480460
p00017
Time Limit Exceeded
s=input() while True: if "this" in s and "that" in s and "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] != "z": s[i] = chr(ord(s[i])+1) else: s[i] = "a" 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>
s437980926
p00017
Time Limit Exceeded
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i -1] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if " the " in s or " that " in s or " this " in s: print(s) 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>
s605010305
p00017
Time Limit Exceeded
s = input() a = "".join([chr(97 + i) for i in range(26)]) b = "".join([a[i - 1] for i in range(26)]) x = str.maketrans(a, b) while True: s = s.translate(x) if " the " in s or "that " in s or "this " in s: print(s) 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>