s_id string | p_id string | u_id string | date string | language string | original_language string | filename_ext string | status string | cpu_time string | memory string | code_size string | code string | error string | stdout string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s757697522 | p00015 | u602903519 | 1487051945 | Python | Python3 | py | Runtime Error | 0 | 0 | 56 | n=input()
for x in n:
a=input()
b=input()
print(a+b) | File "/tmp/tmplcs7v0pb/tmpcyny9m8n.py", line 2
for x in n:
IndentationError: unexpected indent
| |
s851291587 | p00015 | u602903519 | 1487052060 | Python | Python3 | py | Runtime Error | 0 | 0 | 61 | n=input()
while (i<n):
a=input()
b=input()
print(a+b)
i++ | File "/tmp/tmpky134i51/tmpfspe0h0v.py", line 6
i++
^
SyntaxError: invalid syntax
| |
s719329589 | p00015 | u602903519 | 1487052088 | Python | Python3 | py | Runtime Error | 0 | 0 | 73 | n=input()
while (i<n):
a=input()
b=input()
a=a+b
print(a)
i++ | File "/tmp/tmpc9vf71o8/tmpsm62l4sw.py", line 5
a=a+b
TabError: inconsistent use of tabs and spaces in indentation
| |
s819167072 | p00015 | u602903519 | 1487052095 | Python | Python3 | py | Runtime Error | 0 | 0 | 73 | n=input()
while (i<n):
a=input()
b=input()
a=a+b
print(a)
i++ | File "/tmp/tmpd5p97gqb/tmpqawpz7r2.py", line 5
a=a+b
TabError: inconsistent use of tabs and spaces in indentation
| |
s727146507 | p00015 | u400458488 | 1489900535 | Python | Python | py | Runtime Error | 0 | 0 | 206 | n = int(input())
for i in range(n):
x = input()
y = input()
ans = int(x) + int(y)
if len(x) > 80 or len(y) > 80 or len(str(ans)) > 80:
print("overflow")
else:
print(ans) | Traceback (most recent call last):
File "/tmp/tmpcbzsavj6/tmpdlf4ootn.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s827019471 | p00015 | u546285759 | 1491657717 | Python | Python3 | py | Runtime Error | 0 | 0 | 166 | while True:
n = int(input())
for _ in range(n):
a, b = int(input()), int(input())
x = str(a+b)
print('overflow' if len(x) > 80 else x) | Traceback (most recent call last):
File "/tmp/tmpta26l3ws/tmp6ymd2co4.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s106209458 | p00015 | u546285759 | 1491657745 | Python | Python3 | py | Runtime Error | 0 | 0 | 168 | while True:
n = int(input())
for _ in range(n):
a, b = int(input()), int(input())
x = str(a+b)
print('overflow' if len(x) > 80 else a+b) | Traceback (most recent call last):
File "/tmp/tmptkii5esu/tmp_2a9u56b.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s092689465 | p00015 | u299798926 | 1511583566 | Python | Python3 | py | Runtime Error | 0 | 0 | 190 | import math
count=int(input())
for i in range(count):
x=int(input())
y=int(input())
ans=x+y
if int(math.log10(ans)>=80)
print("overflow")
else:
print(ans) | File "/tmp/tmppfv5fx99/tmptlzlp4ly.py", line 7
if int(math.log10(ans)>=80)
^
SyntaxError: expected ':'
| |
s821094863 | p00015 | u299798926 | 1511583619 | Python | Python3 | py | Runtime Error | 0 | 0 | 191 | import math
count=int(input())
for i in range(count):
x=int(input())
y=int(input())
ans=x+y
if int(math.log10(ans)>=80):
print("overflow")
else:
print(ans) | Traceback (most recent call last):
File "/tmp/tmp989j69za/tmpeend8uc0.py", line 2, in <module>
count=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s422495536 | p00015 | u424041287 | 1512108946 | Python | Python3 | py | Runtime Error | 0 | 0 | 153 | for i in range(int(input()))
try:
a = [sum(int(j)) for j in input().split()]
except:
print("overflow")
else:
print(a) | File "/tmp/tmphf4kcae8/tmp9ca_jjvw.py", line 1
for i in range(int(input()))
^
SyntaxError: expected ':'
| |
s351615462 | p00015 | u424041287 | 1512109191 | Python | Python3 | py | Runtime Error | 0 | 0 | 152 | for i in range(int(input())):
try:
a = sum([int(j) for j in input()split()]
except:
print("overflow")
else:
print(a) | File "/tmp/tmp3b765s4s/tmp1ajj_xcx.py", line 3
a = sum([int(j) for j in input()split()]
^^^^^
SyntaxError: invalid syntax
| |
s996557683 | p00015 | u424041287 | 1512109219 | Python | Python3 | py | Runtime Error | 0 | 0 | 153 | for i in range(int(input())):
try:
a = sum([int(j) for j in input().split()]
except:
print("overflow")
else:
print(a) | File "/tmp/tmpjwclk_en/tmpbo8v2suf.py", line 3
a = sum([int(j) for j in input().split()]
^
SyntaxError: '(' was never closed
| |
s539278246 | p00015 | u424041287 | 1512109430 | Python | Python3 | py | Runtime Error | 0 | 0 | 165 | for i in range(int(input())):
try:
a = sum([int(j) for j in input().split()])
if a > 2147483647:
print("overflow")
else:
print(a) | File "/tmp/tmp4rdlb9wx/tmpkah3welp.py", line 4
if a > 2147483647:
^^
SyntaxError: expected 'except' or 'finally' block
| |
s973864594 | p00015 | u700120734 | 1514623813 | Python | Python3 | py | Runtime Error | 0 | 0 | 170 | n = int(input())
for i in range(0, n) :
a, b = list(map(int, input().split()))
sum = a + b
if str(sum).length() > 80 :
print("overflow")
else :
print(sum) | Traceback (most recent call last):
File "/tmp/tmpnr7735b8/tmp58lo5k5c.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s639198803 | p00015 | u024715419 | 1515134717 | Python | Python3 | py | Runtime Error | 0 | 0 | 189 | import math
n = int(input())
for i in range(n):
x = int(input())
y = int(input())
if int(math.log10(x + y) + 1) > 80:
print("overflow")
else:
print(x + y)
| Traceback (most recent call last):
File "/tmp/tmprgycy70s/tmpn8zq_810.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s528050985 | p00015 | u024715419 | 1515134740 | Python | Python3 | py | Runtime Error | 0 | 0 | 188 | import math
n = int(input())
for i in range(n):
x = int(input())
y = int(input())
if int(math.log10(x + y) + 1) > 80:
print("overflow")
else:
print(x + y)
| Traceback (most recent call last):
File "/tmp/tmp6wb6fuoo/tmp3j7o1t6f.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s634840224 | p00015 | u536280367 | 1530191997 | Python | Python3 | py | Runtime Error | 0 | 0 | 1358 | """
# Too slow
def add2(a, b):
a, b = align_digit(a, b)
zipped = zip(a[::-1], b[::-1])
carry = 0
result = []
for a, b in zipped:
s = int(a) + int(b) + carry
carry = int(s / 10)
result.append(str(s % 10))
if result[-1] == '0':
result[-1] = str(carry)
print(''.join(result[::-1]))
"""
def align_digit(a, b):
la, lb = len(a), len(b)
if la < lb:
a = a.zfill(lb)
elif lb < la:
b = b.zfill(la)
return a, b
def split_to_ints(s, n=10):
length = len(s)
return [int(s[i-n:i]) for i in range(length, 0, -n)]
def add(a, b, n=10):
a, b = align_digit(a, b)
print(a, b)
ints_a = split_to_ints(a, n)
ints_b = split_to_ints(b, n)
carry = 0
result = []
zipped = list(zip(ints_a, ints_b))[::-1]
print(zipped)
for i, (int_a, int_b) in enumerate(zipped):
s = int_a + int_b + carry
carry = int(s / (10 ** n))
if i != len(zipped) - 1:
result.append(str(s % (10 ** (n - 1))).zfill(n))
else:
result.append(str(s))
print(result)
ret = str(int(''.join(reversed(result))))
if len(ret) > 80:
return 'overflow'
return ret
if __name__ == '__main__':
n_input = int(input())
for i in range(n_input):
a, b = input(), input()
print(add(a, b))
| Traceback (most recent call last):
File "/tmp/tmpw4mzf1wp/tmp7mi358g_.py", line 58, in <module>
n_input = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s376336548 | p00015 | u460331583 | 1346527430 | Python | Python | py | Runtime Error | 0 | 0 | 169 | while True:
count = int(input())
for a in range(count):
q,w =int(input()),int(input())
t=q+w
if t >10**80:
print "overflow"
else:
print t | File "/tmp/tmp6i00xhqy/tmpbrr9lehi.py", line 7
print "overflow"
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s591211022 | p00015 | u881567576 | 1349861036 | Python | Python | py | Runtime Error | 0 | 0 | 695 | line_num = int(raw_input())
for n in range(line_num):
a = raw_input()
b = raw_input()
ov = 0
if len(a) > 80 or len(b) > 80:
print 'overflow'
ov = 1
filled_a, filled_b = a.zfill(80), b.zfill(80)
rlist_a = map(int,list(filled_a)[::-1])
rlist_b = map(int,list(filled_b)[::-1])
rlist_sum = []
for n in range(80):
rlist_sum.append(rlist_a[n]+rlist_b[n])
for n in range(79):
if rlist_sum[n] > 9:
rlist_sum[n] -= 10
rlist_sum[n+1] += 1
if rlist_sum[79] > 9:
if ov < 1:
print 'overflow'
else
list_sum = []
f = 0
for n in rlist_sum[::-1]:
if f > 0:
list_sum.append(n)
else:
if n > 0:
f = 1
list_sum.append(n)
print ''.join(map(str,list_sum)) | File "/tmp/tmpmdp6v5c2/tmpxdg47m2c.py", line 7
print 'overflow'
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s811080794 | p00015 | u719737030 | 1351128546 | Python | Python | py | Runtime Error | 0 | 0 | 135 | import sys
ds = int(raw_input())
list =[int(x) for x in sys.stdin]
print list
for i in xrange(ds):
print str(list[i*2]+list[i*2+1]) | File "/tmp/tmpokp8xtkz/tmpedrfpzv4.py", line 4
print list
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s092400864 | p00015 | u719737030 | 1351129221 | Python | Python | py | Runtime Error | 0 | 0 | 136 | import sys
ds = int(raw_input())
list =[long(x) for x in sys.stdin]
print list
for i in xrange(ds):
print str(list[i*2]+list[i*2+1]) | File "/tmp/tmpoyaa61oa/tmp1to6sxin.py", line 4
print list
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s152401463 | p00015 | u719737030 | 1351129375 | Python | Python | py | Runtime Error | 0 | 0 | 147 | import sys
ds = int(raw_input())
list =[int(x) for x in sys.stdin.readlines()]
print list
for i in xrange(ds):
print str(list[i*2]+list[i*2+1]) | File "/tmp/tmpuuydm0ns/tmp3kfcik1k.py", line 4
print list
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s583631837 | p00015 | u719737030 | 1351130273 | Python | Python | py | Runtime Error | 0 | 0 | 231 | import sys
ds = int(raw_input())
list =[long(x.strip()) for x in sys.stdin.readlines()]
print list
for i in xrange(ds):
sum = str(list[i*2]+list[i*2+1])
if len(sum) > 80:
print "overflow"
else:
print sum | File "/tmp/tmp_6a58slb/tmpruwv7ttd.py", line 4
print list
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s235071268 | p00015 | u290605490 | 1355230065 | Python | Python | py | Runtime Error | 0 | 0 | 127 | n=input()
for i in range(n):
a=input()
b=input()
if str(a+b)>80:
print overflow
else:
print a+b | File "/tmp/tmpumeq08mb/tmprha5h847.py", line 6
print overflow
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s196033184 | p00015 | u542421762 | 1368180264 | Python | Python | py | Runtime Error | 0 | 0 | 1122 | import sys
def to_list(n):
l = list(n)
ls = len(l)
l = ['0'] * (80 - ls) + l
l.reverse()
return l
def add(a, b, c):
x = a + b + c
if x >= 10:
y = x / 10
x = x % 10
else:
y = 0
return (x, y)
def str_add(a, b):
s = a[0]
k = a[1]
i = int(b[0])
j = int(b[1])
(x, y) = add(i, j, k)
return (s + str(x), y)
def str_format(s):
l = list(s)
l.reverse()
s = ''.join(l)
return s.lstrip('0')
def solv(a, b):
la = to_list(a)
lb = to_list(b)
z = map((lambda x, y: (x, y)), la, lb)
r = reduce((lambda a, b: str_add(a, b)), z, ('', 0))
if r[1] > 0:
return "overflow"
else:
result = str_format(r[0])
return result
def make_pair(lis):
ps = []
while lis:
a = lis.pop(0).rstrip("\r\n")
b = lis.pop(0).rstrip("\r\n")
ps.append((a, b))
return ps
#input_file = open(sys.argv[1], "r")
#lines = input_file.readlines()
lines = sys.stdin.readlines()
lines.pop(0)
pairs = make_pair(lines)
for p in pairs:
result = solv(p[0], p[1])
print result | File "/tmp/tmpii6aazh7/tmp8rxvxy3u.py", line 68
print result
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s940057852 | p00015 | u542421762 | 1368181203 | Python | Python | py | Runtime Error | 0 | 0 | 1170 | #
# AIZU ONLINE JUDGE: National Budget
# cf. http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0015&lang=jp
#
import sys
def to_list(n):
l = list(n)
ls = len(l)
l = ['0'] * (80 - ls) + l
l.reverse()
return l
def add(a, b, c):
x = a + b + c
if x >= 10:
y = x / 10
x = x % 10
else:
y = 0
return (x, y)
def str_add(a, b):
s = a[0]
k = a[1]
i = int(b[0])
j = int(b[1])
(x, y) = add(i, j, k)
return (s + str(x), y)
def str_format(s):
l = list(s)
l.reverse()
s = ''.join(l)
return s.lstrip('0')
def solv(a, b):
la = to_list(a)
lb = to_list(b)
z = map((lambda x, y: (x, y)), la, lb)
r = reduce((lambda a, b: str_add(a, b)), z, ('', 0))
if r[1] > 0:
return "overflow"
else:
result = str_format(r[0])
return result
def make_pair(lis):
ps = []
while lis:
a = lis.pop(0).rstrip("\r\n")
b = lis.pop(0).rstrip("\r\n")
ps.append((a, b))
return ps
lines = sys.stdin.readlines()
lines.pop(0)
pairs = make_pair(lines)
for p in pairs:
result = solv(p[0], p[1])
print result | File "/tmp/tmp456vi3px/tmpjjad4mf9.py", line 70
print result
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s643078338 | p00015 | u192116640 | 1375414358 | Python | Python | py | Runtime Error | 0 | 0 | 132 | while True:
a=raw_input()
b=raw_input()
if int((a + b) / 10**80):
print "overflow"
else:
print a + b | File "/tmp/tmpfxpk77vj/tmpjl_pyywz.py", line 5
print "overflow"
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s998603672 | p00015 | u192116640 | 1375414466 | Python | Python | py | Runtime Error | 0 | 0 | 102 | a=raw_input()
b=raw_input()
total=a+b
if int(total/10**80):
print "overflow"
else:
print total | File "/tmp/tmpdzv27s9c/tmp9xow7fc3.py", line 5
print "overflow"
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s100520365 | p00015 | u192116640 | 1375414664 | Python | Python | py | Runtime Error | 0 | 0 | 93 | a=input()
b=input()
total=a+b
if int(total/10**80)
print "overflow"
else:
print total | File "/tmp/tmpl6yl75en/tmpnahfodnf.py", line 4
if int(total/10**80)
^
SyntaxError: expected ':'
| |
s395937900 | p00015 | u881100444 | 1376726713 | Python | Python | py | Runtime Error | 0 | 0 | 189 | n = int(raw_input())
for i in range(0,n);
a = int(raw_input())
b = int(raw_input())
ans = str(a+b)
if len(ans) > 80;
print 'overflow'
else:
print sum | File "/tmp/tmpnm9c_iwx/tmp6tublsav.py", line 3
for i in range(0,n);
^
SyntaxError: invalid syntax
| |
s755554060 | p00015 | u230836528 | 1392286880 | Python | Python | py | Runtime Error | 0 | 0 | 529 | # -*- coding: utf-8 -*-
import sys
lineNumber = 0
#for line in [ "2", "1000", "800", "999999999999999999999999999", "1" ]:
for line in sys.stdin.readlines():
lineNumber += 1
# line exception
if lineNumber == 1:
continue
# get data
List = map(int, line.strip().split())
# set data
if lineNumber % 2 == 0: a = List[0]
else : b = List[0]
# sum
if lineNumber % 2 == 1:
c = a + b
if c < 10**79: print c
else : print "overflow" | File "/tmp/tmptl9cq6ft/tmp5d6jh1u9.py", line 25
if c < 10**79: print c
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s368616675 | p00015 | u230836528 | 1392286937 | Python | Python | py | Runtime Error | 0 | 0 | 534 | # -*- coding: utf-8 -*-
import sys
lineNumber = 0
#for line in [ "2", "1000", "800", "999999999999999999999999999", "1" ]:
for line in sys.stdin.readlines():
lineNumber += 1
# line exception
if lineNumber == 1:
continue
# get data
List = map(int, line.strip().split())
# set data
if lineNumber % 2 == 0: a = List[0]
else : b = List[0]
# sum
if lineNumber % 2 == 1:
c = a + b
if c < 10**79: print str(c)
else : print "overflow" | File "/tmp/tmp6yak4es_/tmp48h7qinj.py", line 25
if c < 10**79: print str(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s059903376 | p00015 | u230836528 | 1392287041 | Python | Python | py | Runtime Error | 0 | 0 | 647 | # -*- coding: utf-8 -*-
import sys
lineNumber = 0
#for line in [ "2", "1000", "800", "99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "1" ]:
for line in sys.stdin.readlines():
lineNumber += 1
# line exception
if lineNumber == 1:
[a, b] = [0, 0]
continue
# get data
List = map(int, line.strip().split())
# set data
if lineNumber % 2 == 0: a = List[0]
else : b = List[0]
# sum
if lineNumber % 2 == 1:
c = a + b
if c < 10**79: print str(c)
else : print "overflow" | File "/tmp/tmpql1vwld8/tmpdanlvuup.py", line 26
if c < 10**79: print str(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s286956106 | p00015 | u230836528 | 1392287167 | Python | Python | py | Runtime Error | 0 | 0 | 807 | # -*- coding: utf-8 -*-
import sys
[a, b, c] = [0, 0, 0]
lineNumber = 0
#for line in [ "2", "1000", "800", "99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "1" ]:
for line in sys.stdin.readlines():
lineNumber += 1
# line exception
if lineNumber == 1:
continue
# get data
List = map(int, line.strip().split())
# set data
if lineNumber % 2 == 0: a = List[0]
else : b = List[0]
# sum
if lineNumber % 2 == 1:
c = a + b
if c < 10**79: print str(c)
else : print "overflow" | File "/tmp/tmp429yei39/tmp3y1ja2ec.py", line 26
if c < 10**79: print str(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s588155164 | p00015 | u230836528 | 1392287252 | Python | Python | py | Runtime Error | 0 | 0 | 461 | # -*- coding: utf-8 -*-
import sys
lineNumber = 0
for line in sys.stdin.readlines():
lineNumber += 1
# line exception
if lineNumber == 1:
continue
# get data
List = map(int, line.strip().split())
# set data
if lineNumber % 2 == 0: a = List[0]
else : b = List[0]
# sum
if lineNumber % 2 == 1:
c = a + b
if c < 10**79: print str(c)
else : print "overflow" | File "/tmp/tmpdqhlu6fu/tmpqa98gihq.py", line 24
if c < 10**79: print str(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s894792535 | p00015 | u230836528 | 1392287290 | Python | Python | py | Runtime Error | 0 | 0 | 495 | # -*- coding: utf-8 -*-
import sys
lineNumber = 0
for line in sys.stdin.readlines():
lineNumber += 1
# line exception
if lineNumber == 1:
continue
# get data
#List = map(int, line.strip().split())
List = [ int(line.strip()) ]
# set data
if lineNumber % 2 == 0: a = List[0]
else : b = List[0]
# sum
if lineNumber % 2 == 1:
c = a + b
if c < 10**79: print str(c)
else : print "overflow" | File "/tmp/tmptu1l9k3q/tmp8ri35o_r.py", line 25
if c < 10**79: print str(c)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s314337663 | p00015 | u230836528 | 1392289013 | Python | Python | py | Runtime Error | 0 | 0 | 1260 | # -*- coding: utf-8 -*-
import sys
lineNumber = 0
out = False
#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(int, line.strip().split())
# set data
if lineNumber % 2 == 0: a = line.strip()
else : b = line.strip()
# sum
if lineNumber % 2 == 1:
if not out: out = True
else : print
maxlen = max(len(a), len(b))
if maxlen > 80:
print "overflow",
continue
upper = 0
c = ""
for i in xrange(1, maxlen+1):
try:
buf = int(a[-i]) + int(b[-i]) + upper
upper = buf / 10
buf %= 10
except:
try:
buf = int(a[-i]) + upper
upper = buf / 10
buf %= 10
except:
buf = int(b[-i]) + upper
upper = buf / 10
buf %= 10
c = str(buf) + c
if upper != 0: c = str(upper) + c
if len(c) > 80: print "overflow",
else : print int(c), | File "/tmp/tmp62n_5e0v/tmp5lm_hgay.py", line 31
print "overflow",
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s096549901 | p00015 | u814387366 | 1403081284 | Python | Python | py | Runtime Error | 0 | 0 | 116 | n=input()
for i in range(0,n):
a=input()
b=input()
s=str(a+b)
if(len(s)<=80): print a+b
else print "overflow"
| File "/tmp/tmp6e2472yy/tmpqd2htm3c.py", line 6
if(len(s)<=80): print a+b
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s094596930 | p00015 | u814387366 | 1403081351 | Python | Python | py | Runtime Error | 0 | 0 | 121 | n=input()
for i in range(0,n):
a=input()
b=input()
s=str(a+b)
if(len(s)<=80): print str(a+b)
else print "overflow"
| File "/tmp/tmpymkcny8k/tmpsw3cip5b.py", line 6
if(len(s)<=80): print str(a+b)
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s129774133 | p00016 | u775586391 | 1448032926 | Python | Python3 | py | Runtime Error | 0 | 0 | 223 | 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)) | Traceback (most recent call last):
File "/tmp/tmpmjfzkd4z/tmpwlwyba4h.py", line 4, in <module>
m,n = map(int,raw_input().split(','))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s002498016 | p00016 | u148101999 | 1459387721 | Python | Python | py | Runtime Error | 0 | 0 | 261 | 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()) | File "/tmp/tmpk9y7qpv4/tmp4jqwt1q9.py", line 13
print int(k.xcor())
^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s429423745 | p00016 | u966364923 | 1459949643 | Python | Python3 | py | Runtime Error | 0 | 0 | 240 | 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 | Traceback (most recent call last):
File "/tmp/tmpd08lqe3w/tmpa19iqwov.py", line 6, in <module>
d,t=map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s211627172 | p00016 | u776559258 | 1481165432 | Python | Python3 | py | Runtime Error | 0 | 0 | 185 | 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) | File "/tmp/tmp19ta0l_f/tmp7kjrjm6x.py", line 6
if r=0 and theta=0:
^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s681474706 | p00016 | u776559258 | 1481165485 | Python | Python3 | py | Runtime Error | 0 | 0 | 188 | 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) | File "/tmp/tmpaoay66lc/tmp27ex_4i5.py", line 6
if r=0 and theta=0:
^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s143457393 | p00016 | u776559258 | 1481165538 | Python | Python3 | py | Runtime Error | 0 | 0 | 195 | 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) | File "/tmp/tmpg6bz015n/tmprr5qecys.py", line 6
if r=0 and theta=0:
^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s551853750 | p00016 | u205327055 | 1513175982 | Python | Python3 | py | Runtime Error | 0 | 0 | 305 | # -*- coding:utf-8 -*-
import math
a, b = map(int, raw_input().split(","))
c = 0
x = 0
y = 0
while a != 0 and b != 0:
x += a * math.sin(float(2 * math.pi * c / 360))
y += a * math.cos(float(2 * math.pi * c / 360))
c += b
a, b = map(int, raw_input().split(","))
print int(x)
print int(y) | File "/tmp/tmp9_ay0e_e/tmpm0hlpv7v.py", line 15
print int(x)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s097353730 | p00016 | u230836528 | 1392304804 | Python | Python | py | Runtime Error | 0 | 0 | 574 | # -*- 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])) | File "/tmp/tmpw9kr2go1/tmpwdc2l_md.py", line 29
print int(ceil(coord[0]))
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s649044271 | p00016 | u633068244 | 1393361957 | Python | Python | py | Runtime Error | 0 | 0 | 230 | 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( | File "/tmp/tmpx7b73mmv/tmpixqzuvey.py", line 13
print int(x)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s138124488 | p00016 | u633068244 | 1393362130 | Python | Python | py | Runtime Error | 0 | 0 | 244 | 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) | File "/tmp/tmpa1qx1458/tmpp01j2zzt.py", line 13
print int(x)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s084177718 | p00016 | u633068244 | 1393362148 | Python | Python | py | Runtime Error | 0 | 0 | 247 | 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) | File "/tmp/tmpju0apmcm/tmpn5xvkzg1.py", line 13
print int(x)
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s622383419 | p00017 | u525366883 | 1535536366 | Python | Python | py | Runtime Error | 0 | 0 | 195 | b = raw_input()
import string
t = string.maketrans("abcdefghijklmnopqrstuvwxyz","bcdefghijklmnopqrstuvwxyza")
while not ('the' in s or 'this' in s or 'that' in s):
b = b.translate(t)
print b
| File "/tmp/tmpc0vxvn28/tmp00hd6jmh.py", line 6
print b
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s954468403 | p00017 | u525366883 | 1535536574 | Python | Python | py | Runtime Error | 0 | 0 | 230 | b = ""
try:
b += raw_input()
except:
break
import string
t = string.maketrans("abcdefghijklmnopqrstuvwxyz","bcdefghijklmnopqrstuvwxyza")
while not ('the' in b or 'this' in b or 'that' in b):
b = b.translate(t)
print b
| File "/tmp/tmpbxn8c8w2/tmpzltkgsqw.py", line 10
print b
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s418392550 | p00017 | u093607836 | 1403885234 | Python | Python3 | py | Runtime Error | 0 | 0 | 223 | import sys,string
a = string.ascii_lowercase
t = string.maketrans(a,a[1:]+a[0])
for s in sys.stdin:
s = s.strip()
while not ('the' in s or 'this' in s or 'that' in s):
s = s.translate(t)
print s | File "/tmp/tmp_pj0d1ot/tmpjkkm230g.py", line 9
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s906024923 | p00017 | u124909914 | 1406088344 | Python | Python | py | Runtime Error | 0 | 0 | 432 | import sys
while True:
input = raw_input()
for i in range(0, 26):
str = ""
for c in input:
if c.isalpha():
c = chr(ord(c) + i)
if ord(c) > ord('z'):
c = chr(ord('a') - ord('z') + ord(c) - 1)
str += c
for word in ["this", "that", "the"]:
if (str.find(word) != -1):
print str
break | File "/tmp/tmp5j8ckdo7/tmpdq8xo7t5.py", line 15
print str
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s263577224 | p00017 | u018580670 | 1418736352 | Python | Python | py | Runtime Error | 0 | 0 | 152 | d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+6) % 26 + c)
print "".join([d.get(c, c) for c in text]) | File "/tmp/tmp9479i46z/tmpsapfn71u.py", line 1
d = {}
IndentationError: unexpected indent
| |
s409791231 | p00017 | u879226672 | 1423812879 | Python | Python | py | Runtime Error | 0 | 0 | 1382 | # -*- coding: utf-8 -*-
def convert_alphabets_to_numlist(word_string):
"wordを受け取り番号リストに変換する"
temp=[]
for char in word_string:
for num in range(26):
if char==string[num]:
temp.append(num)
return temp
def plus1_to_num_list(ls):
"数字化した各単語に1を足す"
for n in range(len(ls)):
if ls[n]!=25:
ls[n] +=1
elif ls[n]==25:
ls[n]=0
return ls
def decipher(word_nums):
"[19, 7, 4]などを受け取る"
temp=""
for k in word_nums:
temp += string[int(k)]
return temp
string = 'abcdefghijklmnopqrstuvwxyz'
hint=['the','this','that']
hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]]
while True:
cryp=raw_input().split()
for word in cryp:
word_nums= convert_alphabets_to_numlist(str(word))
n=0
while word_nums not in hint_num and n<26:
plus1_to_num_list(word_nums)
n+=1
# すべてをn回ずらす
temp = []
for word in cryp:
word_nums=convert_alphabets_to_numlist(str(word))
for k in range(n):
plus1_to_num_list(word_nums)
temp.append(decipher(word_nums))
if '.' not in cryp[-1]:
print " ".join(temp)
else:
temp[-1] += '.'
print " ".join(temp) | File "/tmp/tmp0wryf1rd/tmpwa0eqt_0.py", line 47
print " ".join(temp)
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s692955023 | p00017 | u879226672 | 1423812935 | Python | Python | py | Runtime Error | 0 | 0 | 1240 | def convert_alphabets_to_numlist(word_string):
temp=[]
for char in word_string:
for num in range(26):
if char==string[num]:
temp.append(num)
return temp
def plus1_to_num_list(ls):
"plus 1 each item in ls"
for n in range(len(ls)):
if ls[n]!=25:
ls[n] +=1
elif ls[n]==25:
ls[n]=0
return ls
def decipher(word_nums):
"[19, 7, 4]"
temp=""
for k in word_nums:
temp += string[int(k)]
return temp
string = 'abcdefghijklmnopqrstuvwxyz'
hint=['the','this','that']
hint_num=[[19, 7, 4],[19, 7, 8, 18],[19, 7, 0, 19]]
while True:
cryp=raw_input().split()
for word in cryp:
word_nums= convert_alphabets_to_numlist(str(word))
n=0
while word_nums not in hint_num and n<26:
plus1_to_num_list(word_nums)
n+=1
temp = []
for word in cryp:
word_nums=convert_alphabets_to_numlist(str(word))
for k in range(n):
plus1_to_num_list(word_nums)
temp.append(decipher(word_nums))
if '.' not in cryp[-1]:
print " ".join(temp)
else:
temp[-1] += '.'
print " ".join(temp)
| File "/tmp/tmpzy195_fj/tmphf2zuy2f.py", line 45
print " ".join(temp)
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s808962251 | p00017 | u879226672 | 1423814273 | Python | Python | py | Runtime Error | 0 | 0 | 44 | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. | File "/tmp/tmp8chxo1xe/tmpzex5kmde.py", line 1
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
^^
SyntaxError: invalid syntax
| |
s951966289 | p00017 | u540744789 | 1425877767 | Python | Python | py | Runtime Error | 0 | 0 | 1105 | import sys
def this(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord('this'[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def that(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("that"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def the(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("the"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2]):
return t[0]
return 30
for string in sys.stdin:
for word in string.split(" "):
if(len(word)==3):
if the(word) < 30:
x=the(word)
break
if(len(word)==4):
if this(word) <30:
x=this(word)
break
if that(word) <30:
x=that(word)
break
alpha = 'abcdefghijklmnopqrstuvwx'
result=""
for c in string:
if c in alpha:
result+=alpha[alpha.find(c)-x]
else:
result+=c
print result | File "/tmp/tmpozx6tlty/tmpjrw78gjj.py", line 53
print result
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s837410238 | p00017 | u540744789 | 1425877915 | Python | Python | py | Runtime Error | 0 | 0 | 1112 | import sys
def this(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord('this'[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def that(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("that"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2] and t[2]==t[3]):
return t[0]
return 30
def the(word):
i=0
t=[]
for c in word:
t.append(ord(c)-ord("the"[i]))
i+=1
if(t[0]==t[1] and t[1]==t[2]):
return t[0]
return 30
for string in sys.stdin:
for word in string.split(" "):
if(len(word)==3):
if the(word) < 30:
x=the(word)
break
if(len(word)==4):
if this(word) <30:
x=this(word)
break
if that(word) <30:
x=that(word)
break
alpha = 'abcdefghijklmnopqrstuvwxyz'
result=""
for c in string:
if c in alpha:
result+=alpha[alpha.find(c)-x]
else:
result+=c
print result[:-1] | File "/tmp/tmp_sy93a7e/tmpk73mtw3g.py", line 53
print result[:-1]
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s745600514 | p00017 | u744114948 | 1425904889 | Python | Python3 | py | Runtime Error | 0 | 0 | 338 | 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) | File "/tmp/tmplw27lplw/tmpihft0o0d.py", line 5
print(s)
^
IndentationError: expected an indented block after 'if' statement on line 4
| |
s279652082 | p00017 | u145563629 | 1429604698 | Python | Python | py | Runtime Error | 0 | 0 | 485 | 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) | Traceback (most recent call last):
File "/tmp/tmp67udl_ww/tmpwjjgoxq7.py", line 1, in <module>
s = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s609436857 | p00017 | u873482706 | 1434476725 | Python | Python | py | Runtime Error | 0 | 0 | 2064 | import sys
def check1():
for string in string_lis:
char0 = string[0]
if char0 < 't':
# +
length = (alpha.find('t')+1) - (alpha.find(char0)+1)
plus(string, length)
# -
length = (alpha.find(char0)+1) + 6
minus(string, length)
elif 't' < char0:
# +
length = 26 - (alpha.find(char0)+1) + 20
print alpha.find(char0)+1
new_str = plus(string, length)
check(new_str, length, '+')
# -
print(1)
length = (alpha.find(char0)+1) - 20
new_str = minus(string, length)
print new_str
check(new_str, length, '-')
def plus(string, length):
new_str = ''
for char in string:
index = alpha.find(char) + length
if index <= 25:
new_str += alpha[index]
else:
index = index - 26
new_str += alpha[index]
return new_str
def minus(string, length):
new_str = ''
for char in string:
index = alpha.find(char) - length
if index >= 0:
new_str += alpha[index]
else:
index = 25 + index + 1
new_str += alpha[index]
return new_str
def check(new_str, length, flag):
result_lis = []
print new_str
if new_str == 'the' or new_str == 'this' or new_str == 'that':
print 1
if flag == '+':
for string in string_lis:
result_lis.append(plus(string, length))
elif flag == '-':
for string in string_lis:
result_lis.append(minus(string, length))
print ' '.join(result_lis)
sys.exit()
if __name__ == '__main__':
for input_line in sys.stdin:
input_line = raw_input()
input_line = input_line.rstrip('.\n')
print input_line
alpha = 'abcdefghijklmnopqrstuvwxyz'
string_lis = input_line.split()
print string_lis
check1() | File "/tmp/tmpyd_5rmv9/tmp327lku91.py", line 17
print alpha.find(char0)+1
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s607514218 | p00017 | u560214129 | 1450456610 | Python | Python3 | py | Runtime Error | 0 | 0 | 517 | strs='abcdefghijklmnopqrstuvwxyz' #use a string like this, instead of ord()
def shifttext(shift):
inp=input('')
data=[]
for i in inp: #iterate over the text not some list
if i.strip() and i in strs: # if the char is not a space ""
data.append(strs[(strs.index(i) + shift) % 26])
else:
data.append(i) #if space the simply append it to data
output = ''.join(data)
return output
print(shifttext(int(input()))) | Traceback (most recent call last):
File "/tmp/tmptfwr3wer/tmpn5uoge19.py", line 12, in <module>
print(shifttext(int(input())))
^^^^^^^
EOFError: EOF when reading a line
| |
s765895237 | p00017 | u797673668 | 1452708259 | Python | Python3 | py | Runtime Error | 0 | 0 | 1123 | import string
import sys
def check_exists(word_set, rotate_dict, search):
for word in word_set:
rotated_word = ''.join(rotate_dict[s] for s in word)
if rotated_word == search:
return True
return False
for line in sys.stdin:
s0 = line.strip()
alphabets = string.ascii_lowercase
frequency = [t[1] for t in sorted([(s0.count(s), ord(s)) for s in alphabets], reverse=True)]
freq_chr_offset = (4, 0, 19, 8, 14)
ss = s0.strip('.').split()
sl3, sl4 = set(s for s in ss if len(s) == 3), set(s for s in ss if len(s) == 4)
i, rotate_dict = 0, None
for order in frequency:
for offset in freq_chr_offset:
i = 97 + offset - order
rotate_dict = {a: b for a, b in zip(alphabets, alphabets[i:] + alphabets[:i])}
if (check_exists(sl3, rotate_dict, 'the')
+ check_exists(sl4, rotate_dict, 'this')
+ check_exists(sl4, rotate_dict, 'that')) > 0:
break
else:
continue
break
print(''.join(rotate_dict[s] if s.isalpha() else s for s in s0)) | ||
s911026622 | p00017 | u650459696 | 1458474219 | Python | Python3 | py | Runtime Error | 0 | 0 | 471 | while True:
try:
b = input()
except:
break
if 'the' in c or 'this' in c or 'that' in b:
print(c)
for i in range(1,26):
c = ''
for j in b:
if(j == 'z'):
c += ('a')
elif(str.isalpha(j) == 1):
c += (chr(ord(j) + 1))
else:
c += j
if 'the' in c or 'this' in c or 'that' in c:
print(c)
break
b = c | ||
s764512079 | p00017 | u075836834 | 1458948333 | Python | Python3 | py | Runtime Error | 0 | 0 | 1190 | def ascii_char(c):
if c<97:
c+=26
elif c>122:
c-=26
return c#type int
def judge_the(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('e')-ord(word[2])==length:
return True
else:
return False
def judge_this(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('i')-ord(word[2])==ord('s')-ord(word[3])==length:
return True
else:
return False
def judge_that(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('a')-ord(word[2])==ord('t')-ord(word[3])==length:
return True
else:
return False
def change(string,l):
string1=""
for i in range(len(string)):
C=ord(string[i])+l
if C<97:
C+=26
elif C>122:
C-=26
string1+=chr(C) if string[i]!='.'
return string1
while True:
try:
A=list(map(str,input().split()))
l=int()
for i in A:
if len(i)==3:
if judge_the(i):
l=ord('e')-ord(i[2])
break
elif len(i)==4:
if judge_this(i):
l=ord('i')-ord(i[2])
break
elif judge_that(i):
l=ord('a')-ord(i[2])
break
else:
break#while?????????
Ans=[""]*len(A)
for i in range(len(A)):
Ans[i]=change(A[i],l)
print(" ".join(Ans))
except EOFError:
break | File "/tmp/tmpcr9ltsem/tmpzo06mboo.py", line 38
string1+=chr(C) if string[i]!='.'
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s897166106 | p00017 | u075836834 | 1458948350 | Python | Python3 | py | Runtime Error | 0 | 0 | 1112 | def judge_the(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('e')-ord(word[2])==length:
return True
else:
return False
def judge_this(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('i')-ord(word[2])==ord('s')-ord(word[3])==length:
return True
else:
return False
def judge_that(word):
length=ord('t')-ord(word[0])
if ord('h')-ord(word[1])==ord('a')-ord(word[2])==ord('t')-ord(word[3])==length:
return True
else:
return False
def change(string,l):
string1=""
for i in range(len(string)):
C=ord(string[i])+l
if C<97:
C+=26
elif C>122:
C-=26
string1+=chr(C) if string[i]!='.'
return string1
while True:
try:
A=list(map(str,input().split()))
l=int()
for i in A:
if len(i)==3:
if judge_the(i):
l=ord('e')-ord(i[2])
break
elif len(i)==4:
if judge_this(i):
l=ord('i')-ord(i[2])
break
elif judge_that(i):
l=ord('a')-ord(i[2])
break
else:
break#while?????????
Ans=[""]*len(A)
for i in range(len(A)):
Ans[i]=change(A[i],l)
print(" ".join(Ans))
except EOFError:
break | File "/tmp/tmpeabeqnbe/tmpyfk9r0ke.py", line 31
string1+=chr(C) if string[i]!='.'
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: expected 'else' after 'if' expression
| |
s603013779 | p00017 | u148101999 | 1459167304 | Python | Python | py | Runtime Error | 0 | 0 | 1038 | #encoding=utf-8
def inp(i):
split_word = i.split()
return split_word
def rot(split_word):
for i in xrange(len(split_word)):
tako = ""
if len(split_word[i]) == 4 or len(split_word[i]) == 3:
num = ord(split_word[i][0]) - ord("t")
for j in xrange(len(split_word[i])):
tako += chr(ord(split_word[i][j]) - num)
if tako == "that" or tako == "the" or tako == "this":
return proce(split_word, num)
else:
pass
num = 0
def proce(split_word, num):
ans = ""
for i in xrange(len(split_word)):
for j in xrange(len(split_word[i])):
if split_word[i][j] < ord("a") or ord("z") < split_word[i][j]:
ans += split_word[i][j]
else:
ans += str(chr(ord(split_word[i][j]) - num))
ans += " "
return ans
if __name__ == "__main__":
import sys
for i in sys.stdin:
word = inp(i)
ans = rot(word)
print ans[0:(len(ans) - 1)] | File "/tmp/tmpa3clip0j/tmpohkos6fh.py", line 37
print ans[0:(len(ans) - 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s833571552 | p00017 | u148101999 | 1459167370 | Python | Python | py | Runtime Error | 0 | 0 | 1038 | #encoding=utf-8
def inp(i):
split_word = i.split()
return split_word
def rot(split_word):
for i in xrange(len(split_word)):
tako = ""
if len(split_word[i]) == 4 or len(split_word[i]) == 3:
num = ord(split_word[i][0]) - ord("t")
for j in xrange(len(split_word[i])):
tako += chr(ord(split_word[i][j]) - num)
if tako == "that" or tako == "the" or tako == "this":
return proce(split_word, num)
else:
pass
num = 0
def proce(split_word, num):
ans = ""
for i in xrange(len(split_word)):
for j in xrange(len(split_word[i])):
if split_word[i][j] < ord("a") or ord("z") < split_word[i][j]:
ans += split_word[i][j]
else:
ans += str(chr(ord(split_word[i][j]) - num))
ans += " "
return ans
if __name__ == "__main__":
import sys
for i in sys.stdin:
word = inp(i)
ans = rot(word)
print ans[0:(len(ans) - 1)] | File "/tmp/tmpbk7c1diq/tmpgkg_911q.py", line 37
print ans[0:(len(ans) - 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s151511559 | p00017 | u894114233 | 1461916257 | Python | Python | py | Runtime Error | 0 | 0 | 831 | while 1:
try:
n=float('inf')
s=raw_input().strip('.').split()
for i in xrange(26):
for j in s:
r=[]
for k in j:
if ord(k)+i<123:
r.append(chr(ord(k)+i))
else:
r.append(chr(97+ord(k)+i-123))
if "".join(r)=="this" or "".join(r)=="that" or "".join(r)=="the":
n=i
if n!=float('inf'):
break
ans=[]
for i in s:
splitans=[]
for j in i:
if ord(j)+n<123:
splitans.append(chr(ord(j)+n))
else:
splitans.append(chr(97+ord(j)+n-122))
ans.append(''.join(splitans))
print(' '.join(ans)+'.') | File "/tmp/tmp264eirnf/tmpw9_dntf9.py", line 26
print(' '.join(ans)+'.')
SyntaxError: expected 'except' or 'finally' block
| |
s138749093 | p00017 | u146816547 | 1462217405 | Python | Python | py | Runtime Error | 0 | 0 | 395 | #!/usr/bin/env python2
# coding: utf-8
def casar(s, n):
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+n) % 26 + c)
return "".join([d.get(c, c) for c in s])
try:
while True:
encrypttxt = raw_input()
for i in range(26):
t = casar(encrypttxt, i)
if "the" in t or "this" in t or "that" in t:
print t
except EOFError:
break | File "/tmp/tmpovw9m05o/tmpgootf44x.py", line 19
print t
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s333771332 | p00017 | u898097781 | 1477816561 | Python | Python3 | py | Runtime Error | 0 | 0 | 491 | worddic = {}
def caesar(n, word):
rword = ''
for char in word:
rword += chr(ord('a') + (ord(char) - ord('a') + n) % 26)
return rword
for i in range(1,26):
worddic[caesar(i, 'the')] = i
worddic[caesar(i, 'this')] = i
worddic[caesar(i, 'that')] = i
str = raw_input()
for word in str.strip('.').split(' '):
if word in worddic.keys():
decode = worddic[word]
break
print ' '.join([caesar(26-decode, word) for word in str.strip('.').split(' ')]) + ('.' if str.find('.')>0 else '') | File "/tmp/tmp_e18j8wk/tmpoe4_9r4n.py", line 20
print ' '.join([caesar(26-decode, word) for word in str.strip('.').split(' ')]) + ('.' if str.find('.')>0 else '')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s871753823 | p00017 | u723913470 | 1493999536 | Python | Python3 | py | Runtime Error | 0 | 0 | 804 | import sys
def restore(n,text):
text_list=list(text)
for i,j in enumerate(text_list):
if ord(j)!=46 and ord(j)!=32:
nw=ord(j)-n
if nw<97:
nw=ord(j)-n+26
text_list[i]=chr(nw)
for i in text_list:
print(i,end='')
print('\n')
def textsa(str):
str_list=list(str)
n=len(str_list)
sa=[]
for i in range(n-1):
sa.append((ord(str_list[i+1])-ord(str_list[i]))%26)
sa.append((ord(str_list[0])-ord(str_list[n-1]))%26)
return sa
for text in sys.stdin:
str=list(map(str,text.split()))
for i in str:
if textsa(i)==[14,1,10,1] or textsa(i)==[14,19,19,0]:
n=ord(list(i)[0])-ord('t')
if textsa(i)==[14,23,15]:
n=ord(list(i)[0])-ord('t')
restore(n,text) | ||
s193698065 | p00017 | u868716420 | 1494190512 | Python | Python3 | py | Runtime Error | 0 | 0 | 1701 | import string
import sys
example = string.ascii_lowercase
def make(x, y, z, a, b, c = True) :
if x - a < 0 : y = 26 + (x - a)
else : y = x - a
if x - b < 0 : z = 26 + (z - b)
else : z = x - b
if c != True :
if x - c < 0 : n = 26 + (x - c)
else : n = x - c
if c != 0 : return (example[x] + example[y] + example[z])
else : return (example[x] + example[y] + example[z])
def solve(temp, number) :
new_temp = []
if number > 19 : number = number - 19
else : number = 19 - number
for _ in temp :
if _ == ' ' or _ == '.' : new_temp.append(_)
elif _ - number < 0 : new_temp.append(26 + (_ - number))
else : new_temp.append(_ - number)
temp = ''
for _ in new_temp :
if _ == ' ' or _ == '.' : temp += _
else : temp += example[_]
return temp
for input_string in sys.stdin :
test = input_string
temp = []
for _ in test :
if _ == ' ' or _ == '.' : temp.append(_)
else : temp.append(example.index(_))
check = 0
the = []
for _ in range(26) : the.append(make(_, _, _, 12, 15))
for number, _ in enumerate(the) :
if _ in test :
print(solve(temp, number))
check = 1
if check == 1 :
this = []
for _ in range(26) : this.append(make(_, _, _, 12, 13, 24))
for number, _ in enumerate(this) :
if _ in test :
print(solve(temp, number))
check = 1
if check == 1 :
that = []
for _ in range(26) : this.append(make(_, _, _, 12, 13, 24))
for number, _ in enumerate(this) :
if _ in test : print(solve(temp, number)) | ||
s554837937 | p00017 | u362104929 | 1496349343 | Python | Python3 | py | Runtime Error | 0 | 0 | 890 | def main():
ex =[ord(".")]
answer = ""
while True:
try:
words = input().split()
except:
break
bl = False
for i in range(1,26):
ans = ""
for word in words:
s = ""
for string in word:
os = ord(string)
if os in ex:
s = s + string
else:
if os - i < 97:
s += chr(122 - (97 - (os - i)))
else:
s += chr(os - i)
if s in ("the", "this", "that", "the.", "this.", "that."):
bl = True
ans += " " + s
if bl:
break
answer.append(ans[1::])
print(*answer, sep="\n")
if __name__ == "__main__":
main() | ||
s463886041 | p00017 | u519227872 | 1496500853 | Python | Python3 | py | Runtime Error | 0 | 0 | 606 | def ascii2num(ascii):
return ord(ascii) - 96
def num2ascii(num):
return chr(num + 96)
def slide(word,num):
return ''.join([num2ascii((ascii2num(ascii) + num) % 26) if ascii != '.' else '.' for ascii in word])
def includekeyword(words):
for word in words:
if word in keywords:
return True
return False
keywords = ['the', 'this', 'that']
decode = []
for row in stdin:
words = row.split()
for num in range(1,27):
tmp = [slide(word,num) for word in words]
if includekeyword(tmp):
decode = tmp
print(' '.join(decode)) | Traceback (most recent call last):
File "/tmp/tmp3y_inwt3/tmprsq___jr.py", line 20, in <module>
for row in stdin:
^^^^^
NameError: name 'stdin' is not defined
| |
s749205516 | p00017 | u546285759 | 1496893433 | Python | Python3 | py | Runtime Error | 0 | 0 | 485 | import string
d = {c:ord(c)-97 for c in string.ascii_lowercase}
b = {v:k for k, v in d.items()}
while True:
try:
s = input()
except:
break
t = 0
for token in list(filter(lambda x: len(x) in [3, 4], s[:-1].split())):
t = d[token[0]]%26-19
word = ''.join([b[d[c]%26-t] for c in token])
if word in ['the', 'that', 'this']:
break
ans = [' ' if c == ' ' else b[d[c]%26-t] for c in s[:-1]]+['.']
print(''.join(ans)) | ||
s559276375 | p00017 | u184989919 | 1505689687 | Python | Python3 | py | Runtime Error | 0 | 0 | 353 |
import string
def CaesarCipher():
low=str.ascii_lowercase
for cry in sys.stdin:
for i in range(1,27):
dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
if 'this' in dec or 'that' in dec or 'the' in dec:
print(dec)
CaesarCipher() | Traceback (most recent call last):
File "/tmp/tmp6rbkci34/tmp07pnd2h0.py", line 17, in <module>
CaesarCipher()
File "/tmp/tmp6rbkci34/tmp07pnd2h0.py", line 5, in CaesarCipher
low=str.ascii_lowercase
^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'str' has no attribute 'ascii_lowercase'
| |
s923341033 | p00017 | u184989919 | 1505689734 | Python | Python3 | py | Runtime Error | 0 | 0 | 356 |
import string
def CaesarCipher():
low=string.ascii_lowercase
for cry in sys.stdin:
for i in range(1,27):
dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
if 'this' in dec or 'that' in dec or 'the' in dec:
print(dec)
CaesarCipher() | Traceback (most recent call last):
File "/tmp/tmp32_wnx30/tmpjica7mih.py", line 17, in <module>
CaesarCipher()
File "/tmp/tmp32_wnx30/tmpjica7mih.py", line 7, in CaesarCipher
for cry in sys.stdin:
^^^
NameError: name 'sys' is not defined
| |
s519258042 | p00017 | u184989919 | 1505689802 | Python | Python3 | py | Runtime Error | 0 | 0 | 356 |
import string
def CaesarCipher():
low=string.ascii_lowercase
for cry in sys.stdin:
for i in range(1,27):
dec=cry.translate(str.maketrans(low,low[i:]+low[:i]))
if 'this' in dec or 'that' in dec or 'the' in dec:
print(dec)
CaesarCipher() | Traceback (most recent call last):
File "/tmp/tmp3g_hq_iw/tmphrfii3gn.py", line 17, in <module>
CaesarCipher()
File "/tmp/tmp3g_hq_iw/tmphrfii3gn.py", line 7, in CaesarCipher
for cry in sys.stdin:
^^^
NameError: name 'sys' is not defined
| |
s440369861 | p00017 | u846136461 | 1516242116 | Python | Python | py | Runtime Error | 0 | 0 | 602 | # coding: utf-8
def contain_the(char):
for i in range(len(char)):
try:
if char[i] == 't' and char[i+1] == 'h' and (char[i+2] == 'e' or (char[i+2] == 'i' and char[i+3] == 's') or (char[i+2] == 'a' and char[i+3] == 't')):
return 1
except IndexError:
return 0
while True:
try:
data = raw_input()
delta = 1
while True:
char = ""
for i in range(len(data)):
if data[i] != '.' and data[i] != ' ':
char += chr(ord(data[i]) - delta)
else:
char += data[i]
if (contain_the(char) == 1):
print(char)
break
else:
delta += 1
except EOFError:
break
| Traceback (most recent call last):
File "/tmp/tmpcs7isguz/tmprdrc1ktr.py", line 13, in <module>
data = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s926758746 | p00017 | u846136461 | 1516243139 | Python | Python | py | Runtime Error | 0 | 0 | 664 | # coding: utf-8
def contain_the(char):
for i in range(len(char)):
try:
if char[i] == 't' and char[i+1] == 'h' and (char[i+2] == 'e' or (char[i+2] == 'i' and char[i+3] == 's') or (char[i+2] == 'a' and char[i+3] == 't')):
return 1
except IndexError:
return 0
while True:
try:
data = raw_input()
delta = 1
while True:
char = ""
for i in range(len(data)):
if data[i] != '.' and data[i] != ' ':
char += chr(ord(data[i]) - delta)
else:
char += data[i]
if (contain_the(char) == 1):
print(char)
break
else:
delta += 1
print("*")
except EOFError: #なぜかEOFErrorにならない
print("**")
break
| Traceback (most recent call last):
File "/tmp/tmp2d6qsvdf/tmpn6yuhusk.py", line 13, in <module>
data = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s308295619 | p00017 | u846136461 | 1516351931 | Python | Python | py | Runtime Error | 0 | 0 | 630 | # coding: utf-8
def contain_the(char):
for i in range(len(char)):
try:
if char[i] == 't' and char[i+1] == 'h' and (char[i+2] == 'e' or (char[i+2] == 'i' and char[i+3] == 's') or (char[i+2] == 'a' and char[i+3] == 't')):
return 1
except IndexError:
return 0
while True:
try:
data = raw_input()
delta = 1
while True:
char = ""
for i in range(len(data)):
if data[i] != '.' and data[i] != ' ':
char += chr(ord(data[i]) - delta)
else:
char += data[i]
if (contain_the(char) == 1):
print(char)
break
else:
delta += 1
print("*")
except EOFError:
print("**")
break
| Traceback (most recent call last):
File "/tmp/tmpu_r280qc/tmpke6t0sdt.py", line 13, in <module>
data = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s544321620 | p00017 | u136916346 | 1529171120 | Python | Python3 | py | Runtime Error | 0 | 0 | 469 | import sys
def l(s,n):
o=ord(s)+n
if not 97<=ord(s)<=122:
return s
if 97<=o<=122:
return chr(o)
elif o>123:
return chr(o-26)
for t in sys.stdin:
s=t[:-1]
for i in range(1,26):
e=lambda s:l(s,i)
if "".join(map(e,"this")) in s:
break
if "".join(map(e,"that")) in s:
break
if "".join(map(e,"the")) in s:
break
print("".join(map(lambda x:l(x,-i),s)))
| ||
s349633138 | p00017 | u136916346 | 1529171977 | Python | Python3 | py | Runtime Error | 0 | 0 | 468 | import sys
def l(s,n):
o=ord(s)+n
if not 97<=ord(s)<=122:
return s
if 97<=o<=122:
return chr(o)
elif o>123:
return chr(o-26)
for t in sys.stdin:
s=t[:-1]
for i in range(1,26):
e=lambda s:l(s,i)
if "".join(map(e,"this")) in s:
break
if "".join(map(e,"that")) in s:
break
if "".join(map(e,"the")) in s:
break
print("".join(map(lambda x:l(x,-i),s)))
| ||
s165872654 | p00017 | u136916346 | 1529174083 | Python | Python3 | py | Runtime Error | 0 | 0 | 581 | import sys
def l(s,n):
o=ord(s.lower())
if not 97<=o<=122:
return s
if 97<=o+n<=122:
if 97<=ord(s)<=122:
return chr(o+n)
else:
return chr(o+n).upper()
elif o+n>122:
if 97<=ord(s)<=122:
return chr(o+n-26)
else:
return chr(o+n-26).upper()
for t in sys.stdin:
s=t[:-1]
for i in range(0,26):
cv=lambda y:"".join(map(lambda x:l(x,i),y))
if cv("this") in s or cv("that") in s or cv("the") in s:
break
print("".join(map(lambda x:l(x,-i),s)))
| ||
s435615000 | p00017 | u136916346 | 1529174188 | Python | Python3 | py | Runtime Error | 0 | 0 | 597 | import sys
def l(s,n):
o=ord(s.lower())
if not 97<=o<=122:
return s
if 97<=o+n<=122:
if 97<=ord(s)<=122:
return chr(o+n)
else:
return chr(o+n).upper()
elif o+n>122:
if 97<=ord(s)<=122:
return chr(o+n-26)
else:
return chr(o+n-26).upper()
for t in sys.stdin:
s=t[:-1]
u=s.lower()
for i in range(0,26):
cv=lambda y:"".join(map(lambda x:l(x,i),y))
if cv("this") in u or cv("that") in u or cv("the") in u:
break
print("".join(map(lambda x:l(x,-i),s)))
| ||
s159319607 | p00017 | u282635979 | 1363944081 | Python | Python | py | Runtime Error | 0 | 0 | 730 | alpha = 'abcdefghijklmnopqrstuvwxyz'
alp_num = dict(zip(alpha,range(26)))
num_alp = dict(zip(range(26),alpha))
alp_num[' ']=' ' ; num_alp[' ']=' ' ; alp_num['.']='.' ; num_alp['.']='.'
while True:
cipher = raw_input()
if len(cipher) != 0:
numcipher = [alp_num[val] for val in cipher]
while True:
cipher = ''
for val in numcipher: cipher += str(num_alp[val])
if 'the'in cipher or 'this'in cipher or 'that'in cipher:
print cipher; break
else:
numcipher2 = []
for val in numcipher:
if val == ' ': numcipher2.append(' ')
elif val == '.': numcipher2.append('.')
elif val == 25: numcipher2.append(0)
else: numcipher2.append(val+1)
numcipher = numcipher2
continue
else: break | File "/tmp/tmpk3m111yk/tmpyf81fwos.py", line 14
print cipher; break
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s045321410 | p00017 | u147801965 | 1366132463 | Python | Python | py | Runtime Error | 0 | 0 | 431 | a = raw_input().split()
b = [i for i in a if len(i)==3 or len(i)==4]
c = [i for i in b if ord(i[0])-ord(i[1]) == 12]
s = [ord('t')-ord(c[0][0]),1] if c[0][0]<'t' else [ord(c[0][0])-ord('t'),0]
q=''
for g,i in enumerate(a):
if g==0:pass
else: q+=' '
for j in i:
if j=='.':
q+='.'
elif s[1] == 0:
q+=chr(ord(j)-s[0])
elif s[0] == 1:
q+=chr(ord(j)+s[0])
print q | File "/tmp/tmp9co7c38n/tmpuyonz9fj.py", line 16
print q
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s462365640 | p00017 | u147801965 | 1366132707 | Python | Python | py | Runtime Error | 0 | 0 | 614 | while True:
try:
a = raw_input().split()
b = [i for i in a if len(i)==3 or len(i)==4]
c = [i for i in b if ord(i[0])-ord(i[1]) == 12]
s = [ord('t')-ord(c[0][0]),1] if c[0][0]<'t' else [ord(c[0][0])-ord('t'),0]
q=''
for g,i in enumerate(a):
if g==0:pass
else: q+=' '
for j in i:
if j=='.':
q+='.'
elif s[1] == 0:
q+=chr(ord(j)-s[0])
elif s[0] == 1:
q+=chr(ord(j)+s[0])
print q
except EOFError:
break | File "/tmp/tmplpfr9jyd/tmpvityjpms.py", line 18
print q
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s770098368 | p00017 | u912237403 | 1377806990 | Python | Python | py | Runtime Error | 0 | 0 | 763 | dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input()
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x) | File "/tmp/tmpf287ppw1/tmp5qnd8qe8.py", line 37
print "".join(x)
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s241939522 | p00017 | u912237403 | 1377807609 | Python | Python | py | Runtime Error | 0 | 0 | 938 | # coding: utf-8
#Q003 Largest prime factor
#import math#,sys,time
#import numpy as np
#start_time = time.clock()
dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input()
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x)
#print time.clock() - start_time, "seconds" | File "/tmp/tmp6izlfm8n/tmp76jic6be.py", line 48
print "".join(x)
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s920145498 | p00017 | u912237403 | 1377807961 | Python | Python | py | Runtime Error | 0 | 0 | 775 | dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input().strip('\n')
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x) | File "/tmp/tmpawsvh3ml/tmpw7v3zh6p.py", line 37
print "".join(x)
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s570921546 | p00017 | u912237403 | 1377808570 | Python | Python | py | Runtime Error | 0 | 0 | 786 | import sys
dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
def makedic():
for i in range(26):
tmp = alpha[i:]+alpha[:i]
for j in range(26):
dic[i][alpha[j]]=tmp[j]
return
def crack(word):
for i in range(26):
s=[]
for c in word:
s.append(dic[i][c])
s="".join(s)
if s=="the" or s=="this" or s=="that":
return i
return None
makedic()
while True:
try:
s = raw_input().strip('\n')
except:
break
for e in s.split():
lene=len(e)
if lene==3 or lene==4:
offset = crack(e)
break
x = []
for c in s:
if "a"<=c and c<="z": x.append(dic[offset][c])
else: x.append(c)
print "".join(x) | File "/tmp/tmpambbyf5f/tmppetuktrv.py", line 38
print "".join(x)
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s675387003 | p00017 | u912237403 | 1377905968 | Python | Python | py | Runtime Error | 0 | 0 | 521 | def rot(s):
x=""
for c in s:
tmp = ord(c)-ord("a")
if "a"<=c<="z":
x += chr((tmp+1) % 26 + ord("a"))
else:
x += c
return x
def check(s):
for word in s.split():
if word=="the" or word=="this" or word=="that":
return True
else return False
while True:
try:
s = raw_input()
f = False
for i in range(26):
if check(s):break
else: s=rot(s)
print s
except:
break | File "/tmp/tmp47if5xa_/tmpk6cvevgv.py", line 15
else return False
^^^^^^
SyntaxError: expected ':'
| |
s649149642 | p00017 | u351182591 | 1381925270 | Python | Python | py | Runtime Error | 0 | 0 | 609 | b = ["the", "this", "that"]
while 1:
try:
a = raw_input()
except IndexError:
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
print a
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | File "/tmp/tmpn03z4ehb/tmpdiflgdbu.py", line 10
print a
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s540203941 | p00017 | u351182591 | 1381925361 | Python | Python | py | Runtime Error | 0 | 0 | 585 | b = ["the", "this", "that"]
while 1:
try:
a = raw_input()
except IndexError:
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | File "/tmp/tmprbuz00a2/tmp_5rfuzbf.py", line 10
print a
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s534857213 | p00017 | u351182591 | 1381925610 | Python | Python | py | Runtime Error | 0 | 0 | 557 | b = ["the", "this", "that"]
while 1:
a = raw_input()
if a == "":
break
for y in range(26):
for x in b:
if x in a:
print a
break
a = list(a)
for x in range(len(a)):
if a[x] == "z":
a[x] = "a"
elif "a" <= a[x] < "z":
a[x] = chr(ord(a[x])+1)
a = "".join(a) | File "/tmp/tmp4vdt2zrn/tmpneligwc1.py", line 9
print a
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s132414253 | p00017 | u633068244 | 1393366090 | Python | Python | py | Runtime Error | 0 | 0 | 491 | alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while True:
try:
sent = ""
word = map(str, raw_input().split())
for i in range(len(word))
for j in range(len(word[i])
for al in alpha:
if al == word[i]:
word[i] = al
sent += word + " "
sent = sent(:lent(sent)-1)
print sent
except:
break | File "/tmp/tmpwvwdwq22/tmpdrvy0mqe.py", line 7
for i in range(len(word))
^
SyntaxError: expected ':'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.