submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s120080175
p00016
Accepted
import math X = Y = a = 0 while True: x,y = map(int,input().split(',')) if x == y == 0: break r = a * math.pi / 180 X += x*math.sin(r) Y += x*math.cos(r) a+=y print(*map(int,(X,Y)),sep='\n')
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s311303369
p00016
Accepted
import math if __name__ == '__main__': x = y = 0 deg = 90 while True: d,a = map(int,input().split(",")) if d == 0 and a == 0: break x += math.cos(math.radians(deg)) * d y += math.sin(math.radians(deg)) * d deg -= a print(int(x)) print(int(y))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s262325021
p00016
Accepted
import math x,y=0,0 angle=math.pi/2 while True: d,a=map(int,input().split(",")) if (d,a)==(0,0): break y +=math.cos(angle)*d x +=math.sin(angle)*d angle -=a*math.pi/180 print(int(y)) print(int(x))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s517407116
p00016
Accepted
import sys, cmath, math t = complex(0) a = math.pi/2 for line in sys.stdin: l = list(map(int, line.split(","))) if l == [0, 0]: break t += cmath.rect(l[0], a) a -= l[1]*math.pi/180 print(int(t.real)) print(int(t.imag))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s362973904
p00016
Accepted
import math x=0 y=0 face=math.pi/2 while True: d,a = map(int,input().split(",")) if d==0 and a==0: break x+=math.cos(face)*d y+=math.sin(face)*d face -=a*math.pi/180 print(int(x)) print(int(y))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s598298428
p00016
Accepted
import math PI = 4.0 * math.atan(1.0) x = 0 y = 0 angle = 90.0 * PI / 180.0 while True: a,b = map(int, input().split(',')) if a == 0 and b == 0: print(int(x)) print(int(y)) break x += a*math.cos(angle) y += a*math.sin(angle) angle -= b * PI / 180.0
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s259702652
p00016
Accepted
deg = 0.0 x = 0.0 y = 0.0 from math import pi, cos,sin while(1): a,b = [int(i) for i in input().split(",")] if a == 0.0 and b==0.0: print(int(y)) print(int(x)) break else: x += a*cos(deg*pi/180) y += a*sin(deg*pi/180) deg += b
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s480414459
p00016
Accepted
import math class Pos(): x = 0 y = 0 direction = math.radians(90) cur_pos = Pos() while True: d, a = [int(i) for i in input().split(",")] if d == 0 and a == 0: break cur_pos.x += d * math.cos(cur_pos.direction) cur_pos.y += d * math.sin(cur_pos.direction) cur_pos.direction -= math.radians(a) #print(cur_pos.x, cur_pos.y, math.degrees(cur_pos.direction)) print(int(cur_pos.x)) print(int(cur_pos.y))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s559495658
p00016
Accepted
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))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s183236518
p00016
Accepted
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))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s435999060
p00016
Accepted
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
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s206204267
p00016
Accepted
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()
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s045256263
p00016
Accepted
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))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s043685040
p00016
Accepted
# 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))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s129774133
p00016
Runtime Error
import math x,y,r = 0,0,90 while True: m,n = map(int,raw_input().split(',')) if (m,n) == (0,0): break y += m * math.sin(math.radians(r)) y x+= m * math.cos(math.radians(r)) r -= n print(int(x)) print(int(y))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s002498016
p00016
Runtime Error
import turtle k = turtle.Turtle() k.speed(0) k.left(90) while True: x = map(int,raw_input().split(",")) if x[0] == 0 and x[1] == 0: break else: k.fd(x[0]) k.right(x[1]) continue print int(k.xcor()) print int(k.ycor())
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s429423745
p00016
Runtime Error
import math x = 0 y = 0 r = 90 while True: d,t=map(int, input().split()) if d==0 and t==0: print(int(x),int(y),sep='\n') exit() x += math.cos(math.radians(r)) * d y += math.sin(math.radians(r)) * d r -= t
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s211627172
p00016
Runtime Error
import math x=0 y=0 while True: r,theta=[int(i) for i in input().split()] if r=0 and theta=0: break theta=math.radians(theta) x+=r*math.cos(theta) y+=r*math.sin(theta) print(x,y)
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s681474706
p00016
Runtime Error
import math x=0 y=0 while True: r,theta=[int(i) for i in input().split("/")] if r=0 and theta=0: break theta=math.radians(theta) x+=r*math.cos(theta) y+=r*math.sin(theta) print(x,y)
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s143457393
p00016
Runtime Error
import math x=0 y=0 while True: r,theta=[int(i) for i in input().split("/")] if r=0 and theta=0: break theta=math.radians(theta) x+=r*math.cos(theta) y+=r*math.sin(theta) print(x) print(y)
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s097353730
p00016
Runtime Error
# -*- coding: utf-8 -*- import sys from math import * lineNumber = 0 coord = [0, 0] theta = 0.5 * pi #for line in [ "2", "1000", "800", "9999999999", "1" ]: for line in sys.stdin.readlines(): lineNumber += 1 # line exception if lineNumber == 1: continue # get data List = map(float, line.strip().split()) # set data forward = List[0] d_theta = List[1] / 180.0 * pi # solve coord[0] += forward * cos(theta) coord[1] += forward * sin(theta) theta += d_theta print int(ceil(coord[0])) print int(ceil(coord[1]))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s649044271
p00016
Runtime Error
import math x = 0 y = 0 while True: m, r = map(int, raw_input()) if m == 0 and r == 0: break theta += r rad = theta/180*math.pi x += m*math.cos(rad) y += m*math.sin(rad) print int(x) print int(
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s138124488
p00016
Runtime Error
import math x = 0.0 y = 0.0 while True: m, r = map(int, raw_input().split()) if m == 0 and r == 0: break theta += r rad = theta/180*math.pi x += m*math.cos(rad) y += m*math.sin(rad) print int(x) print int(y)
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s084177718
p00016
Runtime Error
import math x = 0.0 y = 0.0 while True: m, r = map(int, raw_input().split(",")) if m == 0 and r == 0: break theta += r rad = theta/180*math.pi x += m*math.cos(rad) y += m*math.sin(rad) print int(x) print int(y)
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s613546463
p00016
WA: Presentation Error
import sys,math x=y=r=0 m=3.14/180 for l in sys.stdin: h,w=map(int,l.split(",")) x+=h*math.sin(r*m) y+=h*math.cos(r*m) r+=w print"%d\n%d\n"%(x,y)
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s185808733
p00016
WA: Presentation Error
import math def calc(x, y, r, d, nd): x = x + r * math.cos(math.radians(d)) y = y + r * math.sin(math.radians(d)) d -= nd return x, y, d x = y = 0 d = 90 while True: r, nd = map(int, input().split(",")) if r == nd == 0: break x, y, d = calc(x, y, r, d, nd) print(int(x), "\n", int(y))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s157947680
p00016
WA: Presentation Error
import math deg = 90 x = 0.0 y = 0.0 while True: di,ai = map(int, input().split(',')) if di==0 and ai==0: break x += di*math.cos(deg*math.pi/180.0) y += di*math.sin(deg*math.pi/180.0) deg -= ai print("%d\n%d\n" % (x,y))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s245025560
p00016
WA: Presentation Error
import sys import math def TreasureHunt(): x,y=(0.0,0.0) alpha=90 for line in sys.stdin: a,b=list(map(int,line.split(','))) if a==0 and b==0: break x+=a*math.cos(alpha/180.0*math.pi) y+=a*math.sin(alpha/180.0*math.pi) alpha=(alpha-b+360)%360 print(int(x),'\n',int(y)) TreasureHunt()
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s989552045
p00016
WA: Presentation Error
import cmath,math,sys z=0;p=90 for e in sys.stdin: r,d=map(int,e.split(',')) z+=cmath.rect(r,math.radians(p)) p-=d print(int(z.real),'\n',int(z.imag))
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
<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>
s979472162
p00017
Wrong Answer
b = raw_input() a = b.split() cnt = 0 for i in a: for k in range(-26, 53): tmp = "" for j in i: tmp+=chr(ord(j)+k) if tmp == "this" or tmp == "that" or tmp == "the": cnt = k tmp = "" for i in b: if i in "abcdefghijklmnopqrstrvwxyz": tmp += chr(ord(i)+cnt) else: tmp += i print tmp
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s561940240
p00017
Wrong Answer
b = raw_input() a = b.split() cnt = 0 for i in a: for k in range(-26, 26): tmp = "" for j in i: tmp+=chr(ord(j)+k) if tmp == "this" or tmp == "that" or tmp == "the": cnt = k tmp = "" for i in b: if i in "abcdefghijklmnopqrstrvwxyz": tmp += chr(ord(i)+cnt) else: tmp += i print tmp
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s238173452
p00017
Wrong Answer
b = raw_input() a = b.split() cnt = 0 for k in range(-26, 26): tmp = "" for j in b: tmp+=chr(ord(j)+k) if "this" in tmp or "that" in tmp or "the" in tmp: cnt = k tmp = "" for i in b: if i in "abcdefghijklmnopqrstrvwxyz": tmp += chr(ord(i)+cnt) else: tmp += i print tmp
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s388706616
p00017
Wrong Answer
b = raw_input() a = b.split() cnt = 0 for k in range(-26, 26): tmp = "" for j in b: tmp+=chr(ord(j)+k) if "this" in tmp or "that" in tmp or "the" in tmp: cnt = k tmp = "" for i in b: if i in "abcdefghijklmnopqrsturvwxyz": tmp += chr(ord(i)+cnt) else: tmp += i print tmp
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s852919841
p00017
Wrong Answer
b = raw_input() a = b.split() cnt = 0 for k in range(-26, 26): tmp = "" for j in b: tmp+=chr(ord(j)+k) if "this" in tmp or "that" in tmp or "the" in tmp: cnt = k tmp = "" for i in b: if i in "abcdefghijklmnopqrstuvwxyz": tmp += chr(ord(i)+cnt) else: tmp += i print tmp
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s364051697
p00017
Wrong Answer
b = raw_input().strip() a = b.split() cnt = 0 for k in range(-26, 26): tmp = "" for j in b: tmp+=chr(ord(j)+k) if "this" in tmp or "that" in tmp or "the" in tmp: cnt = k tmp = "" for i in b: if i in "abcdefghijklmnopqrstuvwxyz": tmp += chr(ord(i)+cnt) else: tmp += i print tmp
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s307259602
p00017
Wrong Answer
b = raw_input().strip().lower() 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
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s759810694
p00017
Wrong Answer
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
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s616102652
p00017
Wrong Answer
b = raw_input() import string t = string.maketrans("abcdefghijklmnopqrstuvwxyz","bcdefghijklmnopqrstuvwxyza") while not ('the' in b or 'this' in b or 'that' in b): b = b.translate(t) print b
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s174607786
p00017
Wrong Answer
b = "" try: 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
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s476874703
p00017
Wrong Answer
b = "" 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
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s443566588
p00017
Wrong Answer
import sys input_words = [] while True: try: input_words = raw_input().split() assume_list = [list(str) for str in input_words if len(str) == 4 or len(str) == 3] for word in assume_list: shift = ord('t') - ord(word[0]) word = ''.join([chr(ord(c) + shift) for c in word if c.isalpha()]) if word in ["this", "that", "the"]: break else: print "unknown crypt" sys.exit() decrypt_list = [list(str) for str in input_words] for i in range(len(decrypt_list)): for j in range(len(decrypt_list[i])): if decrypt_list[i][j].isalpha(): c = chr(ord(decrypt_list[i][j]) + shift) if ord(c) > ord('z'): c = chr(ord('a') - ord('z') + ord(c) - 1) elif ord(c) < ord('a'): c = chr(ord('z') + ord('a') - ord(c) - 1) decrypt_list[i][j] = c decrypt_list[i] = ''.join([c for c in decrypt_list[i]]) decrypt_list = ' '.join(decrypt_list) print decrypt_list, except EOFError: break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s477218247
p00017
Wrong Answer
import string import sys str = input() alpha = string.ascii_lowercase for str in sys.stdin: for i in range(len(alpha)): cipher_str = "" for s in str: if s in alpha: cipher_str += alpha[(alpha.index(s)+i) % len(alpha)] else: cipher_str += s if ("the" or "this" or "that") in cipher_str: print(cipher_str) break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s416216032
p00017
Wrong Answer
import string import sys line = input() 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" or "this" or "that") in cipher_str: print(cipher_str) break else: print(line)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s017612011
p00017
Wrong Answer
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" or "this" or "that") in cipher_str: print(cipher_str) break else: print(line)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s412056784
p00017
Wrong Answer
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" or "this" or "that") in cipher_str: print(cipher_str, end="") break else: print(line, end="")
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s900968167
p00017
Wrong Answer
#!/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("\n") 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 flag = False s = sys.stdin.read() 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)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s890354000
p00017
Wrong Answer
import sys import string f = sys.stdin sentence = ''.join([line for line in f]) ceasar1 = str.maketrans(string.ascii_lowercase, string.ascii_lowercase[1:] + string.ascii_lowercase[:1]) for i in range(len(string.ascii_lowercase)): sentence = sentence.translate(ceasar1) for word in ['the', 'this', 'that']: if sentence.find(word) != -1: print(sentence) break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s546033378
p00017
Wrong Answer
import sys import string f = sys.stdin sentence = ''.join([line for line in f]) ceasar1 = str.maketrans(string.ascii_lowercase, string.ascii_lowercase[1:] + string.ascii_lowercase[:1]) for i in range(len(string.ascii_lowercase)): sentence = sentence.translate(ceasar1) for word in ['the', 'this', 'that']: if sentence.find(word) != -1: print(sentence, end='') break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s339140005
p00017
Wrong Answer
import sys import string f = sys.stdin sentence = ''.join([line for line in f]) ceasar1 = str.maketrans(string.ascii_lowercase, string.ascii_lowercase[1:] + string.ascii_lowercase[:1]) for i in range(len(string.ascii_lowercase)): sentence = sentence.translate(ceasar1) words = sentence.split() for word in ['the', 'this', 'that']: if word in words: print(sentence, end='') break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s496935547
p00017
Wrong Answer
def convert_alphabets_to_numlist(word_string): temp=[] for char in word_string: for num in range(26): if char==string[num]: temp.append(num) return temp def plus1_to_num_list(ls): "plus 1 each item in ls" for n in range(len(ls)): if ls[n]!=25: ls[n] +=1 elif ls[n]==25: ls[n]=0 return ls def decipher(word_nums): "[19, 7, 4]" temp="" for k in word_nums: temp += string[int(k)] return temp string = 'abcdefghijklmnopqrstuvwxyz' hint=['the','this','that'] hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]] while True: try: cryp=raw_input().split() for word in cryp: word_nums= convert_alphabets_to_numlist(str(word)) n=0 while word_nums not in hint_num and n<26: plus1_to_num_list(word_nums) n+=1 temp = [] for word in cryp: word_nums=convert_alphabets_to_numlist(str(word)) for k in range(n): plus1_to_num_list(word_nums) temp.append(decipher(word_nums)) if '.' not in cryp[-1]: print " ".join(temp) else: temp[-1] += '.' print " ".join(temp) except: break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s658405912
p00017
Wrong Answer
# -*- coding: utf-8 -*- def convert_alphabets_to_numlist(word_string): temp=[] for char in word_string: for num in range(26): if char==string[num]: temp.append(num) return temp def plus1_to_num_list(ls): "plus 1 each item in ls" for n in range(len(ls)): if ls[n]!=25: ls[n] +=1 elif ls[n]==25: ls[n]=0 return ls def decipher(word_nums): "[19, 7, 4]" temp="" for k in word_nums: temp += string[int(k)] return temp string = 'abcdefghijklmnopqrstuvwxyz' hint=['the','this','that'] hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]] while True: try: cryp=raw_input().split() nlist = [] for word in cryp: word_nums= convert_alphabets_to_numlist(str(word)) n=0 min_n =26 while word_nums not in hint_num and n<=26: plus1_to_num_list(word_nums) n+=1 else: nlist.append(n) else: min_n = min(nlist) temp = [] for word in cryp: word_nums=convert_alphabets_to_numlist(str(word)) for k in range(min_n): plus1_to_num_list(word_nums) temp.append(decipher(word_nums)) if '.' not in cryp[-1]: print " ".join(temp) else: temp[-1] += '.' print " ".join(temp) except: break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s175366043
p00017
Wrong Answer
def convert_alphabets_to_numlist(word_string): temp=[] for char in word_string: for num in range(26): if char==string[num]: temp.append(num) return temp def plus1_to_num_list(ls): "plus 1 each item in ls" for n in range(len(ls)): if ls[n]!=25: ls[n] +=1 elif ls[n]==25: ls[n]=0 return ls def decipher(word_nums): "[19, 7, 4]" temp="" for k in word_nums: temp += string[int(k)] return temp string = 'abcdefghijklmnopqrstuvwxyz' hint=['the','this','that'] hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]] while True: try: cryp=raw_input().split() nlist = [] for word in cryp: word_nums= convert_alphabets_to_numlist(str(word)) n=0 min_n =26 while word_nums not in hint_num and n<=26: plus1_to_num_list(word_nums) n+=1 else: nlist.append(n) else: min_n = min(nlist) temp = [] for word in cryp: word_nums=convert_alphabets_to_numlist(str(word)) for k in range(min_n): plus1_to_num_list(word_nums) temp.append(decipher(word_nums)) if '.' not in cryp[-1]: print " ".join(temp) else: temp[-1] += '.' print " ".join(temp) except: break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s631429830
p00017
Wrong Answer
import sys def this(word): i=0 t=[] for c in word: t.append(ord(c)-ord('this'[i])) i+=1 if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]): return t[0] return 30 def that(word): i=0 t=[] for c in word: t.append(ord(c)-ord("that"[i])) i+=1 if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]): return t[0] return 30 def the(word): i=0 t=[] for c in word: t.append(ord(c)-ord("the"[i])) i+=1 if(t[0]==t[1] and t[1]==t[2]): return t[0] return 30 for string in sys.stdin: for word in string.split(" "): if(len(word)==3): if the(word) < 30: x=the(word) break if(len(word)==4): if this(word) <30: x=this(word) break if that(word) <30: x=that(word) break alpha = 'abcdefghijklmnopqrstuvwxyz' result="" for c in string: if c in alpha: result+=alpha[alpha.find(c)] else: result+=c print result[:-1]
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s686658792
p00017
Wrong Answer
s=input() while True: if "this" in s or "that" in s or "the" in s: print(s) break s=list(s) for i in range(len(s)): if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"): if s[i] != "z": s[i] = chr(ord(s[i])+1) else: s[i] = "a" s="".join(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s436109996
p00017
Wrong Answer
s=input() while True: if "this" in s or "that" in s or "the" in s: print(s) break s=list(s) for i in range(len(s)): if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"): if s[i] != "a": s[i] = chr(ord(s[i])-1) else: s[i] = "z" s="".join(s) print(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s791929730
p00017
Wrong Answer
s=input() for _ in range(26): if "this " in s or "that " in s or "the " in s: print(s) break s=list(s) for i in range(len(s)): if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"): if s[i] != "a": s[i] = chr(ord(s[i])-1) else: s[i] = "z" s="".join(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s997309243
p00017
Wrong Answer
s=input() for _ in range(26): if " this " in s or " that " in s or " the " in s: print(s) break s=list(s) for i in range(len(s)): if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"): if s[i] != "a": s[i] = chr(ord(s[i])-1) else: s[i] = "z" s="".join(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s970031060
p00017
Wrong Answer
s=input() for _ in range(26): if " this." in s or " that." in s or " the." in s: print(s) break s=list(s) for i in range(len(s)): if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"): if s[i] != "a": s[i] = chr(ord(s[i])-1) else: s[i] = "z" s="".join(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s159915931
p00017
Wrong Answer
s=input() for _ in range(26): if " this." in s or " that." in s or " the." in s or " this " in s or " that " in s or " the " in s: print(s) break s=list(s) for i in range(len(s)): if ord(s[i]) <= ord("z") and ord(s[i]) >= ord("a"): if s[i] != "a": s[i] = chr(ord(s[i])-1) else: s[i] = "z" s="".join(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s885214493
p00017
Wrong Answer
while 1: try: s = raw_input() li = s.split() for i in li: if len(i) == 4 or len(i) == 3: a = ord(i[0]) - ord(i[1]) b = ord(i[1]) - ord(i[2]) c = ord(i[2]) - ord(i[3]) if a == 12 and b == -1 and c == -10: n = ord(i[0]) - ord("t") break elif a == 12 and b == 3: n = ord(i[0]) - ord("t") break elif a == 12 and b == 7 and c == -19: n = ord(i[0]) - ord("t") break o = "" for c in s: if ord(c) >= 97 and ord(c) <= 122: o += chr(ord(c) - n) else: o += c print(o) except: exit()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s170868185
p00017
Wrong Answer
import sys while 1: try: s = sys.stdin li = s.split() for i in li: if len(i) == 4 or len(i) == 3: a = ord(i[0]) - ord(i[1]) b = ord(i[1]) - ord(i[2]) c = ord(i[2]) - ord(i[3]) if a == 12 and b == -1 and c == -10: n = ord(i[0]) - ord("t") break elif a == 12 and b == 3: n = ord(i[0]) - ord("t") break elif a == 12 and b == 7 and c == -19: n = ord(i[0]) - ord("t") break o = "" for c in s: if ord(c) >= 97 and ord(c) <= 122: o += chr(ord(c) - n) else: o += c print(o) except: exit()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s099875892
p00017
Wrong Answer
import sys while 1: try: s = sys.stdin.read() li = s.split() n = 0 for i in li: if len(i) == 4 or len(i) == 3: a = ord(i[0]) - ord(i[1]) b = ord(i[1]) - ord(i[2]) c = ord(i[2]) - ord(i[3]) if a == 12 and b == -1 and c == -10: n = ord(i[0]) - ord("t") break elif a == 12 and b == 3: n = ord(i[0]) - ord("t") break elif a == 12 and b == 7 and c == -19: n = ord(i[0]) - ord("t") break o = "" for c in s: if ord(c) >= 97 and ord(c) <= 122: o += chr(ord(c) - n) else: o += c print(o) except: exit()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s902820836
p00017
Wrong Answer
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]) sent = input().split() 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)) break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s510155815
p00017
Wrong Answer
import sys def c(w,n):return reduce(lambda a,b:a+b,[chr(ord(x)+n) 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("this"==r or"that"==r): n=116-ord(s[0]) print c(i,n),
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s937772317
p00017
Wrong Answer
import sys def c(w,n):return reduce(lambda a,b:a+b,[chr(ord(x)+n) 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("this"==r or"that"==r): n=116-ord(s[0]) print c(i,n)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s299252342
p00017
Wrong Answer
import sys def c(w,n):return reduce(lambda a,b:a+b,[chr(ord(x)+n) 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("this"==r or"that"==r): n=116-ord(s[0]) print c(i,n).replace("\n","")
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s299200681
p00017
Wrong Answer
import sys def check1(): for string in string_lis: char0 = string[0] if char0 < 't': # + length = (alpha.find('t')+1) - (alpha.find(char0)+1) plus(string, length) # - length = (alpha.find(char0)+1) + 6 minus(string, length) elif 't' < char0: # + length = 26 - (alpha.find(char0)+1) + 20 new_str = plus(string, length) check(new_str, length, '+') # - length = (alpha.find(char0)+1) - 20 new_str = minus(string, length) check(new_str, length, '-') def plus(string, length): new_str = '' for char in string: index = alpha.find(char) + length if index <= 25: new_str += alpha[index] else: index = index - 26 new_str += alpha[index] return new_str def minus(string, length): new_str = '' for char in string: index = alpha.find(char) - length if index >= 0: new_str += alpha[index] else: index = 25 + index + 1 new_str += alpha[index] return new_str def check(new_str, length, flag): result_lis = [] if new_str == 'the' or new_str == 'this' or new_str == 'that': if flag == '+': for string in string_lis: result_lis.append(plus(string, length)) elif flag == '-': for string in string_lis: result_lis.append(minus(string, length)) print ' '.join(result_lis) sys.exit() if __name__ == '__main__': for input_line in sys.stdin: input_line = input_line.rstrip('.\n') alpha = 'abcdefghijklmnopqrstuvwxyz' string_lis = input_line.split() check1()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s646614582
p00017
Wrong Answer
import sys def check1(): for string in string_lis: char0 = string[0] if char0 < 't': length = (alpha.find('t')+1) - (alpha.find(char0)+1) plus(string, length) elif 't' < char0: length = 26 - (alpha.find(char0)+1) + 20 new_str = plus(string, length) check(new_str, length, '+') def plus(string, length): new_str = '' for char in string: index = alpha.find(char) + length if index <= 25: new_str += alpha[index] else: index = index - 26 new_str += alpha[index] return new_str def check(new_str, length, flag): result_lis = [] if new_str == 'the' or new_str == 'this' or new_str == 'that': if flag == '+': for string in string_lis: result_lis.append(plus(string, length)) print ' '.join(result_lis) sys.exit() if __name__ == '__main__': for input_line in sys.stdin: input_line = input_line.rstrip('.\n') alpha = 'abcdefghijklmnopqrstuvwxyz' string_lis = input_line.split() check1()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s604396886
p00017
Wrong Answer
import sys def check1(): for string in string_lis: char0 = string[0] if char0 < 't': length = 20 - (alpha.find(char0)+1) plus(string, length) elif 't' < char0: length = 26 - (alpha.find(char0)+1) + 20 new_str = plus(string, length) check(new_str, length, '+') def plus(string, length): new_str = '' for char in string: index = alpha.find(char) + length if index <= 25: new_str += alpha[index] else: index = index - 26 new_str += alpha[index] return new_str def check(new_str, length, flag): result_lis = [] if new_str == 'the' or new_str == 'this' or new_str == 'that': if flag == '+': for string in string_lis: result_lis.append(plus(string, length)) print ' '.join(result_lis) sys.exit() if __name__ == '__main__': for input_line in sys.stdin: input_line = input_line.rstrip('.\n') alpha = 'abcdefghijklmnopqrstuvwxyz' string_lis = input_line.split() check1()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s180891381
p00017
Wrong Answer
import sys def check1(): for string in string_lis: char0 = string[0] if char0 < 't': length = 20 - (alpha.find(char0)+1) new_str = plus(string, length) check(new_str, length) elif 't' < char0: length = 26 - (alpha.find(char0)+1) + 20 new_str = plus(string, length) check(new_str, length) def plus(string, length): new_str = '' for char in string: index = alpha.find(char) + length if index <= 25: new_str += alpha[index] else: index = index - 26 new_str += alpha[index] return new_str def check(new_str, length): result_lis = [] if new_str == 'the' or new_str == 'this' or new_str == 'that': for string in string_lis: result_lis.append(plus(string, length)) print ' '.join(result_lis) sys.exit() if __name__ == '__main__': for input_line in sys.stdin: input_line = input_line.rstrip('.\n') alpha = 'abcdefghijklmnopqrstuvwxyz' string_lis = input_line.split() check1()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s337439804
p00017
Wrong Answer
import sys def check1(): for string in string_lis: char0 = string[0] if char0 < 't': length = 20 - (alpha.find(char0)+1) new_str = plus(string, length) check(new_str, length) elif 't' < char0: length = 26 - (alpha.find(char0)+1) + 20 new_str = plus(string, length) check(new_str, length) def plus(string, length): new_str = '' for char in string: if char == '.': new_str += '.' continue index = alpha.find(char) + length if index <= 25: new_str += alpha[index] else: index = index - 26 new_str += alpha[index] return new_str def check(new_str, length): result_lis = [] if new_str == 'the' or new_str == 'this' or new_str == 'that': for string in string_lis: result_lis.append(plus(string, length)) print ' '.join(result_lis) sys.exit() if __name__ == '__main__': for input_line in sys.stdin: input_line = input_line.rstrip('\n') alpha = 'abcdefghijklmnopqrstuvwxyz' string_lis = input_line.split() check1()
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s156174893
p00017
Wrong Answer
l=map(str,raw_input().split()) 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) exit() n+=1
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s104701733
p00017
Wrong Answer
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) exit() n+=1 while 1: try: w=map(str,raw_input().split()) sol(w) except: break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s210473722
p00017
Wrong Answer
import string # s = raw_input() s = 'xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.' def cipher(s, shift): abc = string.ascii_lowercase t = '' for c in s: if c == 'a': c = 'z' elif c in abc: c = chr(ord(c) - shift) t += c return t def decode(s): shift = 0 for i in range(len(s) - 3): if (ord(s[i]) - ord(s[i + 1])) % 26 == 12: if ((ord(s[i + 1]) - ord(s[i + 2])) % 26 == 3 or 7 or 25) and (i < len(s) - 3 and s[i] == s[i + 4]): shift = (ord(s[i]) - ord('t')) % 26 break return cipher(s, shift) print decode(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s095005630
p00017
Wrong Answer
s = raw_input() # s = 'xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.' # s = 'aopz' def cipher(s, shift): abc = 'abcdefghijklmnopqrstuvwxyz' t = '' for c in s: if c in abc: if ord(c) - ord('a') < shift: c = chr(ord(c) + 26 - shift) else: c = chr(ord(c) - shift) t += c return t def decode(s): shift = 0 for i in range(len(s) - 2): if (ord(s[i]) - ord(s[i + 1])) % 26 == 12: if ((ord(s[i + 1]) - ord(s[i + 2])) % 26 == 3) or (i < len(s) - 3 and (((ord(s[i + 1]) - ord(s[i + 2])) % 26 == 7 and s[i] == s[i + 3]) or ((ord(s[i + 1]) - ord(s[i + 2])) % 26 == 25 and (ord(s[i + 2]) - ord(s[i + 3])) % 26 == 16))): shift = (ord(s[i]) - ord('t')) % 26 break return cipher(s, shift) print decode(s)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s064831065
p00017
Wrong Answer
from math import * PI = 3.1415926535898 while True: try: s = str(raw_input()) ans = "" for x in s: if x.isalpha(): c = chr(ord(x) - ord('x') + ord('t')) if ord(c) > ord('z'): c = chr(ord(c) - 26) elif ord(c) < ord('a'): c = chr(ord(c) + 26) ans += c else: ans += x print ans except EOFError: break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s256221468
p00017
Wrong Answer
strs='abcdefghijklmnopqrstuvwxyz' #use a string like this, instead of ord() def shifttext(shift): inp=input('') data=[] for i in inp: #iterate over the text not some list if i.strip() and i in strs: # if the char is not a space "" data.append(strs[(strs.index(i) + shift) % 26]) else: data.append(i) #if space the simply append it to data output = ''.join(data) return output print(shifttext(22))
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s639014150
p00017
Wrong Answer
string='abcdefghijklmnopqrstuvwxyz' def shifttext(shift,inp): s=[] for i in inp: if i.strip() and i in string: s.append(string[(string.index(i) + shift) % 26]) else: s.append(i) output = ''.join(s) print (output) inp=input('') c=[] words=inp.split() for word in words: if(len(word)==3): for i in word: print("i is",i) if i in string: k=string.index(i)-20 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k) else: shift=k print(shift) shifttext(shift,inp)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s917419712
p00017
Wrong Answer
string='abcdefghijklmnopqrstuvwxyz' def shifttext(shift,inp): s=[] for i in inp: if i.strip() and i in string: s.append(string[(string.index(i) + shift) % 26]) else: s.append(i) output = ''.join(s) print (output) inp=input('') c=[] words=inp.split() for word in words: if(len(word)==3): for i in word: if i in string: k=string.index(i)-20 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k) else: shift=k elif(len(word)==4): for i in word: if i in string: k=string.index(i)-20 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k) else: shift=k shifttext(shift,inp)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s325841272
p00017
Wrong Answer
string='abcdefghijklmnopqrstuvwxyz' def shifttext(shift,inp): s=[] for i in inp: if i.strip() and i in string: s.append(string[(string.index(i) + shift) % 26]) else: s.append(i) output = ''.join(s) print (output) inp=input('') c=[] words=inp.split() for word in words: if(len(word)==3): for i in word: if i in string: k=string.index(i)-19 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k) else: shift=k elif(len(word)==4): for i in word: if i in string: k=string.index(i)-19 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k)-1 else: shift=k shifttext(shift,inp)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s218784951
p00017
Wrong Answer
string='abcdefghijklmnopqrstuvwxyz' def shifttext(shift,inp): s=[] for i in inp: if i.strip() and i in string: s.append(string[(string.index(i) + shift) % 26]) else: s.append(i) output = ''.join(s) print (output) inp=input('') c=[] words=inp.split() for word in words: if(len(word)==3): for i in word: if i in string: k=string.index(i)-19 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k) break else: shift=k elif(len(word)==4): for i in word: if i in string: k=string.index(i)-19 if(k>0): k=26-string.index(i)-1+20 shift=((k)) break elif(k<0): shift=(-1*k) break else: shift=k shifttext(shift,inp)
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s834145160
p00017
Wrong Answer
import string 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 s0 = input().strip() alphabets = string.ascii_lowercase frequency = sorted([(s0.count(s), 101 - ord(s)) for s in alphabets], reverse=True) ss = s0.strip('.').split() sl3, sl4 = set(s for s in ss if len(s) == 3), set(s for s in ss if len(s) == 4) i, rotate_dict = 0, None for t in frequency: i = t[1] 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')) > 1: break print(''.join(rotate_dict[s] if s.isalpha() else s for s in s0))
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s650379618
p00017
Wrong Answer
import string 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 s0 = input().strip() alphabets = string.ascii_lowercase frequency = sorted([(s0.count(s), 101 - ord(s)) for s in alphabets], reverse=True) ss = s0.strip('.').split() sl3, sl4 = set(s for s in ss if len(s) == 3), set(s for s in ss if len(s) == 4) i, rotate_dict = 0, None for t in frequency: i = t[1] 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 print(''.join(rotate_dict[s] if s.isalpha() else s for s in s0))
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s549407760
p00017
Wrong Answer
import string 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 s0 = input().strip() alphabets = string.ascii_lowercase frequency = sorted([(s0.count(s), ord(s)) for s in alphabets], reverse=True) freq_chr_offset = (4, 0, 19, 8, 14) ss = s0.strip('.').split() sl3, sl4 = set(s for s in ss if len(s) == 3), set(s for s in ss if len(s) == 4) i, rotate_dict = 0, None for t in frequency: for o in freq_chr_offset: i = 97 + o - t[1] rotate_dict = {a: b for a, b in zip(alphabets, alphabets[i:] + alphabets[:i])} if (check_exists(sl3, rotate_dict, 'the') + check_exists(sl4, rotate_dict, 'this') + check_exists(sl4, rotate_dict, 'that')) > 0: break else: continue break print(''.join(rotate_dict[s] if s.isalpha() else s for s in s0))
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s211597038
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] lines = [] for line in sys.stdin: lines.append(line) print lines key = 0 for key in xrange(0,25): ansstr = "" for line in lines: for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] if "this" in ansstr or "the" in ansstr or "this" in ansstr: break print ansstr
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s792897561
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] lines = [] key = 0 for line in sys.stdin: for key in xrange(0,25): ansstr = "" for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] if "this" in ansstr or "the" in ansstr or "this" in ansstr: print ansstr break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s635744689
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] lines = [] key = 0 for line in sys.stdin: line = line.strip() for key in xrange(0,25): ansstr = "" for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] if "this" in ansstr or "the" in ansstr or "this" in ansstr: print ansstr break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s234871792
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] lines = [] key = 0 for line in sys.stdin: line = line.strip() for key in xrange(0,25): ansstr = "" for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] if "this" in ansstr or "the" in ansstr or "that" in ansstr: print ansstr break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s994902831
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] lines = [] key = 0 for line in sys.stdin: line = line.strip() for key in xrange(0,25): ansstr = "" for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] checkwords = ansstr.split() if "this" in checkwords or "the" in checkwords or "that" in checkwords: print ansstr break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s106940725
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] lines = [] key = 0 for line in sys.stdin: line = line.strip() anslist = [] for key in xrange(0,25): ansstr = "" for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] checkwords = ansstr.split() # if "this" in checkwords or "the" in checkwords or "that" in checkwords: # print ansstr # break if "this" in checkwords or "the" in checkwords or "that" in checkwords: anslist.append(ansstr) countlist = [] for ans in anslist: count =0 if "this" in ans: count +=1 if "the" in ans: count +=1 if "that" in ans: count +=1 countlist.append(count) print anslist[countlist.index(max(countlist))]
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s491454923
p00017
Wrong Answer
import sys charlist = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] for line in sys.stdin: line = line.strip() anslist = [] for key in xrange(0,25): ansstr = "" for c in line: if c not in charlist: ansstr += c continue pos = charlist.index(c)+key if pos > 25: pos -= 26 ansstr += charlist[pos] checkwords = ansstr.split() if "this" in checkwords or "the" in checkwords or "that" in checkwords: print ansstr break
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s179735546
p00017
Wrong Answer
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) elif y < a: y = z - (a - y) return chr(y) while 1: try: txt = input() for s in [x for x in txt.split() if len(x) <= 4 and len(x) >= 3]: 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
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s293605622
p00017
Wrong Answer
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) 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
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s736786538
p00017
Wrong Answer
s = input() b = s 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) | ('this' in c) | ('that' in c)): print(c) break b = '' b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s753483637
p00017
Wrong Answer
b = input() 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) | ('this ' in c) | ('that ' in c)| (' the' in c) | (' this' in c) | (' that' in c)): print(c) break b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s690470727
p00017
Wrong Answer
import sys b = sys.stdin 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) | ('this' in c) | ('that' in c)): print(c) break b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s419678268
p00017
Wrong Answer
import sys b = sys.stdin 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) | ('this' in c) | ('that' in c)): print(c, end = '') break b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s775305499
p00017
Wrong Answer
import sys for b in sys.stdin: for i in range(1,26): c = '' for j in b: if(j == 'z'): c += ('a') elif(str.isalpha(j) == 1): c += (chr(ord(j) + 1)) else: c += j if 'the' in c or 'this' in c or 'that' in c: print(c) break b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s308804633
p00017
Wrong Answer
while True: try: b = input() except: break for i in range(1,26): c = '' for j in b: if(j == 'z'): c += ('a') elif(str.isalpha(j) == 1): c += (chr(ord(j) + 1)) else: c += j if 'the' in c or 'this' in c or 'that' in c: print(c) break b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>
s111554261
p00017
Wrong Answer
while True: try: b = input() except: break if 'the' in b or 'this' in b or 'that' in b: print(c) for i in range(1,26): c = '' for j in b: if(j == 'z'): c += ('a') elif(str.isalpha(j) == 1): c += (chr(ord(j) + 1)) else: c += j if 'the' in c or 'this' in c or 'that' in c: print(c) break b = c
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
this is the picture that i took in the trip.
<H1>Caesar Cipher</H1> <p> In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text: <pre> this is a pen </pre> <p> is would become: </p> <pre> uijt jt b qfo </pre> <p> Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that". </p> <H2>Input</H2> <p> Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters. </p> <p> You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text. </p> <p> The number of datasets is less than or equal to 20. </p> <H2>Output</H2> <p> Print decoded texts in a line. </p> <H2>Sample Input</H2> <pre> xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. </pre> <H2>Output for the Sample Input</H2> <pre> this is the picture that i took in the trip. </pre>