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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s256085065 | p00036 | u350508326 | 1373503432 | Python | Python | py | Runtime Error | 0 | 0 | 1560 | while True:
try:
a = [[0 for j in range(8)]for i in range(8)]
for i in range(8):
a[i] = list(map(int,raw_input()))
f = 0
for i in range(8):
if f == 1:
f = 0
break
for j in range(8):
if a[i][j] =... | File "/tmp/tmpfrftkpwy/tmppn9dr1ud.py", line 22
print "C"
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s417957742 | p00036 | u350508326 | 1373503678 | Python | Python | py | Runtime Error | 0 | 0 | 1923 | while True:
try:
a = [[0 for j in range(8)]for i in range(8)]
for i in range(8):
a[i] = list(map(int,raw_input()))
f = 0
i = 0
j = 0 ... | File "/tmp/tmpcm5c3jfg/tmpqh5v5bs4.py", line 25
print "C"
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s813506232 | p00036 | u350508326 | 1373503703 | Python | Python | py | Runtime Error | 0 | 0 | 1902 | while True:
try:
a = [[0 for j in range(8)]for i in range(8)]
for i in range(8):
a[i] = list(map(int,raw_input()))
f = 0
i = 0
j = 0 ... | File "/tmp/tmptk59tdor/tmp2i82kbrz.py", line 25
print "C"
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s161170414 | p00036 | u350508326 | 1373504036 | Python | Python | py | Runtime Error | 0 | 0 | 2015 | while True:
try:
a = [[0 for j in range(8)]for i in range(8)]
for i in range(8):
a[i] = list(map(int,raw_input()))
f = 0
for i in range(8): ... | File "/tmp/tmpfxma2cn0/tmpnqaw2y4c.py", line 22
print "C"
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s949269055 | p00036 | u350508326 | 1373504121 | Python | Python | py | Runtime Error | 0 | 0 | 2055 | while True:
try:
a = [[0 for k in range(8)]for m in range(8)]
for i in range(8): ... | File "/tmp/tmp7wqxqrvh/tmpedr9c6m0.py", line 22
print "C"
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s347239599 | p00036 | u523886269 | 1384105263 | Python | Python | py | Runtime Error | 0 | 0 | 1635 | # -*- coding: utf8 -*-
import sys
types = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
def main():
while True:
try:
data = []
for i in xrange(8):
data.append(raw_input())
check_figure(data)
# 空行
raw_input()
except EOFError:
... | File "/tmp/tmpdtx57df7/tmpesa556et.py", line 31
print t
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s455139244 | p00036 | u633068244 | 1393579207 | Python | Python | py | Runtime Error | 0 | 0 | 489 | while True:
try:
h = 0
for i in range(10):
tmp = raw_input()
if sum(int(tmp)) != 0:
a[h] = tmp
h += 1
if h == 4:
print "B"
elif h == 1:
print "C"
elif h == 2:
c = int(a[0])/int(a[1])
if c == 1:
print "A"
elif c ... | File "/tmp/tmp16kbhk_n/tmpj7dfiks6.py", line 3
h = 0
TabError: inconsistent use of tabs and spaces in indentation
| |
s387990267 | p00036 | u633068244 | 1393579288 | Python | Python | py | Runtime Error | 0 | 0 | 483 | while True:
try:
h = 0
for i in range(8):
tmp = raw_input()
if int(tmp) != 0:
a[h] = tmp
h += 1
if h == 4:
print "B"
elif h == 1:
print "C"
elif h == 2:
c = int(a[0])/int(a[1])
if c == 1:
print "A"
elif c == 10:... | File "/tmp/tmp11u8kbb1/tmpt89ek7fz.py", line 3
h = 0
TabError: inconsistent use of tabs and spaces in indentation
| |
s113291386 | p00036 | u633068244 | 1393580127 | Python | Python | py | Runtime Error | 0 | 0 | 598 | while True:
try:
h = 0
for i in range(8):
tmp = raw_input()
if tmp.count(1) = 0:
a[h] = tmp
h += 1
if h == 1:
print "C"
elif h == 2:
c = a[0].index(1) - a[1].index(1)
if c == 0:
... | File "/tmp/tmpi1xlsssg/tmplzevcad4.py", line 6
if tmp.count(1) = 0:
^^^^^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
| |
s453207064 | p00036 | u633068244 | 1393580168 | Python | Python | py | Runtime Error | 0 | 0 | 594 | while True:
try:
h = 0
for i in range(8):
tmp = raw_input()
if int(tmp) = 0:
a[h] = tmp
h += 1
if h == 1:
print "C"
elif h == 2:
c = a[0].index(1) - a[1].index(1)
if c == 0:
pr... | File "/tmp/tmp_etpmqc8/tmp4w0i1u9d.py", line 6
if int(tmp) = 0:
^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
| |
s358855845 | p00036 | u633068244 | 1393580203 | Python | Python | py | Runtime Error | 0 | 0 | 602 | while True:
try:
h = 0
for i in range(8):
tmp = raw_input()
if int(tmp) = 0:
a[h] = tmp
h += 1
if h == 1:
print "C"
elif h == 2:
c = a[0].index("1") - a[1].index("1")
if c == 0:
... | File "/tmp/tmpqx06lz9k/tmp9s5qfmk4.py", line 6
if int(tmp) = 0:
^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
| |
s181362311 | p00036 | u633068244 | 1393581690 | Python | Python | py | Runtime Error | 0 | 0 | 625 | while True:
try:
h = 0
a=["","","",""]
for i in range(8):
tmp = raw_input()
if int(tmp) != 0:
a[h] = tmp
h += 1
if h == 1:
print "C"
elif h == 2:
c = a[0].index("1") - a[1].index("1")
if c == 0:
... | File "/tmp/tmp2wt_68u0/tmp6auvmscl.py", line 8
a[h] = tmp
^
IndentationError: expected an indented block after 'if' statement on line 7
| |
s051159019 | p00036 | u912237403 | 1394326659 | Python | Python | py | Runtime Error | 0 | 0 | 338 | import sys
N = 8
ptn = [18,48,6,30,20,34,16]
def f(D):
i = 0
s = 0
D = D[D.index("1"):]
for c in D:
if c=="1": s += i
i += 1
p = "ABCDEF"[ptn.index(s)]
return p
i=0
D=""
for s in sys.stdin:
if i<8:
D+=s[1:]
i+=1
else:
print f(D)
D=""
... | File "/tmp/tmpcnn4usp3/tmppno6tly3.py", line 21
print f(D)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s211112690 | p00036 | u912237403 | 1394326724 | Python | Python | py | Runtime Error | 0 | 0 | 339 | import sys
N = 8
ptn = [18,48,6,30,20,34,16]
def f(D):
i = 0
s = 0
D = D[D.index("1"):]
for c in D:
if c=="1": s += i
i += 1
p = "ABCDEF"[ptn.index(s)]
return p
i=0
D=""
for s in sys.stdin:
if i<8:
D+=s[:-1]
i+=1
else:
print f(D)
i=0
... | File "/tmp/tmpie5bluwv/tmpxuugapm8.py", line 21
print f(D)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s842358150 | p00036 | u912237403 | 1394326938 | Python | Python | py | Runtime Error | 0 | 0 | 349 | import sys
N = 8
ptn = [18,48,6,30,20,34,16]
def f(D):
i = 0
s = 0
D = D[D.index("1"):]
for c in D:
if c=="1": s += i
i += 1
p = "ABCDEF"[ptn.index(s)]
return p
i=0
D=""
for s in sys.stdin:
if i<8:
D+=s[:-1]
i+=1
else:
print f(D)
i=0
... | File "/tmp/tmp8epdqnzd/tmp6aubpo3j.py", line 21
print f(D)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s518350197 | p00036 | u912237403 | 1394339068 | Python | Python | py | Runtime Error | 0 | 0 | 306 | import sys
ptn = [18,48,6,30,20,34,16]
def f(D):
i = 0
s = 0
D = D[D.index("1"):]
for c in D:
if c=="1": s += i
i += 1
p = "ABCDEF"[ptn.index(s)]
return p
i=0
D=""
for s in sys.stdin:
i+=1
D+=s[:-1]
if i==8:
print f(D)
i=0
D="" | File "/tmp/tmpcr6ewob0/tmp55qf_ce2.py", line 20
print f(D)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s533967410 | p00036 | u912237403 | 1394339580 | Python | Python | py | Runtime Error | 0 | 0 | 294 | def f(D):
i = 0
s = 0
D = D[D.index("1"):]
for c in D:
if c=="1": s += i
i += 1
p = "ABCDEF"[ptn.index(s)]
return p
i=0
D=""
for s in sys.stdin:
if i<8:
i+=1
D+=s[:-1]
else:
print f(D)
i=0
D=""
print f(D) | File "/tmp/tmprq1acsib/tmppqd8uzfw.py", line 18
print f(D)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s988470077 | p00036 | u912237403 | 1394340532 | Python | Python | py | Runtime Error | 0 | 0 | 295 | def f(D):
i = 0
s = 0
D = D[D.index("1"):]
for c in D:
if c=="1": s += i
i += 1
p = "ABCDEFG"[ptn.index(s)]
return p
i=0
D=""
for s in sys.stdin:
if i<8:
i+=1
D+=s[:-1]
else:
print f(D)
i=0
D=""
print f(D) | File "/tmp/tmpyt4gts2q/tmpuvla91uu.py", line 18
print f(D)
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s807652175 | p00037 | u873482706 | 1434774812 | Python | Python | py | Runtime Error | 0 | 0 | 2874 | import sys
def xxx(position, direction):
if direction == 'R' or direction == 'L':
if not (0 <= position[tate] <= 8 and 0 <= position[yoko] <= 3):
return
elif direction == 'U' or direction == 'D':
if not (1 <= position[tate] <= 7 and 0 <= position[yoko] <= 4):
return
... | File "/tmp/tmpokkfix5g/tmp_yv63a66.py", line 75
print ''.join(result)
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s999878550 | p00037 | u873482706 | 1434777537 | Python | Python | py | Runtime Error | 0 | 0 | 3470 | import sys
def xxx(position, direction):
if direction == 'R' or direction == 'L':
if not (0 <= position[tate] <= 8 and 0 <= position[yoko] <= 3):
return
elif direction == 'U' or direction == 'D':
if not (1 <= position[tate] <= 7 and 0 <= position[yoko] <= 4):
return
... | File "/tmp/tmp9nd1dw_8/tmp05gtb2ih.py", line 91
print ''.join(result)
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s350714342 | p00037 | u873482706 | 1435293327 | Python | Python | py | Runtime Error | 0 | 0 | 3800 | def xxx(position, direction):
if direction == 'R' or direction == 'L':
if not (0 <= position[tate] <= 8 and 0 <= position[yoko] <= 3):
return
elif direction == 'U' or direction == 'D':
if not (1 <= position[tate] <= 7 and 0 <= position[yoko] <= 4):
return
if (positio... | File "/tmp/tmpv0gmo122/tmpp8pn1kav.py", line 11
print ''.join(result)
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s308970999 | p00037 | u419407022 | 1362161694 | Python | Python | py | Runtime Error | 0 | 0 | 762 | dist = ['R','D','L','U']
dict = [(1,0),(0,1),(-1,0),(0,-1)]
result = ''
sell = [[False]*13]*2
for i in xrange(9):
l = [False,False]
s = raw_input()
if len(s) == 4:
for j in s:
l.append(False)
l.append(bool(int(j)))
l += [False] * 3
else:
for j in s:
... | File "/tmp/tmp5gw0quil/tmpzzujkxap.py", line 34
print result
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s846098170 | p00037 | u542421762 | 1368332660 | Python | Python | py | Runtime Error | 0 | 0 | 4450 |
import sys
class Grid:
def __init__(self, lines):
lines = map((lambda line: list(line)), lines)
l = []
for i in range(len(lines)):
if i % 2 == 0:
l.append(intersperse2(lines[i], '+'))
else:
l.append(intersperse(lines[i], 'x'))
... | File "/tmp/tmpunq22jma/tmpyi9y00b9.py", line 21
print l
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s379496821 | p00038 | u379956761 | 1443343090 | Python | Python3 | py | Runtime Error | 0 | 0 | 1299 | import sys
def is_onepair(x):
for i in range(4):
if x.count(x[i]) == 2:
return True
return False
def is_twopair(x):
count = 0
for e in x:
for e2 in x:
if e == e2:
count += 1
if count == 2:
return True
return Fals... | File "/tmp/tmpz3euxe4i/tmpu2dnqoco.py", line 30
if x[0] == 1 and x[1:] = [10, 11, 12, 13]:
^
SyntaxError: invalid syntax
| |
s299062267 | p00038 | u300946041 | 1469324474 | Python | Python3 | py | Runtime Error | 0 | 0 | 1069 | # -*- coding: utf-8 -*-
def is_four_card(d):
return 4 in d.values()
def is_full_house(d):
return 3 in d.values() and 2 in d.values()
def is_straight(d):
flag = [False, 0]
for i in d.values():
if flag[0] == True and flag[1] == 5:
return True
if i == 1:
flag[... | Traceback (most recent call last):
File "/tmp/tmph1oh4zmx/tmpjtajz4rq.py", line 59, in <module>
_input = input().split(",")
^^^^^^^
EOFError: EOF when reading a line
| |
s333543319 | p00038 | u150984829 | 1518109953 | Python | Python3 | py | Runtime Error | 0 | 0 | 220 | import sys
for e in sys.stdin:
e=sorted(map(int,e.split(',')))
print([['null','straight'][e[4]-e[0]==4 or e[0]*10==e[1]],'one pair','two pair','three card','full house',0,'four card'][(sum(e.count(s)for s in e)//2-2])
| File "/tmp/tmpz_kxp4t5/tmpoignpysc.py", line 4
print([['null','straight'][e[4]-e[0]==4 or e[0]*10==e[1]],'one pair','two pair','three card','full house',0,'four card'][(sum(e.count(s)for s in e)//2-2])
... | |
s691871498 | p00038 | u633068244 | 1393482727 | Python | Python | py | Runtime Error | 0 | 0 | 776 | while True:
try:
hand = sorted(map(int, raw_input().split(",")))
kind = len(set(hand))
ma = max([hand.count(i) for i in hand])
if kind == 4:
print "one pair"
elif kind == 3:
if ma == 2:
print "t... | File "/tmp/tmp_g9cegi2/tmppf0shqv5.py", line 7
print "one pair"
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s222485071 | p00039 | u873482706 | 1435044834 | Python | Python | py | Runtime Error | 0 | 0 | 1010 | def brain(l):
c = l[1] - l[0]
if 0 < c:
result.append(c)
del lis[0]
del lis[0]
else:
lis.append(l[0])
del lis[0]
def cisco(l):
for i in range(len(l)):
if l[i] == 'I':
l[i] = 1
elif l[i] == 'V':
l[i] = 5
elif... | File "/tmp/tmplgrdg003/tmp7zm1vri8.py", line 43
print sum(result)
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s569736704 | p00039 | u379956761 | 1443357528 | Python | Python3 | py | Runtime Error | 0 | 0 | 1060 | import sys
def dec_num(x):
for i in range(len(x)):
if x[i] == 2:
x[i] = 5
elif x[i] == 3:
x[i] = 10
elif x[i] == 4:
x[i] = 50
elif x[i] == 5:
x[i] = 100
elif x[i] == 6:
x[i] = 500
elif x[i] == 7:
... | ||
s089445379 | p00039 | u148101999 | 1460005555 | Python | Python | py | Runtime Error | 0 | 0 | 1532 | #encoding=utf-8
import sys
def inp():
for line in sys.stdin:
word = line.split()
je(word[0])
def je(word):
ans, i = 0, 0
while True:
print word[i], ans
if word[i] == "M":
ans += 1000
elif word[i] == "D":
ans += 500
elif word[i] == "C"... | File "/tmp/tmp3coh9n06/tmpvruhwaxp.py", line 12
print word[i], ans
^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s882159880 | p00039 | u148101999 | 1460005815 | Python | Python | py | Runtime Error | 0 | 0 | 1489 | import sys
def inp():
for line in sys.stdin:
word = line.split()
je(word[0])
def je(word):
ans, i = 0, 0
while True:
if word[i] == "M":
ans += 1000
elif word[i] == "D":
ans += 500
elif word[i] == "C":
ans += 100
try:
... | File "/tmp/tmp31bx8ab8/tmpww8bq59l.py", line 57
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s056456436 | p00039 | u661290476 | 1482918560 | Python | Python3 | py | Runtime Error | 0 | 0 | 309 | nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
try:
s=input()
except:
break
ans=nums[s[0]]
for i in range(len(s)):
if num[s[i-1]]<num[s[i]]:
ans+=num[s[i]]-2*num[s[i-1]]
else:
ans+=num[s[i]]
print(ans)
| ||
s062840968 | p00039 | u661290476 | 1482918592 | Python | Python3 | py | Runtime Error | 0 | 0 | 311 | nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
try:
s=input()
except:
break
ans=nums[s[0]]
for i in range(1,len(s)):
if num[s[i-1]]<num[s[i]]:
ans+=num[s[i]]-2*num[s[i-1]]
else:
ans+=num[s[i]]
print(ans)
| ||
s655399782 | p00039 | u633068244 | 1393417348 | Python | Python | py | Runtime Error | 0 | 0 | 457 | dict = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000}
while True:
try:
roman = raw_input()
sum = 0
value = 1000
for i in range(len(roman)):
if value >= dict[roman[i]]:
value = dict[roman[i]]
sum += value
elif:
... | File "/tmp/tmpq7a8e8_g/tmp8xc9tp6b.py", line 12
elif:
^
SyntaxError: invalid syntax
| |
s500265614 | p00039 | u436634575 | 1401187238 | Python | Python3 | py | Runtime Error | 0 | 0 | 315 | import sys
C = [ 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
N = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
def checkio(data, i = 0):
return C[i]*(data // N[i]) + checkio(data % N[i], i + 1) if data else ''
for line in sys.stdin:
n = int(line)
print(checkio(n)) | ||
s487629725 | p00040 | u567380442 | 1423296374 | Python | Python3 | py | Runtime Error | 0 | 0 | 1208 | import sys
f = sys.stdin
import string
OFFSET = ord('a')
def to_gamma(c):
return ord(c) - OFFSET
def from_gamma(gamma, alpha, beta):
return chr((alpha * gamma + beta) % 26 + OFFSET)
def affine(c, alpha, beta):
return from_gamma(to_gamma(c), alpha, beta)
# g[0]==g[3]である前提
def search_that(w):
b =... | Traceback (most recent call last):
File "/tmp/tmpbkhwmnl7/tmp6de_5ast.py", line 40, in <module>
n = int(f.readline())
^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s047334270 | p00040 | u879226672 | 1429803556 | Python | Python | py | Runtime Error | 0 | 0 | 1207 | def affine_cipher(word,alpha,beta):
newword = ''
for c in word:
newword += w[(alpha*dic[c]+beta)%26]
return newword
def find_quad_word(sentence):
r = []
for word in sentence:
if len(word)==4:
r.append(word)
return r
def get_alpha_and_beta(quad_word):
'''retur... | File "/tmp/tmps3g78ehy/tmpdlklcnm9.py", line 37
print ' '.join(new_sentence)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s147883287 | p00040 | u901080241 | 1491712141 | Python | Python3 | py | Runtime Error | 0 | 0 | 577 | from math import gcd
def unzip(strlist,a,b):
ret = []
for word in strlist:
tmp = ""
for i in range(len(word)):
tmp += chr(((ord(word[i])-97)*a+b)%26+97)
ret.append(tmp)
return ret
n = int(input())
for _ in range(n):
instr = input().split()
for a in range(1,26):
... | Traceback (most recent call last):
File "/tmp/tmpwtfrjz4t/tmp0uuf663m.py", line 11, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s169719439 | p00040 | u282635979 | 1363844680 | Python | Python | py | Runtime Error | 0 | 0 | 2104 | list_a = [0,1,3,5,7,9,11,13,15,17,19,21,23]
num_al = {0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j',10:'k',11:'l',12:'m',13:'n',14:'o',15:'p',16:'q',17:'r',18:'s',19:'t',20:'u',21:'v',22:'w',23:'x',24:'y',25:'z'}
n = input() + 1
for val in range(1,n):
num_a = 0
num_b = 0
sentence = raw_input()
words =... | File "/tmp/tmp0oqer57i/tmpveys593d.py", line 94
print sentence_trans
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s012105230 | p00040 | u282635979 | 1363845387 | Python | Python | py | Runtime Error | 0 | 0 | 2101 | list_a = [0,1,3,5,7,9,11,13,15,17,19,21,23]
num_al = {0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j',10:'k',11:'l',12:'m',13:'n',14:'o',15:'p',16:'q',17:'r',18:'s',19:'t',20:'u',21:'v',22:'w',23:'x',24:'y',25:'z'}
n = input() + 1
for val in range(1,n):
num_a = 0
num_b = 0
sentence = raw_input()
words =... | File "/tmp/tmp0g509o7p/tmpz1cncnbu.py", line 93
print sentence_trans
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s772791615 | p00040 | u282635979 | 1363846241 | Python | Python | py | Runtime Error | 0 | 0 | 2101 | list_a = [0,1,3,5,7,9,11,13,15,17,19,21,23]
num_al = {0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j',10:'k',11:'l',12:'m',13:'n',14:'o',15:'p',16:'q',17:'r',18:'s',19:'t',20:'u',21:'v',22:'w',23:'x',24:'y',25:'z'}
n = input() + 1
for val in range(1,n):
num_a = 0
num_b = 0
sentence = raw_input()
words =... | File "/tmp/tmphse9ut4r/tmp1ocljcx0.py", line 93
print sentence_trans
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s556325882 | p00040 | u282635979 | 1363847578 | Python | Python | py | Runtime Error | 0 | 0 | 2101 | list_a = [0,1,3,5,7,9,11,13,15,17,19,21,23]
num_al = {0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j',10:'k',11:'l',12:'m',13:'n',14:'o',15:'p',16:'q',17:'r',18:'s',19:'t',20:'u',21:'v',22:'w',23:'x',24:'y',25:'z'}
n = input() + 1
for val in range(1,n):
num_a = 0
num_b = 0
sentence = raw_input()
words =... | File "/tmp/tmpun3r6qk8/tmpj7poc0hi.py", line 93
print sentence_trans
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s856868510 | p00040 | u282635979 | 1363848178 | Python | Python | py | Runtime Error | 0 | 0 | 2103 | list_a = [0,1,3,5,7,9,11,13,15,17,19,21,23]
num_al = {0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j',10:'k',11:'l',12:'m',13:'n',14:'o',15:'p',16:'q',17:'r',18:'s',19:'t',20:'u',21:'v',22:'w',23:'x',24:'y',25:'z'}
n = input() + 1
for val in range(1,n):
num_a = 0
num_b = 0
sentence = raw_input()
words =... | File "/tmp/tmpy7p3vrgj/tmp0t30wmfl.py", line 93
print sentence_trans
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s467529826 | p00040 | u782850731 | 1375514702 | Python | Python | py | Runtime Error | 0 | 0 | 1121 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from sys import stdin
from string import ascii_lowercase
from itertools import count
def gcd(m, n):
m, n = sorted([m, n])
while n:
m, n = n, m % n
... | Traceback (most recent call last):
File "/tmp/tmp1g44xo72/tmp8qu49n6y.py", line 39, in <module>
main()
File "/tmp/tmp1g44xo72/tmp8qu49n6y.py", line 31, in main
for _ in range(int(stdin.readline())):
^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s516363661 | p00040 | u912237403 | 1387579507 | Python | Python | py | Runtime Error | 0 | 0 | 799 | A2Z="abcdefghijklmnopqrstuvwxyz"
def decode(L1,L2,msg):
x=[]
for c in msg:
if 'a'<=c<='z':
c = L2[L1.index(c)]
x.append(c)
return "".join(x)
def affine(msg, key):
a,b = key
L = [A2Z[(i*a+b)%26] for i in range(26)]
L = "".join(L)
return decode(A2Z,L,msg)
... | File "/tmp/tmpj3ehznx8/tmpo062llal.py", line 38
print affine(msg,key)
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s426287584 | p00040 | u912237403 | 1387579575 | Python | Python | py | Runtime Error | 0 | 0 | 813 | A2Z="abcdefghijklmnopqrstuvwxyz"
def decode(L1,L2,msg):
x=[]
for c in msg:
if 'a'<=c<='z':
c = L2[L1.index(c)]
x.append(c)
return "".join(x)
def affine(msg, key):
a,b = key
L = [A2Z[(i*a+b)%26] for i in range(26)]
L = "".join(L)
return decode(A2Z,L,msg)
... | File "/tmp/tmpucdmouqk/tmpbot6ic72.py", line 39
print affine(msg,key)
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s196103674 | p00040 | u633068244 | 1393662328 | Python | Python | py | Runtime Error | 0 | 0 | 884 | dict = ["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"]
lsalpha = [1,3,5,7,9,11,15,17,19,21,23,25]
def deaffine(alpha, beta, code):
decode = ""
for chara in code:
if chara != " ":
f = dict.index(chara)
for i in r... | File "/tmp/tmprf14a4j5/tmp_pe5qj6d.py", line 31
print decode
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s621346679 | p00041 | u329400409 | 1453031113 | Python | Python3 | py | Runtime Error | 0 | 0 | 710 | import itertools
def calc(n):
for op in itertools.product(operators, repeat=3):
for form in forms:
formula = form.format(op[0], op[1], op[2], n[0], n[1], n[2], n[3])
if eval(formula) == 10:
print(formula)
return True
return False
operators = ("+"... | Traceback (most recent call last):
File "/tmp/tmphtw17wws/tmpu9n46r9u.py", line 23, in <module>
nums = tuple(map(int, raw_input().split()))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s375801768 | p00041 | u329400409 | 1453031318 | Python | Python3 | py | Runtime Error | 0 | 0 | 710 | import itertools
def calc(n):
for op in itertools.product(operators, repeat=3):
for form in forms:
formula = form.format(op[0], op[1], op[2], n[0], n[1], n[2], n[3])
if eval(formula) == 10:
print(formula)
return True
return False
operators = ("+"... | Traceback (most recent call last):
File "/tmp/tmpjha3lohb/tmps1ab5hyv.py", line 23, in <module>
nums = tuple(map(int, raw_input().split()))
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s742968238 | p00041 | u150984829 | 1518720835 | Python | Python3 | py | Runtime Error | 0 | 0 | 386 | import itertools
def f(a):
if len(a)<2:yield(a[0],a[0])
for i in range(1,len(a)):
for p,s in f(a[:i]):
for q,t in f(a[i:]):
yield(p+q,f'({s}+{t})')
yield(p-q,f'({s}-{t})')
yield(p*q,f'({s}*{t})')
def s(a):
for p in itertools.permutations(a):
for n,s in f(p):
if n==10:print(s);return 1
while 1:
... | Traceback (most recent call last):
File "/tmp/tmp4412wzd7/tmp_smi3kvu.py", line 15, in <module>
a=list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s423825963 | p00041 | u150984829 | 1518721842 | Python | Python3 | py | Runtime Error | 0 | 0 | 402 | import itertools,sys
def f(a):
if len(a)<2:yield[a[0]]*2
for i in range(1,len(a)):
for p,s in f(a[:i]):
for q,t in f(a[i:]):
yield(p+q,f'({s} + {t})')
yield(p-q,f'({s} - {t})')
yield(p*q,f'({s} * {t})')
def s(a):
for p in itertools.permutations(a):
for n,s in f(p):
if n==10:print(s);return 1
fo... | Traceback (most recent call last):
File "/tmp/tmpxqhrqtr2/tmpcyy7034b.py", line 14, in <module>
for e in iter(input,'0 0 0 0\n'):
EOFError: EOF when reading a line
| |
s955181896 | p00041 | u150984829 | 1518724665 | Python | Python3 | py | Runtime Error | 0 | 0 | 412 | from itertools import *
def f(s):
for t in[f"({a} {x} {b}) {y} ({c} {z} {d})",f"(({a} {x} {b}) {y} {c}) {z} {d}",f"{a} {x} ({b} {y} ({c} {z} {d}))",f"({a} {x} ({b} {y} {c})) {z} {d}",f"{a} {x} (({b} {y} {c}) {z} {d})"]:
for a,b,c,d in permutations(s):
for x,y,z in product('+-*',repeat=3):
if eval(t)==10:retur... | Traceback (most recent call last):
File "/tmp/tmpiadep8b9/tmpk73k2is4.py", line 8, in <module>
for e in iter(input,'0 0 0 0'):print(f(list(map(int,e.split()))))
EOFError: EOF when reading a line
| |
s541356293 | p00041 | u150984829 | 1518725349 | Python | Python3 | py | Runtime Error | 0 | 0 | 436 | from itertools import *
def f(s):
for t in["({a} {x} {b}) {y} ({c} {z} {d})","(({a} {x} {b}) {y} {c}) {z} {d}","{a} {x} ({b} {y} ({c} {z} {d}))","({a} {x} ({b} {y} {c})) {z} {d}","{a} {x} (({b} {y} {c}) {z} {d})"]:
for a,b,c,d in permutations(s):
for x,y,z in product('+-*',repeat=3):
t='f"'+t+'"'
if eval(... | Traceback (most recent call last):
File "/tmp/tmpujji__cb/tmp9zgw0sjx.py", line 9, in <module>
for e in iter(input,'0 0 0 0'):print(f(list(map(int,e.split()))))
EOFError: EOF when reading a line
| |
s622880502 | p00041 | u749355444 | 1381421508 | Python | Python | py | Runtime Error | 0 | 0 | 402 | from itertools import *
def find(X):
for a,b,c,d in permutations(X):
for x,y,z in product("+-*",repeat=3):
for f in ("(((%s%s%s)%s%s)%s%s)","(%s%s%s)%s(%s%s%s)"):
t = f%(a,x,b,y,c,z,d)
if eval(t)==10:
return t
return 0
while True:
X =... | File "/tmp/tmp3f_bo96h/tmp62yqj3i6.py", line 16
print find(X)
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s561914327 | p00041 | u912237403 | 1387688999 | Python | Python | py | Runtime Error | 0 | 0 | 1356 | def op(x,y,i):
if i==0:
return x+y
elif i==1:
return x-y
elif i==2:
return x*y
def check(x, n):
a1,a2,a3,a4 = x[0],x[1],x[2],x[3]
s='+-*'
for i1 in range(3):
a1 = op(x[0],x[1],i1)
for i2 in range(3):
a2 = op(a1,x[2],i2)
for i3 in r... | File "/tmp/tmpzy63xu5s/tmp0718zji2.py", line 49
print s
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s545869569 | p00041 | u633068244 | 1394277906 | Python | Python | py | Runtime Error | 0 | 0 | 668 | ex = ["+", "-", "*"]
while True:
a, b, c, d = map(int, raw_input().split())
if a == 0 and c == 0:
break
for i in ex:
for j in ex:
for k in ex:
if eval( (((a k b) j c) i d)) == 10:
print "(((",a,k,b,")",j,c,")",i,d,")"
flag =... | File "/tmp/tmpb8al87j1/tmpe2fxjwzo.py", line 9
if eval( (((a k b) j c) i d)) == 10:
^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
| |
s157799306 | p00041 | u633068244 | 1394278884 | Python | Python | py | Runtime Error | 0 | 0 | 634 | ex = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
for i in ex:
for j in ex:
for k in ex:
if eval( "((("+a+k+b+")"+j+c+")"+i+d+")") == 10:
print "(((",a,k,b,")",j,c,")",i,d,")"
... | File "/tmp/tmp8fjawdft/tmpwhpyw8nj.py", line 10
print "(((",a,k,b,")",j,c,")",i,d,")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s726647185 | p00041 | u633068244 | 1394278922 | Python | Python | py | Runtime Error | 0 | 0 | 692 | ex = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
for i in ex:
for j in ex:
for k in ex:
if eval( "((("+a+k+b+")"+j+c+")"+i+d+")") == 10:
print "(((",a,k,b,")",j,c,")",i,d,")"
... | File "/tmp/tmplr5e5vp0/tmp34wgx7hb.py", line 10
print "(((",a,k,b,")",j,c,")",i,d,")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s664061780 | p00041 | u633068244 | 1394278956 | Python | Python | py | Runtime Error | 0 | 0 | 692 | ex = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
for i in ex:
for j in ex:
for k in ex:
if eval( "((("+a+k+b+")"+j+c+")"+i+d+")") == 10:
print "(((",a,k,b,")",j,c,")",i,d,")"
... | File "/tmp/tmpd9j2r04b/tmp8wl86x6f.py", line 10
print "(((",a,k,b,")",j,c,")",i,d,")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s752245597 | p00041 | u633068244 | 1394291913 | Python | Python | py | Runtime Error | 0 | 0 | 1598 | op = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
for i in op:
for j in op:
for k in op:
for ii in n:
m = [0,1,2,3]
... | File "/tmp/tmpc09b6fey/tmpbxy7xwkn.py", line 23
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s587427804 | p00041 | u633068244 | 1394291935 | Python | Python | py | Runtime Error | 0 | 0 | 1598 | op = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
for i in op:
for j in op:
for k in op:
for ii in n:
m = [0,1,2,3]
... | File "/tmp/tmpxpmq0eh1/tmpxdr4xlr5.py", line 23
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s719266638 | p00041 | u633068244 | 1394291988 | Python | Python | py | Runtime Error | 0 | 0 | 1598 | op = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
for i in op:
for j in op:
for k in op:
for ii in n:
m = [0,1,2,3]
... | File "/tmp/tmpzvh6hfty/tmpjnppuxga.py", line 23
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s073622564 | p00041 | u633068244 | 1394292021 | Python | Python | py | Runtime Error | 0 | 0 | 1598 | op = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
for i in op:
for j in op:
for k in op:
for ii in n:
m = [0,1,2,3]
... | File "/tmp/tmpo1k58v2g/tmpsggulz5d.py", line 23
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s081157157 | p00041 | u633068244 | 1394292072 | Python | Python | py | Runtime Error | 0 | 0 | 1598 | op = ["+", "-", "*"]
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
for i in op:
for j in op:
for k in op:
for ii in n:
m = [0,1,2,3]
... | File "/tmp/tmpswmq39bk/tmp4z2u5bov.py", line 23
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s180452399 | p00041 | u633068244 | 1394293079 | Python | Python | py | Runtime Error | 0 | 0 | 1521 | op = ["+", "-", "*"]
x = int(raw_input())
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
m = [0,1,2,3]
m.remove(ii)
for jj in m:
l = [0,1,2,3]
l.remove(ii);l.remove(jj)
... | File "/tmp/tmpmclp1rr6/tmp0a9u4_4k.py", line 24
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s247173275 | p00041 | u633068244 | 1394293165 | Python | Python | py | Runtime Error | 0 | 0 | 1537 | op = ["+", "-", "*"]
x = int(raw_input())
while True:
a, b, c, d = map(str, raw_input().split())
if a == 0 and c == 0:
break
n = [0,1,2,3]
q = [str(a),str(b),str(c),str(d)]
flag = 0
m = [0,1,2,3]
m.remove(ii)
for ii in n:
for jj in m:
l = [0,1,2,3]
... | File "/tmp/tmputpffpjd/tmp7uksr3zq.py", line 24
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s176157853 | p00041 | u633068244 | 1394293198 | Python | Python | py | Runtime Error | 0 | 0 | 1521 | op = ["+", "-", "*"]
x = int(raw_input())
while True:
a, b, c, d = map(str, raw_input().split())
if a == "0" and c == "0":
break
n = [0,1,2,3]
q = [a,b,c,d]
flag = 0
m = [0,1,2,3]
m.remove(ii)
for ii in n:
for jj in m:
l = [0,1,2,3]
l.remove(ii);l.... | File "/tmp/tmp0mdrxezu/tmp11_o8qj8.py", line 24
print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s562102812 | p00042 | u198477543 | 1535190442 | Python | Python3 | py | Runtime Error | 0 | 0 | 667 | count = 0
while True:
count += 1
W = int(input())
if W == 0:
break
N = int(input())
value = []
weight = []
for i in range(N):
a, b = map(int, input().split())
value.append(a)
weight.append(b)
dp = [[-float("inf") for i in range(W+1)] for j in range(N+1)]
... | Traceback (most recent call last):
File "/tmp/tmpkh_gmcfe/tmp39s3lxoo.py", line 5, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s581468718 | p00042 | u540744789 | 1426832129 | Python | Python | py | Runtime Error | 0 | 0 | 795 | while True:
# try:
case=0
while True:
case+=1
weight=input()
if weight==0:
break
N=input()
data=[[0 for i in range(2)] for j in range(N)]
for i in range(N):
data[i][0],data[i][1]=map(int,raw_input().split(","))
table=[[-1 for i ... | File "/tmp/tmp6vaomwxb/tmpa8c5yffg.py", line 22
print "Case "+str(case)+":"
^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s119841462 | p00042 | u489809100 | 1447687529 | Python | Python | py | Runtime Error | 0 | 0 | 617 | import itertools
count = 0
while True:
w = int(raw_input())
if w == 0:
break
m = int(raw_input())
n = [0 for _ in xrange(m)]
h = [0 for _ in xrange(m)]
count += 1
for i in xrange(m):
n[i],h[i] = map(int,raw_input().split(","))
js= []
for i in xrange(m):
lis = list(itertools.combinations(n, m - i))
... | File "/tmp/tmp43ibzgei/tmpl6y5xpf4.py", line 31
print "Case " + str(count) + ":"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s755133983 | p00042 | u489809100 | 1447687696 | Python | Python | py | Runtime Error | 0 | 0 | 594 | import itertools
count = 0
while True:
w = int(raw_input())
if w == 0:
break
m = int(raw_input())
n = [0 for _ in xrange(m)]
h = [0 for _ in xrange(m)]
count += 1
for i in xrange(m):
n[i],h[i] = map(int,raw_input().split(","))
js= []
jk = []
for i in xrange(m):
lis = list(itertools.combinations(h, ... | File "/tmp/tmpfp3jo3ls/tmpgcaj1obg.py", line 29
print "Case " + str(count) + ":"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s477125888 | p00042 | u489809100 | 1447687985 | Python | Python | py | Runtime Error | 0 | 0 | 595 | import itertools
count = 0
while True:
w = int(raw_input())
if w == 0:
break
m = int(raw_input())
n = [0 for _ in xrange(m)]
h = [0 for _ in xrange(m)]
count += 1
for i in xrange(m):
n[i],h[i] = map(int,raw_input().split(","))
tr = []
ty = []
for i in xrange(m):
lis = list(itertools.combinations(h,... | File "/tmp/tmpp_ec2o8a/tmpshi13efd.py", line 29
print "Case " + str(count) + ":"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s819002453 | p00042 | u489809100 | 1447688180 | Python | Python | py | Runtime Error | 0 | 0 | 647 | import itertools
count = 0
if __name__ == "__main__":
while True:
w = int(raw_input())
if w == 0:
break
m = int(raw_input())
n = [0 for _ in xrange(m)]
h = [0 for _ in xrange(m)]
count += 1
for i in xrange(m):
n[i],h[i] = map(int,raw_input().split(","))
tr = []
ty = []
for i in xrange(m)... | File "/tmp/tmp_f1yrvbc/tmpicbh4sst.py", line 30
print "Case " + str(count) + ":"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s759286285 | p00042 | u896025703 | 1469782069 | Python | Python3 | py | Runtime Error | 1200 | 72480 | 686 |
def rec(i, j):
if dp[i][j] != -1:
return dp[i][j]
if i == N:
ans = 0, W - j
elif j < wl[i]:
ans = rec(i + 1, j)
else:
v1, w1 = rec(i + 1, j)
v2, w2 = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = v1, w1
elif v1 < v2:
ans = v2, w2
elif v1 == v2:
if w1 < w2:
ans = v1, w1
else... | Traceback (most recent call last):
File "/tmp/tmp8a4_q50d/tmpgtgn4ji9.py", line 28, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s815694651 | p00042 | u896025703 | 1469782249 | Python | Python3 | py | Runtime Error | 420 | 27088 | 686 |
def rec(i, j):
if dp[i][j] != -1:
return dp[i][j]
if i == N:
ans = 0, W - j
elif j < wl[i]:
ans = rec(i + 1, j)
else:
v1, w1 = rec(i + 1, j)
v2, w2 = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = v1, w1
elif v1 < v2:
ans = v2, w2
elif v1 == v2:
if w1 < w2:
ans = v1, w1
else... | Traceback (most recent call last):
File "/tmp/tmph8p4r1_z/tmpigl5p7r3.py", line 28, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s048310023 | p00042 | u896025703 | 1469782451 | Python | Python3 | py | Runtime Error | 1870 | 110788 | 685 |
def rec(i, j):
if dp[i][j] != -1:
return dp[i][j]
if i == N:
ans = 0, W - j
elif j < wl[i]:
ans = rec(i + 1, j)
else:
v1, w1 = rec(i + 1, j)
v2, w2 = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = v1, w1
elif v1 < v2:
ans = v2, w2
elif v1 == v2:
if w1 < w2:
ans = v1, w1
else... | Traceback (most recent call last):
File "/tmp/tmpv7fty_gt/tmp7igeesf8.py", line 28, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s966402467 | p00042 | u896025703 | 1469782523 | Python | Python3 | py | Runtime Error | 1870 | 110656 | 701 |
def rec(i, j):
if dp[i][j] != -1:
return dp[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = (v1, w1)
elif v1 < v2:
ans = (v2, w2)
elif v1 == v2:
if w1 < w2:
ans = (v1,... | Traceback (most recent call last):
File "/tmp/tmpzahy2toy/tmphqka5pqt.py", line 28, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s961308360 | p00042 | u896025703 | 1469782753 | Python | Python3 | py | Runtime Error | 1860 | 110692 | 758 |
def rec(i, j):
if 3000 < i or 3000 < j:
while True:
print("aaa")
if dp[i][j] != -1:
return dp[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = (v1, w1)
elif v1 < v2:
ans ... | Traceback (most recent call last):
File "/tmp/tmppk0dxnv4/tmp3dclopy7.py", line 32, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s883618968 | p00042 | u896025703 | 1469783450 | Python | Python3 | py | Runtime Error | 20 | 7800 | 911 |
def rec(i, j):
#print("rec({}, {}) called".format(i, j))
"""
if dp[i][j] != -1:
return dp[i][j]
"""
if i in dphash and j in dphash[i]:
return dphash[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
... | Traceback (most recent call last):
File "/tmp/tmpl2ofw6vc/tmpihy8gee0.py", line 39, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s281336939 | p00042 | u896025703 | 1469783579 | Python | Python3 | py | Runtime Error | 20 | 7668 | 911 |
def rec(i, j):
#print("rec({}, {}) called".format(i, j))
"""
if dp[i][j] != -1:
return dp[i][j]
"""
if i in dphash and j in dphash[i]:
return dphash[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
... | Traceback (most recent call last):
File "/tmp/tmprblv5cy9/tmpnau78gta.py", line 39, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s680688302 | p00042 | u896025703 | 1469783622 | Python | Python3 | py | Runtime Error | 20 | 7688 | 863 |
def rec(i, j):
#print("rec({}, {}) called".format(i, j))
if i in dphash and j in dphash[i]:
return dphash[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = (v1, w1)
elif v1 < v2:
... | Traceback (most recent call last):
File "/tmp/tmpufrvsikk/tmpepxrhvrq.py", line 35, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s494253673 | p00042 | u896025703 | 1469783849 | Python | Python3 | py | Runtime Error | 20 | 7696 | 866 |
def rec(i, j):
#print("rec({}, {}) called".format(i, j))
if i in dphash and j in dphash[i]:
return dphash[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = (v1, w1)
elif v1 < v2:
... | Traceback (most recent call last):
File "/tmp/tmpgbj3dg2q/tmp98hlw8t8.py", line 35, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s851735541 | p00042 | u896025703 | 1469936504 | Python | Python3 | py | Runtime Error | 0 | 0 | 704 | case = 1
while True:
W = int(input())
if W == 0: break
N = int(input())
vl = []
wl = []
for _ in range(N):
v, w = map(int, input().split(','))
vl.append(v)
wl.append(w)
dp = [[[0, 0] for j in range(W + 1)] for i in range(N + 1)]
for i in range(N - 1, -1, -1):
for j in range(0, W + 1):
if j < wl[i]:
... | File "/tmp/tmp9mnpsew3/tmp3qf7y_b3.py", line 23
elif dp[i + 1][j][0] = dp[i+1][j - wl[i]][0] + vl[i]:
^^^^^^^^^^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s795849336 | p00042 | u812047151 | 1469941947 | Python | Python3 | py | Runtime Error | 30 | 7752 | 863 |
def rec(i, j):
#print("rec({}, {}) called".format(i, j))
if i in dphash and j in dphash[i]:
return dphash[i][j]
if i == N:
ans = (0, W - j)
elif j < wl[i]:
ans = rec(i + 1, j)
else:
(v1, w1) = rec(i + 1, j)
(v2, w2) = rec(i + 1, j - wl[i])
v2 += vl[i]
if v1 > v2:
ans = (v1, w1)
elif v1 < v2:
... | Traceback (most recent call last):
File "/tmp/tmpohb8y9hh/tmpkbr2g9oo.py", line 35, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s774923613 | p00042 | u661290476 | 1482134694 | Python | Python3 | py | Runtime Error | 0 | 0 | 583 | times=0
while True:
times+=1
W=int(input())
n=int(input())
if W==0:
break
w=[0]*n
v=[0]*n
for i in range(n):
v[i],w[i]=map(int,input().split(","))
dp=[[0]*(W+1) for i in range(n+1)]
for i in range(n):
for j in range(W+1):
if j<w[i]:
... | Traceback (most recent call last):
File "/tmp/tmpzomh60yx/tmpyes8i_wr.py", line 4, in <module>
W=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s761508934 | p00042 | u252368621 | 1482161628 | Python | Python3 | py | Runtime Error | 20 | 7736 | 908 | def dfs_dp(w, v, N, W, index, dp):
if (dp[index][W][0] != -1):
return dp[index][W]
if index==N: return [0,0]
if W<w[index]: return dfs_dp(w, v, N, W, index + 1, dp)
temp1=dfs_dp(w, v, N, W, index + 1, dp)
temp=dfs_dp(w, v, N, W - w[index], index + 1, dp)
temp2=[v[index] + temp[0],w[inde... | Traceback (most recent call last):
File "/tmp/tmpb5rrtdph/tmpmoja06e0.py", line 23, in <module>
W=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s133473839 | p00042 | u227162786 | 1490176514 | Python | Python3 | py | Runtime Error | 20 | 7636 | 902 | # i????????\??????????????§??????j??§??????(?????§??????, ??????????????????)
def ns(vs, ws, i, j, dp):
if dp[i][j][0] != -1:
return dp[i][j]
if i == len(vs):
return [0, 0]
else:
if ws[i] > j:
dp[i][j] = ns(vs, ws, i+1, j, dp)
return dp[i][j]
else:
... | Traceback (most recent call last):
File "/tmp/tmp7aib2047/tmp9kqdsagc.py", line 18, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s428893666 | p00042 | u227162786 | 1490176972 | Python | Python3 | py | Runtime Error | 30 | 7752 | 913 | # i????????\??????????????§??????j??§??????(?????§??????, -??????????????????)
def ns(vs, ws, i, j, dp):
if dp[i][j][0] != -1:
return dp[i][j]
if i == len(vs):
return [0, 0]
else:
if ws[i] > j:
dp[i][j] = ns(vs, ws, i+1, j, dp)
return dp[i][j]
else:
... | Traceback (most recent call last):
File "/tmp/tmp98n_a4zf/tmpe8iyrbof.py", line 18, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s323617671 | p00042 | u227162786 | 1490177069 | Python | Python3 | py | Runtime Error | 30 | 7692 | 831 | def ns(vs, ws, i, j, dp):
if dp[i][j][0] != -1:
return dp[i][j]
if i == len(vs):
return [0, 0]
else:
if ws[i] > j:
dp[i][j] = ns(vs, ws, i+1, j, dp)
return dp[i][j]
else:
tmp = ns(vs, ws, i+1, j-ws[i], dp)
dp[i][j] = max(ns(vs,... | Traceback (most recent call last):
File "/tmp/tmpi3_kx8_z/tmp_c6wnkz9.py", line 17, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s397182723 | p00042 | u144068724 | 1494954030 | Python | Python3 | py | Runtime Error | 0 | 0 | 31 | # coding: utf-8
count += 1 | File "/tmp/tmpbnk7racz/tmppsb_plr2.py", line 3
count += 1
IndentationError: unexpected indent
| |
s619283595 | p00042 | u144068724 | 1494954048 | Python | Python3 | py | Runtime Error | 0 | 0 | 30 | # coding: utf-8
count = 1 | File "/tmp/tmpegr6gkwp/tmpx6rd8ear.py", line 3
count = 1
IndentationError: unexpected indent
| |
s361318135 | p00042 | u144068724 | 1494954435 | Python | Python3 | py | Runtime Error | 0 | 0 | 470 | def get():
p,w = map(int, raw_input().split(","))
for i in range(W-w,-1,-1):
if bag[i] > 0 and bag[i]+p > bag[i+w]:
bag[i+w] = bag[i]+p
else:
if p > bag[w]: bag[w] = p
return
c = 1
while True:
W = int(raw_input())
if W == 0: break
bag = [0]*(W+1)
N = int(raw... | File "/tmp/tmpgrmzah2x/tmpw6llc0r2.py", line 19
print "Case {}:\n{}\n{}".format(c,w_all,money)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s213256570 | p00042 | u868716420 | 1496190409 | Python | Python3 | py | Runtime Error | 0 | 0 | 966 | from itertools import combinations
case = 0
while True :
limit = int(input())
if limit == 0 : break
case += 1
number = int(input())
value, weight = [], []
for _ in range(number) :
a, b = input().split(',')
value.append(int(a))
weight.append(int(b))
temp1, te... | File "/tmp/tmp6b84_rog/tmpln9y2j44.py", line 26
if result[0] < value[_] and weight[_] =< limit :
^
SyntaxError: invalid syntax
| |
s802438537 | p00042 | u009961299 | 1504775562 | Python | Python3 | py | Runtime Error | 20 | 7756 | 704 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
def solve():
cache = dict()
def loop(i, w):
if (i, w) in cache:
return cache[i, w]
if i == N:
return (0, 0)
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[i][... | Traceback (most recent call last):
File "/tmp/tmpei4p5pmh/tmprs905zli.py", line 20, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s573891222 | p00042 | u009961299 | 1504775668 | Python | Python3 | py | Runtime Error | 30 | 7696 | 653 | import itertools
def solve():
cache = {}
def loop(i, w):
if (i, w) in cache:
return cache[i, w]
if i == N:
return (0, 0)
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[i][1])
cache[i, w] = max(cache[i, w], (t[0... | Traceback (most recent call last):
File "/tmp/tmpmoijwc1_/tmpt_arrdgd.py", line 18, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s892533809 | p00042 | u009961299 | 1504775859 | Python | Python3 | py | Runtime Error | 30 | 7796 | 667 | import itertools
def solve(W, N, v):
cache = {}
def loop(i, w):
if (i, w) in cache:
return cache[i, w]
if i == N:
return (0, 0)
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[i][1])
cache[i, w] = max(cache[i, w... | Traceback (most recent call last):
File "/tmp/tmpw7buuw2w/tmpsd3dsdrg.py", line 18, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s953407805 | p00042 | u009961299 | 1504776121 | Python | Python3 | py | Runtime Error | 30 | 7716 | 768 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
def solve(W, N, v):
cache = [[None for _ in range(W + 1)] for _ in range(N)]
def loop(i, w):
if i == N:
return (0, 0)
if cache[i][w] is not None:
return cache[i][w]
cache[i][w] = loop(i + 1, w)
... | Traceback (most recent call last):
File "/tmp/tmpcimh_m12/tmpn652w5nx.py", line 20, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s709644587 | p00042 | u009961299 | 1504776682 | Python | Python3 | py | Runtime Error | 20 | 7804 | 788 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
def solve(W, N, v):
cache = {}
def loop(i, w):
if i == N:
return (0, 0)
if (i, w) in cache:
return cache[i, w]
cache[i, w] = loop(i + 1, w)
if v[i][1] <= w:
t = loop(i + 1, w - v[... | Traceback (most recent call last):
File "/tmp/tmp2vzlzong/tmpj9uiblrg.py", line 22, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s630073206 | p00042 | u150984829 | 1525016228 | Python | Python3 | py | Runtime Error | 0 | 0 | 267 | c=0
for W in iter(input,'0\n'):
c+=1
W=int(W)
dp=[0]*-~W
for _ in[0]*int(input()):
v,w=map(int,input().split(','))
for i in range(W,w-1,-1):
if dp[i]<dp[i-w]+v:dp[i]=dp[i-w]+v
for i in range(W+1):
if dp[W]==dp[i]:print(f'Case {c}:\n{dp[W]}\n{i}');break
| Traceback (most recent call last):
File "/tmp/tmpsxy04i5z/tmp9yexmini.py", line 2, in <module>
for W in iter(input,'0\n'):
EOFError: EOF when reading a line
| |
s197093521 | p00042 | u019169314 | 1527996745 | Python | Python3 | py | Runtime Error | 30 | 5616 | 1109 | case = 0
while True:
W = int(input())
if W == 0:
break
N = int(input())
case += 1
# a list of [itemValue, itemWeight]
items = [list(map(int,input().split(','))) for i in range(N)]
dp = {}
def bestVW(item, capa):
if (item,capa) in dp:
return dp[(item,capa)]
... | Traceback (most recent call last):
File "/tmp/tmp6fycouws/tmp_ufc_c7w.py", line 3, in <module>
W = int(input())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.