submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s828973730 | p04045 | Accepted | def check(x,d):
s=str(x)
flag=True
for i in range(len(s)):
if int(s[i]) not in d:
flag=False
return flag
n,k=map(int,input().split())
a=[int(x) for x in input().split()]
d=[]
for i in range(10):
if i not in a:
d.append(i)
l=len(str(n))
final=10**l
flag=False
#print(d)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s480385729 | p04045 | Accepted | n,k = map(int,input().split())
a = set(map(int,input().split()))
for i in range(n,1000001):
x = str(i)
for j in x:
if int(j) in a:
break
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s014166942 | p04045 | Accepted | 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() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s171444114 | p04045 | Accepted | N, K = map(int, input().split())
D = set(list(map(str, input().split())))
for i in range(N, 10**6):
if N <= i and len(set(str(i)) & D) == 0:
print(i)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s966628021 | p04045 | Accepted | 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:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s448998399 | p04045 | Accepted | import sys
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s595789486 | p04045 | Accepted | import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate
def read_ints():
return list(map(int, read().split()))
def read_a_int():
return int(read())
def read_tuple(H):
'''
H is number of rows
'''
ret = []
for _ in range(H):
ret.append(tuple... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s212798172 | p04045 | Accepted | 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 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s670385838 | p04045 | Accepted | n,k=map(int,input().split())
d=list(map(int,input().split()))
for i in range(n,n*10+1):
for x in d:
if str(x) in str(i):
break
else:
print(i)
break
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s071656222 | p04045 | Accepted | 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(... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s392401321 | p04045 | Accepted | N, K = map(int, input().split())
D = set(input().split())
n = N
while True:
d = set(list(str(n)))
check = D & d
if len(check) == 0:
break
n += 1
print(n)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s051772997 | p04045 | Accepted | 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) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s344857518 | p04045 | Accepted | n,k = map(int,input().split())
l = list(map(str,input().split()))
for i in range(n,10**7):
a = [j for j in str(i)]
if set(a).isdisjoint(set(l)):
print(i)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s490687046 | p04045 | Accepted | a,n=map(int,input().split())
b=input()
c=[]
for i in range(n):
c.append(int(b[2*i]))
flag="F"
while flag=="F":
k=a
fflag="T"
while k>=1:
l=int(k%10)
for i in range(n):
if c[i]==l:
fflag="F"
break
k=int(k/10)
if fflag=="F":
break
if fflag=="T":
flag="T"
else:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s169698724 | p04045 | Accepted | import sys
import math # noqa
import bisect # noqa
import queue # noqa
def input():
return sys.stdin.readline().rstrip()
def main():
N, K = map(int, input().split())
D = list(map(int, input().split()))
while True:
feasible = True
for n in str(N):
if int(n) in D:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s602090008 | p04045 | Accepted | import sys
n,k = map(int,input().split())
d = list(map(int,input().split()))
for i in range(100000):
s = str(i)
n2 = len(s)
fl = 0
for j in range(len(s)):
for k in d:
if s[j] == str(k):
fl = 1
if fl == 0:
if i >= n:
print(i)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s875558036 | p04045 | Accepted | 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) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s307168183 | p04045 | Accepted | n, k = map(int, input().split())
list_D = list(map(str, input().split()))
num = n
ans = -1
while True:
S = list(str(num))
cnt = 0
for s in S:
if s in list_D:
cnt += 1
if cnt == 0:
ans = num
break
num += 1
print(ans) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s662507905 | p04045 | Accepted | n, k = map(int, input().split())
list_D = set(map(str, input().split()))
num = n
ans = -1
while True:
S = set(list(str(num)))
cnt = 0
for s in S:
if s in list_D:
cnt += 1
if cnt == 0:
ans = num
break
num += 1
print(ans) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s133165217 | p04045 | Accepted | 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 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s541510131 | p04045 | Accepted | def main(data: list):
[price, numbers] = data
numbers_set = set(numbers)
while True:
unique_price_numbers = set(map(int, list(str(price))))
common_numbers = numbers_set.intersection(unique_price_numbers)
if len(common_numbers) == 0:
print(price)
break
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s717677551 | p04045 | Accepted | #coding: utf-8
N,K = map(int, input().split())
D = list(input().split())
while 1:
flg = 1
for d in D:
if d in str(N): flg = 0
if flg:
print(N)
break
N += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s331925321 | p04045 | Accepted | 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
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s718322405 | p04045 | Accepted | def main():
N, K = (int(_) for _ in input().split())
D = set(input().split())
ret = 10 ** 10
for a in range(10):
for b in range(10):
for c in range(10):
for d in range(10):
for e in range(10):
cc = str(int(str(a) + str(b) + str(c) + str(d) + str(e)))
for s in ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s753783428 | p04045 | Accepted | n,k=map(int,input().split())
d=set(list(map(str,input().split())))
for i in range(n,10*n):
flag=0
sn=str(i)
for j in sn:
if j in d:
flag=1
if flag==0:
print(i)
exit()
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s915286682 | p04045 | Accepted | from collections import deque
N,K=map(int,input().split())
l=list(map(int,input().split()))
num=[1]*10
nums=[]
d=deque()
ans=[]
for i in range(len(l)):
num[l[i]]=0
for i in range(10):
if num[i]==1:
nums.append(i)
d.append(i)
#print(nums)
for i in range(10000):
v=d.popleft()
ans.append(v)... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s697131512 | p04045 | Accepted | N,K = map(int, input().split())
Alist = list(map(int, input().split()))
Alist_str = [str(n) for n in Alist]
M=N
while True:
Mlist_str = list(str(M))
double = set(Alist_str) & set(Mlist_str)
if len(double) == 0:
print(M)
break
else:
M = M +1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s428499330 | p04045 | Accepted | amount, num = map(int, input().split())
hate_num_list = list(map(str, input().split()))
while(True):
check = 0
for digit in str(amount):
if digit in hate_num_list:
check += 1
if check == 0:
print(amount)
break
else:
amount += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s552711198 | p04045 | Accepted | n,k = map(int,input().split())
d = list(map(int,input().split()))
for i in range(100001):
nn = n+i
cnt = 0
for j in d:
if str(j) in str(nn):
break
else:
cnt += 1
if cnt == len(d):
print(nn)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s893480719 | p04045 | Accepted | n, k = map(int, input().split())
array = list(map(int, input().split()))
def jadgesuruo():
for i in range(k):
if str(n).find(str(array[i])) >= 0:
return False
break
return True
while True:
if jadgesuruo():
print(n)
break
els... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s977053884 | p04045 | Accepted | n, k = map(int, input().split())
array = list(map(int, input().split()))
def jadgesuruo():
for i in range(k):
if str(n).find(str(array[i])) >= 0:
return False
break
return True
for i in range(10**5):
if jadgesuruo():
print(n)
br... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s703020288 | p04045 | Accepted | INT_MAX=10**18+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#################################################################################
n,k=INPUT()
A=INPUT()
accepted=... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s091508216 | p04045 | Accepted | N,K =input().split()
listA=list(map(int,input().split()))
for i in range(100001):
if i >= int(N):
ans=str(i)
num=0
for j in range(len(ans)):
if int(ans[j]) not in listA:
num += 1
if num == len(ans):
print(i)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s089685582 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
iscollect = False
while(True):
for i in D:
if str(i) in str(N):
N += 1
break
else:
if i == D[-1]:
iscollect = True
break
if iscollect:
break
print(N)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s021064633 | p04045 | Accepted | N, K = list(map(int, input().split()))
D = list(map(int, input().split()))
flag = True
ans = N
while flag:
ans_nums = []
x = ans
while x>=1:
ans_nums.append(x%10)
x = (int)(x/10)
#print(ans_nums)
a = list(set(ans_nums) & set(D))
#print(a)
if len(a) == 0:
flag = False
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s406801018 | p04045 | Accepted | n,k,*d=map(int,open(0).read().split())
c=0
for i in range(n*10):
if n<=i:
for j in str(i):
if not int(j) in d:
c+=1
if c==len(str(i)):
print(i)
exit()
c=0 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s304882673 | p04045 | Accepted | 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
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s757687568 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
L=[]
for i in range(0, 10):
if i not in D:
L.append(str(i))
L.sort()
i = N
while True:
if set(list(str((i)))) <= set(L):
print(i)
break
i += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s923275147 | p04045 | Accepted | 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()) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s855876869 | p04045 | Accepted | N,K = map(int, input().split())
D = list(map(int, input().split()))
dt = [True] * 10
for d in D:
dt[d] = False
def check(x):
while x:
if not dt[x%10]:
return False
x //= 10
return True
for i in range(N, 10*N):
if check(i):
print(i)
break
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s440195953 | p04045 | Accepted | 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:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s315402897 | p04045 | Accepted | from collections import deque
N,K=map(int,input().split())
a=list(map(int,input().split()))
A=deque([str(i) for i in range(10) if i not in a])
B=[str(i) for i in range(10) if i not in a]
while True:
s=A.popleft()
if int(s)>=N:
print(s)
exit()
A.extend([s+i for i in B]) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s686134301 | p04045 | Accepted | N,K=map(int,input().split())
D=list(map(int,input().split()))
ans=N
for price in range(N,10**5+1):
s=str(price)
flag=True
for i in range(len(s)):
if int(s[i]) in D:
flag=False
if flag:
ans=price
break
print(ans) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s274579938 | p04045 | Accepted | 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
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s028788964 | p04045 | Accepted | 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
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s484887132 | p04045 | Accepted | N, K = [int(i) for i in input().split(" ")]
D = input().split(" ")
for i in range(N, 1000000):
if len(list(set(D) & set(str(i)))) == 0:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s663515116 | p04045 | Accepted | 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 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s866446573 | p04045 | Accepted | n, k = map(int, input().split())
d = set(map(int, input().split()))
d ^= {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
while True:
if d >= set(map(int, list(str(n)))):
print(n)
break
n += 1
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s911199507 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
strN = str(N)
setN = set(list(map(int, strN)))
setD = set(D)
# 10Nが最大という全探索
for ans in range(N, 10 * N + 1):
s = str(ans)
flag = True
for ch in s:
if int(ch) in setD:
flag = False
break
if flag:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s222013598 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s860452794 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s049720855 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s421391791 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s040456704 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
n = N
while True:
tmp = n
ng = False
while tmp > 0:
ng = ng or tmp%10 in D
tmp //= 10
if not ng:
break
n += 1
print(n) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s041326697 | p04045 | Accepted | n, k = map(int, input().split())
ddd = set(input().split())
while not ddd.isdisjoint(str(n)):
n += 1
print(n)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s731410471 | p04045 | Accepted | 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)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s413386940 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s532283126 | p04045 | Accepted | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s678812514 | p04045 | Accepted | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s754278845 | p04045 | Accepted | n, k = map(int,input().split())
a = input().split()
while True:
if all(c not in str(n) for c in a):
print(n)
break
else:
n += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s814590466 | p04045 | Accepted | 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) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s791361321 | p04045 | Accepted | 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)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s779835180 | p04045 | Accepted | def resolve():
n, k, = map(int, input().split())
ok = [str(i) for i in range(10)]
for i in input().split():
if i in ok:
ok.remove(i)
while True:
again = False
for i in str(n):
if not i in ok:
again = True
n += 1
break
if not again:
break
print(n)
resolve() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s906543597 | p04045 | Accepted | 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):
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s515775053 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s738760184 | p04045 | Accepted | import collections, math, bisect
local = False
if local:
file = open("input.txt", "r")
import time
def inp():
if local:
return file.readline().rstrip()
else:
return input().rstrip()
def ints():
return [int(_) for _ in inp().split()]
if local:
start=time.time()
N, K = ints()
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s927360821 | p04045 | Accepted | 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, ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s688477251 | p04045 | Accepted | N, K = map(int, input().split())
D = set(input().split())
for i in range(N,10**5):
l = set(list(str(i)))
if l & D:
continue
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s325169450 | p04045 | Accepted | def intersection(lst1, lst2):
lst3 = [value for value in lst1 if value in lst2]
return lst3
n,k=map(int,input().split())
a=list(map(str,input().split()))
while(1):
x=list(str(n))
check=True
if len(intersection(x,a))==0:
print(n)
break
n+=1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s878796182 | p04045 | Accepted | 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 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s431065062 | p04045 | Accepted | def check(n):
if set(list(map(int, str(n)))) & D:
return 1
else:
return 0
N, K = map(int, input().split())
D = set(list(map(int, input().split())))
surplus = 0
while check(N + surplus):
surplus += 1
print(N + surplus)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s717313050 | p04045 | Accepted | n, k=map(int, input().split())
d = list(input().split())
i=n
while True:
count = 0
for j in range(k):
if d[j] in str(i):
count += 1
if count == 0:
print(i)
break
else:
i += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s754799785 | p04045 | Accepted | # -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, K = map(int, input().split())
# 文字列用のリスト インプットをブランクで区切りリスト化
k = input()
s = [int(j) for j in k.split(" ")]
valIn = 0
# Nの桁毎の分解
def digit(i):
if i > 0:
return digit(i//10) + [i%10]
else:
return []
def irohacheck(n):
global valIn
valIn = 0
# 分解した数値をリス... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s005495808 | p04045 | Accepted | 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 =... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s756173542 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s180987116 | p04045 | Accepted |
def resolve():
N, K = map(int, input().split())
D = set(input().split())
while True:
if D & set(str(N)):
N += 1
continue
print(N)
return
if __name__ == "__main__":
resolve() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s730023966 | p04045 | Accepted | 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 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s488470660 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s973325174 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s445441797 | p04045 | Accepted | 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... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s753771959 | p04045 | Accepted | n,k = map(int,input().split())
D = set(list(map(str,input().split())))
while True:
s = set(list(str(n)))
if len(s&D)==0:
print(n)
break
n += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s225057770 | p04045 | Accepted |
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
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s233434807 | p04045 | Accepted | n,k = map(int,input().split())
t = list(map(int,input().split()))
kagu = []
for i in range(10):
if i in t:
continue
kagu.append(str(i))
ans = 1000000000000
for i in kagu:
if i == '0':
continue
if n<=int(i):
print(i)
exit()
memo = [i]
while int(memo[-1])< n:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s174077094 | p04045 | Accepted | 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)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s275818719 | p04045 | Accepted | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collection... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s167636672 | p04045 | Accepted | #
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
r_ = n / m
if (r_ - (n // m)) > 0:
return (n//m) + 1
else:
return (n//m)"""
""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def i... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s299707541 | p04045 | Accepted | N,K = list(map(int,input().split()))
D = list(map(str,input().split()))
D = set(D)
# print(D)
i = N
while True:
# print("i =",i)
b = list(str(i))
b = set(b)
# print(b)
c = b&D
# print(c)
if len(c)>0 :
i += 1
continue
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s274858189 | p04045 | Accepted | n, k = map(int, input().split())
d = list(input().split())
dis = False
while True:
a = str(n)
hate = False
for x in a:
for y in d:
if x == y:
hate = True
break
if hate == True:
break
if hate == True:
n += 1
else:
break
if n > 100000:
break
print(n) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s670646807 | p04045 | Accepted | 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() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s542072134 | p04045 | Accepted | import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()
def resolve():
N,K=map(int,input().split())
N= str(N)
S={i for i in range(10)}
D=set(map(int,input().split()))
D=S-D
def search(N):
for i in range(len(N)):
if int(N[i]) not in ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s732896939 | p04045 | Accepted | #!/usr/bin/env python3
# 全探索
n,k = map(int,input().split())
s = str(n)
d = list(map(int,input().split()))
for i in range(n,100000):
# i の中にd に含めれるものがないか1つづつ見ていく
str_i = str(i)
ok = 1
for j in str_i:
if int(j) in d:
ok = 0
break
if ok:
print(i)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s718466024 | p04045 | Accepted | ans,k = map(int,input().split())
d = set(input().split())
f = True
while f:
f = False
for i in str(ans):
if i in d:
f = True
if f:ans += 1
print(ans) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s992077797 | p04045 | Accepted | 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(... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s180967458 | p04045 | Accepted | import sys
n,k=map(int,input().split())
d=list(map(int,input().split()))
count=0
for i in range(n,1000000000):
for j in range(len(str(i))):
if str(i)[j] in str(d):
break
else:
count+=1
if count==len(str(i)):
print(i)
sys.exit()
count=0 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s833896221 | p04045 | Accepted | 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() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s365591903 | p04045 | Accepted | from collections import deque
N,K=map(int,input().split())
D=list(map(int,input().split()))
like=list(range(1,10))
dislike0=False
for s in D:
if s==0:
dislike0=True
else:
like.remove(s)
like.sort()
q=deque(like)
if dislike0==False:
like.insert(0,0)
while q:
num=q.popleft()
if n... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s912667301 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
n_str = str(n)
# print(n_str)
l = list(({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(d)))
# print(l)
ans = n
found = False
while not found:
found = True
ans_str = str(ans)
for i in range(len(ans_str)):
if int(ans_str[i]) not in l:
# print(... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s104615941 | p04045 | Accepted | # -*- coding: utf-8-*-
strs = []
n,k = map(int,input().split())
hates = list(input().split())
give = n
while(True):
stri = str(give)
hantei = True
for hate in hates:
if hate in stri:
hantei = False
break;
if hantei:
print(give)
break;
else:
give = give + 1
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s667493639 | p04045 | Accepted | import itertools
n,k = map(int,input().split())
unlike = list(map(int,input().split()))
like = []
for i in range(0,10):
if not(i in unlike):
like.append(i)
i = 1
ans = 0
while(i < 99):
current = list(itertools.product(like,repeat=i))
for j in range(len(current)):
h = int("".join(map(str,(lis... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s540580184 | p04045 | Accepted | N,K=map(int,input().split())
D=list(map(int,input().split()))
n=[str(N)[i] for i in range(len(str(N)))]
#print(n)
for i in range(N,10*N+1):
flag=True
for j in range(len(str(i))):
if(int(str(i)[j]) in D):
flag=False
if(flag==True):
ans=i
break
print(ans) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.