s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s439601595 | p04045 | u177398299 | 1533868682 | Python | Python (3.4.3) | py | Accepted | 50 | 2940 | 183 | N, K = map(int, input().split())
D = input().split()
for i in range(N, 10 * N + 1):
for j in str(i):
if j in D:
break
else:
print(i)
exit() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,617 |
s444364727 | p04045 | u826263061 | 1533412019 | Python | Python (3.4.3) | py | Accepted | 63 | 3060 | 310 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 4 15:31:00 2018
@author: maezawa
"""
n, k = list(map(int, input().split()))
d = frozenset(list(map(str, input().split())))
ok = frozenset(list(map(str,range(10)))) - d
for i in range(n, 100000):
if frozenset(str(i)) <= ok:
print(i)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,618 |
s498397135 | p04045 | u690536347 | 1533361571 | Python | Python (3.4.3) | py | Accepted | 26 | 3064 | 321 | from itertools import product as p
n,k=map(int,input().split())
e={i for i in range(10)}
d=e^set(map(int,input().split()))
f=lambda x:int("".join(map(str,x)))
g=lambda x:x>=n
h=sorted(filter(g,map(f,p(d,repeat=len(str(n))))))
if h:
print(h[0])
else:
h=sorted(filter(g,map(f,p(d,repeat=len(str(n))+1))))
print(h[0]... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,619 |
s531781840 | p04045 | u115682115 | 1533184632 | Python | Python (3.4.3) | py | Accepted | 98 | 3060 | 234 | N, K = [int(i) for i in input().split()]
D = [s for s in input().split()]
ans = N
while(True):
for i in range(len(str(ans))):
if str(ans)[i] in D:
ans += 1
break
else:
break
print(ans)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,620 |
s832252351 | p04045 | u415905784 | 1533177768 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 600 | N, K = input().split()
D = [int(x) for x in input().split()]
L = [str(i) for i in range(10) if i not in D]
ANS = ''
for i, n in enumerate(N):
if n in L:
ANS += n
elif int(L[-1]) > int(n):
ANS += [l for l in L if int(l) > int(n)][0]
ANS += L[0] * (len(N) - len(ANS))
break
else:
while ANS:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,621 |
s951277369 | p04045 | u419686324 | 1533177568 | Python | Python (3.4.3) | py | Accepted | 73 | 2940 | 109 | N, K = map(int, input().split())
D = set(input().split())
while any(x in D for x in str(N)): N += 1
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,622 |
s342166572 | p04045 | u006657459 | 1533176061 | Python | Python (3.4.3) | py | Accepted | 93 | 3060 | 280 | N, K = map(int, input().split())
D = [Di for Di in input().split()]
for n in range(N, 1000000000):
n = str(n)
flag = True
for i in range(len(str(n))):
if n[i] in D:
flag = False
break
if flag is True:
print(n)
exit() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,623 |
s536527691 | p04045 | u828847847 | 1532988809 | Python | Python (2.7.6) | py | Accepted | 75 | 2696 | 445 | n,k = map(int,raw_input().split())
arr = [0,1,2,3,4,5,6,7,8,9]
r = map(int,raw_input().split())
for i in r:
arr.remove(i)
def count_digit(num):
count = 0
t = num
while t > 0 :
count += 1
t /= 10
return count
dc = count_digit(n) + 1
ans = float("inf")
def dfs(s,i):
global ans,n,dc
ret = int(s) if i... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,624 |
s499933307 | p04045 | u562935282 | 1532901489 | Python | Python (3.4.3) | py | Accepted | 58 | 2940 | 231 | def inpl(): return input().split()
n, k = map(int, inpl())
d = inpl()
x = n
while True:
flg = True
for c in str(x):
if c in d:
flg = False
break
if flg:
break
x += 1
print(x) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,625 |
s598551920 | p04045 | u718096172 | 1532433779 | Python | Python (3.4.3) | py | Accepted | 80 | 3060 | 246 | N, K = [int(i) for i in input().split()]
d = [s for s in input().split()]
ans = N
while(True):
sAns = str(ans)
for i in range(len(sAns)):
if sAns[i] in d:
ans += 1
break
else:
break
print(ans) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,626 |
s345367336 | p04045 | u136090046 | 1532000203 | Python | Python (3.4.3) | py | Accepted | 47 | 3064 | 471 | import itertools, math
n, k = input().split()
nums = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - {x for x in input().split()}
length = len(n)
coms = itertools.product(nums, repeat=length+1)
n = int(n)
ans = float("inf")
for com in coms:
tmp = "".join(com)
if n <= int(tmp) < ans:
ans = int(tmp)... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,627 |
s046008942 | p04045 | u136090046 | 1532000129 | Python | Python (3.4.3) | py | Accepted | 45 | 3064 | 470 | import itertools, math
n, k = input().split()
nums = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - {x for x in input().split()}
length = len(n)
coms = itertools.product(nums, repeat=length)
n = int(n)
ans = float("inf")
for com in coms:
tmp = "".join(com)
if n <= int(tmp) < ans:
ans = int(tmp)
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,628 |
s296046275 | p04045 | u099566485 | 1531339511 | Python | Python (3.4.3) | py | Accepted | 81 | 3060 | 240 | n,k=map(int,input().split())
d=list(map(int,input().split()))
while True:
change=False
for i in str(n):
if int(i) in d:
n+=1
change=True
break
if change==False:
break
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,629 |
s812802452 | p04045 | u232852711 | 1531300266 | Python | Python (3.4.3) | py | Accepted | 81 | 3060 | 271 | n, k = list(map(int, input().split()))
d = list(map(int, input().split()))
while(True):
contain = False
for nn in str(n):
if int(nn) in d:
contain = True
n += 1
break
if not contain:
break
print(n)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,630 |
s070182815 | p04045 | u622255286 | 1531190082 | Python | Python (2.7.6) | py | Accepted | 79 | 2568 | 177 | n, k = map(int, raw_input().split())
d = set(raw_input().split())
found = False
while True:
a = set(str(n))
if a & d:
n += 1
continue
else:
print(n)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,631 |
s793349369 | p04045 | u029315034 | 1531106731 | Python | Python (3.4.3) | py | Accepted | 58 | 2940 | 249 | n, k = [int(i) for i in input().split()]
d = [i for i in input().split()]
can = False
while not can:
can = True
n_str = str(n)
for num in n_str:
if num in d:
can = False
n += 1
break
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,632 |
s426684064 | p04045 | u470735879 | 1530899481 | Python | Python (3.4.3) | py | Accepted | 71 | 3060 | 213 | n, k = map(int,input().split())
unlike = list(map(int,input().split()))
while 1:
for n_i in str(n):
if int(n_i) in unlike:
n += 1
break
else:
print(n)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,633 |
s864160136 | p04045 | u482969053 | 1530790918 | Python | Python (3.4.3) | py | Accepted | 70 | 2940 | 215 | N, K = list(map(int, input().split()))
D = list(map(int, input().split()))
while True:
for N_i in str(N):
if int(N_i) in D:
N += 1
break
else:
print(N)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,634 |
s270468884 | p04045 | u118605645 | 1530787934 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 943 | 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:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,635 |
s520919188 | p04045 | u280512618 | 1530757101 | Python | Python (3.4.3) | py | Accepted | 20 | 3188 | 562 | from itertools import product
def generator(ls, length):
for i in product(*(ls for i in range(length))):
yield "".join(i)
def solve(ls, n):
for i in generator(ls, len(n)):
if n <= i:
return i
if ls[0] == "0":
return ls[1] + "".join(ls[0] for i in range(len(n)))
retu... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,636 |
s136630325 | p04045 | u064408584 | 1530677260 | Python | Python (3.4.3) | py | Accepted | 89 | 3060 | 188 | n,k=map(int, input().split())
d=list(input().split())
ans=10000
for i in range(n,100000):
for j in d:
if str(i).count(j):break
else:
ans=i
break
print(ans) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,637 |
s553092332 | p04045 | u409064224 | 1530554203 | Python | Python (3.4.3) | py | Accepted | 65 | 2940 | 269 | n,k = map(int,input().split())
d = list(map(str,input().split()))
flg = True
while flg:
l = list()
n_s = str(n)
for i in n_s:
if i in d:
break
else:
print(n)
flg = False
break
n = n +1
else:
print(n)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,638 |
s998082072 | p04045 | u480847874 | 1530456376 | Python | Python (3.4.3) | py | Accepted | 75 | 3060 | 334 | def m():
def is_included(i,d):
s = str(i)
for j in d:
if str(j) in s:
return True
return False
n, k = map(int, input().split())
d = list(map(int, input().split()))
for i in range(n, n*10):
if not is_included(i,d):
return i
retur... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,639 |
s735120669 | p04045 | u395086545 | 1530401369 | Python | Python (3.4.3) | py | Accepted | 88 | 3060 | 269 | n, k = map(int, input().split())
d = list(map(int, input().split()))
def solve():
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
solve()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,640 |
s350521586 | p04045 | u395086545 | 1530401224 | Python | Python (3.4.3) | py | Accepted | 90 | 2940 | 247 | N,K=map(int,input().split())
D=list(map(int,input().split()))
def solve():
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
solve() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,641 |
s749491146 | p04045 | u177040005 | 1530135154 | Python | Python (3.4.3) | py | Accepted | 64 | 2940 | 257 | N,K = map(int, input().split())
D = input().split()
for ans in range(N,N*10+1):
ch_n = str(ans)
cnt = 0
for c in ch_n:
cnt += 1
if c in D:
break
if cnt == len(ch_n):
print(ans)
exit()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,642 |
s575958080 | p04045 | u957084285 | 1529689845 | Python | Python (3.4.3) | py | Accepted | 81 | 2940 | 169 | n,k = map(int, input().split())
d = set(input().split())
ans = 99999
for i in range(n, n*10):
if set(str(i)) & d == set():
ans = i
break
print(ans)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,643 |
s105043683 | p04045 | u136869985 | 1529185376 | Python | Python (3.4.3) | py | Accepted | 46 | 3060 | 325 | def main():
N, K = map(int, input().split())
D = list(input().split())
while True:
S = str(N)
f = True
for s in S:
if s in D:
f = False
break
if f:
break
N += 1
print(N)
if __name__ == "__main__":
m... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,644 |
s023047063 | p04045 | u403301154 | 1528774728 | Python | Python (3.4.3) | py | Accepted | 84 | 2940 | 154 | n, k = map(int, input().split())
d = set(input().split())
ans=10000
for i in range(n, n*10):
if set(str(i)) & d == set():
ans=i
break
print(ans) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,645 |
s169384706 | p04045 | u755591593 | 1528745173 | Python | Python (3.4.3) | py | Accepted | 83 | 2940 | 124 | N, K = map(int, input().split())
D = set(input().split())
while True:
if not set(str(N)) & D:
break
N += 1
print(N)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,646 |
s846590821 | p04045 | u761320129 | 1528419800 | Python | Python (3.4.3) | py | Accepted | 45 | 2940 | 180 | N,K = map(int,input().split())
D = set(input().split())
while True:
for c in str(N):
if c in D:
break
else:
print(N)
exit()
N += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,647 |
s416983751 | p04045 | u894440853 | 1528365735 | Python | Python (3.4.3) | py | Accepted | 82 | 2940 | 123 | N, K = map(int, input().split())
D = set(input().split())
while True:
if not set(str(N)) & D:
break
N += 1
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,648 |
s268980885 | p04045 | u875361824 | 1528090416 | Python | Python (3.4.3) | py | Accepted | 87 | 2940 | 352 | def main():
N, K = map(int, input().split())
*D, = map(int, input().split())
price = N
while True:
a = False
for x in D:
if str(x) in str(price):
a = True
break
if not a:
break
price += 1
print(price)
if __n... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,649 |
s621056185 | p04045 | u112523623 | 1527550379 | Python | Python (3.4.3) | py | Accepted | 65 | 3064 | 1,118 | def find_next_valid_digit(d, bad_nums):
next_digit = d
while True:
valid = True
for c in str(next_digit):
if int(c) in bad_nums:
valid = False
break
if valid:
break
else:
next_digit += 1
return next_digit
if... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,650 |
s932765737 | p04045 | u354638986 | 1526698413 | Python | Python (3.4.3) | py | Accepted | 52 | 2940 | 288 | def main():
n, k = map(int, input().split())
d = set(map(int, input().split()))
for i in range(n, 90000):
for j in str(i):
if int(j) in d:
break
else:
print(i)
break
if __name__ == '__main__':
main()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,651 |
s982005369 | p04045 | u040380068 | 1525898216 | Python | Python (2.7.6) | py | Accepted | 83 | 2692 | 212 | N, K = map(int, raw_input().split())
D = raw_input().split()
while True:
flag = True
for i in range(0, len(str(N))):
if str(N)[i] in D:
flag = False
break
if flag:
print N
break
else:
N = N + 1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,652 |
s499192591 | p04045 | u952708174 | 1525847923 | Python | Python (3.4.3) | py | Accepted | 58 | 3060 | 427 | 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... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,653 |
s805990068 | p04045 | u925726015 | 1525683259 | Python | Python (3.4.3) | py | Accepted | 70 | 2940 | 295 | def check(d, x):
x = str(x)
for xx in x:
if int(xx) not in d:
return False
return True
n, k = map(int, input().split())
d = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ^ set(map(int, input().split()))
i = n
while 1:
if check(d, i):
break
i += 1
print(i)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,654 |
s026199051 | p04045 | u125205981 | 1525335638 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 459 | 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, top, i = N, 0, 0
while num > 0:
while num % 10 in D:
num += 1
to... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,655 |
s490575432 | p04045 | u761320129 | 1525044467 | Python | Python (3.4.3) | py | Accepted | 44 | 2940 | 184 | N,K = map(int,input().split())
ban = set(input().split())
while True:
for c in str(N):
if c in ban:
break
else:
print(N)
exit()
N += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,656 |
s366228117 | p04045 | u390958150 | 1525022991 | Python | Python (3.4.3) | py | Accepted | 94 | 3060 | 312 | n,k = [int(i) for i in input().split()]
D = [i for i in input().split()]
c = n
def match(A,B):
for a in A:
if a in B:
return True
else:
return False
while True:
if match(D,list(str(c))):
c += 1
continue
else:
break
print(c) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,657 |
s931703580 | p04045 | u745385679 | 1524979189 | Python | Python (3.4.3) | py | Accepted | 88 | 2940 | 154 | n, k = map(int, input().split())
o = set(input().split())
while True:
if set(str(n)).intersection(o):
n += 1
else:
break
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,658 |
s171222717 | p04045 | u050428930 | 1524674668 | Python | Python (3.4.3) | py | Accepted | 82 | 2940 | 191 | N,M=map(int,input().split())
s=list(input().split())
q=1
while q==1:
for i in list(str(N)):
if i in s:
N=N+1
break
else:
print(N)
q=0
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,659 |
s621961588 | p04045 | u281303342 | 1524622734 | Python | Python (3.4.3) | py | Accepted | 84 | 3316 | 129 | N,K = map(int,input().split())
D = set(input().split())
while True:
if not set(str(N)) & D:
break
N += 1
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,660 |
s889294465 | p04045 | u268793453 | 1524584974 | Python | Python (3.4.3) | py | Accepted | 81 | 2940 | 149 | n, l = [int(i) for i in input().split()]
d = {i for i in input().split()}
while True:
if not set(str(n)) & d:
break
n += 1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,661 |
s951041501 | p04045 | u941884460 | 1524303749 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 626 | N,K=input().split()
nums = input().split()
cand = list(map(str,list(x for x in range(10))))
for num in nums:
if num in cand:
cand.remove(num)
work = []
if int(N) <= int(cand[-1]*len(N)):
for i in range(len(N)):
for c in cand:
if int(N[i]) == int(c):
work.append(c)
break
elif int(... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,662 |
s005624284 | p04045 | u826263061 | 1523833534 | Python | Python (3.4.3) | py | Accepted | 19 | 3064 | 1,023 | n, k = list(map(int, input().split()))
d = list(map(int, input().split()))
if 0 in d:
zero = True
else:
zero = False
n_ok = {0} | set([0,1,2,3,4,5,6,7,8,9]) - set(d)
n_oks = sorted(n_ok)
#print(n_oks)
def lowest():
for i in n_oks:
for j in n_oks:
for k in n_oks:
for l i... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,663 |
s662529053 | p04045 | u826263061 | 1523833177 | Python | Python (3.4.3) | py | Accepted | 20 | 3064 | 1,019 | n, k = list(map(int, input().split()))
d = list(map(int, input().split()))
if 0 in d:
zero = True
else:
zero = False
n_ok = {0} | set([0,1,2,3,4,5,6,7,8,9]) - set(d)
n_oks = sorted(n_ok)
#print(n_oks)
def lowest():
for i in n_oks:
for j in n_oks:
for k in n_oks:
for l i... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,664 |
s305613222 | p04045 | u562016607 | 1523649437 | Python | Python (3.4.3) | py | Accepted | 27 | 3940 | 764 | N,K=map(int,input().split())
D=[int(i) for i in input().split()]
T=[0 for i in range(10)]
for i in D:
T[i]=1
S=[]
for i in range(10):
if T[i]==0:
S.append(i)
import itertools
L=[]
R=[]
if N>=1000:
L=list(itertools.product(S,S,S,S))
R=sorted([int(str(i[0])+str(i[1])+str(i[2])+str(i[3])) for i in ... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,665 |
s734020243 | p04045 | u729707098 | 1521950406 | Python | Python (3.4.3) | py | Accepted | 93 | 2940 | 171 | n,k = (int(i) for i in input().split())
d = [int(i) for i in input().split()]
for i in range(n,88889):
a = str(i)
if all(int(j) not in d for j in a):
print(i)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,666 |
s628552669 | p04045 | u773981351 | 1521365733 | Python | Python (3.4.3) | py | Accepted | 23 | 3572 | 1,242 | from functools import reduce
def obsession(n, disliked):
def nearest(digit):
for i in range(digit, digit + 10):
mod10 = i % 10
if mod10 not in disliked:
return (mod10, i != mod10)
will_pay = list(map(int, str(n)))
index = 0
while index < len(will_pay):
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,667 |
s252052817 | p04045 | u672710370 | 1520493009 | Python | Python (3.4.3) | py | Accepted | 83 | 3064 | 686 | import sys
debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False
if debug_mode:
import os
inf = open(os.path.basename(__file__).replace(".py", ".in"))
def input():
return inf.readline()
else:
inf = sys.stdin
# ==============================================================
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,668 |
s197362302 | p04045 | u143492911 | 1518148457 | Python | Python (3.4.3) | py | Accepted | 94 | 3060 | 220 | n,k=map(int,input().split())
d=list(input().split())
ans=n
p=0
for i in range(10*n+1):
s=str(ans)
for j in range(len(str(s))):
if s[j] in d:
break
else:
break
ans+=1
print(ans) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,669 |
s848328033 | p04045 | u764600134 | 1517680315 | Python | Python (3.4.3) | py | Accepted | 62 | 3064 | 726 | # -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc042/tasks/arc058_a
AC
"""
import sys
from sys import stdin
input = stdin.readline
def solve(forbiddens, N):
forbiddens = set(forbiddens)
ans = N
repeat = True
while repeat:
repeat = False
num_s = str(ans)
for ... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,670 |
s805171138 | p04045 | u764600134 | 1517680231 | Python | Python (3.4.3) | py | Accepted | 65 | 3188 | 692 | # -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc042/tasks/arc058_a
"""
import sys
from sys import stdin
input = stdin.readline
def solve(forbiddens, N):
forbiddens.sort()
ans = N
repeat = True
while repeat:
repeat = False
num_s = str(ans)
for s in num_s:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,671 |
s711734556 | p04045 | u257974487 | 1517630774 | Python | Python (3.4.3) | py | Accepted | 92 | 3188 | 260 | price, num = map(int,input().split())
dislike = list(input().split())
ans = price
p = 0
for i in range(10*price+1):
s = str(ans)
for j in range(len(str(s))):
if s[j] in dislike:
break
else:
break
ans += 1
print(ans)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,672 |
s275439687 | p04045 | u952708174 | 1517085789 | Python | Python (3.4.3) | py | Accepted | 51 | 3064 | 315 | def c_IrohaObsession(N, K, D):
d = [str(i) for i in D]
i = N
while True:
for c in str(i):
if c in d:
break
else:
return i
i += 1
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().split()]
print(c_IrohaObsession(N, K, D)) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,673 |
s996179481 | p04045 | u432780056 | 1516330671 | Python | Python (2.7.6) | py | Accepted | 68 | 2568 | 154 | (n, k), d = map(int, raw_input().split()), set(raw_input().split())
for _ in xrange(n, 100001):
if not set(str(_)) & d:
print _
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,674 |
s686126900 | p04045 | u665415433 | 1515123442 | Python | Python (3.4.3) | py | Accepted | 85 | 3060 | 217 | def solve(d,s):
for i in range(len(d)):
if d[i] in s:
return 1
return 0
N,K = map(int,input().split())
D = list(map(str,input().split()))
m = N
while solve(D,str(m)):
m += 1
print(m)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,675 |
s764905909 | p04045 | u550574002 | 1514388627 | Python | Python (3.4.3) | py | Accepted | 89 | 2940 | 86 | n=int(input().split()[0])
d=set(input())
while len(set(str(n))&d)>0:
n+=1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,676 |
s658365704 | p04045 | u621935300 | 1514183048 | Python | Python (2.7.6) | py | Accepted | 100 | 2568 | 258 | N,K=map(int,raw_input().split())
D=map(int,raw_input().split())
n=[0,1,2,3,4,5,6,7,8,9]
a=[] #Allowed numbers
for i in n:
if i not in D:
a.append(i)
i=N
while True:
for j in D:
if str(i).find(str(j))!=-1:
break
else:
print str(i)
break
i+=1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,677 |
s145845445 | p04045 | u825528847 | 1513887874 | Python | Python (3.4.3) | py | Accepted | 100 | 2940 | 209 | N, K = map(int, input().split())
D = input().split()
for i in range(N, 100001):
set_n = set(list(str(i)))
for s in set_n:
if s in D:
break
else:
print(i)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,678 |
s648834114 | p04045 | u132434645 | 1513085980 | Python | Python (2.7.6) | py | Accepted | 52 | 2568 | 222 | [n, k] = map(int, raw_input().split())
d = raw_input().split()
while True:
ok = True
for c in str(n):
if c in d:
ok = False
break
if ok:
print n
break
n += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,679 |
s107705127 | p04045 | u252745826 | 1508455474 | Python | Python (3.4.3) | py | Accepted | 43 | 3060 | 308 | n, k = list(map(int, input().split(" ")))
d = list(map(int, input().split(" ")))
def valid(n):
while n > 0:
digit = n % 10
if digit in d:
return False
n = int(n / 10)
return True
for num in range(n, 10 * n):
if valid(num):
print(num)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,680 |
s450434318 | p04045 | u055459962 | 1508045885 | Python | Python (3.4.3) | py | Accepted | 19 | 3064 | 1,330 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""042-c"""
import sys
def solve(dislike_digits_table, first_like_digit, N):
"""Solve."""
for i, _ in enumerate(N):
c = N[i]
while dislike_digits_table[int(c)]:
if c == '9':
if i == 0:
return solve... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,681 |
s837344789 | p04045 | u444856278 | 1505109697 | Python | Python (3.4.3) | py | Accepted | 99 | 3060 | 272 | import sys
N,K = list(map(int,input().split()))
D = input().split()
while True:
breaked = False
for i in range(len(str(N))):
if str(N)[i] in D:
breaked = True
break
if not(breaked):
print(N)
sys.exit()
N += 1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,682 |
s464037232 | p04045 | u182096840 | 1504457449 | Python | Python (2.7.6) | py | Accepted | 74 | 2568 | 314 | n, k = map(int, raw_input().strip().split())
l = map(int, raw_input().strip().split())
ls = []
for x in l:
ls.append(str(x))
def has_string(ns):
r = True
for x in ls:
if x not in ns:
pass
else:
r = False
return r
while n < 100000:
ns = str(n)
if has_string(ns):
print(ns)
exit()
else:
n+=1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,683 |
s649714775 | p04045 | u650245944 | 1502277153 | Python | Python (3.4.3) | py | Accepted | 43 | 5732 | 539 | 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... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,684 |
s986285125 | p04045 | u596276291 | 1501780510 | Python | Python (3.4.3) | py | Accepted | 43 | 3188 | 321 | from itertools import count
def main():
N, K = map(int, input().split())
D_list = list(input().split())
for c in count(N):
c = str(c)
for d in D_list:
if d in c:
break
else:
print(c)
return
if __name__ == '__main__':
main()... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,685 |
s043307632 | p04045 | u839537730 | 1501066808 | Python | Python (3.4.3) | py | Accepted | 78 | 3060 | 263 | N, K = list(map(int, input().split(" ")))
D = list(map(str, input().split(" ")))
ans = N
while(1):
j = True
for d in D:
if d in str(ans):
j = False
break
if j == True:
break
ans += 1
print(ans) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,686 |
s515963656 | p04045 | u993069079 | 1498298003 | Python | Python (2.7.6) | py | Accepted | 30 | 2820 | 160 | a, _ = map(int, raw_input().split())
b = "".join(raw_input().split())
b = set(b)
for i in xrange(a, 99999999):
if b.isdisjoint(str(i)):
print i
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,687 |
s566473380 | p04045 | u761320129 | 1497367542 | Python | Python (2.7.6) | py | Accepted | 36 | 5764 | 229 | N,K = map(int, raw_input().split())
dislike = raw_input().split()
like = [str(n) for n in range(10) if str(n) not in dislike]
for n in range (N,100000):
for d in str(n):
if d in dislike: break
else:
print n
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,688 |
s292200461 | p04045 | u879309973 | 1495797102 | Python | Python (2.7.6) | py | Accepted | 23 | 2568 | 243 | N, K = map(int, raw_input().split())
D = map(int, raw_input().split())
W = filter(lambda x: not x in D, range(10))
def dfs(x):
if x >= N:
return x
return min([dfs(10*x + d) for d in W])
print min([dfs(i) for i in W if (i > 0)]) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,689 |
s120728340 | p04045 | u058240079 | 1494344681 | Python | Python (2.7.6) | py | Accepted | 41 | 5764 | 251 | def isValid(n,l):
s = str(n)
for c in s:
if c in l:
return False
return True
n,k = map(int, raw_input().split())
dls = raw_input().split()
for i in range(n,100000):
if isValid(i,dls):
print i
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,690 |
s823272035 | p04045 | u332385682 | 1488582022 | Python | Python (3.4.3) | py | Accepted | 89 | 3064 | 570 | import sys
def debug(x, table):
for name, val in table.items():
if x is val:
print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
return None
def solve():
N, K = map(int, input().split())
D = [str(i) for i in input().split()]
ans = 0
for m in range(N, 10**6):... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,691 |
s440170617 | p04045 | u622011073 | 1487337411 | Python | Python (3.4.3) | py | Accepted | 26 | 3064 | 260 | import itertools
a=set([0,1,2,3,4,5,6,7,8,9])
n,_=map(int,input().split())
b=map(int,input().split())
l=len(str(n))
c=set(b)^a
for i in range(l,l+2):
for x in itertools.product(c,repeat=i):
d=''.join(map(str,x))
if int(d)>=n:print(d);exit() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,692 |
s180779735 | p04045 | u122916923 | 1483921554 | Python | Python (3.4.3) | py | Accepted | 24 | 3192 | 1,596 | 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):
last = 10
for ad in (avail_digits + [last]):
if ad >= d:
if ad == last:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,693 |
s063343244 | p04045 | u942697937 | 1483376590 | Python | Python (2.7.6) | py | Accepted | 90 | 2568 | 160 | N, K = map(int, raw_input().split())
D = set(raw_input().split())
for i in xrange(N, 100000+1):
if set(str(i)) & D == set():
print i
exit()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,694 |
s618853722 | p04045 | u423925725 | 1483200244 | Python | Python (3.4.3) | py | Accepted | 61 | 3064 | 415 | # coding: utf-8;
def main():
num = [0,1,2,3,4,5,6,7,8,9]
n, k = map(int, input().split())
d = list(map(int, input().split()))
usable_num = list(set(num) - set(d))
while True:
f = True
for a in str(n):
if int(a) not in usable_num:
f = False
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,695 |
s127921814 | p04045 | u596276291 | 1482637228 | Python | Python (3.4.3) | py | Accepted | 30 | 3820 | 654 | from collections import defaultdict
from itertools import combinations
def func(i, d, now, use, st):
if i >= d:
st.append(now)
return
for x in use:
func(i + 1, d, now + str(x), use, st)
def solve():
n, k = map(int, input().split())
d = list(map(int, input().split()))
us... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,696 |
s436959440 | p04045 | u123756661 | 1481510920 | Python | PyPy2 (5.6.0) | py | Accepted | 77 | 18284 | 218 | n,k=map(int,raw_input().split())
d=set(map(int,raw_input().split()))
chk=set([str(i) for i in range(10) if i not in d])
while 1:
tmp=set(str(n))
if len(tmp&chk)==len(tmp):
print n
break
n+=1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,697 |
s284598641 | p04045 | u333917945 | 1480967779 | Python | Python (3.4.3) | py | Accepted | 24 | 3192 | 2,018 | n, k = map(int, input().split())
d = [int(i) for i in input().split()]
ablenum = [int(i) for i in range(10)]
lis_n = str(n)
lis_n = list(lis_n)
#print(lis_n)
# 使用可能な数一覧
for i in d:
ablenum.remove(i)
#print(ablenum)
flag_bigdigit = -1
# max(ablenum)より大きい桁があるかどうか
for i in range(len(lis_n)):
_i = len(lis_n) -... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,698 |
s789637562 | p04045 | u402953845 | 1480612648 | Python | Python (2.7.6) | py | Accepted | 47 | 2820 | 401 | import sys
N, K = map(int, sys.stdin.readline().split())
D = map(int, sys.stdin.readline().split())
for i in xrange(N * 10):
if i >= N:
temp = i
isCorrect = True
while temp > 0:
if (temp % 10) in D:
isCorrect = False
break
else:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,699 |
s661000810 | p04045 | u582243208 | 1480114456 | Python | Python (2.7.6) | py | Accepted | 70 | 2568 | 210 | n,k=map(int,raw_input().split())
d=[i for i in raw_input().split()]
while True:
f=True
for i in d:
if i in str(n):
f=False
break
if f:
break
n+=1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,700 |
s901455089 | p04045 | u582243208 | 1480114398 | Python | Python (3.4.3) | py | Accepted | 83 | 3064 | 202 | n,k=map(int,input().split())
d=[i for i in input().split()]
while True:
f=True
for i in d:
if i in str(n):
f=False
break
if f:
break
n+=1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,701 |
s127761575 | p04045 | u117095520 | 1477925124 | Python | Python (2.7.6) | py | Accepted | 17 | 2568 | 453 | 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 ... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,702 |
s401028585 | p04045 | u471797506 | 1476589178 | Python | Python (2.7.6) | py | Accepted | 57 | 4904 | 309 | # -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll
N, K = map(int, raw_input().split())
D = set(raw_input().split())
for i in xrange(100000):
for x in str(N):
if x in D:
break
else:
print N
break
N += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,703 |
s492188572 | p04045 | u867933941 | 1475590983 | Python | Python (2.7.6) | py | Accepted | 19 | 2944 | 802 | N,K = map(int,raw_input().split(" "))
A = map(int,raw_input().split(" "))
n = [int(c) for c in str(N)]
len_n = len(n)
digits = []
for i in range(10):
if not(i in A):
digits.append(i)
def need_big_keta():
if n[0] < digits[-1]:
return False
i=0
while i < len_n and n[i] == digits[-1] :
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,704 |
s185192121 | p04045 | u820351940 | 1475032290 | Python | Python (3.4.3) | py | Accepted | 95 | 3064 | 220 | N, K = map(int, input().split())
d = input().split()
def check(c):
for i in d:
if str(c).count(i): return False
return True
count = N
while True:
if check(count): break
count += 1
print(count)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,705 |
s953591807 | p04045 | u550734883 | 1473273911 | Python | Python (3.4.3) | py | Accepted | 41 | 3064 | 490 | N,K=map(int,input().split())
Ds=list(input().split())
Di=list(map(int,Ds))
nex=[1]*10
for i in reversed(Di):
nex[i-1]=nex[i]+1
def check(n):
ns = str(N)
for nss in ns:
if nss in Ds:
return False
return True
def next(i):
global N
ns='{0:0>5}'.format(N)
t=nex[int(ns[i])]
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,706 |
s076004289 | p04045 | u518732500 | 1471895995 | Python | Python (3.4.3) | py | Accepted | 89 | 3064 | 313 | def solve():
n, k = map(int, input().split())
d = set(input().split())
while True:
s = str(n)
for x in d:
if x in s:
break
else:
print(s)
break
n += 1
def main():
solve()
if __name__ == '__main__':
main()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,707 |
s431487299 | p04045 | u804080968 | 1469645545 | Python | Python (3.4.3) | py | Accepted | 40 | 3064 | 851 | import sys
S, K = input().split()
Bad = list(map(int, input().split()))
OK = sorted(set(range(10)) - set(Bad))
NotZero = sorted(set(OK) - set([0]))
if any(d > str(OK[-1]) for d in S):
print(str(NotZero[0]) + str(OK[0]) * len(S))
sys.exit()
count = [0] * 10
for c in str(S):
count[ord(c) - ord('0')] += 1
gr... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,708 |
s537530506 | p04045 | u150117535 | 1469547295 | Python | Python (3.4.3) | py | Accepted | 82 | 5784 | 428 | import itertools
ini = int(input().split(" ")[0])
try:
negaset = [int(x) for x in input().split(" ")]
except :
print (ini)
exit()
okset = sorted([str(i) for i in range (10) if i not in negaset])
#print(ini,okset)
for p in [int("".join(j)) for j in itertools.chain.from_iterable (itertools.product(okset,rep... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,709 |
s085766481 | p04045 | u463836923 | 1469366697 | Python | Python (3.4.3) | py | Accepted | 40 | 3064 | 615 | #coding=UTF-8
mojir=input()
hyo=mojir.split(' ')
N=int(hyo[0])
K=int(hyo[1])
mojir=input()
hyo=mojir.split(' ')
D=[int(mono) for mono in hyo]
kouho=N
def usecheck(gaku):
gakustr=str(gaku)
keta=len(gakustr)
dame=None
for idx in range(0,keta,1):
if gakustr[idx] in hyo:
dame=idx
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,216,710 |
s083985714 | p04046 | u075595666 | 1594186938 | Python | PyPy3 (7.3.0) | py | Accepted | 100 | 79764 | 543 | h,w,a,b = map(int,input().split())
mod = 10**9+7
MAX = 2*10**5
fact = [1]*(MAX+1)
for i in range(1, MAX+1):
fact[i] = (fact[i-1]*i) % mod
inv = [1]*(MAX+1)
for i in range(2, MAX+1):
inv[i] = inv[mod % i]*(mod-mod//i) % mod
fact_inv = [1]*(MAX+1)
for i in range(1, MAX+1):
fact_inv[i] = fact_inv[i-1] * inv... | p04046 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a large square grid with <var>H</var> rows and <var>W</var> columns.
Iroha is now standing in the top-left cell.
She will repeat going right or down to the adjacent cell, until she reaches the b... | 2 3 1 1
| 2
| 1,216,711 |
s260437334 | p04046 | u176645218 | 1593570784 | Python | PyPy3 (7.3.0) | py | Accepted | 97 | 77656 | 525 | import sys
input = sys.stdin.readline
H,W,A,B= map(int,input().split())
MOD = 10**9 + 7
num = 200010
fact = [1] * (num+1)
ifact = [1] * (num+1)
for i in range(1,num+1):
fact[i] = (fact[i-1] * i) % MOD
ifact[-1] = pow(fact[-1],MOD-2,MOD)
for i in range(1,num+1)[::-1]:
ifact[i-1] = (ifact[i] * i)% MOD
def nCr(... | p04046 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a large square grid with <var>H</var> rows and <var>W</var> columns.
Iroha is now standing in the top-left cell.
She will repeat going right or down to the adjacent cell, until she reaches the b... | 2 3 1 1
| 2
| 1,216,712 |
s608912666 | p04047 | u785573018 | 1601436167 | Python | Python (3.8.2) | py | Accepted | 27 | 9048 | 109 | n = int(input()); a = list(map(int, input().split()))
a.sort(); b = 0
for i in range(n): b += a[2*i]
print(b) | p04047 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/a... | 2
1 3 1 2
| 3
| 1,216,713 |
s953558284 | p04047 | u380491044 | 1601398343 | Python | Python (3.8.2) | py | Accepted | 24 | 9032 | 111 | n=input()
l=list(map(int,input().split(" ")))
l.sort()
ans=0
for i in range(0,len(l),2):
ans+=l[i]
print(ans) | p04047 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/a... | 2
1 3 1 2
| 3
| 1,216,714 |
s064220340 | p04047 | u752907799 | 1601081529 | Python | Python (3.8.2) | py | Accepted | 27 | 9156 | 61 | print(sum(sorted(map(int,open(0).read().split()[1:]))[::2]))
| p04047 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/a... | 2
1 3 1 2
| 3
| 1,216,715 |
s231853840 | p04047 | u666550725 | 1601039946 | Python | PyPy3 (7.3.0) | py | Accepted | 66 | 61188 | 123 | N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(0, 2 * N, 2):
ans += A[i]
print(ans) | p04047 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/a... | 2
1 3 1 2
| 3
| 1,216,716 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.