s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s559495658
p00016
u717526540
1541645431
Python
Python3
py
Accepted
20
5720
256
import math x = 0 y = 0 angle = math.pi / 2 while(1): d, a = map(int, input().split(",")) if d == 0 and a == 0: break x += math.cos(angle) * d y += math.sin(angle) * d angle -= a * math.pi / 180 print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure"> </td> <td align="top"> Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br> <pre> 30, 10 50, -40 20, 15 . . </pre> </td> </tr> </table> </center> --> <p> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". </p> <p> His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper. </p> <p> For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town. </p> <p> You can assume that <var>d</var> &le; 100 and -180 &le; <var>t</var> &le; 180. </p> <H2>Input</H2> <p> A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>". </p> <H2>Output</H2> <p> Print the integer portion of <var>x</var> and <var>y</var> in a line respectively. </p> <H2>Sample Input</H2> <pre> 56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0 </pre> <H2>Output for the Sample Input</H2> <pre> 171 -302 </pre>
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,402
s183236518
p00016
u536280367
1537010111
Python
Python3
py
Accepted
20
5712
344
import math if __name__ == '__main__': x = 0 y = 0 angle = 90 r, t = map(int, input().split(',')) while r != 0 or t != 0: x = x + r * math.cos(math.radians(angle)) y = y + r * math.sin(math.radians(angle)) angle -= t r, t = map(int, input().split(',')) print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure"> </td> <td align="top"> Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br> <pre> 30, 10 50, -40 20, 15 . . </pre> </td> </tr> </table> </center> --> <p> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". </p> <p> His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper. </p> <p> For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town. </p> <p> You can assume that <var>d</var> &le; 100 and -180 &le; <var>t</var> &le; 180. </p> <H2>Input</H2> <p> A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>". </p> <H2>Output</H2> <p> Print the integer portion of <var>x</var> and <var>y</var> in a line respectively. </p> <H2>Sample Input</H2> <pre> 56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0 </pre> <H2>Output for the Sample Input</H2> <pre> 171 -302 </pre>
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,403
s435999060
p00016
u319725914
1534223602
Python
Python3
py
Accepted
20
5712
245
from math import sin,cos x,y,t = 0,0,90 while(True): d,a = map(int,input().split(",")) if d==0 and a==0: print(int(x)) print(int(y)) break x += d*cos(t/180*3.141592) y += d*sin(t/180*3.141592) t -= a
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure"> </td> <td align="top"> Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br> <pre> 30, 10 50, -40 20, 15 . . </pre> </td> </tr> </table> </center> --> <p> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". </p> <p> His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper. </p> <p> For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town. </p> <p> You can assume that <var>d</var> &le; 100 and -180 &le; <var>t</var> &le; 180. </p> <H2>Input</H2> <p> A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>". </p> <H2>Output</H2> <p> Print the integer portion of <var>x</var> and <var>y</var> in a line respectively. </p> <H2>Sample Input</H2> <pre> 56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0 </pre> <H2>Output for the Sample Input</H2> <pre> 171 -302 </pre>
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,404
s206204267
p00016
u995990363
1533779084
Python
Python3
py
Accepted
20
5716
439
import math def move(dig): rad = math.radians(dig) x = math.cos(rad) y = math.sin(rad) return x,y def run(): x, y = 0,0 dig = 90 while True: r, d = map(int, input().split(',')) d = -d if r == 0 and d == 0: break _x, _y = move(dig) dig += d x += r * _x y += r * _y print(int(x)) print(int(y)) if __name__ == '__main__': run()
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure"> </td> <td align="top"> Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br> <pre> 30, 10 50, -40 20, 15 . . </pre> </td> </tr> </table> </center> --> <p> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". </p> <p> His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper. </p> <p> For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town. </p> <p> You can assume that <var>d</var> &le; 100 and -180 &le; <var>t</var> &le; 180. </p> <H2>Input</H2> <p> A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>". </p> <H2>Output</H2> <p> Print the integer portion of <var>x</var> and <var>y</var> in a line respectively. </p> <H2>Sample Input</H2> <pre> 56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0 </pre> <H2>Output for the Sample Input</H2> <pre> 171 -302 </pre>
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,405
s045256263
p00016
u853158149
1521974468
Python
Python3
py
Accepted
20
5712
262
import math x = 0 y = 0 shi = 90 while 1: a,b = map(int, input().split(",")) if a == 0 and b == 0: break else: x += a*math.cos(math.radians(shi)) y += a*math.sin(math.radians(shi)) shi -= b print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure"> </td> <td align="top"> Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br> <pre> 30, 10 50, -40 20, 15 . . </pre> </td> </tr> </table> </center> --> <p> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". </p> <p> His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper. </p> <p> For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town. </p> <p> You can assume that <var>d</var> &le; 100 and -180 &le; <var>t</var> &le; 180. </p> <H2>Input</H2> <p> A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>". </p> <H2>Output</H2> <p> Print the integer portion of <var>x</var> and <var>y</var> in a line respectively. </p> <H2>Sample Input</H2> <pre> 56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0 </pre> <H2>Output for the Sample Input</H2> <pre> 171 -302 </pre>
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,406
s043685040
p00016
u079141094
1467420881
Python
Python3
py
Accepted
20
7864
272
# Treasure Hunt import math x,y,pd = 0,0,-90 r,d = map(int, input().split(',')) while not (r == 0 and d == 0): x += r * math.cos(math.radians(-pd)) y += r * math.sin(math.radians(-pd)) pd += d r,d = map(int, input().split(',')) print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure"> </td> <td align="top"> Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br> <pre> 30, 10 50, -40 20, 15 . . </pre> </td> </tr> </table> </center> --> <p> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". </p> <p> His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper. </p> <p> For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town. </p> <p> You can assume that <var>d</var> &le; 100 and -180 &le; <var>t</var> &le; 180. </p> <H2>Input</H2> <p> A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>". </p> <H2>Output</H2> <p> Print the integer portion of <var>x</var> and <var>y</var> in a line respectively. </p> <H2>Sample Input</H2> <pre> 56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0 </pre> <H2>Output for the Sample Input</H2> <pre> 171 -302 </pre>
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,407
s361354970
p00017
u525366883
1535536760
Python
Python
py
Accepted
10
4764
254
try: while True: b = raw_input() import string t = string.maketrans("abcdefghijklmnopqrstuvwxyz","bcdefghijklmnopqrstuvwxyza") while not("this" in b or "the" in b or "that" in b): b = b.translate(t) print b except: pass
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,408
s692201848
p00017
u093607836
1403885313
Python
Python
py
Accepted
20
4376
223
import sys,string a = string.ascii_lowercase t = string.maketrans(a,a[1:]+a[0]) for s in sys.stdin: s = s.strip() while not ('the' in s or 'this' in s or 'that' in s): s = s.translate(t) print s
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,409
s622642681
p00017
u124909914
1406088521
Python
Python
py
Accepted
20
4216
528
import sys while True: try: input = raw_input() for i in range(0, 26): str = "" for c in input: if c.isalpha(): c = chr(ord(c) + i) if ord(c) > ord('z'): c = chr(ord('a') - ord('z') + ord(c) - 1) str += c for word in ["this", "that", "the"]: if (str.find(word) != -1): print str break except EOFError: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,410
s877627081
p00017
u244742296
1409920876
Python
Python3
py
Accepted
30
6720
480
import string import sys alpha = string.ascii_lowercase for line in sys.stdin: for i in range(len(alpha)): cipher_str = "" for s in line: if s in alpha: cipher_str += alpha[(alpha.index(s)+i) % len(alpha)] else: cipher_str += s if "the" in cipher_str or "this" in cipher_str or "that" in cipher_str: print(cipher_str, end="") break else: print(line, end="")
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,411
s448079878
p00017
u579833671
1410767090
Python
Python
py
Accepted
20
4224
420
while(True): try: s = raw_input() for i in range(26): for j in range(len(s)): if('a' <= s[j] <= 'y'): s = s[0:j:] + chr(ord(s[j]) + 1) + s[j + 1::] elif(s[j] == 'z'): s = s[0:j:] + 'a' + s[j + 1::] if("this" in s or "that" in s or "the" in s): print(s) except Exception: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,412
s741673909
p00017
u855866586
1412774469
Python
Python
py
Accepted
10
4228
494
def mov(c,x): if ord('a')<=ord(c)<=ord('z'): return chr(ord('a')+(ord(c)-ord('a')+x)%26) else: return c while True: try: s=raw_input() flag=False for i in xrange(26): t=''.join([mov(c,i) for c in s]) #print t ts=t[:-1].split() if ('this' in ts) or ('that' in ts) or ('the' in ts ): flag=True break if flag: print t except EOFError: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,413
s976531435
p00017
u506132575
1416122661
Python
Python
py
Accepted
10
4272
946
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def move(i,string): lis = [] for e in string: if e == "." : lis.append(".") elif e == "\n": lis.append("\n") else: if ord(e)+i > 122: lis.append( chr(ord(e)+i-26) ) else: lis.append( chr(ord(e)+i ) ) st = "".join(lis) if st in ["the","that","this"]: return True else: return False def move2(i,string): lis = [] for e in string: if e == "." : lis.append(".") elif e == "\n": lis.append("") elif e == " ": lis.append(" ") else: if ord(e)+i > 122: lis.append( chr(ord(e)+i-26) ) else: lis.append( chr(ord(e)+i ) ) st = "".join(lis) return st for s in sys.stdin: flag = False i = 0 d = map(str , s.split()) for i in range(26): for e in d: if move(i,e): flag = True break if flag: break print move2(i,s)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,414
s201085568
p00017
u567380442
1422877670
Python
Python3
py
Accepted
30
6724
388
import sys import string f = sys.stdin ceasar1 = str.maketrans(string.ascii_lowercase, string.ascii_lowercase[1:] + string.ascii_lowercase[:1]) for sentence in f: for i in range(len(string.ascii_lowercase)): sentence = sentence.translate(ceasar1) if 'the' in sentence or 'this' in sentence or 'that' in sentence: print(sentence, end='') break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,415
s854964527
p00017
u540744789
1425803264
Python
Python
py
Accepted
20
4212
456
import sys def c1(c): alph ="abcdefghijklmnopqrstuvwxyz" if c in alph: return alph[(alph.find(c)+1)%26] else: return c for string in sys.stdin: while True: af_string="" for c in string: af_string+=c1(c) if af_string.find("the")!=-1\ or af_string.find("this")!=-1\ or af_string.find("that")!=-1: break string = af_string print af_string[:-1]
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,416
s167396469
p00017
u540744789
1425882890
Python
Python
py
Accepted
20
4336
1,343
import sys alpha = 'abcdefghijklmnopqrstuvwxyz' def this(word): i=0 t=[] for c in word: x=ord(c)-ord('this'[i]) if x>=0: t.append(x) else: t.append(26+x) i+=1 if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]): return t[0] return 30 def that(word): i=0 t=[] for c in word: x=ord(c)-ord('that'[i]) if x>=0: t.append(x) else: t.append(26+x) i+=1 if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]): return t[0] return 30 def the(word): i=0 t=[] for c in word: x=ord(c)-ord('the'[i]) if x>=0: t.append(x) else: t.append(26+x) i+=1 if(t[0]==t[1] and t[1]==t[2]): return t[0] return 30 for string in sys.stdin: for word in string.split(" "): if(len(word)==3): if the(word) < 30: x=the(word) break if(len(word)==4): if this(word) <30: x=this(word) break if that(word) <30: x=that(word) break result="" for c in string: if c in alpha: result+=alpha[alpha.find(c)-x] else: result+=c print result[:-1]
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,417
s378137526
p00017
u162387221
1431320245
Python
Python
py
Accepted
10
4204
317
while True: try: s = raw_input() except EOFError: break for i in range(26): S = '' for c in s: if c.islower(): n = (ord(c)-ord('a')+i)%26 S +=chr(ord('a')+n) else: S += c if 'the' in S or 'this' in S or 'that' in S: print S break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,418
s544916051
p00017
u408260374
1431428224
Python
Python3
py
Accepted
40
6724
565
import string def cipher(s, i): if s in string.ascii_lowercase: return string.ascii_lowercase[(ord(s) - ord('a')+ i) % 26] elif s in string.ascii_uppercase: return string.ascii_uppercase[(ord(s) - ord('A')+ i) % 26] else: return s def decode(s, i): return ''.join([cipher(x, i) for x in s]) while True: try: sent = input().split() except: break for i in range(26): si = [decode(s, i) for s in sent] if 'the' in si or 'this' in si or 'that' in si: print(' '.join(si))
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,419
s724223827
p00017
u067299340
1433230314
Python
Python
py
Accepted
20
4324
302
import sys c=lambda w,n:reduce(lambda a,b:a+b,[chr((ord(x)-97+n)%26+97)if x.isalpha() else x for x in w]) for i in sys.stdin: n=0 for s in i.replace(".","").split(): r=c(s,116-ord(s[0])) m=len(s) if m==3 and"the"==r or m==4 and r in["this","that"]:n=116-ord(s[0]) print c(i,n).replace("\n","")
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,420
s692813466
p00017
u067299340
1433230330
Python
Python
py
Accepted
20
4328
302
import sys c=lambda w,n:reduce(lambda a,b:a+b,[chr((ord(x)-97+n)%26+97)if x.isalpha() else x for x in w]) for i in sys.stdin: n=0 for s in i.replace(".","").split(): r=c(s,116-ord(s[0])) m=len(s) if m==3 and"the"==r or m==4 and r in["this","that"]:n=116-ord(s[0]) print c(i,n).replace("\n","")
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,421
s897946889
p00017
u067299340
1433233792
Python
Python
py
Accepted
10
4200
188
import sys,re c=lambda w,n:"".join([chr((ord(x)-97+n)%26+97)if x.isalpha()else x for x in w]) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,422
s398089140
p00017
u067299340
1433234597
Python
Python
py
Accepted
20
4200
182
import sys,re c=lambda l,n:re.sub("[a-z]",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,423
s448071842
p00017
u067299340
1433234602
Python
Python
py
Accepted
20
4204
182
import sys,re c=lambda l,n:re.sub("[a-z]",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,424
s274818949
p00017
u067299340
1433234606
Python
Python
py
Accepted
20
4204
182
import sys,re c=lambda l,n:re.sub("[a-z]",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,425
s215659979
p00017
u067299340
1433234620
Python
Python
py
Accepted
20
4204
182
import sys,re c=lambda l,n:re.sub("[a-z]",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,426
s381324328
p00017
u067299340
1433234676
Python
Python
py
Accepted
20
4208
179
import sys,re c=lambda l,n:re.sub("\w",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,427
s317991921
p00017
u067299340
1433234693
Python
Python
py
Accepted
20
4204
179
import sys,re c=lambda l,n:re.sub("\w",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,428
s506635259
p00017
u067299340
1433236414
Python
Python
py
Accepted
10
4208
179
import sys,re c=lambda l,n:re.sub("\w",lambda x:chr((ord(x.group(0))-97+n)%26+97),l) for i in sys.stdin: n=0 while not re.search("th(e|is|at)",c(i,n)):n+=1 print c(i,n).strip()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,429
s611321244
p00017
u379956761
1434854126
Python
Python3
py
Accepted
30
6788
564
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math for s in sys.stdin: for i in range(26): state = list(s.strip()) j = 0 for d in state: if 'a' <= d and d <= 'z': state[j] = chr((ord(d) + i - ord('a')) % 26 + ord('a')) elif 'A' <= d and d <= 'Z': state[j] = chr((ord(d) + i - ord('A')) % 26 + ord('A')) j += 1 state = "".join(state) if "the" in state or "this" in state or "that" in state: print(state) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,430
s253985652
p00017
u140201022
1446734751
Python
Python
py
Accepted
10
6288
567
def sol(l): n=1 while n<27: ans=[] for i in l: x='' for j in i: s=ord(j)+n if s>=123: s-=26 if s<97: s=46 x+=chr(s) ans.append(x) if 'that' in ans or 'thet.' in ans or 'this' in ans or 'this.' in ans or 'the' in ans or 'the.' in ans: print ' '.join(ans) break n+=1 while 1: try: w=map(str,raw_input().split()) sol(w) except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,431
s858346008
p00017
u461370825
1449741302
Python
Python
py
Accepted
30
6516
501
from math import * PI = 3.1415926535898 x = "this" y = "the" z = "that" while True: try: s = str(raw_input()) res = "" ans = "" for i in range(26): res = "" for a in s: if a.isalpha(): c = chr(ord(a) + i) if ord(c) > ord('z'): c = chr(ord(c) - 26) elif ord(c) < ord('a'): c = chr(ord(c) + 26) res += c else: res += a if res.find(x) >= 0 or res.find(y) >= 0 or res.find(z) >= 0: ans = res print ans except EOFError: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,432
s107432085
p00017
u797673668
1452708767
Python
Python3
py
Accepted
40
8020
1,147
import string import sys def check_exists(word_set, rotate_dict, search): for word in word_set: rotated_word = ''.join(rotate_dict[s] for s in word) if rotated_word == search: return True return False for line in sys.stdin: alphabets = string.ascii_lowercase frequency = [t[1] for t in sorted([(line.count(s), ord(s)) for s in alphabets], reverse=True)] freq_chr_offset = (4, 0, 19, 8, 14) ss = list(map(lambda word: word.strip('.\n'), line.split())) sl3, sl4 = set(s for s in ss if len(s) == 3), set(s for s in ss if len(s) == 4) i, rotate_dict = 0, None for order in frequency: for offset in freq_chr_offset: i = 97 + offset - order rotate_dict = {a: b for a, b in zip(alphabets, alphabets[i:] + alphabets[:i])} if (check_exists(sl3, rotate_dict, 'the') + check_exists(sl4, rotate_dict, 'this') + check_exists(sl4, rotate_dict, 'that')) > 0: break else: continue break print(''.join(rotate_dict[s] if s.isalpha() else s for s in line), end='')
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,433
s075178542
p00017
u463990569
1452852880
Python
Python3
py
Accepted
30
7520
532
base = ord('a') az = [chr(j) for j in range(base, base+26)] def crack(s): i = -1 while True: new = [] for c in s: if 96 < ord(c) < 123: new.append(az[(ord(c)-19+i)%26]) else: new.append(c) i -= 1 yield ''.join(new) while True: try: s = input() except: break c = crack(s) while True: ans = next(c) if 'the' in ans or 'this' in ans or 'that' in ans: print(ans) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,434
s077831150
p00017
u777299405
1453270898
Python
Python3
py
Accepted
40
8008
259
import string import sys a = string.ascii_lowercase key = str.maketrans(a, a[1:] + a[:1]) for s in sys.stdin: for i in range(1, 27): s = s.translate(key) if 'the' in s or 'this' in s or 'that' in s: break print(s, end="")
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,435
s883279492
p00017
u777299405
1453271171
Python
Python3
py
Accepted
40
7980
256
import string import sys a = string.ascii_lowercase key = str.maketrans(a, a[1:] + a[:1]) for s in sys.stdin: for i in range(26): s = s.translate(key) if 'the' in s or 'this' in s or 'that' in s: break print(s, end="")
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,436
s636105769
p00017
u766477342
1457537523
Python
Python3
py
Accepted
20
7528
632
t = ord("t") z = ord("z") a = ord("a") def _decode(tv, v): spam = ord(v) if not (a <= spam <= z): return v x = t - ord(tv) y = spam + x if y > z: y = a + (y % z) - 1 elif y < a: y = z - (a - y - 1) return chr(y) while 1: try: txt = input() for s in [x for x in txt.split() if 3 <= len(x) <= 4]: tv = s[0] dec_val = ''.join(list(map(lambda x:_decode(tv,x),s))) if (dec_val in ('this', 'the', 'that')): print(''.join(list(map(lambda x:_decode(tv,x),txt)))) break except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,437
s836214520
p00017
u650459696
1458474289
Python
Python3
py
Accepted
30
7288
471
while True: try: b = input() except: break if 'the' in b or 'this' in b or 'that' in b: print(b) for i in range(1,26): c = '' for j in b: if(j == 'z'): c += ('a') elif(str.isalpha(j) == 1): c += (chr(ord(j) + 1)) else: c += j if 'the' in c or 'this' in c or 'that' in c: print(c) break b = c
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,438
s057624242
p00017
u148101999
1459167513
Python
Python
py
Accepted
10
6324
217
import sys, string alpha = 'abcdefghijklmnopqrstuvwxyza' tbl = string.maketrans(alpha[:-1], alpha[1:]) for s in sys.stdin: while not('the' in s or 'this' in s or 'that' in s): s = s.translate(tbl) print s[:-1]
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,439
s939313730
p00017
u130979865
1459945578
Python
Python
py
Accepted
20
6380
523
# -*- coding: utf-8 -*- import sys import codecs for line in sys.stdin: for i in range(0, 26): ans = "" for j in range(len(line)): a = ord(line[j]) if ord('a') <= a <= ord('z'): if a-i >= ord('a'): ans = ans + chr(a-i) else: ans = ans + chr(a-i+26) else: ans = ans + line[j] if "the" in ans or "this" in ans or "that" in ans: break sys.stdout.write(ans)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,440
s893238566
p00017
u572790226
1460299292
Python
Python3
py
Accepted
30
7352
352
import sys abc = 'abcdefghijklmnopqrstuvwxyz' lines = sys.stdin.readlines() for line in lines: for i in range(26): abcshift = abc[i:]+abc[:i] decode = line.translate(str.maketrans(abc, abcshift)) if 'the' in decode or 'this' in decode or 'that' in decode: print(decode, end = '') break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,441
s926671345
p00017
u529386725
1461625680
Python
Python3
py
Accepted
20
7348
293
li = 'abcdefghijklmnopqrstuvwxyz' while True: try: s = input() except: exit() for d in range(1, 27): t = s[:-1].translate(str.maketrans(li, li[d:] + li[:d])) if 'the' in t or 'this' in t or 'that' in t: print(t + '.') break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,442
s823787690
p00017
u146816547
1462217497
Python
Python
py
Accepted
20
6296
396
#!/usr/bin/env python2 # coding: utf-8 def casar(s, n): d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+n) % 26 + c) return "".join([d.get(c, c) for c in s]) while True: try: encrypttxt = raw_input() for i in range(26): t = casar(encrypttxt, i) if "the" in t or "this" in t or "that" in t: print t except EOFError: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,443
s977087426
p00017
u146816547
1462217670
Python
Python
py
Accepted
20
6260
396
#!/usr/bin/env python2 # coding: utf-8 def casar(s, n): d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+n) % 26 + c) return "".join([d.get(c, c) for c in s]) while True: try: encrypttxt = raw_input() for i in range(26): t = casar(encrypttxt, i) if "the" in t or "this" in t or "that" in t: print t except EOFError: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,444
s206496483
p00017
u146816547
1462359353
Python
Python
py
Accepted
20
6268
398
#!/usr/bin/env python2 # coding: utf-8 def caesar(s, n): d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+n) % 26 + c) return "".join([d.get(c, c) for c in s]) while True: try: encrypttxt = raw_input() for i in range(26): t = caesar(encrypttxt, i) if "the" in t or "this" in t or "that" in t: print t except EOFError: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,445
s176973850
p00017
u074121480
1463030059
Python
Python3
py
Accepted
30
7444
288
chars = 'abcdefghijklmnopqrstuvwxyz' while True: try: string = input() except: exit() for i in range(1, 27): t = string.translate(string.maketrans(chars, chars[i:] + chars[:i])) if 'the' in t or 'this' in t or 'that' in t: print(t)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,446
s574879754
p00017
u681787924
1466431123
Python
Python3
py
Accepted
30
7580
702
#!/usr/bin/env python import sys import re def move(char, num): if ord(char) + num <= ord('z'): return ord(char) + num else: return ord(char) + num - (ord('z') - ord('a') + 1) def shift(s, num): new = "" for i in range(0, len(s)): if s[i].isalpha(): new += str(chr(move(s[i], num))); else: new += s[i] return new def decrypt(s): for i in range(0, 26): decrypted = shift(s, i) if re.search('the|this|that', decrypted): return decrypted if __name__ == '__main__': lines = [] for line in sys.stdin: lines.append(line) for line in lines: print(decrypt(line), end="")
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,447
s048090663
p00017
u589886885
1471964788
Python
Python3
py
Accepted
30
7260
252
import sys a = 'abcdefghijklmnopqrstuvwxyz' for i in sys.stdin.readlines(): s = i.strip() for j in range(1, 27): t = s.translate(str.maketrans(a, a[j:] + a[:j])) if 'the' in t or 'this' in t or 'that' in t: print(t)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,448
s798742648
p00017
u358919705
1471978778
Python
Python3
py
Accepted
30
7440
641
def ceasar(sentence, n): sentence = list(sentence) for i in range(len(sentence)): if sentence[i] in alphabets: sentence[i] = alphabets[(alphabets.index(sentence[i]) + n) % 26] return ''.join(sentence) def is_right(sentence): words = '.'.join(sentence.split(' ')).split('.') return 'the' in words or 'this' in words or 'that' in words alphabets = 'abcdefghijklmnopqrstuvwxyz' while True: try: line = input() if line == '*': break except: break for i in range(26): if is_right(ceasar(line, i)): print(ceasar(line, i)) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,449
s499081820
p00017
u379499530
1473042516
Python
Python
py
Accepted
10
6348
1,108
l = [['the', 'uif', 'vjg', 'wkh', 'xli', 'ymj', 'znk', 'aol', 'bpm', 'cqn', 'dro', 'esp', 'ftq', 'gur', 'hvs', 'iwt', 'jxu', 'kyv', 'lzw', 'max', 'nby', 'ocz', 'pda', 'qeb', 'rfc', 'sgd'], \ ['this', 'uijt', 'vjku', 'wklv', 'xlmw', 'ymnx', 'znoy', 'aopz', 'bpqa', 'cqrb', 'drsc', 'estd', 'ftue', 'guvf', 'hvwg', 'iwxh', 'jxyi', 'kyzj', 'lzak', 'mabl', 'nbcm', 'ocdn', 'pdeo', 'qefp', 'rfgq', 'sghr'], \ ['that', 'uibu', 'vjcv', 'wkdw', 'xlex', 'ymfy', 'zngz', 'aoha', 'bpib', 'cqjc', 'drkd', 'esle', 'ftmf', 'gung', 'hvoh', 'iwpi', 'jxqj', 'kyrk', 'lzsl', 'matm', 'nbun', 'ocvo', 'pdwp', 'qexq', 'rfyr', 'sgzs']] while 1: try: s = raw_input() for w in l: for i in xrange(25): o = w[i] if s.find(w[i]) != -1: r = '' for c in s: if c == ' ' or c == '.' : r+= c else: r += chr((ord(c) - ord('a') - i) % 26 + ord('a')) print r break else: continue break except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,450
s859157087
p00017
u266872031
1474367741
Python
Python
py
Accepted
10
6364
487
import string def cyp(strr,n): nstrr='' for c in strr: if c in string.lowercase: ind=string.lowercase.index(c) nstrr+=string.lowercase[(ind+n)%26] else: nstrr+=c return nstrr while(1): try: s=raw_input() for i in range(26): nstrr=cyp(s,i) if ('the' in nstrr) or ('this' in nstrr) or ('that' in nstrr): print nstrr break except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,451
s104713770
p00017
u922871577
1479285500
Python
Python
py
Accepted
10
6316
383
import sys def decode(s, n): ret = '' for c in s: if c.isalpha(): ret += chr((ord(c)+n-ord('a'))%26+ord('a')) else: ret += c return ret T = ['the', 'this', 'that'] for line in sys.stdin: s = line.rstrip() for i in xrange(26): if any(t in decode(s, i) for t in T): print decode(s, i) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,452
s039830540
p00017
u775586391
1480558989
Python
Python3
py
Accepted
30
7460
371
import sys s = "abcdefghijklmnopqrstuvwxyz" for line in sys.stdin: while True: if ("the" in line) or ("this" in line) or ("that" in line): break else: l = [i for i in line] for i in range(len(l)): if l[i] in s: a = s.index(l[i]) l[i] = l[i].replace(l[i],s[(a+1)%26]) line = "".join(l) print(line.rstrip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,453
s726254741
p00017
u123687446
1481291528
Python
Python3
py
Accepted
30
7336
476
def cshift(w): r = "" for c in w: if c == 'z': r += 'a' elif c == '.': r += '.' else: r += chr(ord(c)+1) return r while True: try: sent = input() except EOFError: break words = sent.split() while ("the" not in words) and ("this" not in words) and ("that" not in words): for i, w in enumerate(words): words[i] = cshift(w) print(" ".join(words))
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,454
s604357874
p00017
u811733736
1481603011
Python
Python3
py
Accepted
30
7384
824
import sys def decrypt(c, i): """ ????????¶????????? """ if c.isalpha(): t = ord(c) - i if t < ord('a'): t += 26 return chr(t) else: return c if __name__ == '__main__': # ??????????????\??? for line in sys.stdin: # ????????????????????? found = '' # ????????????????????? for i in range(0, 26): decrypted = ''.join([decrypt(x, i) for x in line.strip()]) # print(decrypted) if ' the ' in decrypted or ' this ' in decrypted or ' that ' in decrypted or \ decrypted.startswith('the ') or decrypted.startswith('this ') or decrypted.startswith('that '): found = decrypted break # ??????????????? if found: print(found)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,455
s125617937
p00017
u661290476
1482216398
Python
Python3
py
Accepted
30
7464
485
def chg(s,n): res="" for i in s: o=ord(i) if 97<=o<=122: if o+n<=122: res+=chr(o+n) else: res+=chr(o+n-26) else: res+=i return res while True: try: s=input() for i in range(25,-1,-1): c=chg(s,i) e=c.split() if "the" in e or "this" in e or "that" in e: print(c) break except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,456
s705697033
p00017
u661290476
1484814323
Python
Python3
py
Accepted
20
7500
507
def decode(s, n): a = "" for i in s: if i.islower(): o = ord(i) + n if o <= 122: a += chr(o) else: a += chr(o - 26) else: a += i return a def judge(s): a = s.split() return "the" in a or "this" in a or "that" in a while True: try: s = input() except: break for i in range(26): a = decode(s, i) if judge(a): print(a) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,457
s361006116
p00017
u078042885
1485433646
Python
Python3
py
Accepted
30
7360
247
a='abcdefghijklmnopqrstuvwxyz' while 1: try:s=input() except:break for i in range(1,27): b='' for x in s: b+=a[a.index(x)-i]if x in a else x if 'the' in b or 'this' in b or 'that' in b:print(b);break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,458
s827403717
p00017
u252414452
1486043175
Python
Python
py
Accepted
10
6440
406
import sys def caesar(c): if c == "z": return "a" elif c == "Z": return "A" elif 65 <= ord(c) and ord(c) <= 122: return chr(ord(c)+1) else: return c while True: text = sys.stdin.readline() if not text: break text = text.rstrip() while True: if "the" in text or "this" in text or "that" in text: print(text) break text = "".join(map(caesar, list(text)))
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,459
s682998046
p00017
u711765449
1486306474
Python
Python3
py
Accepted
40
7360
553
s = [] while True: try: s.append(input()) except: break for e in range(len(s)): st = list(map(str,s[e])) t = [] for c in st: t.append(ord(c)) for i in range(26): string = '' for j in range(len(st)): if t[j] >= 97 and 122 >= t[j]: l = 97 + ((t[j] - 97 + i) % 26) string += chr(l) else: string += chr(t[j]) if 'this' in string or 'the' in string or 'that' in string: print(string)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,460
s774151820
p00017
u032662562
1486629153
Python
Python3
py
Accepted
30
7588
530
import re def rot(i,s): s0 = 'abcdefghijklmnopqrstuvwxyz' sr = s0[i:] + s0[:i] s1 = '' for i in range(len(s)): if s[i] in s0: s1 = s1 + sr[s0.find(s[i])] else: s1 = s1 + s[i] return(s1) def cae(s): for i in range(26): ro =rot(i,s) if re.search(r'the',ro) or re.search(r'this',ro) or re.search(r'that',ro): return(rot(i,s)) if __name__ == "__main__": while True: try: s = input() print(cae(s)) except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,461
s650990395
p00017
u901080241
1488965680
Python
Python3
py
Accepted
30
7424
498
import sys def unzip(instd): for i in range(26): search = "" for idx in instd: if 97 <= ord(idx) <= 122: if ord(idx) + i <= 122: search += chr(ord(idx) + i) else: search += chr(ord(idx) + i - 26) else: search += idx if 'the' in search or 'this' in search or 'that' in search: return search for line in sys.stdin: print(unzip(line.rstrip()))
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,462
s759557488
p00017
u073709667
1490633920
Python
Python3
py
Accepted
40
7392
686
while True: try: words=input() except: break for j in range(26): word="" for i in range(len(words)): if 65<=ord(words[i])<=90: if ord(words[i])+j>90: word+=chr(ord(word[i])+j-26) else: word+=chr(ord(word[i])+j) elif 97<=ord(words[i])<=122: if ord(words[i])+j>122: word+=chr(ord(words[i])+j-26) else: word+=chr(ord(words[i])+j) else: word+=words[i] if "the" in word or "this" in word or "that" in word: print(word)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,463
s763729249
p00017
u728901930
1490857666
Python
Python3
py
Accepted
20
7536
313
import sys import math as mas li='abcdefghijklmnopqrstuvwxyz' for t in sys.stdin: for i in range(30): a=t[:-1].translate(str.maketrans(li,li[i:]+li[:i])) if 1+a.find("this") or 1+a.find("that") or 1+a.find("the"): print(a) break #for i in sys.stdin: # a,b=map(int,i.split()) # print(gcd(a,b),lcm(a,b))
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,464
s994820077
p00017
u462831976
1492713890
Python
Python3
py
Accepted
30
7548
632
# -*- coding: utf-8 -*- import sys import os from math import sin, cos import math alphabet = 'abcdefghijklmnopqrstuvwxyz' def rotate_char(c, num): if c == ' ' or c == '.' or c == '\n': return c n = ord(c) + num if n > 122: n -= 26 return chr(n) def rotate_string(s, num): ret = [] for c in s: new_c = rotate_char(c, num) ret.append(new_c) return ''.join(ret) for s in sys.stdin: for i in range(26): rotated = rotate_string(s, i) if 'the' in rotated or 'this' in rotated or 'that' in rotated: print(rotated, end='') break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,465
s732505932
p00017
u618637847
1494900129
Python
Python3
py
Accepted
20
7292
289
import sys alpha = 'abcdefghijklmnopqrstuvwxyz' for i in sys.stdin.readlines(): aaa = i.strip() for j in range(1, 27): text = aaa.translate(str.maketrans(alpha, alpha[j:] + alpha[:j])) if 'the' in text or 'this' in text or 'that' in text: print(text)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,466
s616561350
p00017
u905313459
1496408274
Python
Python3
py
Accepted
20
7476
556
def c(s, n): s = list(s) for i in range(len(s)): if s[i] in alphabets: s[i] = alphabets[(alphabets.index(s[i]) + n) % 26] return ''.join(s) def is_right(s): words = '.'.join(s.split(' ')).split('.') return 'the' in words or 'this' in words or 'that' in words alphabets = 'abcdefghijklmnopqrstuvwxyz' while True: try: line = input() if line == '*': break except: break for i in range(26): if is_right(c(line, i)): print(c(line, i)) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,467
s123944864
p00017
u519227872
1496504274
Python
Python3
py
Accepted
30
7372
650
from sys import stdin def ascii2num(ascii): return ord(ascii) - 96 def num2ascii(num): return chr(num + 96) def slide(word,num): return ''.join([num2ascii((ascii2num(ascii) - num) % 26 + 1) if ascii != '.' else '.' for ascii in word]) def includekeyword(words): for word in words: if word in keywords: return True return False keywords = ['the', 'this', 'that'] decode = [] for row in stdin: words = row.split() for num in range(1,27): tmp = [slide(word,num) for word in words] if includekeyword(tmp): decode = tmp print(' '.join(decode)) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,468
s532197738
p00017
u546285759
1496894334
Python
Python3
py
Accepted
40
7944
281
import string a=string.ascii_lowercase while True: try: s=input() except: break for i in range(1, 27): t = s[:-1].translate(str.maketrans(a, a[i:]+a[:i])) if 'the'in t or'that'in t or'this'in t: print(t+".") break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,469
s913526675
p00017
u957840591
1497357024
Python
Python3
py
Accepted
30
7392
556
def c(s, n): s = list(s) for i in range(len(s)): if s[i] in alphabets: s[i] = alphabets[(alphabets.index(s[i]) + n) % 26] return ''.join(s) def is_right(s): words = '.'.join(s.split(' ')).split('.') return 'the' in words or 'this' in words or 'that' in words alphabets = 'abcdefghijklmnopqrstuvwxyz' while True: try: line = input() if line == '*': break except: break for i in range(26): if is_right(c(line, i)): print(c(line, i)) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,470
s656993205
p00017
u371289566
1501518975
Python
Python3
py
Accepted
30
7364
297
while True: try: s = input() except: break for i in range(26): ss = "" for c in s: if c == ' ' or c == '.': ss += c continue c = ord(c) c = (c-ord('a')+i)%26+ord('a') ss += chr(c) a = ss.split() if "the" in a or "this" in a or "that" in a: print(ss) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,471
s180003865
p00017
u354053070
1501933201
Python
Python3
py
Accepted
20
7404
397
def caesarshift(sentence): abc = "abcdefghijklmnopqrstuvwxyz" bcd = abc[1:] + "a" return sentence.translate(str.maketrans(abc, bcd)) while True: try: sentence = input() except EOFError: break while True: if "the" in sentence or "this" in sentence or "that" in sentence: break sentence = caesarshift(sentence) print(sentence)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,472
s755092374
p00017
u187606290
1502051659
Python
Python3
py
Accepted
40
7892
900
import fileinput import string alphabetArray = list(string.ascii_lowercase) for data in fileinput.input(): for n in range(-26, 27): replacedStrAry = list(data.replace('\n', '').replace('\r', '')) for index in range(0, len(replacedStrAry)): if not replacedStrAry[index] in alphabetArray: continue if n >= 0: replacedStrAry[index] = alphabetArray[(alphabetArray.index(replacedStrAry[index]) + n) % 26] else: replacedStrAry[index] = replacedStrAry[index] = alphabetArray[alphabetArray.index(replacedStrAry[index]) + n] replacedStr = "".join(replacedStrAry) replacedStrSplitedBySpace = replacedStr.split(' ') if "the" in replacedStrSplitedBySpace or "this" in replacedStrSplitedBySpace or "that" in replacedStrSplitedBySpace: print(replacedStr) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,473
s352815169
p00017
u214404619
1502750195
Python
Python3
py
Accepted
30
7388
538
import sys; for line in sys.stdin: if (line.find('the') != -1) | (line.find('this') != -1) | (line.find('that') != -1): print(line[0:len(line) - 1]); continue; alpha = 'abcdefghijklmnopqrstuvwxyz'; for i in range(1, 26): str = ''; for j in range(len(line) - 1): if ((line[j] == ' ') | (line[j] == '.')): str += line[j]; continue; index = alpha.find(line[j]); str += alpha[(index + i) % 26]; if (str.find('the') != -1) | (str.find('this') != -1) | (str.find('that') != -1): print(str); break;
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,474
s817233332
p00017
u957021183
1504765763
Python
Python3
py
Accepted
30
7576
648
# 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 for cipher in sys.stdin: cipher = cipher.strip() 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
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,475
s812060603
p00017
u184989919
1505689935
Python
Python3
py
Accepted
40
8064
373
import string import sys def CaesarCipher(): low=string.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec[:-1]) CaesarCipher()
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,476
s924654498
p00017
u197615397
1506668674
Python
Python3
py
Accepted
30
7424
421
import sys for s in map(lambda l: list(l.rstrip()), sys.stdin.readlines()): 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) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,477
s848866819
p00017
u146816547
1508109599
Python
Python
py
Accepted
40
6380
455
#!/usr/bin/env python2 # coding: utf-8 def caesar(s, n): d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+n) % 26 + c) return "".join([d.get(c, c) for c in s]) while True: try: encrypt_txt = raw_input() except EOFError: break for i in range(26): t = caesar(encrypt_txt, i) if "the" in t or "this" in t or "that" in t: print t break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,478
s937697325
p00017
u299798926
1512906695
Python
Python3
py
Accepted
20
5568
638
t = ord("t") z = ord("z") a = ord("a") def _decode(tv, v): spam = ord(v) if not (a <= spam <= z): return v x = t - ord(tv) y = spam + x if y > z: y = a + (y % z) - 1 elif y < a: y = z - (a - y - 1) return chr(y) while 1: try: txt = input() for s in [x for x in txt.split() if 3 <= len(x) <= 4]: tv = s[0] dec_val = ''.join(list(map(lambda x:_decode(tv,x),s))) if (dec_val in ('this', 'the', 'that')): print(''.join(list(map(lambda x:_decode(tv,x),txt)))) break except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,479
s359059005
p00017
u299798926
1512906727
Python
Python3
py
Accepted
20
5564
226
import sys a = 'abcdefghijklmnopqrstuvwxyz' for s in sys.stdin: for n in range(1, 27): t = s[:-1].translate(str.maketrans(a, a[n:] + a[:n])) if 'the' in t or 'this' in t or 'that' in t: break print(t)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,480
s519066331
p00017
u203261375
1513472715
Python
Python3
py
Accepted
20
5564
466
while True: try: s = input() except: break 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)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,481
s817684434
p00017
u028347703
1514735515
Python
Python3
py
Accepted
30
5568
445
import sys for line in sys.stdin: if line == '\r' or line == '\n': break slist = list(line) slist.pop() while True: for i in range(len(slist)): if slist[i] == ' ' or slist[i] == '.' or slist[i] == ',': continue elif slist[i] == 'z': slist[i] = 'a' else: slist[i] = chr(ord(slist[i]) + 1) s = ''.join(slist) if "the" in s or "this" in s or "that" in s: print(s) break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,482
s784881149
p00017
u024715419
1515138310
Python
Python3
py
Accepted
30
5560
450
while True: try: 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 except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,483
s729467133
p00017
u764789069
1515419900
Python
Python
py
Accepted
10
4688
992
def ShiftCharacter(str): plaintext="" for ch in list(str): if 'a' <= ch <= 'z': plaintext += chr((ord(ch)-ord('a') + 1) % 26 + ord('a')) else: plaintext +=ch return plaintext def Match(str): fg = 0 if (str=="the") or (str=="this") or (str=="that"): fg = 1 return fg while True: try: flag =0 word=raw_input().split() if len(word)==0: break while (flag==0): #try: #print "aaaaa" for i in range(0,len(word)): word[i]=ShiftCharacter(word[i]) #print word[i] for j in range(0,len(word)): if Match(word[j]) == 1: flag = 1 break else: continue if flag==1: for k in range(0,len(word)-1): print word[k], print word[len(word)-1] except: break
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,484
s850752291
p00017
u043254318
1516635411
Python
Python3
py
Accepted
40
6512
729
import math import re def get_input(): while True: try: yield ''.join(input()) except EOFError: break N = list(get_input()) for l in range(len(N)): S = list(N[l]) ans = "" for d in range(26): for i in range(len(S)): if ord('a') <= ord(S[i]) and ord(S[i]) < ord('z'): S[i] = chr(ord(S[i])+1) elif ord(S[i]) == ord('z'): S[i] = 'a' s = "".join(S) s = s.replace('.','') test = s.split() for i in range(len(test)): if test[i] == "the" or test[i] == "that" or test[i] == "this": ans = "".join(S) if ans != "": break print(ans)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,485
s267610159
p00017
u546285759
1516697421
Python
Python3
py
Accepted
40
6684
768
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 = ans + "." if c == "." else ans + " " print(ans)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,486
s206222110
p00017
u150984829
1516937674
Python
Python3
py
Accepted
30
5572
204
import sys a='abcdefghijklmnopqrstuvwxyz' 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)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,487
s195967618
p00017
u150984829
1516937679
Python
Python3
py
Accepted
20
5568
204
import sys a='abcdefghijklmnopqrstuvwxyz' 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)
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,488
s972498650
p00017
u150984829
1516937751
Python
Python3
py
Accepted
30
5568
199
import sys a='abcdefghijklmnopqrstuvwxyz' 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.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,489
s549644391
p00017
u150984829
1516937754
Python
Python3
py
Accepted
30
5576
199
import sys a='abcdefghijklmnopqrstuvwxyz' 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.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,490
s609854944
p00017
u150984829
1516937757
Python
Python3
py
Accepted
20
5568
199
import sys a='abcdefghijklmnopqrstuvwxyz' 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.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,491
s848536028
p00017
u150984829
1516939205
Python
Python3
py
Accepted
30
5572
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,492
s593189644
p00017
u150984829
1516939221
Python
Python3
py
Accepted
30
5572
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,493
s390024167
p00017
u150984829
1516939223
Python
Python3
py
Accepted
30
5568
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,494
s564757413
p00017
u150984829
1516939226
Python
Python3
py
Accepted
30
5572
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,495
s213504130
p00017
u150984829
1516939229
Python
Python3
py
Accepted
30
5572
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,496
s224691731
p00017
u150984829
1516939234
Python
Python3
py
Accepted
30
5568
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,497
s691364606
p00017
u150984829
1516943876
Python
Python3
py
Accepted
30
5576
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,498
s015191939
p00017
u150984829
1516943879
Python
Python3
py
Accepted
30
5568
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,499
s768033037
p00017
u150984829
1516943881
Python
Python3
py
Accepted
30
5572
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,500
s186604752
p00017
u150984829
1516943882
Python
Python3
py
Accepted
30
5572
180
import sys for b in sys.stdin: for i in range(26): c=''.join([e,chr((ord(e)-96+i)%26+97)][96<ord(e)<123]for e in b) if any(('the'in c,'this'in c,'that'in c)):print(c.strip())
p00017
<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>
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
6,501