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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s462267325 | p04045 | u095021077 | 1580389775 | Python | Python (3.4.3) | py | Accepted | 46 | 3060 | 170 | N, K=map(int, input().split())
D=set(map(str, input().split()))
while True:
s=str(N)
for t in s:
if t 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,217 |
s904002779 | p04045 | u113971909 | 1580353330 | Python | Python (3.4.3) | py | Accepted | 77 | 2940 | 130 | N,K=map(int,input().split())
D=set(input().split())
for i in range(N,100000):
if len(set(str(i)) & D)==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,218 |
s399090444 | p04045 | u207359046 | 1580275072 | Python | Python (3.4.3) | py | Accepted | 44 | 2940 | 265 | def is_valid(A, D):
while A > 0:
if (A%10) in D:
return False
else:
A = A//10
return True
N, K = map(int, input().split())
D = list(map(int, input().split()))
while is_valid(N, D) == False:
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,219 |
s809278232 | p04045 | u857070771 | 1580230942 | Python | Python (3.4.3) | py | Accepted | 75 | 2940 | 192 | n,k=map(int,input().split())
s=set(input().split())
while True:
l=list(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,220 |
s591906783 | p04045 | u984276646 | 1580154105 | Python | Python (3.4.3) | py | Accepted | 34 | 3064 | 503 | N, K = map(int, input().split())
D = list(map(int, input().split()))
S = ""
ND = []
for i in range(10):
if i not in D:
ND.append(i)
if K == 9:
S = str(ND[0])
while int(S) < N:
S = str(ND[0]) + S[:]
print(int(S))
else:
l = 0
F = ND[0]
j = 10 - K
cnt = 0
while F < N:
l += 1
s = l
F ... | 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,221 |
s323124777 | p04045 | u098012509 | 1580080999 | Python | Python (3.4.3) | py | Accepted | 55 | 3060 | 380 | import sys
input = sys.stdin.readline
def main():
N, K = [int(x) for x in input().split()]
D = [int(x) for x in input().split()]
Dset = set(D)
for i in range(N, 1000000):
for j in str(i):
if int(j) in Dset:
break
else:
print(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,222 |
s304202659 | p04045 | u441575327 | 1580004068 | Python | Python (3.4.3) | py | Accepted | 57 | 3064 | 723 | N,K = list(map(int,input().split()))
D = list(input().split())
ok = set(("0","1","2","3","4","5","6","7","8","9"))-set(D)
def solve(str_num):
ans = 100000
if str_num == "":
for c in ok:
if c == "0":
continue
ans = min(ans,solve(str_num+c))
else:
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,223 |
s624284385 | p04045 | u696831348 | 1579717198 | Python | Python (3.4.3) | py | Accepted | 84 | 3060 | 277 | N, K = map(int, input().split())
D = list(map(str, input().split()))
while True:
flg = True
num = str(N)
for i in range(len(num)):
if num[i] in D:
flg = False
break
if flg is True:
print(int(num))
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,224 |
s119162255 | p04045 | u609061751 | 1579691714 | Python | Python (3.4.3) | py | Accepted | 82 | 3060 | 341 | import sys
input = sys.stdin.readline
N, K = [int(x) for x in input().split()]
D = [str(x) for x in input().rstrip().split()]
D = set(D)
for i in range(N, N + 10 ** 6):
i_list = list(str(i))
flag = 1
for j in i_list:
if j in D:
flag = 0
break
if flag:
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,225 |
s421744213 | p04045 | u488884575 | 1579661661 | Python | Python (3.4.3) | py | Accepted | 19 | 3064 | 548 | # https://atcoder.jp/contests/abc042/submissions/9653489
import itertools
N, K = input().split()
P = input().split()
#使える数字
a= sorted(set([str(i) for i in range(10)])-set(P))
#同じ桁
b1 = itertools.product(a, repeat=len(N))
#繰り上がって一つ大きい桁
b2 = itertools.product(a, repeat=len(N)+1)
ans=str()
cnt=0
for i in b1:
#print(ty... | 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,226 |
s969631449 | p04045 | u906481659 | 1579621676 | Python | Python (3.4.3) | py | Accepted | 21 | 3064 | 530 | import itertools
N, L = map(str, input().split())
P = list(map(str, input().split()))
U = itertools.product(sorted(list(set([str(i) for i in range(10)])-set(P))),repeat=len(N))
F = itertools.product(sorted(list(set([str(i) for i in range(10)])-set(P))),repeat=len(N)+1)
K = str()
cnt=0
for i in U:
#print(''.join(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,227 |
s625381221 | p04045 | u071868443 | 1579590409 | Python | Python (3.4.3) | py | Accepted | 89 | 2940 | 187 | N, K = map(int, input().split())
hate = set(map(str, input().split()))
Nos = {str(i) for i in range(10)}
available = Nos ^ hate
while not set(list(str(N))) <= available:
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,228 |
s091570318 | p04045 | u989345508 | 1579555170 | Python | Python (3.4.3) | py | Accepted | 74 | 2940 | 188 | n,k=map(int,input().split())
s=set(input().split())
#print(s)
while True:
l=list(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,229 |
s096621492 | p04045 | u350836088 | 1579051611 | Python | Python (3.4.3) | py | Accepted | 43 | 2940 | 211 | n,k = map(int,input().split())
d = list(map(int,input().split()))
def ok(i):
while i > 0:
k = i%10
if k in d:
return False
i //= 10
return True
while not ok(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,230 |
s036848601 | p04045 | u671211357 | 1579048728 | Python | Python (3.4.3) | py | Accepted | 86 | 3060 | 294 | N,K=map(int,input().split())
D=list(input().split())
while True:
A=str(N)
count = 0
for i in range(len(A)):
if A[i] in D:
N+=1
break
else:
count +=1
if count == len(A):
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,231 |
s165358186 | p04045 | u225388820 | 1578967823 | Python | Python (3.4.3) | py | Accepted | 68 | 3060 | 235 | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,10*n):
a=str(i)
b=len(a)
ans=True
for j in a:
if j in d:
ans=False
break
if ans:
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,232 |
s488929274 | p04045 | u761989513 | 1578967557 | Python | Python (3.4.3) | py | Accepted | 85 | 2940 | 207 | n, k = map(int, input().split())
d = set(input().split())
while True:
flag = True
for i in str(n):
if i in d:
flag = False
if flag:
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,233 |
s765342528 | p04045 | u241190159 | 1578672005 | Python | Python (3.4.3) | py | Accepted | 24 | 3700 | 516 | import sys
from copy import copy
N, K, *D = map(int, open(0).read().split())
candidate = sorted(list({i for i in range(10)} - set(D)))
like_integer = copy(candidate)
# 1桁の場合を判定
for j in candidate:
if j >= N:
print(j)
sys.exit()
for i in range(1, 6):
order = 10 ** i
_candidate = []
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,234 |
s392140921 | p04045 | u648212584 | 1578602239 | Python | Python (3.4.3) | py | Accepted | 80 | 3064 | 530 | #import sys
#input = sys.stdin.buffer.readline
def main():
N,K = map(int,input().split())
D = list(map(int,input().split()))
use = []
for i in range(10):
if i not in D:
use.append(i)
nl = []
for i in range(N,10*N+1):
num = i
ans = True
while 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,235 |
s355366470 | p04045 | u268792407 | 1578432229 | Python | Python (3.4.3) | py | Accepted | 67 | 5884 | 531 | n,k=map(int,input().split())
d=list(map(int,input().split()))
use = [str(i) for i in range(10) if i not in d]
mon5 = [int(i+j+k+l+m) for i in use for j in use for k in use for l in use for m in use if int(i+j+k+l+m)>=n]
mon4 = [int(i+j+k+l) for i in use for j in use for k in use for l in use if int(i+j+k+l)>=n]
mon3 ... | 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,236 |
s943499685 | p04045 | u906077984 | 1578012762 | Python | Python (3.4.3) | py | Accepted | 45 | 2940 | 220 | N,K = map(int,input().split())
D = list(map(int,input().split()))
for i in range(N,100000):
j = i
while j > 0:
if j % 10 in D:
break
j = int(j/10)
if j == 0:
break
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,237 |
s999877894 | p04045 | u179169725 | 1577936111 | Python | Python (3.4.3) | py | Accepted | 69 | 2940 | 374 | # https://atcoder.jp/contests/abc042/tasks/arc058_a
# 最悪でも10**6探索する程度なのでNを一つづつ足して全探索でもよくね?
N, K = list(map(int, input().split()))
D = set(input().split())
def is_inD(n: int):
tmp = set(str(n))
return tmp.isdisjoint(D)
for i in range(N, N + 10 ** 6):
if is_inD(i):
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,238 |
s151576327 | p04045 | u143903328 | 1577846524 | Python | Python (3.4.3) | py | Accepted | 42 | 2940 | 246 | ### N = int(input(())
N, M = map(int, input().split())
D = list(map(int, input().split()))
for i in range(N,100000):
j = i
while j > 0:
if j % 10 in D:
break
j = int(j/10)
if j == 0:
break
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,239 |
s888813293 | p04045 | u517910772 | 1577765643 | Python | Python (3.4.3) | py | Accepted | 59 | 2940 | 329 | def problem_c():
N, K = map(int, input().split())
D = list(map(str, input().split()))
numbers = {str(i) for i in range(10)}
availables = set(numbers) - set(D)
for i in range(N, 100000):
nums = set(str(i))
if nums <= availables:
print(i)
return
##########
pro... | 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,240 |
s516519647 | p04045 | u517910772 | 1577765274 | Python | Python (3.4.3) | py | Accepted | 66 | 3060 | 253 | numbers = {str(i) for i in range(10)}
N, K = map(int, input().split())
*D, = map(str, input().split())
D = set(D)
available = numbers - D
ans = 0
for i in range(N, 100000):
nums = set(str(i))
if nums <= available:
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,241 |
s535095681 | p04045 | u768896740 | 1577462330 | Python | Python (3.4.3) | py | Accepted | 93 | 3060 | 385 | n, k = map(int, input().split())
one_to_nine = set([0,1,2,3,4,5,6,7,8,9])
a = set(list(map(int, input().split())))
a = one_to_nine - a
a = list(a)
for i in range(n, 100001):
x = list(str(i))
flag = True
for j in x:
if int(j) in a:
continue
else:
flag = 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,242 |
s271615075 | p04045 | u581187895 | 1577419957 | Python | Python (3.4.3) | py | Accepted | 25 | 3316 | 385 | import bisect
from itertools import product
N, K = map(int, input().split())
D = map(int, input().split())
like_num = set(range(0,10)) ^ set(D)
length = len(str(N))
for l in range(length, length+2):
comb = [int("".join(map(str, a))) for a in product(like_num, repeat=l)]
ind = bisect.bisect_left(comb, N)
if len(... | 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,243 |
s572442225 | p04045 | u581187895 | 1577418787 | Python | Python (3.4.3) | py | Accepted | 26 | 3060 | 311 | from itertools import product
N, K = map(int, input().split())
D = map(int, input().split())
like_num = set(range(10)) ^ set(D)
length = len(str(N))
for i in range(length, length+2):
for x in product(like_num,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,244 |
s435235964 | p04045 | u426572476 | 1577414862 | Python | Python (3.4.3) | py | Accepted | 98 | 5432 | 266 | import math
import fractions
n, k = map(int, input().split())
d = [i for i in input().split()]
i = n
while 1:
flag = 1
for j in d:
if j in str(i):
i += 1
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,245 |
s152326336 | p04045 | u580258754 | 1577389497 | Python | Python (3.4.3) | py | Accepted | 53 | 3060 | 224 | N,K = map(int,input().split())
D = set([i for i in map(str,input().split())])
for i in range(N,10**6):
ng = 0
str_i = str(i)
for s in str_i:
if s in D:
ng = 1
break
if ng == 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,246 |
s312144617 | p04045 | u810457760 | 1577318182 | Python | Python (3.4.3) | py | Accepted | 60 | 2940 | 156 | n,k = map(int, input().split())
d = input().split()
while True:
s = str(n)
for i in d:
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,247 |
s824820725 | p04045 | u940831163 | 1577315799 | Python | Python (3.4.3) | py | Accepted | 99 | 2940 | 257 | n, k = map(int, input().split())
d = list(map(str, input().split()))
for i in range(n, 10*n+1):
num = list(str(i))
for j, n in enumerate(num):
if n in d:
break
if j == len(num)-1:
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,248 |
s659827613 | p04045 | u327532412 | 1577312302 | Python | Python (3.4.3) | py | Accepted | 69 | 3060 | 252 | numbers = {str(i) for i in range(10)}
N, K = map(int, input().split())
*D, = map(str, input().split())
D = set(D)
available = numbers - D
ans = 0
for i in range(N, 100000):
nums = set(str(i))
if nums <= available:
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,249 |
s025481414 | p04045 | u102960641 | 1577298988 | Python | Python (3.4.3) | py | Accepted | 96 | 3060 | 231 | n,k = map(int, input().split())
d = list(map(int, input().split()))
a = []
for i in range(10):
if i not in d:
a.append(str(i))
ans = n
while True:
b = str(ans)
if all([i in a for i in b]):
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,250 |
s807763637 | p04045 | u325282913 | 1577247639 | Python | Python (3.4.3) | py | Accepted | 71 | 3060 | 251 | N, X = map(int, input().split())
arr = list(input().split())
ans = 0
for i in range(N,10**7):
flg = True
s = str(i)
for k in s:
if str(k) in arr:
flg = False
break
if flg:
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,251 |
s211857960 | p04045 | u171065106 | 1577161428 | Python | Python (3.4.3) | py | Accepted | 98 | 3064 | 130 | n, k = map(int, input().split())
d = list(map(int, input().split()))
while any(int(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,252 |
s375336496 | p04045 | u470542271 | 1577158641 | Python | Python (3.4.3) | py | Accepted | 96 | 3060 | 281 | n, k = map(int, input().split())
d = list(map(int, input().split()))
d = set([str(_d) for _d in d])
ans = n
while True:
f = True
a = str(ans)
for _a in a:
if _a in d:
f = False
if f:
print(ans)
break
else:
ans += 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,253 |
s634200640 | p04045 | u710659690 | 1577134902 | Python | Python (3.4.3) | py | Accepted | 89 | 2940 | 220 | N, K = list(map(int, input().split()))
D = input().split()
num = list(map(str, range(10)))
for k in range(K):
num.remove(D[k])
for I in range(N, 100000):
if all([II in num for II in 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,254 |
s903636554 | p04045 | u808688003 | 1576981230 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 388 | import sys
N, K = map(int, input().split())
st = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
dis = map(int, input().split())
for i in dis:
st.remove(i)
def dfs(num, pos, target):
if pos == target:
if num >= N:
print(num)
sys.exit()
return
for i in st:
dfs(num * 10 + i, 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,255 |
s620484185 | p04045 | u761989513 | 1576811518 | Python | Python (3.4.3) | py | Accepted | 82 | 2940 | 102 | n, k = map(int, input().split())
d = set(input().split())
while set(str(n)) & d:
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,256 |
s367734864 | p04045 | u933341648 | 1576691367 | Python | Python (3.4.3) | py | Accepted | 55 | 2940 | 178 | n, k = map(int, input().split())
d = input().split()
while True:
s = str(n)
for x in d:
if x 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,257 |
s555967626 | p04045 | u343092716 | 1576643289 | Python | Python (3.4.3) | py | Accepted | 53 | 3060 | 225 | n, k = map(int, input().split())
dislikes = input().split()
payment = n
while True:
tmp = str(payment)
for t in tmp:
if t in dislikes:
break
else:
break
payment += 1
print(payment) | 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,258 |
s044400733 | p04045 | u030848580 | 1576536047 | Python | Python (3.4.3) | py | Accepted | 67 | 3064 | 445 | from itertools import *
if __name__=="__main__":
n,k = map(int,input().split(' '))
d = list(map(int,(input().split(' '))))
d = [i for i in range(10) if i not in d]
ans = 1e10
keta = len(str(n))
for k in range(1,keta+2):
for perm in product(d,repeat=k):
num = 0
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,259 |
s884266114 | p04045 | u254871849 | 1576469580 | Python | Python (3.4.3) | py | Accepted | 77 | 2940 | 281 | import sys
n, k, *dislikes = sys.stdin.read().split()
n = int(n)
dislikes = set(dislikes)
def main():
i = n
while True:
if set(str(i)) & dislikes:
i += 1
continue
return i
if __name__ == '__main__':
ans = main()
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,260 |
s374833679 | p04045 | u254871849 | 1576469241 | Python | Python (3.4.3) | py | Accepted | 27 | 3824 | 599 | import sys
from string import digits
from itertools import product
from bisect import bisect_left as bi_l
n, k, *dislikes = sys.stdin.read().split()
def main():
likes = sorted(set(digits) - set(dislikes))
cand = product(likes, repeat=len(n))
*cand, = map(lambda x: int(''.join(x)), cand)
cand.sort()
... | 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,261 |
s150163118 | p04045 | u002459665 | 1576429250 | Python | Python (3.4.3) | py | Accepted | 54 | 9828 | 901 | def main():
N, K = list(map(int, input().split()))
D = set(map(int, input().split()))
OK_N = set([i for i in range(0, 10)]) - D
OK_N = list(OK_N)
l1 = [str(i)for i in OK_N]
for _ in range(len(str(N)) - 1):
tmp_l = []
for li in l1:
# print(li)
for ni in O... | 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,262 |
s909972478 | p04045 | u309141201 | 1576292628 | Python | Python (3.4.3) | py | Accepted | 63 | 3060 | 236 | n, k = map(int, input().split())
d = set(map(str, input().split()))
numbers = {str(i) for i in range(10)}
available = numbers - d
for i in range(n, 100000):
nums = set(str(i))
if nums <= available:
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,263 |
s785057302 | p04045 | u309141201 | 1576290938 | Python | Python (3.4.3) | py | Accepted | 65 | 3064 | 252 | numbers = {str(i) for i in range(10)}
N, K = map(int, input().split())
*D, = map(str, input().split())
D = set(D)
available = numbers - D
ans = 0
for i in range(N, 100000):
nums = set(str(i))
if nums <= available:
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,264 |
s253173002 | p04045 | u350997995 | 1576214215 | Python | Python (3.4.3) | py | Accepted | 83 | 2940 | 141 | N,K = map(int,input().split())
D = set(input().split())
while 1:
E = set(str(N))
if not(D&E):
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,265 |
s946955248 | p04045 | u622045059 | 1576206562 | Python | Python (3.4.3) | py | Accepted | 56 | 2940 | 194 | N,K = map(int, input().split())
D = input().split()
ans = N
while True:
tmp = str(ans)
for t in tmp:
if t 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,266 |
s026883796 | p04045 | u557168336 | 1576126191 | Python | Python (3.4.3) | py | Accepted | 97 | 2940 | 151 | import sys
N,K,*vD=map(int,sys.stdin.buffer.read().split())
for x in range(N,10**5):
if any(int(d) in vD for d in str(x)):
continue
print(x)
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,267 |
s269368288 | p04045 | u061127257 | 1575911320 | Python | Python (3.4.3) | py | Accepted | 64 | 3064 | 243 | a,b=map(int, input().split())
s = list(map(str,input().split()))
num=int(a)
D = set(s)
numbers = {str(i) for i in range(10)}
available = numbers - D
for i in range(a,100000):
nums = set(str(i))
if nums <= available:
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,268 |
s457797619 | p04045 | u484229314 | 1575848170 | Python | Python (3.4.3) | py | Accepted | 20 | 3188 | 565 | N, K = input().split()
K = int(K)
NL = list(map(int, N[::-1]))
D = [int(_) for _ in input().split()]
min_d = min([i for i in range(10) if i not in D])
mod_idx = -1
i = 0
while len(NL) > i:
n = NL[i]
for j in range(n, 10):
if j in D:
NL[i] += 1
mod_idx = i
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,269 |
s516582219 | p04045 | u762420987 | 1575781657 | Python | Python (3.4.3) | py | Accepted | 99 | 2940 | 165 | N, K = map(int, input().split())
Dset = set(input().split())
while True:
if Dset & set(str(N)) == set():
print(N)
break
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,270 |
s956229945 | p04045 | u952491523 | 1575730506 | Python | Python (3.4.3) | py | Accepted | 95 | 2940 | 274 | import sys
def hantei(array,n):
s = str(n)
for i in range(len(s)):
if int(s[i]) in array:
return False
return True
n,k = map(int,input().split())
d = list(map(int,input().split()))
while True:
if hantei(d,n):
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,271 |
s889599569 | p04045 | u021548497 | 1575389596 | Python | Python (3.4.3) | py | Accepted | 43 | 3060 | 317 | import sys
n, k = map(int, input().split())
d = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}-set(int(x) for x in input().split()))
while True:
ans = n
while ans > 0:
key = ans%10
if key in d:
ans = ans//10
if ans == 0:
print(n)
sys.exit()
continue
else:
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,272 |
s547488461 | p04045 | u365254117 | 1574990399 | Python | Python (3.4.3) | py | Accepted | 90 | 2940 | 142 | n, k = map(int, input().split())
l=set(input().split())
while True:
if set(str(n)) & l == set():
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,273 |
s330322138 | p04045 | u658288444 | 1574978000 | Python | Python (3.4.3) | py | Accepted | 89 | 2940 | 129 | n,k=map(int,input().split())
L = set(input().split())
while True:
if set(str(n)) & L == set():
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,274 |
s140723501 | p04045 | u771756419 | 1574545862 | Python | Python (3.4.3) | py | Accepted | 78 | 3060 | 293 | nums = input().split()
s_N = str(nums[0])
i_N = int(nums[0])
K = int(nums[1])
nums2 = input().split()
count = 0
while count < K:
#x=嫌いな数候補
x = nums2[count]
if x in s_N:
i_N += 1
s_N = str(i_N)
count = 0
else:
count += 1
print(s_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,275 |
s714055318 | p04045 | u143278390 | 1574279199 | Python | Python (3.4.3) | py | Accepted | 82 | 3896 | 348 | import string
n,k =[int(i) for i in input().split()]
not_use=[int(i) for i in input().split()]
use=[int(i) for i in string.digits if int(i) not in not_use]
def check(n):
for i in str(n):
if(int(i) in not_use):
return False
return True
x=n-1
while True:
x+=1
if(check(x)==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,276 |
s940675311 | p04045 | u836737505 | 1574143375 | Python | Python (3.4.3) | py | Accepted | 72 | 3060 | 248 | N, K = map(int, input().split())
D = list(map(int, input().split()))
for i in range(N*10):
if i >= N:
s = str(i)
for j in s:
if int(j) in D:
break
else:
print(s)
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,277 |
s558756580 | p04045 | u673981655 | 1574098830 | Python | Python (3.4.3) | py | Accepted | 88 | 3060 | 257 | N,K=map(int,input().split())
D=list(map(int,input().split()))
def solve():
for i in range(10*N):
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,278 |
s365968859 | p04045 | u248670337 | 1574090546 | Python | Python (3.4.3) | py | Accepted | 75 | 3060 | 195 | n,k=map(int,input().split())
D=list(map(int,input().split()))
L=D
for i in range(9*n):
for s in str(n+i):
if int(s) in D:
break
else:
print(n+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,279 |
s079914307 | p04045 | u673981655 | 1574025084 | Python | Python (3.4.3) | py | Accepted | 88 | 3060 | 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,280 |
s786905631 | p04045 | u141786930 | 1573701889 | Python | Python (3.4.3) | py | Accepted | 88 | 3060 | 359 | def main():
N, K = map(int, input().split())
D = list(str(x) for x in input().split())
while True:
strN = str(N)
flg = 0
for i in strN:
if i in D:
flg = 1
if flg == 0:
print(N)
break
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,281 |
s654906543 | p04045 | u923659712 | 1573677329 | Python | Python (3.4.3) | py | Accepted | 78 | 3060 | 206 | N, K = map(int, input().split())
D = set(input().split())
while True:
l = list(str(N))
for x in l:
if x 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,282 |
s037948623 | p04045 | u633450100 | 1573674813 | Python | Python (3.4.3) | py | Accepted | 62 | 2940 | 334 | N,K = [int(i) for i in input().split()]
#D = [int(i) for i in input().split()]は数値代入
#文字列を複数代入
D = input().split()
#集合に置き換える(型はset)
D = set(D)
use = set(['0','1','2','3','4','5','6','7','8','9'])
use -= D
for i in range(N,88889):
if use >= set(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,283 |
s605143348 | p04045 | u633450100 | 1573674712 | Python | Python (3.4.3) | py | Accepted | 63 | 3060 | 334 | N,K = [int(i) for i in input().split()]
#D = [int(i) for i in input().split()]は数値代入
#文字列を複数代入
D = input().split()
#集合に置き換える(型はset)
D = set(D)
use = set(['0','1','2','3','4','5','6','7','8','9'])
use -= D
for i in range(N,100*N):
if use >= set(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,284 |
s952926367 | p04045 | u600402037 | 1573661673 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 338 | N, K = map(int, input().split())
D = set(map(int, input().split()))
safe = set(range(10)) - D
def test(N):
return set((int(x) for x in str(N))) <= safe
def F(N):
while N % 10:
if test(N):
return N
N += 1
N //= 10
x = F(N)
y = min(safe)
return 10 * x + y
answer = F(... | 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,285 |
s572588784 | p04045 | u600402037 | 1573660993 | Python | Python (3.4.3) | py | Accepted | 76 | 2940 | 206 | N, K = map(int, input().split())
D = set(input().split())
while True:
l = list(str(N))
for x in l:
if x 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,286 |
s963192794 | p04045 | u052499405 | 1573621728 | Python | Python (3.4.3) | py | Accepted | 64 | 3316 | 396 | #!/usr/bin/env python3
from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
n, k = [int(item) for item in input().split()]
d = [item for item in input().split()]
for i in range(n, n+10**5):
si = str(i)
ok = True
for item in d:
if item in si:
... | 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,287 |
s019337513 | p04045 | u799164835 | 1573526787 | Python | Python (3.4.3) | py | Accepted | 80 | 3064 | 2,037 | # すべてを str型として読み込み、Kのみ int型に変換
N, Kstr = map(str, input().split()) # N: 元の数, K: NG数の数
K = int(Kstr)
D = list(map(str, input().split())) # D: NG数のリスト
# N = str(1000)
# K = 8
# D = ('1', '3', '4', '5', '6', '7', '8', '9')
def getMinimumOK():
# NGではない最小の数字を求める
for i in range(0, 9):
for j in range(1, 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,288 |
s496115702 | p04045 | u390883247 | 1573354326 | Python | Python (3.4.3) | py | Accepted | 42 | 2940 | 250 | N,K = map(int,input().split())
Data = list(map(int,input().split()))
def check(n):
while n > 0:
if n % 10 in Data:
return False
n //= 10
return True
while True:
if check(N):
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,289 |
s026740915 | p04045 | u511379665 | 1573277988 | Python | Python (3.4.3) | py | Accepted | 94 | 3064 | 359 | cnt=[0,1,2,3,4,5,6,7,8,9]
n,k=map(int,input().split())
d=list(map(int,input().split()))
tmp=[]
for i in range(k):
cnt.remove(d[i])
def digit(x):
xt=str(x)
for i in range(len(xt)):
if not int(xt[i]) in cnt:
return False
return True
t=n
while t>=n:
if digit(t):
print(t)
... | 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,290 |
s272592623 | p04045 | u638795007 | 1573260087 | Python | Python (3.4.3) | py | Accepted | 67 | 5712 | 540 | def examC():
import bisect
N, K = LI()
D = list(map(str,input().split()))
ansC = []
for i in range(100001):
cur = str(i)
k = 1
for s in cur:
if s in D:
k = 0
break
if k==1:
ansC.append(i)
# print(ansC)
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,291 |
s061804694 | p04045 | u798818115 | 1573237985 | Python | Python (3.4.3) | py | Accepted | 87 | 3188 | 615 | # coding: utf-8
# Your code here!
N,K=map(int,input().split())
D=list(map(int,input().split()))
temp=[]
for i in range(10):
if D.count(i)==0:
temp.append(i)
D=temp[:]
preK=0
K=10-K
opt=D[:]
ans=10**18
for item in opt:
if item>=N:
ans=min(ans,item)
for t in range(5):
for d in D:
f... | 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,292 |
s839443693 | p04045 | u281303342 | 1573159901 | Python | Python (3.4.3) | py | Accepted | 74 | 2940 | 196 | # python3 (3.4.3)
import sys
input = sys.stdin.readline
# main
N,K = map(int,input().split())
D = set(input().split())
for i in range(N,N*10+1):
if not D&set(str(i)):
break
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,293 |
s383290511 | p04045 | u380524497 | 1573096025 | Python | Python (3.4.3) | py | Accepted | 84 | 3060 | 195 | n, k = map(int, input().split())
D = set(input().split())
use = set(map(str, range(10)))
use -= D
for num in range(n, 100*n):
if use >= set(list(str(num))):
print(num)
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,294 |
s271687269 | p04045 | u936985471 | 1573019574 | Python | Python (3.4.3) | py | Accepted | 36 | 3064 | 264 | n,k=map(int,input().split())
d=set(list(map(int,input().split())))
def checkIfOk(num):
while True:
if num%10 in d:
return False
else:
num=num//10
if num==0:
return True
while True:
if checkIfOk(n):
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,295 |
s339516171 | p04045 | u183840468 | 1572997253 | Python | Python (3.4.3) | py | Accepted | 73 | 2940 | 220 | n,k = [int(i) for i in input().split()]
all_num = {'0','1','2','3','4','5','6','7','8','9'}
l = all_num - {i for i in input().split()}
for i in range(n,n*20):
if not set(str(i)) - l:
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,296 |
s915507667 | p04045 | u614875193 | 1572984954 | Python | Python (3.4.3) | py | Accepted | 31 | 9312 | 458 | import itertools
N,K=map(int,input().split())
D=set(list(map(str,input().split())))
U=list({'0','1','2','3','4','5','6','7','8','9'}^D)
U.sort()
PRD1 = list(itertools.product(U, repeat=len(str(N))))
PRD2 = list(itertools.product(U, repeat=len(str(N))+1))
import sys
for i in range(len(PRD1)):
T=int(''.join(PRD1[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,297 |
s966643733 | p04045 | u032468447 | 1572899710 | Python | Python (3.4.3) | py | Accepted | 100 | 2940 | 230 | N,K = map(int,input().split())
D = list(map(str,input().split()))
ans = 0
for j in range(N,10*N+1):
f = True
for k in D:
if str(k) in str(j):
f = False
break
if f:
ans = j
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,298 |
s805675295 | p04045 | u503294750 | 1572819237 | Python | Python (3.4.3) | py | Accepted | 65 | 3060 | 222 | line=input().split()
N=int(line[0])
K=int(line[1])
D=input().rstrip().split()
for i in range(N,10*N+1):
s=str(i)
flag=True
for x in D:
if x in s:
flag=False
break
if flag:
print(s)
break
else:
continue | 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,299 |
s877154062 | p04045 | u796942881 | 1572803753 | Python | Python (3.4.3) | py | Accepted | 58 | 2940 | 300 | from sys import stdin
def main():
lines = stdin.readlines()
N = int(lines[0].split()[0])
Dk = lines[1].split()
for i in range(N, 10 * N):
for D in Dk:
if D in str(i):
break
else:
print(i)
break
return
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,300 |
s585463024 | p04045 | u314089899 | 1572741817 | Python | Python (3.4.3) | py | Accepted | 37 | 5400 | 955 | #042c slow
N,K = map(int, input().split())
D_set = set([int(e) for e in input().split()])
INF = 9999999999
OK_D = {0,1,2,3,4,5,6,7,8,9} - D_set
OK_D_list = list(OK_D)
OK_D_list.sort
ans = []
pay = 0
def dfs(pos,pay):
#print("#####################")
#print(pay)
#停止条件
#深さに限らず,任意の停止条件を書く
if 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,301 |
s805935525 | p04045 | u143278390 | 1572664140 | Python | Python (3.4.3) | py | Accepted | 80 | 3768 | 364 | import string
import sys
N,K=[int(i) for i in input().split()]
D=[int(i) for i in input().split()]
use=[int(i) for i in string.digits if int(i) not in D]
def check(use,x):
for i in str(x):
if(int(i) not in use):
return False
return x
i=N-1
while True:
i+=1
x=check(use,i)
if(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,302 |
s848339530 | p04045 | u020390084 | 1572413603 | Python | Python (3.4.3) | py | Accepted | 89 | 3064 | 645 | #!/usr/bin/env python3
import sys
def solve(N: int, K: int, D: "List[int]"):
while True:
for d in D:
strn=str(N)
if str(d) in strn:
break
else:
print(N)
return
N+=1
return
def main():
def iterate_tokens():
... | 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,303 |
s976969959 | p04045 | u149991748 | 1572372815 | Python | Python (3.4.3) | py | Accepted | 82 | 3060 | 337 | # -*-coding: utf-8 -*-
#金額と個数の入力
sum,num = map(int,input().split())
#嫌いな数字の入力
dis = list(map(int,input().split()))
pay = sum
while True:
flag = 0;
str_pay = str(pay)
for i in str_pay:
if int(i) in dis:
flag = 1
break
if flag == 0:
break
else:
pay = pay + 1
print(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,304 |
s859968388 | p04045 | u134520518 | 1572309541 | Python | Python (3.4.3) | py | Accepted | 100 | 3060 | 154 | n, k = map(int, input().split())
d = list(input().split())
while 1:
if all(dd not in str(n) for dd in d):
print(n)
break
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,305 |
s814624324 | p04045 | u814986259 | 1572193315 | Python | Python (3.4.3) | py | Accepted | 59 | 2940 | 221 | N,K=map(int,input().split())
D=list(input().split())
for i in range(N,10*N+1):
s=str(i)
flag=True
for x in D:
if x in s:
flag=False
break
if flag:
print(s)
break
else:
continue
| 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,306 |
s876120861 | p04045 | u076917070 | 1572053344 | Python | Python (3.4.3) | py | Accepted | 33 | 3060 | 390 | import sys
input = sys.stdin.readline
def isOk(n, D):
while n > 0:
if n % 10 in D:
return False
n //= 10
return True
def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
ans = 0
for i in range(N, 10**5):
if isOk(i, 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,307 |
s949844698 | p04045 | u368882459 | 1572036868 | Python | Python (3.4.3) | py | Accepted | 84 | 2940 | 157 | n, k = map(int, input().split())
d = set(map(str, input().split()))
for i in range(n, 10*n):
if len(d & set(str(i))) == 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,308 |
s435199067 | p04045 | u153902122 | 1572033139 | Python | Python (3.4.3) | py | Accepted | 37 | 3060 | 227 | N, K = map(int, input().split())
D = set(list(map(int, input().split())))
for i in range(N, 100001):
tmp = i
while tmp > 0 and tmp % 10 not in D:
tmp = tmp // 10
if tmp == 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,309 |
s848377980 | p04045 | u254871849 | 1571973930 | Python | Python (3.4.3) | py | Accepted | 74 | 3060 | 204 | n, k = map(int, input().split())
dis = input().split()
m = n
while True:
m = str(m)
for d in dis:
if d in m:
break
else:
print(m)
exit()
m = int(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,310 |
s155966160 | p04045 | u254871849 | 1571969874 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 705 | price, size = map(int, input().split())
dislikes = list(map(int, input().split()))
likes = list(set(range(10)) - set(dislikes))
digits = [int(digit) for digit in str(price)]
r_digits = list(reversed(digits))
res = []
for i in range(len(r_digits)):
if r_digits[i] in likes:
res.append(r_digits[i])
elif ma... | 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,311 |
s899089799 | p04045 | u552192779 | 1571953932 | Python | Python (3.4.3) | py | Accepted | 78 | 2940 | 213 | n,k = map(int,input().split())
nums =set(input().split())
i = n
while True:
i = str(i)
for num in nums:
if num in i:
break
else:
print(i)
exit()
i =int(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,312 |
s971516089 | p04045 | u079427319 | 1571810266 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 829 | val, size = map(int, input().split())
disabledList = [int(x) for x in input().split()] # number
enableList = list(set(range(10)) - set(disabledList)) # number
resultList = [] # str, must reverse
isTenOver = False
for char in reversed(list(str(val))):
targetInt = int(char)
if isTenOver:
targetInt += 1
if targe... | 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,313 |
s277844139 | p04045 | u741953371 | 1571708058 | Python | Python (3.4.3) | py | Accepted | 85 | 3060 | 193 | p, _ = [int(x) for x in input().split(' ')]
v = set([str(x) for x in range(10)]) - set(input().split(' '))
for x in range(p, 100000):
if all([s in v for s in str(x)]):
print(x)
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,314 |
s826143685 | p04045 | u912115033 | 1571572829 | Python | Python (3.4.3) | py | Accepted | 78 | 2940 | 147 | n, k = map(int, input().split())
d = set(input().split())
for i in range(n, 10*n):
if len(set(str(i)) & d) == 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,315 |
s852155532 | p04045 | u886747123 | 1571437962 | Python | Python (3.4.3) | py | Accepted | 88 | 2940 | 230 | # C - こだわり者いろはちゃん / Iroha's Obsession
N, K = map(int, input().split())
D = set(input().split())
set_str_N = set(str(N))
while len(set_str_N & D) > 0:
N = N + 1
set_str_N = set(str(N))
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,316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.