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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s845038590 | p04045 | u669770658 | 1542153512 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 301 | price, len_hate_set = map(int, input().split())
hate_set = set([int(i) for i in input().split()])
ans = 0
while True:
if all(map(lambda x: int(x) in set(range(0, 10)) - hate_set,
[int(str(ans)[i]) for i in range(len(str(ans)))])) and ans >= price:
print ans
ans += 1 | File "/tmp/tmpxjkceisp/tmpmdzi6fi8.py", line 9
print ans
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s200630963 | p04045 | u943657163 | 1541272492 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 208 | n, k = input().split()
dic = [int(_) for _ in input().split()]
not_in = [i for i in range(10) if i not in dic]
ans = [min(list(filter(lambda x: int(i) <= x, not_in))) for i in n]
print(''.join(map(str, ans))) | Traceback (most recent call last):
File "/tmp/tmpph7m6e23/tmp2oog_wtn.py", line 1, in <module>
n, k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s614384793 | p04045 | u637824361 | 1540951263 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 253 | n, k = map(int, input().split())
d = [int(i) for i in input().split()]
for i in range(100000):
m = n + i
N = []
while(m > 0):
N.append(m%10)
m //= 10
N.reverse()
if N.intersection(d) == []:
print(N)
exit()
else:
continue | Traceback (most recent call last):
File "/tmp/tmp3cx4cfg9/tmpioohevx4.py", line 1, in <module>
n, k = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s676841300 | p04045 | u459697504 | 1539926155 | Python | Python (3.4.3) | py | Runtime Error | 85 | 4120 | 870 | #! /usr/bin/python3
# こだわり者いろはちゃん / Iroha's Obsession
"""
1≦N<10000
1≦K<10
0≦D1<D2<…<DK≦9
{D1,D2,…,DK}≠{1,2,3,4,5,6,7,8,9}
"""
N, K = map(int, input().split())
D = list(map(int, input().split()))
test_mode = False
def check_num(x, d):
"""
金額xの中に中の文字があるか確認する関数。
x : 現在の金額(N, x+1 を想定)
... | Traceback (most recent call last):
File "/tmp/tmpbbpp9nlc/tmps1w9lqwh.py", line 11, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s784693491 | p04045 | u459697504 | 1539925740 | Python | Python (3.4.3) | py | Runtime Error | 85 | 4120 | 976 | #! /usr/bin/python3
# こだわり者いろはちゃん / Iroha's Obsession
"""
1≦N<10000
1≦K<10
0≦D1<D2<…<DK≦9
{D1,D2,…,DK}≠{1,2,3,4,5,6,7,8,9}
"""
N, K = map(int, input().split())
D = list(map(int, input().split()))
test_mode = False
def check_num(x, d):
"""
金額xの中に中の文字があるか確認する関数。
x : 現在の金額(N, x+1 を想定)
... | Traceback (most recent call last):
File "/tmp/tmpye72xumh/tmpmkqzqv7s.py", line 11, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s608883540 | p04045 | u459697504 | 1539925042 | Python | Python (3.4.3) | py | Runtime Error | 87 | 4124 | 1091 | #! /usr/bin/python3
# こだわり者いろはちゃん / Iroha's Obsession
"""
1≦N<10000
1≦K<10
0≦D1<D2<…<DK≦9
{D1,D2,…,DK}≠{1,2,3,4,5,6,7,8,9}
"""
N, K = map(int, input().split())
D = list(map(int, input().split()))
test_mode = False
def check_num(x, d, n):
"""
金額xの中に中の文字があるか確認する関数。
x : 現在の金額(N, x+n を想定)
... | Traceback (most recent call last):
File "/tmp/tmparxk3a6d/tmpklnrkc9w.py", line 11, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s005737478 | p04045 | u883048396 | 1537482087 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 1810 | iN,iK = [int(x) for x in input().split()]
aD = [int(x) for x in input().split()]
aUnList = sorted([x for x in range(10) if x not in aD])
aUnList.sort()
sN = str(iN)
iF = int(sN[0])
def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev):
iL = len(sTarget)
iF = int(sTarget[iPoint])
aUpper = [x for x in aUnList i... | Traceback (most recent call last):
File "/tmp/tmp5b38ywhj/tmpdfezb011.py", line 1, in <module>
iN,iK = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s610435366 | p04045 | u883048396 | 1537481890 | Python | Python (3.4.3) | py | Runtime Error | 88 | 4276 | 1778 | iN,iK = [int(x) for x in input().split()]
aD = [int(x) for x in input().split()]
aUnList = sorted([x for x in range(10) if x not in aD])
sN = str(iN)
iF = int(sN[0])
def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev):
iL = len(sTarget)
iF = int(sTarget[iPoint])
aUpper = [x for x in aUnList if x >= iF]
... | Traceback (most recent call last):
File "/tmp/tmpe4tvxkdy/tmph9qp46o7.py", line 1, in <module>
iN,iK = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s734378322 | p04045 | u883048396 | 1537481524 | Python | Python (3.4.3) | py | Runtime Error | 85 | 4268 | 1665 | iN,iK = [int(x) for x in input().split()]
aD = [int(x) for x in input().split()]
aUnList = sorted([x for x in range(10) if x not in aD])
sN = str(iN)
iF = int(sN[0])
def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev):
iL = len(sTarget)
iF = int(sTarget[iPoint])
aUpper = [x for x in aUnList if x >= iF]
... | Traceback (most recent call last):
File "/tmp/tmp1vpe86ae/tmpxosmxkaa.py", line 1, in <module>
iN,iK = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s413056807 | p04045 | u394853232 | 1536180309 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 231 | N , K = map(int,input().split())
lst = []
for i in range(K):
lst.append(input())
start = N
while True:
for num in str(start):
if num in lst:
break
else:
break
start += 1
print(str(start)) | Traceback (most recent call last):
File "/tmp/tmpco8ivi1v/tmp2b29cwah.py", line 1, in <module>
N , K = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s795237012 | p04045 | u693048766 | 1535674924 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 357 | xs, k = input().split()
k = int(k)
xs = [int(x) for x in list(xs)]
ds = set([int(d) for d in input().split()])
#print(ds)
ans = []
for x in xs:
if x not in ds:
ans.append(x)
else:
us = [ u for u in range(0,10) if u not in ds ]
#print(us)
x = sorted([ p for p in us if p > x ]).pop(0)
ans.a... | Traceback (most recent call last):
File "/tmp/tmp7nv4pwct/tmpjgg05dwz.py", line 1, in <module>
xs, k = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s756688424 | p04045 | u807772568 | 1535506767 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38256 | 164 | a,b = map(int,input().split())
c = input().split()
while 1:
f = 1
s = str(a)
for i in c:
if i in s: f = 0
if f : break
c += 1
print(c) | Traceback (most recent call last):
File "/tmp/tmpwa01j6jr/tmpbxfd62yw.py", line 1, in <module>
a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s367454447 | p04045 | u807772568 | 1535506574 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 40432 | 164 | a,b = map(int,input().split())
c = input().split()
while 1:
f = 1
s = str(c)
for i in c:
if i in s: f = 0
if f : break
c += 1
print(c) | Traceback (most recent call last):
File "/tmp/tmpjhlvbs05/tmpiwjzceth.py", line 1, in <module>
a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s733606161 | p04045 | u807772568 | 1535506518 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38640 | 164 | a,b = map(int,input().split())
c = input().split()
while 1:
f = 1
s = str(c)
for i in s:
if i in c: f = 0
if f : break
c += 1
print(c) | Traceback (most recent call last):
File "/tmp/tmpsaivky62/tmpt64j6y7i.py", line 1, in <module>
a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s676600008 | p04045 | u807772568 | 1535506481 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38256 | 164 | a,b = map(int,input().split())
c = input().split()
while 1:
f = 1
s = str(c)
for i in c:
if i in c: f = 0
if f : break
c += 1
print(c) | Traceback (most recent call last):
File "/tmp/tmp6mi7bg7m/tmp8h5bawxz.py", line 1, in <module>
a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s922400907 | p04045 | u599547273 | 1534611539 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 172 | n, k = map(int, input().split(" "))
d = input().split(" ")
for i in range(len(str(n))+1):
if str(n)[~i] not in d:
continue
while str(n)[~i] in d:
n += 10**i
print(n) | Traceback (most recent call last):
File "/tmp/tmpp072lz_t/tmpw6bgoe38.py", line 1, in <module>
n, k = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s994723791 | p04045 | u599547273 | 1534611486 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 169 | n, k = map(int, input().split(" "))
d = input().split(" ")
for i in range(len(str(n))+1):
if str(n)[~i] not in d:
break
while str(n)[~i] in d:
n += 10**i
print(n) | Traceback (most recent call last):
File "/tmp/tmpjqmnaxpm/tmpw8o_ywer.py", line 1, in <module>
n, k = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s946355450 | p04045 | u599547273 | 1534611405 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 136 | n, k = map(int, input().split(" "))
d = input().split(" ")
for i in range(len(str(n))+1):
while str(n)[~i] in d:
n += 10**i
print(n) | Traceback (most recent call last):
File "/tmp/tmprq28ob7p/tmpgmfq0pia.py", line 1, in <module>
n, k = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s764495372 | p04045 | u693048766 | 1534019911 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 308 | N, K = map(int, input().split())
ds = [int(d) for d in input().split()]
us = [ i for i in range(10) if i not in ds]
#print(us)
oo = [int(s) for s in str(N)]
o_u = {}
for o in oo:
o_u[o] = min(list(filter(lambda x:x>=o, us)))
n = str(N)
for o, u in o_u.items():
n = n.replace(str(o),str(u))
print(n) | Traceback (most recent call last):
File "/tmp/tmpxt_vcjg4/tmpiuyirxo1.py", line 1, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s067092316 | p04045 | u572271833 | 1530949849 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 434 | N,K = map(int,input().split( ))
Ds = list(map(int,input().split( )))
word = list(map(int,list(str(N))))
z = 0
while z in Ds:
z += 1
for i in range(len(word)):
for j in range(len(Ds)):
if word[-i-1] in Ds:
word[-i-1] += 1
if i > 0:
word[-i:] = [z for i in range(i)]
if word[-i-1]>=10:... | Traceback (most recent call last):
File "/tmp/tmpe1pkytho/tmp_fhb8ke2.py", line 1, in <module>
N,K = map(int,input().split( ))
^^^^^^^
EOFError: EOF when reading a line
| |
s219275450 | p04045 | u572271833 | 1530949811 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 434 | N,K = map(int,input().split( ))
Ds = list(map(int,input().split( )))
word = list(map(int,list(str(N))))
z = 0
while z in Ds:
z += 1
for i in range(len(word)):
for j in range(len(Ds)):
if word[-i-1] in Ds:
word[-i-1] += 1
if i > 0:
word[-i:] = [z for i in range(i)]
if word[-i-1]>=10:... | Traceback (most recent call last):
File "/tmp/tmpt5ksve1e/tmpgr58cire.py", line 1, in <module>
N,K = map(int,input().split( ))
^^^^^^^
EOFError: EOF when reading a line
| |
s812863341 | p04045 | u470735879 | 1530892248 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 577 | n, k = map(int,input().split())
n = str(n)
unlike = list(map(int,input().split()))
like = []
ans = ''
for i in range(1, 10):
if i not in unlike:
like.append(i)
for num in range(len(n)):
for i in like:
if n[0] == 9 and (9 not in like):
ans += like[0]
break
if int(... | Traceback (most recent call last):
File "/tmp/tmpig3ltflr/tmpv1of8lsx.py", line 1, in <module>
n, k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s612952511 | p04045 | u118605645 | 1530787221 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 879 | n, k = (int(char) for char in input().split())
d = [int(i) for i in input().split()]
'''
n = 10
k = 8
d = [0, 2, 3]
D = [i for i in range(10)]
'''
like_vals = [int(str(i)) for i in D if i not in d]
i = 0
n = [int(str(n)[i]) for i in range(len(str(n)))]
r = [-1] * len(n)
while i < len(n):
if n[i] in like_vals:
... | Traceback (most recent call last):
File "/tmp/tmpv_622eit/tmps1jcnb9o.py", line 1, in <module>
n, k = (int(char) for char in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s511819129 | p04045 | u632557492 | 1530587753 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 424 | n, k = [i for i in input().split()]
d = [i for i in input().split()]
# OK 숫자의 집합을 구하고,
# 각 자리수부터 들어가 NG 숫자를 OK숫자로 바꿔주면 되는 거 아냐?
n = list(n)
ng = set(d)
for i in range(len(n)):
# print(ng)
ok = set([str(i) for i in range(10)]) - ng
# print(ok)
if i == 0:
ok.remove('0')
if n[i] in ng:
... | Traceback (most recent call last):
File "/tmp/tmpnzinnmy8/tmpxpeo1nsl.py", line 1, in <module>
n, k = [i for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s489127000 | p04045 | u395086545 | 1530401332 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 230 | n, k = map(int, input().split())
d = list(map(int, input().split()))
for i in range(10*n+2):
if i >= n:
s = str(i)
for j in range(len(s)):
if int(s[j]) in d:
break
else:
print(i)
return 0
| File "/tmp/tmpsr93gre_/tmpxcww8y1k.py", line 12
return 0
^^^^^^^^
SyntaxError: 'return' outside function
| |
s418004815 | p04045 | u952708174 | 1525847900 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 426 | def c_iroha_obsession(N, K, D):
for ans in range(N, 10 * N + 1):
for digit in str(ans): # 1桁ずつ調べる
if int(digit) in D: # 嫌いな数字があった
break
else: # 嫌いな数字がなかった。このときのansが解
break
return ans
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().s... | Traceback (most recent call last):
File "/tmp/tmp_md32xh9/tmp72tyot_z.py", line 9, in <module>
N,K = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s464018841 | p04045 | u125205981 | 1525335520 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 451 | def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
for i in range(10):
if i not in D:
min_ = i
break
ans = []
apnd = ans.append
num, i = N, 0
while num > 0:
while num % 10 in D:
num += 1
top = i
... | Traceback (most recent call last):
File "/tmp/tmp274xx5hh/tmplmgyfn07.py", line 24, in <module>
main()
File "/tmp/tmp274xx5hh/tmplmgyfn07.py", line 2, in main
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s148335538 | p04045 | u709052417 | 1524982428 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 240 | N, K = map(int, input().split())
D = list(map(int, input().split()))
shiharai=N
l = [int(x) for x in list(str(N))]
for i in range(l):
while l[i] in D:
shiharai+=1
l = [int(x) for x in list(str(shiharai))]
print(shiharai) | Traceback (most recent call last):
File "/tmp/tmpqa42we1u/tmpdev66krr.py", line 1, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s411896493 | p04045 | u709052417 | 1524982386 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 240 | N, K = map(int, input().split())
D = list(map(int, input().split()))
shiharai=N
l = [int(x) for x in list(str(N))]
for i in range(l):
while l[i] in D:
shiharai+=1
l = [int(x) for x in list(str(shiharai))]
print(shiharai) | Traceback (most recent call last):
File "/tmp/tmpejls40co/tmpw1qrjehh.py", line 1, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s867128631 | p04045 | u231685196 | 1522087190 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 472 |
input_array = list(map(int,input().split()))
N = input_array[0]
input_array = list(map(int,input().split()))
num = [1,1,1,1,1,1,1,1,1,1]
ok = []
out = []
for l in range(len(input_array)):
num[input_array[l]] = 0
for i in range(len(num)):
if num[i] == 1:
ok.append(i)
N = list(str(N))
for n in N:
... | Traceback (most recent call last):
File "/tmp/tmpawjz6n_e/tmptjc03h8i.py", line 2, in <module>
input_array = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s119533351 | p04045 | u875478816 | 1521503575 | Python | Python (3.4.3) | py | Runtime Error | 412 | 3064 | 570 | li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]
D = list(map(int,input().split()))
minvalue=N
temp=0
for i in range(10*N):
i=i+N
numtemp=i
num_4=int(i/10000)
i=i-10000*num_4
num_3=int(i/1000)
i=i-1000*num_3
num_2=int(i/100)
i=i-100*num_2
num_1=int(i/10)
i=i-10*n... | Traceback (most recent call last):
File "/tmp/tmp2caml23f/tmpt7hi7oap.py", line 1, in <module>
li_1 = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s074228576 | p04045 | u875478816 | 1521502381 | Python | Python (3.4.3) | py | Runtime Error | 41 | 3064 | 587 | li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]
D = list(map(int,input().split()))
minvalue=N
temp=0
for i in range(10*(N+1)):
i=i+N
numtemp=i
num_4=int(i/10000)
i=i-10000*num_4
num_3=int(i/1000)
i=i-1000*num_3
num_2=int(i/100)
i=i-100*num_2
num_1=int(i/10)
i=i-... | Traceback (most recent call last):
File "/tmp/tmptupab6v_/tmpgef_jl5z.py", line 1, in <module>
li_1 = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s511504712 | p04045 | u875478816 | 1521502230 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 583 |
li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]
D = list(map(int,input().split()))
minvalue=N
temp=0
for i in range(N+1):
i=i+N
numtemp=i
num_4=int(i/10000)
i=i-10000*num_4
num_3=int(i/1000)
i=i-1000*num_3
num_2=int(i/100)
i=i-100*num_2
num_1=int(i/10)
i=i-10*n... | Traceback (most recent call last):
File "/tmp/tmpsyl4vxdw/tmpgiudlp22.py", line 2, in <module>
li_1 = list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s342694197 | p04045 | u143492911 | 1518148616 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 205 | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,100001):
set_i=set(list(str(i)))
for j in set_i:
if s in d:
break
else:
print(i)
break
| Traceback (most recent call last):
File "/tmp/tmp9vfukw2p/tmpzg423tca.py", line 1, in <module>
n,k=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s979709031 | p04045 | u055459962 | 1507957717 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1088 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""042-c"""
import sys
ZERO_UNICODE = 48
def solve(dislike_digits_table, first_like_digit, number):
"""Solve."""
if dislike_digits_table[int(number[0])]:
while dislike_digits_table[int(number[0])]:
number = "{0}{1}".format(chr(ord(number[0]... | Traceback (most recent call last):
File "/tmp/tmp4hotevl0/tmp3xl9t23n.py", line 44, in <module>
sys.exit(main())
^^^^^^
File "/tmp/tmp4hotevl0/tmp3xl9t23n.py", line 25, in main
N, _ = sys.stdin.readline().split(' ')
^^^^
ValueError: not enough values to unpack (expected 2, got 1)
| |
s994011015 | p04045 | u650245944 | 1502277052 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 527 | N, K = map(int, input().split())
D = list(map(int, input().split()))
L = [i for i in range(10) if i not in D]
A = []
for i in L:
A.append(i)
for i in L:
for j in L:
A.append(10*i+j)
for i in L:
for j in L:
for k in L:
A.append(100*i+10*j+k)
for i in L:
for j in L:
for k in L:
for l in L... | File "/tmp/tmphuou6wf1/tmpu8009xyq.py", line 25
A.append(10000*i+1000*j+100*k+10*l+m)
IndentationError: expected an indented block after 'for' statement on line 24
| |
s565426486 | p04045 | u788681441 | 1484260775 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 383 | n, k = map(int, input().split())
dislikes = list(map(int, input().split())
m = n
while True:
m = list(str(m))
l = []
for p in m:
if int(p) not in dislikes:
l.append(p)
continue
else:
m = int(''.join(m))+1
break
if len(l) >= len(str(n)):
... | File "/tmp/tmp2_s5tu0d/tmpiufri786.py", line 2
dislikes = list(map(int, input().split())
^
SyntaxError: '(' was never closed
| |
s231547753 | p04045 | u122916923 | 1483919094 | Python | Python (3.4.3) | py | Runtime Error | 174 | 6476 | 1379 | N, K = [int(i) for i in input().split()]
ds = [int(i) for i in input().split()]
#N, K = (99999, 8)
#ds = [0,1,2,3,4,5,6,7,9]
def run_code(N, K, ds):
dislike_digits_set = set(i for i in ds)
avail_digits = [i for i in range(10) if i not in dislike_digits_set]
avail_min = avail_digits[0]
def get_next_d... | Traceback (most recent call last):
File "/tmp/tmpwy5h58r2/tmpc31o80uq.py", line 1, in <module>
N, K = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s219891551 | p04045 | u122916923 | 1483918251 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 1050 | N, K = [int(i) for i in input().split()]
ds = [int(i) for i in input().split()]
#N, K = (99999, 1)
#ds = [0]
def run_code(N, K, ds):
dislike_digits_set = set(i for i in ds)
avail_digits = [i for i in range(10) if i not in dislike_digits_set]
avail_min = avail_digits[0]
def get_next_digit(d):
... | File "/tmp/tmpcvwld480/tmpp99j17kv.py", line 42
if inc > 0:
IndentationError: expected an indented block after 'if' statement on line 42
| |
s837836376 | p04045 | u831695469 | 1479018139 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 198 | N, K = map(int, input().split())
D = list(map(int, input().split()))
n = str(N)
ans = N
for i in reversed(range(str(len(N)))):
temp = n[i]
while(int(temp) in D):
ans += 1
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpoiiwbf7f/tmppi197j5b.py", line 1, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s762676909 | p04045 | u831695469 | 1479018017 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 188 | N, K = map(int, input().split())
D = list(map(int, input().split()))
n = str(N)
ans = N
for i in reversed(range(N)):
temp = n[i]
while(int(temp) in D):
ans += 1
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpod8y82iv/tmp_sqh0pqj.py", line 1, in <module>
N, K = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s815140573 | p04045 | u025504404 | 1478522190 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 781 | n, k = [int(i) for i in input().split()]
q = n
not_liked = [int(i) for i in input().split()]
liked = [i for i in range(10) if i not in not_liked]
digits = list()
while(n):
digits.append(n%10)
n //= 10
digits.reverse()
ind = -2
for i in digits:
if i not in liked:
ind = digits.index(i)
break
js = list(... | Traceback (most recent call last):
File "/tmp/tmpxl6n9b1k/tmpld20wif5.py", line 1, in <module>
n, k = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s806999533 | p04045 | u025504404 | 1478521885 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3192 | 758 | n, k = [int(i) for i in input().split()]
q = n
not_liked = [int(i) for i in input().split()]
liked = [i for i in range(10) if i not in not_liked]
digits = list()
while(n):
digits.append(n%10)
n //= 10
digits.reverse()
ind = -2
for i in digits:
if i not in liked:
ind = digits.index(i)
break
js = list(... | Traceback (most recent call last):
File "/tmp/tmpqea_e8r2/tmpmr5uqne1.py", line 1, in <module>
n, k = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s929331940 | p04045 | u025504404 | 1478521806 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3192 | 780 | n, k = [int(i) for i in input().strip(" ").split()]
q = n
not_liked = [int(i) for i in input().strip(" ").split()]
liked = [i for i in range(10) if i not in not_liked]
digits = list()
while(n):
digits.append(n%10)
n //= 10
digits.reverse()
ind = -2
for i in digits:
if i not in liked:
ind = digits.index(i)
... | Traceback (most recent call last):
File "/tmp/tmpqhe7n47n/tmp74blstl4.py", line 1, in <module>
n, k = [int(i) for i in input().strip(" ").split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s402522954 | p04045 | u025504404 | 1478520730 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 669 | n, k = [int(i) for i in input().strip(" ").split()]
q = n
not_liked = [int(i) for i in input().strip(" ").split()]
liked = [i for i in range(10) if i not in not_liked]
digits = list()
while(n):
digits.append(n%10)
n //= 10
digits.reverse()
ind = -2
for i in digits:
if i not in liked:
ind = digits.index(i)
... | Traceback (most recent call last):
File "/tmp/tmpy828u7h_/tmp6f5hc42h.py", line 1, in <module>
n, k = [int(i) for i in input().strip(" ").split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s839492722 | p04045 | u117095520 | 1477685560 | Python | Python (2.7.6) | py | Runtime Error | 48 | 3524 | 420 | N, K = raw_input().split()
D = raw_input().split()
candi = [str(i) for i in xrange(10)]
for d in D:
candi.remove(d)
def decide(i):
if i >= len(N):
return ''
for c in candi:
if N[i] == c:
return c + decide(i+1)
elif N[i] < c:
return c + candi[0] * (len(N) - i ... | File "/tmp/tmppg49dhm6/tmpgn97nq7c.py", line 18
print decide(0)
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s036894632 | p04045 | u564917060 | 1469695128 | Python | Python (3.4.3) | py | Runtime Error | 50 | 4340 | 394 | import itertools
if __name__ == "__main__":
line_one = input().split()
line_two = input().split()
use_num = {'0','1','2','3','4','5','6','7','8','9'}.difference(line_two)
all_comb = list(itertools.product(use_num, repeat=len(str(line_one[0]))))
nums = list((map(int,["".join(x) for x in all_comb]))... | Traceback (most recent call last):
File "/tmp/tmp7i5ciljf/tmp6bbheol5.py", line 4, in <module>
line_one = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s447764636 | p04045 | u557523358 | 1469329948 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 516 | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
int main() {
int n, k, d;
bool is_safe[10] = {};
std::cin >> n >> k;
std::fill(is_safe, is_safe + 10, true);
for (int ki = 0 ; ki < k; ++ki) {
std::cin >> d;
is_safe[d] = false;
}
wh... | File "/tmp/tmprc9tg3p6/tmpof2lgo3m.py", line 8
int main() {
^^^^
SyntaxError: invalid syntax
| |
s006728586 | p04045 | u124139453 | 1469324493 | Python | Python (2.7.6) | py | Runtime Error | 225 | 2568 | 285 | n, k = map(int, raw_input().split())
d = map(int, raw_input().split())
def use_d(n):
for i in list(str(n)):
if int(i) in d:
return True
else:
return False
while n < 100000:
if use_d(n):
n += 1
else:
print n
sys.exit() | File "/tmp/tmp974uvf2j/tmprr0hf0cf.py", line 13
print n
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s316420238 | p04046 | u682467216 | 1600391636 | Python | PyPy3 (7.3.0) | py | Runtime Error | 93 | 74876 | 1429 | # coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, h... | Traceback (most recent call last):
File "/tmp/tmp3gvqetwu/tmphaj74bmr.py", line 79, in <module>
n, k = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s670718509 | p04046 | u049364987 | 1599733573 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9232 | 656 | from sys import stdin, stdout
from time import perf_counter
import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7
# import sys
# sys.stdout = open("e:/cp/output.txt","w")
# sys.stdin = open("e:/cp/input.txt","r")
n,k = map(int,input().split())
d= list(map(int,input().split()))
test = [1,2,3,4,5,6,7,8,9]
for item ... | Traceback (most recent call last):
File "/tmp/tmpw5bc6xds/tmp07kh3sof.py", line 14, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s282585295 | p04046 | u049364987 | 1599733506 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9128 | 558 | from sys import stdin, stdout
from time import perf_counter
import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7
n,k = map(int,input().split())
d= list(map(int,input().split()))
test = [1,2,3,4,5,6,7,8,9]
for item in range(k):
if d[item]==0:
print(n)
exit()
result =[]
for item in test:
... | Traceback (most recent call last):
File "/tmp/tmpyg7vmwac/tmps9br4jlx.py", line 12, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s611185518 | p04046 | u049364987 | 1599733485 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9124 | 558 | from sys import stdin, stdout
from time import perf_counter
import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7
n,k = map(int,input().split())
d= list(map(int,input().split()))
test = [1,2,3,4,5,6,7,8,9]
for item in range(k):
if d[item]==0:
print(n)
exit()
result =[]
for item in test:
... | Traceback (most recent call last):
File "/tmp/tmpa2z8au1w/tmpqayz6yhj.py", line 12, in <module>
n,k = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s680323602 | p04046 | u417309772 | 1599645428 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9144 | 418 | P = 10**9+7
fac = [1]
ifac = [1]
ff = 1
for i in range(1,200001):
ff *= i
ff %= p
fac.append(ff)
ifac.append(pow(ff, p-2, p))
def ncr(n, r, p):
return (fac[n] * ifac[r] % p * ifac[n-r] % p);
h,w,a,b = map(int,input().split())
s = 0
nC = b-1
kC = 0
nD = w-b-1+h-1
kD = h-1
for i in range(h-a):
C = ncr(nC, k... | Traceback (most recent call last):
File "/tmp/tmpix8b_egi/tmpqc8tvytj.py", line 7, in <module>
ff %= p
^
NameError: name 'p' is not defined. Did you mean: 'P'?
| |
s728668182 | p04046 | u107639613 | 1599448815 | Python | PyPy3 (7.3.0) | py | Runtime Error | 98 | 87292 | 1616 | import sys
def input(): return sys.stdin.readline().strip()
mod = 10**9+7
class Combination:
"""
O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる
n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
使用例:
comb = Combination(1000000)
print(comb(5, 3)) # 10
"""
def __init__(self, n_max, mod=10**... | Traceback (most recent call last):
File "/tmp/tmps3hl_4if/tmpft50ca4o.py", line 51, in <module>
main()
File "/tmp/tmps3hl_4if/tmpft50ca4o.py", line 42, in main
H, W, A, B = map(int, input().split())
^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 0)
| |
s448115246 | p04046 | u062691227 | 1598299857 | Python | PyPy3 (7.3.0) | py | Runtime Error | 96 | 74696 | 697 | H, W, A, B = map(int, open(0).read().split())
MOD = 10**9+7
def modperm(m, n, mod):
p = 1
for i in range(n):
p = p * (m - i) % mod
return p
def modcomb(m, n, mod):
if n > m - n:
n = m - n
p = modperm(m, n, mod)
q = pow(modperm(n, n, mod), -1, mod)
return p * q % mod
total ... | Traceback (most recent call last):
File "/tmp/tmp6delzoi1/tmpj_qui8zz.py", line 1, in <module>
H, W, A, B = map(int, open(0).read().split())
^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 0)
| |
s641090957 | p04046 | u658181634 | 1598208277 | Python | Python (3.8.2) | py | Runtime Error | 1054 | 42560 | 637 | from operator import mul
from functools import reduce
from scipy.special import comb
# def cmb(n, r, mod):
# if ( r<0 or r>n ):
# return 0
# r = min(r, n-r)
# return g1[n] * g2[r] * g2[n-r] % mod
# def cmb(n, r):
# r = min(n-r, r)
# if r == 0:
# return 1
# over = reduce(mul, r... | Traceback (most recent call last):
File "/tmp/tmp490fimdy/tmpk8il_6qv.py", line 21, in <module>
hwab = list(map(lambda x: int(x), input().split(" ")))
^^^^^^^
EOFError: EOF when reading a line
| |
s755233800 | p04046 | u658181634 | 1598208087 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9176 | 220 | hwab = list(map(lambda x: int(x), input().split(" ")))
h = hwab[0]
w = hwab[1]
a = hwab[2]
b = hwab[3]
mod = 10**9 + 7
res = 0
for i in range(h-a):
res += comb(b+i-1, i) * comb(w-b+h-i-2, h-i-1)
print(res % mod)
| Traceback (most recent call last):
File "/tmp/tmpbwjn1okl/tmpbde1x7ca.py", line 1, in <module>
hwab = list(map(lambda x: int(x), input().split(" ")))
^^^^^^^
EOFError: EOF when reading a line
| |
s429006145 | p04046 | u875113233 | 1595741287 | Python | Python (3.8.2) | py | Runtime Error | 550 | 11152 | 450 | def main():
import math
h,w,a,b=map(int,input().split())
h-=1
w-=1
a-=1
b-=1
N=math.factorial(w-b-1+h)/math.factorial(h)/math.factorial(w-b-1)
h1=h-1
while h1>a:
z=h-h1+b
z1=w-b-1+h1
N+=math.factorial(z)/math.factorial(h-h1)/math.factorial(b)*math.factorial(z1... | Traceback (most recent call last):
File "/tmp/tmpupztzxli/tmpo63i_hse.py", line 20, in <module>
main()
File "/tmp/tmpupztzxli/tmpo63i_hse.py", line 3, in main
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s847675542 | p04046 | u414920281 | 1595357867 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9280 | 700 | a,b=map(int,input().split())
fac=[0]*200001#iの階乗mod(1000000007)
inv=[0]*200001#iの逆元mod(1000000007)
fac[0]=1
ans=0
for i in range(1,200001):
fac[i]=fac[i-1]*i%1000000007
inv[200000]=pow(fac[200000],1000000005,1000000007)
for i in range(199999,0,-1):
inv[i]=(inv[i+1]*(i+1))%1000000007
inv[0]=1
for i in range(... | Traceback (most recent call last):
File "/tmp/tmp9lh_cq4b/tmp4u4cm1h5.py", line 1, in <module>
a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s447961783 | p04046 | u252160635 | 1594268449 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 11640 | 294 | import math
def combinations_count(n, r):
return math.factorial(n+r) // (math.factorial(n) * math.factorial(r))
H, W, A, B = list(map(int, input().split()))
ans = 0
for i in range(H-A):
ans += combinations_count(B-1, i) * combinations_count(W-B-1, H-1-i)
print(int(ans%(1e+9 + 7))) | Traceback (most recent call last):
File "/tmp/tmpe9khd7qu/tmpqqq2iez1.py", line 6, in <module>
H, W, A, B = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s768002776 | p04046 | u896004073 | 1593313180 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9592 | 444 | H, W, A, B = map(int, input().split())
N = 10**9 + 7
def factor(n,k):
assert n>=k
if n == k:
return 1
else:
return n*factor(n-1,k)
def comb(n,k):
if k < n/2:
return int(factor(n,n-k) / factor(k,0))
else:
return int(factor(n,k) / factor(n-k,0))
result = 0
for i in r... | Traceback (most recent call last):
File "/tmp/tmptgn0p51b/tmp8lk1i0d5.py", line 1, in <module>
H, W, A, B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s933727690 | p04046 | u345710188 | 1592970075 | Python | Python (3.8.2) | py | Runtime Error | 2205 | 9664 | 485 | def irohamasu(i, j, H, W, A, B):
if (i >= H - A) and (j <= B - 1):
return 0
elif i == 0 & j == 0:
return 1
elif i == 0:
return irohamasu(i, j-1, H, W, A, B)
elif j == 0:
return irohamasu(i-1, j, H, W, A, B)
else:
return (irohamasu(i-1, j, H, W, A, B) + irohama... | Traceback (most recent call last):
File "/tmp/tmp2j1j2ly6/tmpvw3fct8c.py", line 13, in <module>
H, W, A, B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s726350375 | p04046 | u552145906 | 1592292989 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3968 | 973 |
import math
def re_factorial(n, r):
if n <= r:
return 1
return n * re_factorial(n-1,r)
H, W, A, B = map(int, input().split())
y = H - A - 1
ans = 0
for dx in range(B+1,W+1):
x = W - dx
if y >= dx-1:
xn = re_factorial(dx-1,1)
nn = re_factorial(dx-1+y, y)
Ansn = nn / x... | Traceback (most recent call last):
File "/tmp/tmp6zc2tuww/tmp4h4iucr_.py", line 9, in <module>
H, W, A, B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s320744238 | p04046 | u552145906 | 1592290589 | Python | Python (3.4.3) | py | Runtime Error | 2026 | 5236 | 386 | import math
H, W, A, B = map(int, input().split())
y = H - A -1
ans = 0
for x in range(B,W):
yn = math.factorial(y)
xn = math.factorial(x)
nn = math.factorial(y+x)
Ansn = nn / (xn * yn)
xm = math.factorial(W-x-1)
ym = math.factorial(A-1)
mm = math.factorial(W-x-1+A-1)
Ansm = mm / (xm ... | Traceback (most recent call last):
File "/tmp/tmpuse087nz/tmpfl69oikz.py", line 4, in <module>
H, W, A, B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s215993841 | p04046 | u189479417 | 1591892422 | Python | Python (3.4.3) | py | Runtime Error | 35 | 4340 | 530 | def cmb(n, r, mod):
if ( r<0 or r>n ):
return 0
r = min(r, n-r)
return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7
size = 10**4
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range( 2, size + 1 ):
g1.append( ( g1[-1] * i ) % mod )
inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )... | Traceback (most recent call last):
File "/tmp/tmpmd7u3tr7/tmp__7tlybu.py", line 18, in <module>
H, W, A, B = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s291695475 | p04046 | u667472448 | 1591730889 | Python | Python (3.4.3) | py | Runtime Error | 147 | 13572 | 733 | mod = 1000000007
H, W, A, B = map(int, input().split())
factorial = [1]
for n in range(1, H+W):
factorial.append(factorial[n-1]*n%mod)
def power(x, y):
if y == 0:
return 1
elif y == 1:
return x % mod
elif y % 2 == 0:
return power(x, y/2)**2 % mod
else :
return pow... | Traceback (most recent call last):
File "/tmp/tmpivkyc8da/tmpzzx2aca8.py", line 2, in <module>
H, W, A, B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s599821710 | p04046 | u667472448 | 1591605218 | Python | Python (3.4.3) | py | Runtime Error | 2022 | 5136 | 300 | import math
h,w,a,b = map(int, input().split())
result = 0
for i in range(b,w):
result += ((math.factorial((i)+(h-a-1))) / (math.factorial(i) * math.factorial(h-a-1))) * ((math.factorial((w-i-1)+(a-1))) / (math.factorial(w-i-1)*math.factorial(a-1)))
result = int(result%(10**9 + 7))
print(result) | Traceback (most recent call last):
File "/tmp/tmpg46fe7j3/tmp6eqii6eu.py", line 2, in <module>
h,w,a,b = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s550946411 | p04046 | u139112865 | 1591203581 | Python | Python (3.4.3) | py | Runtime Error | 2286 | 319732 | 425 | h, w, a, b = map(int, input().split())
mod = 10 ** 9 + 7
n = h + w
f = [1 for _ in range(n)]
for i in range(1, n):
f[i] = f[i-1] * i
def f_inv(x):
return pow(f[x], mod-2, mod)
def comb(n, k):
return (f[n] * f_inv[k] % mod) * f_inv[n-k] % mod
ans = comb(h+w-2, h-1)
for i in range(b):
print(h-a+i, i)
... | Traceback (most recent call last):
File "/tmp/tmp4522x103/tmpoe6r3niz.py", line 1, in <module>
h, w, a, b = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s843052367 | p04046 | u373858851 | 1590538737 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3952 | 365 | #Iroha and a grid
#abc 042
h,w,a,b=map(int,input().split())
mod=10**9+7
def dp(x,y,h,w,a,b):
if x==-2:
c=1
else:
if x==w-1 and y==h-1:
return 1
if x>=w or y>=h or (x<b and y>=h-a):
return 0
ans=dp(x+1,y,h,w,a,b)+dp(x,y+1,h,w,a,b)
... | Traceback (most recent call last):
File "/tmp/tmpd4zs_vh9/tmpbn9_vaep.py", line 4, in <module>
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s076339125 | p04046 | u373858851 | 1590538645 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 363 | #Iroha and a grid
#abc 042
h,w,a,b=map(int,input().split())
mod=10**9+7
def dp(x,y,h,w,a,b):
if x==-2:
c=1
else:
if x==w-1 and y==h-1:
return 1
if x>=w or y>=h or (x<b and y>=h-a):
return 0
ans=dp(x+1,y,h,w,a,b)+dp(x,y+1,h,w,a,b)
r... | File "/tmp/tmpgegs6uy3/tmpxua0t7o3.py", line 10
c=1
TabError: inconsistent use of tabs and spaces in indentation
| |
s278222990 | p04046 | u373858851 | 1590538496 | Python | Python (3.4.3) | py | Runtime Error | 78 | 4592 | 414 | #Iroha and a grid
#abc 042
h,w,a,b=map(int,input().split())
mod=10**9+7
memo={}
def dp(x,y,h,w,a,b):
if (x,y) in memo:
return memo[(x,y)]
else:
if x==w-1 and y==h-1:
return 1
if x>=w or y>=h or (x<b and y>=h-a):
return 0
ans=dp(x+1,y,h,w,a,b)+dp(x,y+1,h,... | Traceback (most recent call last):
File "/tmp/tmp0pmxgz_g/tmph0wsdq2q.py", line 4, in <module>
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s553943529 | p04046 | u373858851 | 1590538176 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4592 | 407 | #Iroha and a grid
#abc 042
h,w,a,b=map(int,input().split())
mod=10**9+7
memo={}
def dp(x,y,h,w,a,b):
if (x,y) in memo:
return memo[(x,y)]
else:
if x==w-1 and y==h-1:
return 1
if x>=w or y>=h or (x<b and y>=h-a):
return 0
ans=dp(x+1,y,h,w,a,b)+dp(x,y+1,h,... | Traceback (most recent call last):
File "/tmp/tmpe13jvmkt/tmpe15wixsq.py", line 4, in <module>
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s033577118 | p04046 | u557659226 | 1590224199 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 712 | n,k = map(int,input().rstrip().split())
dislikes = list(map(int,input().rstrip().split()))
n = str(n)
len_n = len(n)
separate_n = [int(s) for s in n]
pay = separate_n.copy()
up_nextlevel = False
for i in range(len(separate_n)-1,-1,-1):
up_nextlevel = False
if separate_n[i] in dislikes:
for j in range(1... | Traceback (most recent call last):
File "/tmp/tmpqnc93ajd/tmpcle48d5s.py", line 1, in <module>
n,k = map(int,input().rstrip().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s289382506 | p04046 | u822179469 | 1590031747 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 729 | mod = 1000000007
H, W, A, B = map(int, raw_input().split())
factorial = [1]
for n in xrange(1, H+W):
factorial.append(factorial[n-1]*n%mod)
def power(x, y):
if y == 0 : return 1
elif y == 1 : return x % mod
elif y % 2 == 0 : return power(x, y/2)**2 % mod
else : return power(x,... | File "/tmp/tmpg614t3dc/tmpnbt93958.py", line 25
print sum
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s469438602 | p04046 | u822179469 | 1590031205 | Python | Python (3.4.3) | py | Runtime Error | 230 | 4092 | 497 | from math import factorial
h,w,a,b = map(int,input().split())
sg = 0
i = 0 #場合分け
svi = factorial(i+b)/factorial(i)/factorial(b)
vig = factorial(h-i-1+w-b-1)/factorial(h-i-1)/factorial(w-b-1)
sg = sg + svi*vig
# 1<= i <= h-a の時
for i in range(1,h-a):
svj = svi = factorial(i-1+b)/factorial(i-1)/factorial(b)
sv... | Traceback (most recent call last):
File "/tmp/tmp6hfkwi63/tmp2_ywsebc.py", line 2, in <module>
h,w,a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s712199502 | p04046 | u285891772 | 1589496369 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38384 | 1278 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, radians, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string imp... | Traceback (most recent call last):
File "/tmp/tmpmzrtvtto/tmpi2sh18ht.py", line 9, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s146624685 | p04046 | u285891772 | 1589496313 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38384 | 1311 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from cop... | Traceback (most recent call last):
File "/tmp/tmp4929jvwz/tmpw311q51o.py", line 9, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s993478612 | p04046 | u285891772 | 1589496287 | Python | PyPy3 (2.4.0) | py | Runtime Error | 187 | 38256 | 1310 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from cop... | Traceback (most recent call last):
File "/tmp/tmp7oh8uege/tmp1_vtyz2r.py", line 9, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s020909568 | p04046 | u285891772 | 1589496228 | Python | PyPy3 (2.4.0) | py | Runtime Error | 187 | 38384 | 1301 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import ... | Traceback (most recent call last):
File "/tmp/tmpstcui633/tmpjzkipm2q.py", line 9, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s583284856 | p04046 | u285891772 | 1589496179 | Python | PyPy3 (2.4.0) | py | Runtime Error | 183 | 39876 | 1319 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul... | Traceback (most recent call last):
File "/tmp/tmpi5r593dx/tmppb6w5ftw.py", line 9, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s563818377 | p04046 | u285891772 | 1589495872 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38256 | 1456 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul... | Traceback (most recent call last):
File "/tmp/tmp11wat7l8/tmpr7di2l6y.py", line 9, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s541449056 | p04046 | u285891772 | 1589495368 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 38496 | 1293 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul... | Traceback (most recent call last):
File "/tmp/tmp2j10myhd/tmpig74byua.py", line 38, in <module>
H, W, A, B = MAP()
^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 0)
| |
s290427555 | p04046 | u285891772 | 1589494992 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 1220 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter... | Traceback (most recent call last):
File "/tmp/tmplx6wrtdf/tmpewej39j9.py", line 33, in <module>
H, W, A, B = MAP()
^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 0)
| |
s242144826 | p04046 | u835534360 | 1589319816 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3940 | 422 | def func(i, j, h, w, a, b):
if j == 0:
return 1
elif i == 0:
if j < h - a:
return 1
else:
return 0
else:
if 0 < i < b and h - a <= j < h:
return 0
else:
return func(i-1, j, h, w, a, b) + func(i, j-1, h, w, a, b)
h, w, ... | Traceback (most recent call last):
File "/tmp/tmpaqlhzgw0/tmpbdtysmip.py", line 16, in <module>
h, w, a, b = (int(x) for x in input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s620083079 | p04046 | u922851354 | 1588459671 | Python | Python (3.4.3) | py | Runtime Error | 1413 | 5840 | 467 | import math
h,w,a,b=map(int, input().split())
def comb(n,r):
c=math.factorial(n)/(math.factorial(n-r)*math.factorial(r))
return c
def way_num(x, y):
return comb(x+y-2, x-1)
all_num=way_num(h, w)
no_num=0
for i in range(b):
to_here=way_num(h-a+1, i+1)
from_here=way_num(a, w-i)
if i>0:
over... | Traceback (most recent call last):
File "/tmp/tmpqo9dq05u/tmpyn5frr3x.py", line 3, in <module>
h,w,a,b=map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s188214041 | p04046 | u831081653 | 1588384477 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 7324 | 535 | h,w,a,b = map(int,input().split())
xList = list(range(w-b))
Py = h-a-1
mod = 10**9+7
def combination(x, y):
c = factorial(x)/(factorial(y)*factorial(x-y))
return c
def factorial(x):
f = 1
for i in range(1,x+1):
f *= i
return f
ans = 0
for x in xList:
Px = b+x
Gx = a+w-1-b-x
i... | Traceback (most recent call last):
File "/tmp/tmpocvs8rs6/tmpncim504c.py", line 1, in <module>
h,w,a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s434053541 | p04046 | u831081653 | 1588384169 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 7328 | 524 | h,w,a,b = map(int,input().split())
xList = list(range(w-b))
Py = h-a-1
def combination(x, y):
c = factorial(x)/(factorial(y)*factorial(x-y))
return c
def factorial(x):
f = 1
for i in range(1,x+1):
f *= i
return f
ans = 0
for x in xList:
Px = b+x
Gx = a+w-1-b-x
if x == 0:
... | Traceback (most recent call last):
File "/tmp/tmp8rtr2pah/tmpb5ngcphv.py", line 1, in <module>
h,w,a,b = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s330023849 | p04046 | u486814557 | 1588141816 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 247 | H,W,A,B=map(int,input().split())
M=H-A
N=W-B
import math
def comb(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
a=B-1
b=H+N-2
c=N-1
S=sum(comb(a+k,a)*(comb(b-i,c)%(10**+7) for k in range(M))
print(S%(10**9+7)) | File "/tmp/tmp1830n7bd/tmpxajgm41b.py", line 11
S=sum(comb(a+k,a)*(comb(b-i,c)%(10**+7) for k in range(M))
^
SyntaxError: '(' was never closed
| |
s921265113 | p04046 | u486814557 | 1588141728 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 238 | H,W,A,B=map(int,input().split())
M=H-A
N=W-B
import math
def comb(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
a=B-1
b=H+N-2
c=N-1
S=sum(comb(a+k,a)*(comb(b-i,c) for k in range(M))
print(S%(10**9+7)) | File "/tmp/tmph36h3tgi/tmpd7k9ao8l.py", line 11
S=sum(comb(a+k,a)*(comb(b-i,c) for k in range(M))
^
SyntaxError: '(' was never closed
| |
s170327385 | p04046 | u486814557 | 1588141647 | Python | Python (3.4.3) | py | Runtime Error | 442 | 4368 | 226 | H,W,A,B=map(int,input().split())
M=H-A
N=W-B
import math
def comb(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
a=B-1
b=H+N-2
c=N-1
S=sum(comb(a+k,a)*comb(b-i,c) for k in range(M))
print(S) | Traceback (most recent call last):
File "/tmp/tmpoetl1spy/tmp_6w7ytu8.py", line 1, in <module>
H,W,A,B=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s169045602 | p04046 | u308918401 | 1587854654 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3492 | 256 | def fac(x):
y=1
for i in range(x):
y*=(i+1)
return(y)
def combi(i,j):
x=fac(i+j)/(fac(i)*fac(j))
return(int(x))
h,w,a,b=map(int,input().split())
ans=0
for i in range(w-b):
ans+=combi(b+i,h-a-1)*combi(w-b-i-1,a-1)
print(int(ans%(10**9+7))) | Traceback (most recent call last):
File "/tmp/tmp7xtja_hl/tmpqen0wpl1.py", line 11, in <module>
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s663572790 | p04046 | u308918401 | 1587850330 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3540 | 491 | def fac(x):
y=1
for i in range(x):
y*=(i+1)
return(y)
def combi(i,j):
x=fac(i+j)/(fac(i)*fac(j))
return(int(x))
h,w,a,b=map(int,input().split())
all=combi(h-1,w-1)
z=[[0 for i in range(a)] for j in range(b)]
exc=0
for i in range(b):
for j in range(a):
if i==0:
z[i][j]=1
elif j==0:
... | Traceback (most recent call last):
File "/tmp/tmp5ab_e6jm/tmp_34cyn0a.py", line 11, in <module>
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s863431271 | p04046 | u308918401 | 1587828533 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3504 | 276 | def fac(x):
y=1
for i in range(x):
y*=(i+1)
return(y)
def combi(i,j):
x=fac(i+j)/(fac(i)*fac(j))
return(x)
h,w,a,b=map(int,input().split())
all=combi(h-1,w-1)
exc=0
for i in range(a):
exc+=combi(a-1-i,b-1)*combi(i,w-b-1)
ans=all-exc
print(int(ans%(10^9+7)))
| Traceback (most recent call last):
File "/tmp/tmpsrzzi5z9/tmpvzrwq79a.py", line 11, in <module>
h,w,a,b=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s861402974 | p04046 | u519923151 | 1587499044 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 4412 | 627 | H,W,A,B = map(int, input().split())
judge = (A+B)/(H+W)
a = H-A
res = 0
import math
def comba(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if judge < 0.5:
base = comba((H+W-2), W-1, exact=True)
for i in range(1,B+1):
ex1 = comba(a-1+i-1,i-1)
ex2 = comba(... | Traceback (most recent call last):
File "/tmp/tmpf_ijkf0e/tmpb214f2_a.py", line 1, in <module>
H,W,A,B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s375877240 | p04046 | u519923151 | 1587497997 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 277 | H,W,A,B = map(int, input().split())
a = H-A
res = 0
for i in range(1,B+1):
ex1 = comba(a-1+i-1,i-1)
print("ex1="+str(ex1))
ex2 = comba(A-1+W-i,W-i)
print("ex2="+str(ex2))
exres = ex1 *ex2
res = res + exres
result = (base -res) %1000000007
print(result) | Traceback (most recent call last):
File "/tmp/tmpzr7rki3b/tmpf_z53wt6.py", line 1, in <module>
H,W,A,B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s735200795 | p04046 | u835924161 | 1587084692 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 3791 | #include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<tuple>
#include<vector>
#include<cstdlib>
#include<cstdint>
#include<stdio.h>
#include<cmath>
#include<limits>
#include<iomanip>
#include<ctime>
#include<climits>
#include<random>
#include<queue>
using namespace std;
template <class T... | File "/tmp/tmpceqfx4jq/tmpck21pea1.py", line 38
const long long INF = 1LL << 60;
^
SyntaxError: invalid decimal literal
| |
s461626085 | p04046 | u234091409 | 1586754043 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38384 | 741 | # 解説を見て解いた。解説PDFの「B≦i≦Wを満たす全てのiについて」のWはW-1の間違い。
def make_table(h, w):
for i in range(1, h + w - 1):
fac_table.append(fac_table[-1] * i % mod) # i! mod 10**9+7
inv_table.append(pow(fac_table[-1], mod - 2, mod)) # (i!)^(-1) mod 10**9+7.
def comb(n, r):
return fac_table[n] * inv_table[n - r] *... | Traceback (most recent call last):
File "/tmp/tmp6hpks7i_/tmpb6jvt324.py", line 29, in <module>
resolve()
File "/tmp/tmp6hpks7i_/tmpb6jvt324.py", line 14, in resolve
H, W, A, B = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s957350133 | p04046 | u788337030 | 1586549875 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3576 | 414 | import math
h, w, a, b = map(int, input().split())
ans = 0
rp = [h-a-1, b]
def f(x):
if x == 0:
return 1
else:
a = 1
for i in range(1, x+1):
a *= i
return a
def c(x, y):
return f(x)/(f(y)*f(x-y))
sum = 0
while True:
x = c(rp[0]+rp[1], rp[0]) * c((h-rp[0]-1)+(w-rp[1]-1), h-rp[0]-1)
sum +=... | Traceback (most recent call last):
File "/tmp/tmp9z1b1e_9/tmphm0mr3v6.py", line 2, in <module>
h, w, a, b = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s083831303 | p04046 | u788337030 | 1586549837 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3512 | 390 | h, w, a, b = map(int, input().split())
ans = 0
rp = [h-a-1, b]
def f(x):
if x == 0:
return 1
else:
a = 1
for i in range(1, x+1):
a *= i
return a
def c(x, y):
return f(x)/(f(y)*f(x-y))
sum = 0
while True:
x = c(rp[0]+rp[1], rp[0]) * c((h-rp[0]-1)+(w-rp[1]-1), h-rp[0]-1)
sum += x
if rp[0... | Traceback (most recent call last):
File "/tmp/tmp6hi8wori/tmpgiybj1h0.py", line 1, in <module>
h, w, a, b = map(int, input().split())
^^^^^^^
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.