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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s959594916 | p04045 | u306950978 | 1590433920 | Python | Python (3.4.3) | py | Accepted | 34 | 5620 | 309 | from collections import deque
n , k = map(int,input().split())
d = set(list(map(int,input().split())))
kouho =list({0,1,2,3,4,5,6,7,8,9} - d)
kouho.sort()
p = deque()
p.append(0)
while p:
now = p.popleft()
if now >= n:
print(now)
exit()
for i in kouho:
p.append(now*10+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,017 |
s561273728 | p04045 | u540290227 | 1590424162 | Python | Python (3.4.3) | py | Accepted | 46 | 2940 | 181 | 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,018 |
s392511263 | p04045 | u422272120 | 1589951258 | Python | Python (3.4.3) | py | Accepted | 76 | 5472 | 391 | import sys
sys.setrecursionlimit(500000)
n,k = map(int,input().split())
D = list(map(int,input().split()))
ans = []
def dfs(p:str):
if int(p)>=n:
ans.append(int(p))
return
if len(p)>len(str(n))+1:
return
for i in range(10):
if not i in D:
dfs(p+str(i))
for 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,019 |
s292707444 | p04045 | u857759499 | 1589938961 | Python | Python (3.4.3) | py | Accepted | 25 | 3956 | 396 | import copy
n,k = map(int,input().split())
d = input().split()
nd = list(map(str,range(10)))
for i in d:
nd.remove(i)
l = len(str(n))
if "0" in nd:
a1 = 1
else:
a1 = 0
alist = nd[a1:]
for _ in range(l-1):
tlist = []
for i in alist:
for j in nd:
tlist.append(i+j)
alist = copy.copy(tlist)
alist.appe... | 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,020 |
s274321094 | p04045 | u857759499 | 1589937715 | Python | Python (3.4.3) | py | Accepted | 50 | 2940 | 199 | n,k = map(int,input().split())
d = input().replace(" ","")
for i in range(n,10**9):
check = True
for j in str(i):
if j in d:
check = False
break
if check:
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,021 |
s741340503 | p04045 | u860657719 | 1589932726 | Python | Python (3.4.3) | py | Accepted | 95 | 3064 | 399 | n, k = map(int, input().split())
d = list(map(int, input().split()))
lis = []
for i in range(10):
if not i in d:
lis.append(i)
inf = 1001001001
ans = inf
def dfs(s, n):
if len(s) >= len(str(n)) + 2:
return
if len(s) > 0 and int(s) >= n:
global ans
ans = min(ans, int(s))
e... | 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,022 |
s051030271 | p04045 | u871980676 | 1589927878 | Python | Python (3.4.3) | py | Accepted | 88 | 3060 | 234 | N, K = map(int,input().split())
D = set(map(str,input().split()))
res = N
while 1:
flg = 0
for char in str(res):
if char in D:
flg = 1
if flg == 1:
res += 1
continue
break
print(res) | 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,023 |
s208200556 | p04045 | u530786533 | 1589913529 | Python | Python (3.4.3) | py | Accepted | 95 | 2940 | 231 | n, k = map(int, input().split())
d = list(map(str, input().split()))
while (1):
c = [x for x in str(n)]
ok = 1
for x in c:
if x in d:
ok = 0
break
if ok == 1:
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,024 |
s331467290 | p04045 | u038815010 | 1589780638 | Python | Python (3.4.3) | py | Accepted | 45 | 3060 | 180 | n,k=map(int,input().split())
d=set(input().split())
while True:
for c in str(n):
if c in d:
n+=1
break
else:
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,025 |
s782447437 | p04045 | u562935282 | 1589752270 | Python | Python (3.4.3) | py | Accepted | 97 | 2940 | 285 | def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
pay = N
while True:
if any(c in D for c in map(int, str(pay))):
pay += 1
continue
print(pay)
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,026 |
s494921490 | p04045 | u562935282 | 1589751977 | Python | Python (3.4.3) | py | Accepted | 36 | 3064 | 659 | def main():
import sys
sys.setrecursionlimit(10 ** 7)
N, K = map(int, input().split())
D = set(map(int, input().split()))
digits = {x for x in range(10)}
digits -= D
# print(digits)
digits = sorted(digits)
def dfs(pay):
if pay >= N:
return pay
np = 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,027 |
s776746180 | p04045 | u038021590 | 1589744091 | Python | Python (3.4.3) | py | Accepted | 22 | 3064 | 631 | N, K = map(int, input().split())
D = list(map(int, input().split()))
digitlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for d in D:
digitlist.remove(d)
Keta = len(str(N))
Ans = ''
def clear(X):
if len(X) == Keta:
if int(X) >= N:
print(X)
exit()
else:
for i in digitlist:
... | 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,028 |
s372164826 | p04045 | u025501820 | 1589740550 | Python | Python (3.4.3) | py | Accepted | 67 | 9460 | 422 | #!/usr/bin/env python3
from collections import deque
N, K = map(int, input().split())
D = list(map(int, input().split()))
init = [str(i) for i in range(10) if i not in D and i != 0]
use = [str(i) for i in range(10) if i not in D]
q = deque(init)
ans = []
while q:
num = q.pop()
if int(num) >= N:
ans.app... | 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,029 |
s163162464 | p04045 | u803617136 | 1589733393 | Python | Python (3.4.3) | py | Accepted | 78 | 3060 | 257 | n, k = map(int, input().split())
d = list(map(int, input().split()))
num = n
while True:
is_match = True
for c in str(num):
if int(c) in d:
is_match = False
break
if is_match:
break
num += 1
print(num) | 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,030 |
s687408430 | p04045 | u674574659 | 1589679997 | Python | Python (3.4.3) | py | Accepted | 82 | 5720 | 331 | N,K = map(int,input().split())
D = list(map(int,input().split()))
l = [i for i in range(10)]
for i in range(K):
l.remove(D[i])
ansl = []
def dfs(s):
if len(s) < len(str(N))+1:
for i in l:
new = s+str(i)
ansl.append(int(new))
dfs(new)
dfs("")
ansl.sort()
for i in ansl:
if i >= N:
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,031 |
s298471923 | p04045 | u371385198 | 1589679946 | Python | Python (3.4.3) | py | Accepted | 61 | 3060 | 492 | import sys
input = sys.stdin.readline
def readstr():
return input().strip()
def readint():
return int(input())
def readnums():
return map(int, input().split())
def readstrs():
return input().split()
def main():
N, _ = readnums()
d = set(readstrs())
for i in range(N, 100000):
... | 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,032 |
s653086857 | p04045 | u678167152 | 1589678848 | Python | Python (3.4.3) | py | Accepted | 86 | 3060 | 265 | def solve():
N, K = map(int, input().split())
D = list(map(int, input().split()))
while True:
S = list(str(N))
for s in S:
if int(s) in D:
break
else:
return N
N += 1
print(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,033 |
s716713076 | p04045 | u970308980 | 1589678597 | Python | Python (3.4.3) | py | Accepted | 55 | 3064 | 255 |
N, K = map(int, input().split())
D = set(list(map(str, input().split())))
def ok(s):
for c in s:
if c in D:
return False
return True
i = N
while True:
s = str(i)
if ok(s):
print(s)
exit()
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,034 |
s378070431 | p04045 | u241159583 | 1589678182 | Python | Python (3.4.3) | py | Accepted | 21 | 3064 | 480 | import itertools
n,k = map(int, input().split())
d = list(input().split())
d = [str(i) for i in range(10) if str(i) not in d]
ans = float("INF")
for v in itertools.product(d, repeat=len(str(n))):
if v[0] != "0" and int("".join(v)) >= n:
if ans > int("".join(v)): ans = int("".join(v))
if ans == float("INF"):
fo... | 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,035 |
s626880472 | p04045 | u185896732 | 1589678042 | Python | Python (3.4.3) | py | Accepted | 71 | 3060 | 280 | import sys
input=sys.stdin.readline
n,k=map(int,input().split())
d=[int(i) for i in input().split()]
for i in range(1,100001):
if i<n:
continue
now=str(i)
for j in now:
if int(j) in d:
break
else:
print(now)
sys.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,036 |
s898279903 | p04045 | u392319141 | 1589677406 | Python | Python (3.4.3) | py | Accepted | 90 | 2940 | 184 | N, K = map(int, input().split())
D = set(map(str, range(10))) - set(list(input().split()))
for i in range(N, 100 * N):
if set(list(str(i))) <= D:
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,037 |
s731761318 | p04045 | u729535891 | 1589656808 | Python | Python (3.4.3) | py | Accepted | 99 | 5812 | 744 | from collections import deque
n, k = map(int, input().split())
D = list(map(int, input().split()))
# 1. 初期化
ok_lst = [x for x in range(0, 10) if x not in D]
ok_lst.sort(reverse = True)
stack = deque([x for x in ok_lst if x != 0])
ans_list = []
while len(stack) > 0:
# 2. 現在の情報の取得
# 今回は現在の数字
now_num = stack... | 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,038 |
s789191270 | p04045 | u896847891 | 1589648311 | Python | Python (3.4.3) | py | Accepted | 62 | 2940 | 202 | n, k = map(int, input().split())
d = input().split()
ans = n
flag = True
while flag:
flag = False
for x in d:
if x in str(ans):
ans += 1
flag = True
continue
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,039 |
s985186971 | p04045 | u401487574 | 1589632417 | Python | Python (3.4.3) | py | Accepted | 97 | 2940 | 185 | ma = lambda :map(int,input().split())
n,k = ma()
D = set(input().split())
for i in range(n,10*n+1):
if set(list(str(i))) & D:
pass
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,040 |
s239047992 | p04045 | u177388368 | 1589628427 | Python | Python (3.4.3) | py | Accepted | 91 | 3060 | 187 | n,k=map(int,input().split())
d=input().split()
yet=True
while yet:
yet=False
for i in list(str(n)):
if i in d:
yet=True
break
n+=1
print(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,041 |
s745574367 | p04045 | u480300350 | 1589610456 | Python | Python (3.4.3) | py | Accepted | 44 | 3064 | 3,134 | #!/usr/bin/env python3
import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgette... | 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,042 |
s283251369 | p04045 | u518958552 | 1589510222 | Python | Python (3.4.3) | py | Accepted | 73 | 2940 | 197 | n, k = map(int, input().split())
d = list(map(int, input().split()))
while True:
for i in str(n):
if int(i) in d:
n += 1
break
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,043 |
s836020738 | p04045 | u662430503 | 1589509127 | Python | Python (3.4.3) | py | Accepted | 92 | 2940 | 300 | def main():
num = list(map(int,input().split()))
bad = list(map(str,input().split()))
while True :
flg=0
for i in range(0,len(str(num[0]))):
stnum=str(num[0])
if stnum[i] in bad:
flg=1
break
if flg==1:
num[0]+=1
continue
else:
break
print(num[0])
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,044 |
s831167046 | p04045 | u617829104 | 1589497373 | Python | Python (3.4.3) | py | Accepted | 72 | 2940 | 197 | N, K = map(int, input().split())
D = list(map(int, input().split()))
while True:
for i in str(N):
if int(i) in D:
N += 1
break
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,045 |
s223945497 | p04045 | u617829104 | 1589495560 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 1,434 | N, K = map(int, input().split())
D = list(map(int, input().split()))
UN = [i for i in range(10)]
for i in D:
UN.remove(i)
n = str(N)
N_keta = len(n)
for i in n:
if int(i) not in UN:
break
else:
print(N)
exit()
ex_0 = [i for i in UN if i > 0]
if N_keta == 1:
if N < max(UN):
_11 =... | 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,046 |
s522746985 | p04045 | u127499732 | 1589495033 | Python | Python (3.4.3) | py | Accepted | 27 | 4080 | 688 | def main():
from itertools import combinations_with_replacement,permutations
n, k = map(int, input().split())
*d, = input().split()
m = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} - set(d)
m = list(m)
m.sort()
mm = ""
if m[0] != "0":
mm = m[0]
else:
mm = m[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,047 |
s998012456 | p04045 | u688203790 | 1589489694 | Python | Python (3.4.3) | py | Accepted | 47 | 2940 | 180 | n,k = map(int,input().split())
s = set(input().split())
while True:
l = str(n)
for i in l:
if i in s:
break
else:
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,048 |
s613137257 | p04045 | u513081876 | 1589426950 | Python | PyPy3 (7.3.0) | py | Accepted | 91 | 68292 | 197 | N, K = map(int, input().split())
D = [str(i) for i in input().split()]
ans = N
for i in range(N, 100001):
if set(list(str(i))) & set(D):
gg = 1
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,049 |
s214905944 | p04045 | u761062383 | 1589331282 | Python | Python (3.4.3) | py | Accepted | 76 | 3060 | 239 | n, k = [int(i) for i in input().split()]
dd = [int(i) for i in input().split()]
ans = n
flg = True
while flg:
for s in str(ans):
if int(s) in dd:
ans += 1
break
else:
flg = False
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,050 |
s707184230 | p04045 | u408958033 | 1589328405 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 1,748 | def cin():
return map(int,input().split())
def cina():
return list(map(int,input().split()))
a,b = cin()
a = list(str(a))
x = []
for i in a:
x.append(int(i))
c = cina()
d = {0,1,2,3,4,5,6,7,8,9}
e = d.difference(c)
s = ""
index = -1
test = 0
no = 0
for i in range(len(x)):
check = False
for j in 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,051 |
s350591390 | p04045 | u835534360 | 1589314032 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 697 | n, k = (int(x) for x in input().split())
ds = [int(x) for x in input().split()]
xs = list(filter(lambda x: x not in ds, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))
o = n
m = len(str(n))
ans = 0
c = False
for i in range(m):
d = (o // 10 ** i) % 10
ys = list(filter(lambda x: x >= d, xs))
if len(ys) == 0:
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,052 |
s226734653 | p04045 | u454524105 | 1589284996 | Python | Python (3.4.3) | py | Accepted | 70 | 3060 | 291 | n, k = map(int, input().split())
d = set(list(map(str, input().split())))
for i in range(n, 10**6):
w = True
idx = 0
i = str(i)
while idx < len(str(i)):
if i[idx] in d:
w = False
break
idx += 1
if w:
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,053 |
s709994065 | p04045 | u216752093 | 1589248635 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 667 | n,k=map(int,input().split())
d=list(map(int,input().split()))
n=[int(x) for x in str(n)]
ok=[]
for i in range(10):
if i not in d:
ok.append(i)
import bisect
for i in range(len(n)-1,-1,-1):
if n[i]>ok[len(ok)-1]:
for j in range(i,len(n)):
n[j]=str(ok[0])
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,054 |
s467178480 | p04045 | u223646582 | 1589149343 | Python | Python (3.4.3) | py | Accepted | 92 | 2940 | 176 | N, K = map(int, input().split())
D = [i for i in input().split()]
while True:
if all(n not in D for n in str(N)):
print(N)
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,055 |
s979200204 | p04045 | u446451725 | 1589087489 | Python | Python (3.4.3) | py | Accepted | 46 | 10456 | 454 | import itertools
NK = input().split()
N = NK[0]
K = int(NK[1])
d = input().split()
D = [int(s) for s in d]
Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in D:
Da.remove(i)
Da_str = [str(j) for j in Da]
a_1 = [''.join(j) for j in itertools.product(Da_str, repeat=len(N))]
a_2 = [''.join(j) for j in itertools.prod... | 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,056 |
s328356667 | p04045 | u241159583 | 1589059277 | Python | Python (3.4.3) | py | Accepted | 22 | 3064 | 473 | import itertools
n, k = input().split()
d = list(map(int, input().split()))
number = list(range(10))
number = [str(x) for x in number if x not in d]
ans = []
for v in itertools.product(number, repeat=len(n)):
if v[0] == "0": continue
if int("".join(v)) >= int(n): ans.append(int("".join(v)))
if not ans:
for v 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,057 |
s518172887 | p04045 | u934442292 | 1589000636 | Python | Python (3.4.3) | py | Accepted | 68 | 3060 | 392 | import sys
input = sys.stdin.readline
def main():
N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(N, 10 ** 5):
s = str(i)
hated = False
for d in D:
if d in s:
hated = True
if not hated:
ans = 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,058 |
s484741025 | p04045 | u355865104 | 1588976021 | Python | Python (3.4.3) | py | Accepted | 84 | 3060 | 348 |
def main():
N, K = input().split(" ")
D = list(input().split(" "))
use_num = list(set([str(i) for i in range(10)]) - set(D))
N = int(N)
i = N
while True:
if not set(str(i)) <= set(use_num) and i >= N:
i += 1
else:
print(i)
break
if __name_... | 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,059 |
s283061821 | p04045 | u355865104 | 1588976008 | Python | Python (3.4.3) | py | Accepted | 83 | 3060 | 348 |
def main():
N, K = input().split(" ")
D = list(input().split(" "))
use_num = list(set([str(i) for i in range(10)]) - set(D))
N = int(N)
i = N
while True:
if not set(str(i)) <= set(use_num) and i >= N:
i += 1
else:
print(i)
break
if __name_... | 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,060 |
s176411938 | p04045 | u729535891 | 1588951242 | Python | Python (3.4.3) | py | Accepted | 70 | 5692 | 400 | from collections import deque
n, k = map(int, input().split())
D = list(map(int, input().split()))
ok_lst = [x for x in range(0, 10) if x not in D]
stack = deque([x for x in ok_lst if x != 0])
while len(stack) > 0:
now_num = stack.popleft()
if now_num >= n:
print(now_num)
break
for x in ok_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,061 |
s903242655 | p04045 | u730257868 | 1588826810 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 755 | n, k = map(int,input().split())
d = list(map(int,input().split()))
s = 0
while s<k and s == d[s]:
s += 1
x = 0
y = 0
while x <4:
if n // (10**x) >0:
y = x
x += 1
i = 0
a = [0]
m = 0
while i <= y:
a.append(((n//(10**(y-i)))%10))
i +=1
i = 0
t = 0
while i <= y + t:
j = 0
while j < ... | 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,062 |
s546642751 | p04045 | u927870520 | 1588823395 | Python | Python (3.4.3) | py | Accepted | 43 | 2940 | 177 | N,k=map(int,input().split())
D=set(input().split())
for i in range(N,88889):
for s in str(i):
if s 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,063 |
s952365356 | p04045 | u207241407 | 1588796537 | Python | Python (3.4.3) | py | Accepted | 19 | 3064 | 735 | import itertools
N, K = map(int, input().split())
D = set(input().split())
n = [x for x in str(N)]
num = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - D
judge = "no"
ans = N
for i in n:
if i in D:
judge = "yes"
break
if judge == "yes":
if ans < int(sorted(list(num))[-1] * len(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,064 |
s413100509 | p04045 | u903005414 | 1588771329 | Python | Python (3.4.3) | py | Accepted | 42 | 3060 | 186 | N, K = map(int, input().split())
D = set(input().split())
for n in range(N, 100001):
for s in str(n):
if s in D:
break
else:
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,065 |
s555259063 | p04045 | u489959379 | 1588707894 | Python | Python (3.4.3) | py | Accepted | 79 | 5784 | 677 | import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7
res = []
def resolve():
n, k = map(int, input().split())
D = set(list(map(int, input().split())))
Available = []
for i in range(10):
if i not in D:
Available.append(str(i))
def dfs(Price):
... | 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,066 |
s826923287 | p04045 | u151785909 | 1588619159 | Python | Python (3.4.3) | py | Accepted | 18 | 3188 | 592 | n , k = map(int, input().split())
ns = str(n)
d = set(list(map(int,input().split())))
s = set([0,1,2,3,4,5,6,7,8,9])
l = s-d
le = len(ns)
ans = 0
c=0
k=0
for i in range(le):
for j in range(10-n%10-k):
if n%10+j+k in l:
ans += n%10+j+k
if j+k != 0:
ans=int(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,067 |
s805244383 | p04045 | u106797249 | 1588543510 | Python | Python (3.4.3) | py | Accepted | 46 | 2940 | 334 | def resolve():
N, K = list(map(int, input().split()))
D = input().split()
i = N
while True:
for s in str(i):
if s in D:
i += 1
break
else:
print(i)
return
raise Exception("unreachable!")
if '__main__' == __name__:
... | 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,068 |
s731260387 | p04045 | u578323547 | 1588287520 | Python | Python (3.4.3) | py | Accepted | 82 | 2940 | 185 | n,k = map(int, input().split())
d_set = {x for x in input().split()}
for i in range(n, 100000):
i_set = set(str(i))
if(len(i_set & d_set) == 0):
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,069 |
s963912647 | p04045 | u969850098 | 1588274052 | Python | Python (3.4.3) | py | Accepted | 38 | 3064 | 410 | import sys
readline = sys.stdin.readline
def main():
N, K = map(int, readline().rstrip().split())
D = set(readline().rstrip().split())
for i in range(N, N*10+1):
d = str(i)
flg = True
for e in d:
if e in D:
flg = False
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,070 |
s744186309 | p04045 | u969850098 | 1588273928 | Python | Python (3.4.3) | py | Accepted | 41 | 3064 | 511 | import sys
readline = sys.stdin.readline
def main():
N, K = map(int, readline().rstrip().split())
D = list(map(int, readline().rstrip().split()))
nums = [str(i) for i in range(10)]
for d in D:
nums.remove(str(d))
for i in range(N, N*10+1):
d = str(i)
flg = True
for e... | 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,071 |
s113088742 | p04045 | u431068320 | 1588248990 | Python | Python (3.4.3) | py | Accepted | 78 | 2940 | 318 | if __name__ == '__main__':
n, k = map(int, input().split())
lst = list(map(int, input().split()))
while True:
flag = True
for char in str(n):
if int(char) in lst:
flag = False
break
if flag:
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,072 |
s843685734 | p04045 | u989306199 | 1588210747 | Python | Python (3.4.3) | py | Accepted | 58 | 2940 | 242 | n, k = map(int, input().split())
D = list(input().split())
for i in range(n, n*10+1):
t = str(i)
isok = True
for d in D:
if d in t:
isok = False
break
if isok:
print(t)
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,073 |
s278904736 | p04045 | u831081653 | 1588109619 | Python | Python (3.4.3) | py | Accepted | 59 | 2940 | 257 | n,k = map(int, input().split())
d = list(input().split())
flag = True
while flag:
flag = False
n_str = str(n)
for i in d:
if i in n_str:
flag = True
n += 1
break
else:
pass
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,074 |
s495182644 | p04045 | u486814557 | 1588108029 | Python | Python (3.4.3) | py | Accepted | 74 | 3064 | 261 | l=list(map(int,input().split()))
d=list(map(int,input().split()))
u={i for i in range(10)}
d_bar=u-set(d)
d_bar={str(i) for i in d_bar}
n=l[0]
n_set=set(str(n))
while True:
if n_set<=d_bar:
print(n)
break
n=n+1
n_set=set(str(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,075 |
s143108495 | p04045 | u940533000 | 1588100528 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 994 | N, K = map(str, input().split())
D = map(str, input().split())
D = set(D) # 集合に変換
number = {'0','1','2','3','4','5','6','7','8','9'} # 集合
out = D^number
#print(out)
out = sorted(list(out))
res_list = []
flag = 0
for i in range(len(N)):
if flag == 0:
if len(set(N[i])&set(out)) == 1:
res_list.append(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,076 |
s497062333 | p04045 | u940533000 | 1588100451 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 1,732 | N, K = map(str, input().split())
D = map(str, input().split())
D = set(D) # 集合に変換
number = {'0','1','2','3','4','5','6','7','8','9'} # 集合
out = D^number
#print(out)
out = sorted(list(out))
res_list = []
flag = 0
for i in range(len(N)):
if flag == 0:
if len(set(N[i])&set(out)) == 1:
res_list.append(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,077 |
s964087492 | p04045 | u309716323 | 1588058393 | Python | Python (3.4.3) | py | Accepted | 34 | 3060 | 457 | def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def contains_digit(number, digits):
while number != 0:
if number%10 in digits:
return True
number //= 10
return False
def solve():
N, K = read_ints()
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,078 |
s422266427 | p04045 | u502731482 | 1588040871 | Python | Python (3.4.3) | py | Accepted | 100 | 3316 | 405 | from collections import defaultdict
n, k = map(int, input().split())
d = list(map(int, input().split()))
nums = defaultdict(int)
for i in range(len(d)):
nums[d[i]] += 1
def judge(n, nums):
n = str(n)
for i in range(len(n)):
if nums[int(n[i])] == 1:
return False
return True... | 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,079 |
s320398162 | p04045 | u103178403 | 1588038472 | Python | Python (3.4.3) | py | Accepted | 84 | 2940 | 142 | n,l=map(int,input().split())
dis=[i for i in input().split()]
for i in range(n,10*n):
if set(dis).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,080 |
s014166942 | p04045 | u426764965 | 1587943349 | Python | Python (3.4.3) | py | Accepted | 59 | 3060 | 263 | def abc042_c():
n, _ = map(int, input().split())
D = list(map(int, input().split()))
for i in range(n, 10**5):
like = True
for s in str(i):
if int(s) in D:
like = False
break
if like:
print(i)
return
abc042_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,081 |
s966628021 | p04045 | u306033313 | 1587924264 | Python | Python (3.4.3) | py | Accepted | 20 | 3188 | 1,221 | n, k = map( int, input().split())
hate = set( input().split())
usable = sorted( list( {str(i) for i in range(10)} - hate))
l = len(str(n))
def check(l):
num = []
if l == 1:
for i in usable:
num.append(int(i))
elif l == 2:
for ii in usable:
for i in usable:
... | 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,082 |
s212798172 | p04045 | u614984376 | 1587913448 | Python | Python (3.4.3) | py | Accepted | 98 | 2940 | 198 | n,k=map(int,input().split())
d=list(map(int,input().split()))
for i in range(n,100001):
for x in d:
if str(x) in str(i):
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,083 |
s071656222 | p04045 | u551909378 | 1587874295 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 324 | N, K = map(int, input().split())
D = list(input().split())
ans, i, OK = str(N), 0, False
while not OK:
OK = True
digit = len(ans)
for i in range(digit):
if ans[i] in D:
k = digit - i - 1
ans = str((int(ans)//(10**k) + 1)*10**k)
OK = False
break
print(... | 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,084 |
s051772997 | p04045 | u941794834 | 1587871138 | Python | Python (3.4.3) | py | Accepted | 81 | 3060 | 240 | n, k=map(int,input().split())
d=list(map(int,input().split()))
while True:
for i in str(n):
flag=True
if int(i) in d:
flag=False
break
if flag:
break
else:
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,085 |
s875558036 | p04045 | u089142196 | 1587773763 | Python | Python (3.4.3) | py | Accepted | 51 | 3060 | 222 | N,K=map(int,input().split())
D=set(map(str,input().split()))
p=N
def check(p,D):
st=str(p)
for char in st:
if char in D:
return False
else:
return True
while check(p,D)==False:
p += 1
print(p) | 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,086 |
s133165217 | p04045 | u189479417 | 1587753583 | Python | Python (3.4.3) | py | Accepted | 49 | 2940 | 225 | N, K = map(int,input().split())
D = set(input().split())
for i in range(N, 100000):
flag = 1
for char in str(i):
if char in D:
flag = 0
break
if flag:
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,087 |
s331925321 | p04045 | u790710233 | 1587645143 | Python | Python (3.4.3) | py | Accepted | 97 | 2940 | 201 | n, k = map(int, input().split())
d = list(map(int, input().split()))
for i in range(n, 10*n+1):
for x in d:
if str(x) in str(i):
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,088 |
s304882673 | p04045 | u576432509 | 1587314714 | Python | Python (3.4.3) | py | Accepted | 79 | 2940 | 149 | n,k=map(int,input().split())
d=set(input().split())
for nn in range(n,10*n+1):
if len(set(str(nn)) & d)==0:
print(nn)
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,089 |
s923275147 | p04045 | u678167152 | 1587244438 | Python | Python (3.4.3) | py | Accepted | 59 | 3060 | 224 | def solve():
N, K = map(int, input().split())
D = input().split()
while True:
for d in D:
if d in str(N):
break
else:
return N
N += 1
print(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,090 |
s440195953 | p04045 | u189023301 | 1587236297 | Python | Python (3.4.3) | py | Accepted | 23 | 3572 | 453 | from collections import deque
n, k = map(int, input().split())
org = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
kod = set(map(int, input().split()))
ele = list(org ^ kod)
que = deque(ele)
if n < 10:
for i in ele:
if i >= n:
print(i)
exit()
while que:
x = que.popleft()
for i in ele:
... | 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,091 |
s274579938 | p04045 | u452512115 | 1587125399 | Python | Python (3.4.3) | py | Accepted | 82 | 2940 | 223 | N, K = map(int, input().split())
D = list(map(int, input().split()))
i = N
while True:
flg = True
for j in str(i):
if int(j) in D:
flg = False
break
if flg == True:
print(i)
exit()
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,092 |
s028788964 | p04045 | u103341055 | 1587094145 | Python | Python (3.4.3) | py | Accepted | 49 | 3064 | 310 | N ,K = map(int,input().split())
D = [int(n) for n in input().split()]
flag = False
for i in range(N,100000):
N = i
while i > 0:
flag = True
if i%10 in D:
flag = False
break
else:
i //=10
if flag == True:
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,093 |
s663515116 | p04045 | u580316619 | 1587090975 | Python | Python (3.4.3) | py | Accepted | 92 | 2940 | 176 | a, b = map(int, input('').split(' '))
c = input('').split(' ')
for i in range(a, 1000000):
for j in range(len(str(i))):
if str(i)[j] in c:
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,094 |
s993984456 | p04045 | u744920373 | 1587077962 | Python | Python (3.4.3) | py | Accepted | 23 | 3548 | 1,027 | import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*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,095 |
s049720855 | p04045 | u744920373 | 1587077920 | Python | Python (3.4.3) | py | Accepted | 20 | 3316 | 1,145 | import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*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,096 |
s041326697 | p04045 | u340781749 | 1587010067 | Python | Python (3.4.3) | py | Accepted | 47 | 3064 | 114 | n, k = map(int, input().split())
ddd = set(input().split())
while not ddd.isdisjoint(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,097 |
s731410471 | p04045 | u505830998 | 1587009765 | Python | Python (3.4.3) | py | Accepted | 79 | 3064 | 947 | import sys
input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]
IN=lambda : map(int, input().split())
mod=1000000007
#+++++
def main():
#a = int(input())
n , k = IN()
el=set(IN())
for i in range(n, 1000000):
is_ok=True
for v in list(str(i)):
#print(v in el)
... | 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,098 |
s413386940 | p04045 | u505830998 | 1587005780 | Python | Python (3.4.3) | py | Accepted | 18 | 3192 | 1,720 | import sys
input_methods=['clipboard','file','key']
using_method=1
input_method=input_methods[using_method]
IN=lambda : map(int, input().split())
mod=1000000007
#+++++
def next(v, cu):
for i in cu:
if i > v:
return i
else:
return -1
def main():
n, k = IN()
al = list(IN())
cu=[]
for i in range(10):
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,099 |
s814590466 | p04045 | u870518235 | 1586919206 | Python | Python (3.4.3) | py | Accepted | 93 | 3060 | 218 | N, K = map(int, input().split())
dislike = list(map(str, input().split()))
num = ["0","1","2","3","4","5","6","7","8","9"]
can_use = set(num) - set(dislike)
while not set(list(str(N))) <= can_use:
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,100 |
s791361321 | p04045 | u145600939 | 1586918327 | Python | Python (3.4.3) | py | Accepted | 84 | 2940 | 246 | n,k = map(int,input().split())
d = list(input().split())
ans = n
while True:
flag = False
for i in d:
if flag :break
if i in str(ans):
ans += 1
flag = True
if flag:continue
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,101 |
s906543597 | p04045 | u568789901 | 1586909822 | Python | Python (3.4.3) | py | Accepted | 54 | 3192 | 1,617 | N,K=map(int,input().split())
D=list(map(int,input().split()))
A=[0,1,2,3,4,5,6,7,8,9]
for i in range(0,K):
A.remove(D[i])
A=sorted(A)
B=A
B.append(0)
ans=0
M=str(N)
L=len(M)
if A[0]==0:
ans+=111111*A[1]
else:
ans+=111111*A[0]
if L==5:
for q in range(0,11-K):
for w in range(0,10-K):
... | 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,102 |
s515775053 | p04045 | u342456871 | 1586902506 | Python | Python (3.4.3) | py | Accepted | 82 | 3060 | 336 | n, k = map(int, input().split())
si = list(map(str, input().split()))
def checkiroha(a):
a1 = str(a)
for i in range(len(a1)):
if (a1[i] in si):
return 'F'
elif (i == (len(a1)-1)):
return 'T'
else:
continue
while (checkiroha(n) == 'F'):
n = n+1
el... | 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,103 |
s927360821 | p04045 | u515647766 | 1586892660 | Python | Python (3.4.3) | py | Accepted | 84 | 3064 | 326 | def function1(m, set1):
set2 = set(str(m))
if len(set1 & set2) > 0:
return False
else:
return True
def function(n, set1):
m = n
while not function1(m, set1):
m += 1
return m
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = input().split()
set1 = set(list1)
print(function(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,104 |
s878796182 | p04045 | u449863068 | 1586823116 | Python | Python (3.4.3) | py | Accepted | 85 | 2940 | 222 | N, K = map(int, input().split())
D = list(map(int, input().split()))
i = N
while True:
flg = True
for j in str(i):
if int(j) in D:
flg = False
break
if flg == True:
print(i)
exit()
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,105 |
s005495808 | p04045 | u691018832 | 1586797963 | Python | Python (3.4.3) | py | Accepted | 59 | 3060 | 394 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
n, k = map(int, readline().split())
d = list(input().split())
for check in range(n, 10 ** 5):
flag = True
for i in str(check):
if i in d:
flag =... | 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,106 |
s756173542 | p04045 | u863442865 | 1586785833 | Python | Python (3.4.3) | py | Accepted | 45 | 3316 | 768 | def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby
#from itertools import product
from bisect import bisect_left,b... | 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,107 |
s730023966 | p04045 | u898967808 | 1586727379 | Python | Python (3.4.3) | py | Accepted | 64 | 3060 | 278 | def is_include(n,D):
for c in str(n):
for d in D:
if d == c:
return True
else:
return False
n,k = map(int,input().split())
D = list(map(str,input().split()))
for i in range(n,n*10):
if is_include(i,D) == False:
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,108 |
s488470660 | p04045 | u576432509 | 1586714891 | Python | Python (3.4.3) | py | Accepted | 99 | 3060 | 338 | n,k=map(int,input().split())
d=list(map(int,input().split()))
nmax=100000
for nn in range(n,nmax):
ns=list(str(nn))
yn="yes"
for nsi in ns:
# print(nn,nsi,(nsi in d))
if int(nsi) in d:
yn="no"
break
if yn=="no":
continue
else:
break
if yn=="ye... | 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,109 |
s973325174 | p04045 | u254871849 | 1586682727 | Python | Python (3.4.3) | py | Accepted | 25 | 3772 | 731 | import sys
from string import digits
n, k, *d = sys.stdin.read().split()
d = set(digits) - set(d)
l = len(n)
def main(d):
res = ''
flag = True
for i in range(l):
if flag:
if n[i] in d:
res += n[i]
else:
flag = False
for j in r... | 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,110 |
s445441797 | p04045 | u254871849 | 1586682350 | Python | Python (3.4.3) | py | Accepted | 33 | 3956 | 710 | import sys
from string import digits
n, k, *d = sys.stdin.read().split()
d = set(digits) - set(d)
l = len(n)
def main(d):
res = ''
flag = True
for i in range(l):
if flag:
if n[i] in d:
res += n[i]
else:
flag = False
for j in r... | 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,111 |
s225057770 | p04045 | u006817280 | 1586642294 | Python | Python (3.4.3) | py | Accepted | 36 | 3316 | 541 |
import collections
def solve(n, k, digits):
digitsNotAvailable = set(digits)
ans = n
while True:
temp = ans
possible = True
while temp:
digit = temp % 10
if digit in digitsNotAvailable:
possible = False
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,112 |
s174077094 | p04045 | u992910889 | 1586636997 | Python | Python (3.4.3) | py | Accepted | 86 | 3064 | 551 | import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()
def resolve():
def main():
N,K=map(int,input().split())
D=set(map(int,input().split()))
L={i for i in range(10)}
U=L-D
while True:
sn = str(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,113 |
s670646807 | p04045 | u172780602 | 1586483039 | Python | Python (3.4.3) | py | Accepted | 51 | 3188 | 183 | N,K=map(int,input().split())
D=list(input().split())
while True:
for s in str(N):
if s in D:
N+=1
break
else:
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,114 |
s992077797 | p04045 | u201802797 | 1586369227 | 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,115 |
s833896221 | p04045 | u842964692 | 1586287592 | Python | Python (3.4.3) | py | Accepted | 51 | 2940 | 182 | N,K=map(int,input().split())
D=list(input().split())
while True:
for s in str(N):
if s in D:
N+=1
break
else:
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,116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.