submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s130031485
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) D = [x for x in range(0,10) if x not in D] n = len(str(N)) K = 10 - K def bi(x): o = [0]*n c = 0 while x > 0: o[c] = x % K x //= K c += 1 return o m = int(str(min(filter(lambda x:x,D)))+str(min(D))*n) for i 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...
s902093039
p04045
Accepted
N, K = map(int,input().split()) D = list(input().split()) while 1: price = str(N) flag = True for p in price: for d in D: if p == d: flag = False if flag == True: 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...
s061964979
p04045
Accepted
n, k = list(map(int, input().split())) ds = set(list(map(int, input().split()))) while True: ok = True for c in str(n): if int(c) in ds: ok = False break if ok: 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...
s421670445
p04045
Accepted
n,k=map(int,input().split()) d=input().split() stopcode=False while stopcode==False: for i in range(len(str(n))): if str(n)[i] in d: n+=1 break elif i+1==len(str(n)): stopcode=True 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...
s033387863
p04045
Accepted
n,k=map(int,input().split()) l=list(map(int,input().split())) ans=n def judge(m,li): ml=list(str(m)) for i in ml: if int(i) in li: return True return False while judge(ans,l): 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...
s602011959
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) while D & set(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...
s077707920
p04045
Accepted
n = int(input().split()[0]) a = set(input()) while a&set(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...
s946041506
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) while True: strn = str(n) for i in range(len(strn)): if strn[i] in d: n += 1 break if i == len(strn)-1: 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...
s848833780
p04045
Accepted
N,K = map(int,input().split()) *D, = map(int,input().split()) for i in range(N,100000): for n in str(i): if int(n) in D: break else: break 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...
s788757284
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10*n+1): s=set(str(i)) for j in range(k): if str(d[j]) in s: 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...
s359068066
p04045
Accepted
# -*- coding: utf-8 -*- #mathをインポート import math #n円が金額、嫌いな数がk個。入力 n,k=map(int,input().split(" ")) #嫌いな文字リスト klist=input().split(" ") def hantei(n,kl): if len(str(n))==4: while math.floor(n/1000)==kl or \ math.floor(n/100)-10*math.floor(n/1000)==kl or \ math.floor(n/10)-10*math.floor(n/100)==...
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...
s384738058
p04045
Accepted
n, k = [int(n) for n in input().split()] d = [n for n in input().split()] while(1): for l in list(str(n)): if l in d: break else: 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...
s605748477
p04045
Accepted
n,k=map(int,input().split()) p=[int(i) for i in input().split()] s=[] for i in range(10): if i not in p: s.append(str(i)) for x in range(n,10*n): flg=True for d in str(x): if d not in s: flg=False if flg: print(x) 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...
s068653402
p04045
Accepted
#n=int(input()) ans=10**6 n,k=map(int,input().split()) p=[int(i) for i in input().split()] s=[] for i in range(10): if i not in p: s.append(str(i)) for a in s+['0']: for b in s: for c in s: for d in s: for e in s: x=map(int,[a+b+c+d+e,b+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...
s053743020
p04045
Accepted
n, k = [int(n) for n in input().split()] d = [n for n in input().split()] while(1): for l in list(str(n)): if l in d: break else: 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...
s185169379
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) for i in range(N, N * 10 + 1): check = True for n in str(i): if int(n) in D: check = False if check: 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...
s470638197
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) N_list = list(str(N)) flag = True cnt = 0 while True: N_list = list(str(N+cnt)) if flag: for j, n in enumerate(N_list): if int(n) in D: cnt += 1 break elif j==len(N_list)-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...
s477908830
p04045
Accepted
import itertools n,k = map(int,input().split()) a = list(map(str,input().split())) d = [str(i) for i in range(10)] for c in a: d.remove(c) res = -1 for l in itertools.product(d,repeat=len(str(n))): x = int(''.join(l)) if x>=n and (res==-1 or x<res): res = x if res != -1: print(res) exit(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...
s933224422
p04045
Accepted
N, _ = map(int, input().split()) D = set(input().split()) while D & set(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...
s985264564
p04045
Accepted
N, K = [int(i) for i in input().split()] D = [int(i) for i in input().split()] for i in range(N, 10 * N + 1): for s in str(i): if int(s) in D: break else: print(i) quit()
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...
s868633924
p04045
Accepted
#C問題 N, K = map(int, input().split()) D = list(map(str, input().split())) def check(n, d): n = str(n) for nstr in n: if nstr in d: return False return True while True: if check(N, D): 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...
s445365199
p04045
Accepted
N, K = (int(i) for i in input().split()) D=[] for i in input().split(): D.append(i) n=N while True: queue=0 nstr=str(n) for i in nstr: if i in D: queue=1 if queue==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...
s472401025
p04045
Accepted
def get_greater_equals(number, target, exclude_digits): if number >= target: return number results = [] for i in range(10): if not i in exclude_digits: if i == 0 and number == 0: continue results.append( get_greater_equals(number * 10 +...
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...
s701999413
p04045
Accepted
import itertools white_num_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] N, K = map(int, input().split()) black_num_list = list(map(int, input().split())) white_num_list = list(set(white_num_list).difference(set(black_num_list))) num_combination = list(itertools.product(white_num_list, repeat = len(str(N)))) num_list = [...
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...
s386138207
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) while not all([n not in D for n in 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...
s884925135
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, input().split())) i = N while(1): if len(D & set(list(str(i)))) == 0: 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...
s220101760
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) flag = False for a in range(N, 10*N): ans = list(str(a)) for b in range(len(ans)): if ans[b] in D: break if b == len(ans) - 1 and ans[b] not in D: print(a) flag = True if flag: 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...
s355732268
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) flag = False for a in range(N, 10*N+1): ans = list(str(a)) for b in range(len(ans)): if ans[b] in D: break if b == len(ans) - 1 and ans[b] not in D: print(a) flag = True if flag: 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...
s677667725
p04045
Accepted
n, k = map(int, input().split()) d = [str(i) for i in input().split()] for i in range(n, 10*n+1): if len(set(list(str(i))) & set(d)) == 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...
s370042471
p04045
Accepted
N, K = map(int, input().split(' ')) d_list = input().split(' ') for h in range(10): for i in range(10): for j in range(10): for k in range(10): for l in range(10): number = h * 10000 + i * 1000 + j * 100 + k * 10 + l result = set(list(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...
s566558142
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, input().split())) for i in range(N, 10*N+1): sn = str(i) flg = True for c in sn: if c in D: flg = False break if flg: 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...
s070871522
p04045
Accepted
N,K = map(int,input().split()) D = set(map(str,input().split())) def check(n,d): n = str(n) for nstr in n: if nstr in d: return False return True while True: if check(N,D): print(N) break else: N = 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...
s569810593
p04045
Accepted
N, K =list(map(int, input().split())) D = input().split() for n in range(N, 100000): s = str(n) for d in D: if d in s: break else: print(s) 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...
s479490943
p04045
Accepted
N,K=map(int,input().split()) D={int(i) for i in input().split()} C = {0,1,2,3,4,5,6,7,8,9} - D A=[] for i in range(9*N+1): if (N+i)%10 in C: if ((N+i)%100)//10 in C: if ((N+i)%1000)//100 in C: if ((N+i)%10000)//1000 in C: if (N+i)//10000 in 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...
s709274763
p04045
Accepted
import sys N, K = map(int, input().split()) d = list(map(int, input().split())) d_set = set(d) num_set = set([1,2,3,4,5,6,7,8,9,0]) enable = num_set - d_set #print(type(enable)) #print(enable) def dfs(s): #print(s) global ans # すでにN以上の場合はこの先を探索しない if s != "": if int(s) >= N: #print(s) ans.a...
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...
s227568968
p04045
Accepted
def main(): N, K = map(int, input().split()) D = list(map(int, input().split())) rec = 0 rec2 = 1 for d in D: if rec != d: break rec += 1 for d in D: if rec2 != d: break rec2 += 1 strN = str(N) carry = False ans = "" for i in range(len(strN)-1, -1, -1): cur = int(strN[i]) chanegd = 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...
s271616866
p04045
Accepted
N, K = map(int, input().split()) s = list(map(int, input().split())) x = N while set(list(str(x))) & set(list(str(s))): x += 1 continue else: print(x)
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...
s989745043
p04045
Accepted
def task_c(): """ https://atcoder.jp/contests/abc042/tasks/abc042_c """ n, k = map(int, input().split()) dd = input().split() while True: if any(d in dd for d in str(n)): n += 1 else: break print(n) task_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...
s890693615
p04045
Accepted
# -*- coding: utf-8 -*- n, k = map(int, input().split()) nums = input().split() pay = n disLike = True while disLike: disLike = False for j in range(len(str(pay))): if str(pay)[j] in nums: disLike = True pay += 1 print(pay)
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...
s278845678
p04045
Accepted
N, K = map(int,input().split()) D =list(map(str,input().split())) import sys for i in range (N, 10**5+1): if len(set(list(str(i))) & set(D)) == 0: print(i) sys.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...
s461258680
p04045
Accepted
n,k = map(int,input().split()) ng = set(input().split()) while len(set(str(n))&ng): 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...
s163781622
p04045
Accepted
N, K = map(int, input().split()) D = list(map(str, input().split())) for i in range(N, 100000): j = str(i) more = False for k in D: if j.count(k) > 0: more = True break if not more: 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...
s039124101
p04045
Accepted
N, K = map(int, input().split()) l = input().split() result = N - 1 def hasNum(result, l): for num in l: if num in str(result): return False return True while True: result = result + 1 if hasNum(result, l): print(result) 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...
s154966599
p04045
Accepted
N,_ = map(int,input().split()) lists=list(map(str,input().split())) for i in range(N,100000): flg=True for j in str(i): if j in lists: flg = False break if flg: 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...
s935205824
p04045
Accepted
N, K = map(int, input().split()) D = [i for i in input().split()] num = N while True: tmp = str(num) if all(i not in D for i in tmp): break num += 1 print(num)
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...
s588810426
p04045
Accepted
def read_input(): n, k = map(int, input().split()) dlist = list(map(int, input().split())) return n, k, dlist def check_inclusion(dislike, target): return any(d in target for d in dislike) def submit(): n, k, dlist = read_input() target = n checkee = [int(digit) for digit in str(targe...
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...
s145363833
p04045
Accepted
n,k = map(int,input().split()) ok = set(input().split()) while len(set(str(n))&ok): 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...
s693226969
p04045
Accepted
N, _ = map(int, input().strip().split()) D = input().strip().split() for ans in range(N, 100000): if len(set(str(ans)) & set(D)) == 0: print(ans) 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...
s883671241
p04045
Accepted
n,k=map(int,input().split()) m=list(map(int,input().split())) for i in range(n,100000): k=1 for a in str(i): if int(a) in m: k=0 if k: 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...
s616461007
p04045
Accepted
N,K = map(int,input().split()) D = input().split() for i in range(N, 10*N+1): for j in str(i): if j in D: break else: print(i) exit()
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...
s001745489
p04045
Accepted
import sys from itertools import product def main(): input = sys.stdin.readline N, K = map(str, input().split()) D = list(map(str, input().split())) nums = set([str(i) for i in range(10)]) safe = sorted(list(nums - set(D))) min_safe = safe[0] if min_safe == '0': min_safe = safe[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...
s546532230
p04045
Accepted
n,k = map(int,input().split()) d = input().split() while len(set(str(n)) & set(d)) !=0: 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...
s770184405
p04045
Accepted
n,k = map(int,input().split()) d = list(map(str,input().split())) for i in range(n,10*n): ans = 0 for j in str(i): if not j in d: ans += 1 if ans==len(str(i)): 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...
s368964963
p04045
Accepted
def check(x,sample): x=str(x) for i in x: if i in sample: return False return True def main(): n,k=map(int,input().split()) sample=input().split() while 1: if check(n,sample): print(n) return; n+=1 main()
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...
s540435044
p04045
Accepted
# -*- coding: utf-8 -*- def solve(N, K, D): i = 0 while(True): test = N + i test_str = str(test) for j in range(K): index = -1 index = test_str.find(D[j]) if(index>=0): break if(index == -1): 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...
s178086626
p04045
Accepted
import itertools n,k=map(int,input().split()) D=list(map(int,input().split())) N=set(i for i in range(10)) C=list(N-set(D)) ans=float("inf") for a in list(itertools.product(C,repeat=len(str(n)))): m=int("".join(map(str,a))) if m>=n: ans=min(ans,m) if ans==float("inf"): for a in list(itertools.product(C,repeat...
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...
s621656686
p04045
Accepted
n=int(input().split()[0]) d=set(input()) while set(str(n))&d: 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...
s918656672
p04045
Accepted
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) ans = '' for n in list(map(int, list(str(N)))): if n > use[-1]: ans+=str(use[0]) else: for i in use: if i >= n: ans+=str(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...
s270348144
p04045
Accepted
N, K = map(int, input().split()) D=input().split() ans=N while True: for i in str(ans): if i in D: break else: print(ans) exit() ans +=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...
s675461758
p04045
Accepted
N, K = map(int, input().split()) # 標準入力 D = map(int, input().split()) # 嫌いな数字のリスト D_str = list(map(str, D)) m = N while True: for n in str(m): if n in D_str: break else: # breakされなかったら実行される print(m) break 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...
s047515963
p04045
Accepted
import sys import collections ns = lambda: sys.stdin.readline().rstrip() ni = lambda: int(ns()) nm = lambda: map(int, sys.stdin.readline().split()) nl = lambda: list(nm()) nsl = lambda: map(str, sys.stdin.readline().split()) n, k = nm() d = nl() for i in range(n, 100001): lis = list(str(i)) f = 0 for j 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...
s008869271
p04045
Accepted
n, k = map(int, input().split()) d = input().split() ans = n while True: for i in str(ans): if i in d: break else: print(ans) exit() ans += 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...
s635906829
p04045
Accepted
N, K = map(int, input().split()) # 標準入力 D = map(int, input().split()) # 嫌いな数字のリスト D_str = list(map(str, D)) m = N while True: for n in str(m): if n in D_str: break else: # breakされなかったら実行される print(m) break 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...
s170188925
p04045
Accepted
n,k=map(int,input().split()) D=input() D_str=str(D) i=0 string=D_str.split() while True: judge=0 fee=n+i fee_str=str(fee) for j in range(k): index=fee_str.find(string[j]) judge = judge + index if judge == -k : break i=i+1 print(fee)
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...
s506605758
p04045
Accepted
n,k=map(int,input().split()) d=[int(i) for i in input().split()] t=n while 1: x=t while 1: if x%10 in d: break else: x//=10 if x==0: print(t) exit() t+=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...
s827967736
p04045
Accepted
N, K = map(int, input().split()) dislike = list(map(int, input().split())) for i in range(N, 10*N+1): num = list(map(int,str(i))) match = list(set(num) & set(dislike)) if len(match)==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...
s340049467
p04045
Accepted
N, K = map(int, input().split()) dislike = list(input().split()) while True: M = str(N) numbers = list(M) matchedlist = [] for a in dislike: for b in numbers: if a == b: matchedlist.append(a) if matchedlist == []: 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...
s177331854
p04045
Accepted
n, k = (int(_) for _ in input().split()) a = [int(_) for _ in input().split()] found = False bad = False while not found: for i in str(n): if int(i) in a: bad = True if not bad: found = True bad = False n += 1 print(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...
s357813868
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) for i in range(N,10*N+1): I=list(map(int,str(i))) match=list(set(I)&set(D)) if len(match)==0: print(i) break else: pass
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...
s544006973
p04045
Accepted
n, k = map(int, input().split()) dl = list(map(int, input().split())) while True: f = True for a in map(int, list(str(n))): if a in dl: f = False if f: 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...
s603219868
p04045
Accepted
import bisect n,k=map(int,input().split()) l=list(map(int,input().split())) nl=list(range(10)) for i in l:nl.remove(i) ch=int(str(nl[-1])*len(str(n)))<n if ch and nl[0]==0: print(int(str(nl[1])+"0"*(len(str(n))))) elif ch: print(int(str(nl[0])*(len(str(n))+1))) else: ans="" for i in range(len(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...
s653218410
p04045
Accepted
# 0〜9 l=list(range(10)) # 入力 N,K=map(int,input().split()) l2=list(map(int,input().split())) # 使用可能な数字を求める for x in l2: l.remove(x) # 集合型に変換 l=set(l) # 1<=N<=10000 なので、答えは最大でも100000まで for x in range(1,100001): # 集合型に変換 y=set(map(int,list(str(x)))) # Nを上回る数字かつ、使える数字のみを使用している場合 if N<=x and l.issuperset(y): ...
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...
s491340211
p04045
Accepted
# 0〜9 l=list(range(10)) # 入力 N,K=map(int,input().split()) l2=list(map(int,input().split())) ans='' f=False # 使用可能な数字を求める for x in l2: l.remove(x) # 集合型に変換 l=set(l) for x in range(1,1000000): y=set(map(int,list(str(x)))) if N<=x and l.issuperset(y): print(x) 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...
s106976780
p04045
Accepted
import collections import math import sys N,K = map(int,input().split()) Ds = list(map(int,input().split())) for n in range(N,100000): check = True for d in Ds: if str(d) in str(n): check = False break if check ==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...
s801700577
p04045
Accepted
def f(n, d): while True: for x in d: try: str(n).index(str(x)) except ValueError: pass else: break else: return n n = n + 1 nk = list(map(int, input().split())) n = nk[0] d = list(map(int, inpu...
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...
s241196464
p04045
Accepted
n, _ = map(int, input().split(' ')) no_likes = list(map(int, input().split(' '))) numbers = sorted([i for i in range(10) if i not in no_likes]) for i in range(n, 100000): for b in str(i): if int(b) not in numbers: 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...
s266447039
p04045
Accepted
Num = [int(n) for n in input().rstrip().split()] D = [int(n) for n in input().rstrip().split()] for i in range(Num[0],100000): if len(set([str(n) for n in D]) & set(str(i))) == 0: print(int(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...
s373261820
p04045
Accepted
N, K = [int(i) for i in input().split()] d_li = [int(i) for i in input().split()] all_digits = set(range(10)) dis_digits = set(d_li) like_digits = all_digits - dis_digits like_li = sorted(list(like_digits)) while set([int(i) for i in str(N)]) & dis_digits: 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...
s943490010
p04045
Accepted
N, K = map(int, input().split()) D = set(list(map(int, input().split()))) while True: int_i = [int(s) for s in list(str(N))] set_i = set(int_i) if not D & set_i: 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...
s093533303
p04045
Accepted
n,k=map(int, input().split()) l1=map(int,input().split()) l2=[0,1,2,3,4,5,6,7,8,9] l3=set(l1)^set(l2) m=str(n) l4=map(int,set(m)) l4=set(l4) def check(a,b): if (a|b)==a: return True else: return False while check(l3,l4) is False: n=n+1 m=str(n) l4=map(int,set(m)) l4=set(l4) 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...
s487263174
p04045
Accepted
import itertools N,K = map(int,input().split()) D = list(map(int,input().split())) #使用可能数字の取り出し Num1 = [] for i in range(10): if(i in D): continue else: Num1.append(i) #組み合わせ Comb = [] n = len(str(N)) for i in range(n+1): Comb.append(Num1) Comb = list(itertools.product(*Comb)) ans = -1 for i in range(len(Comb...
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...
s773343783
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) j=[(True if i in d else False)for i in range(10)] for i in range(n,10**6): s=str(i) for h in range(len(s)): if j[int(s[h])]: break else: print(s) 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...
s089563773
p04045
Accepted
N, K = map(int, input().split()) list_D = input().split() while True: for c in str(N): if c in list_D: break else: 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...
s116009425
p04045
Accepted
N, K = map(int,input().split()) dl = list(input().split()) # 案1:使える数値を順に組み合わせていく # 案2:Nから順に数字を+1ずつ加算していき、使える文字のみになったら終了 temp = N - 1 flg = True while flg: temp += 1 flg = False st = str(temp) for i in range(len(st)): if st[i] in dl: flg = True print(temp)
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...
s124301987
p04045
Accepted
def irohas_obsession(N: int, K: int, D: list) -> int: # D に含まれない最小の値 min_not_d = min(d for d in range(10) if d not in D) min_not_d_and_not_zero = min(d for d in range(10) if d not in D and d != 0) # 数字を各桁に分解する。 nums = [] while N > 0: nums = [N % 10] + nums N //= 10 # 上位の桁から...
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...
s998360720
p04045
Accepted
import sys sys.setrecursionlimit(1000000) N, K = map(int, input().split()) D = input().split() decimal = set(["0","1", "2", "3", "4", "5", "6", "7", "8", "9"]) - set(D) candidate = [] def dfs(s): if len(s) == 0: sub_d = decimal - set("0") for d in sub_d: dfs(s + d) elif len(s) <...
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...
s516480897
p04045
Accepted
# -*- coding:utf-8 -*- n, k = map(int, input().split()) d = list(map(int, input().split())) while True: res = n for x in d: res = str(res).replace(str(x), "X") if "X" in res: n += 1 else: print(res) 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...
s435462817
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) can_use = [] for i in range(10): if i not in D: can_use.append(i) ans = [] t = 0 for i, dig in enumerate(list(str(N))): m = 10 for cu in can_use: sa = cu - int(dig) if sa <= m and sa >= 0: m = sa ...
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...
s118033173
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10**6): flag=True for j in str(i): if int(j) in d: flag=False break if flag: 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...
s375447731
p04045
Accepted
n,k=map(int,input().split()) D=set(map(int,input().split())) X={0,1,2,3,4,5,6,7,8,9}-D for i in range(n,100000): if set([int(a) for a in str(i)])|X==X: 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...
s516704787
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) n_list = list(str(n)) n_list = [int(num) for num in n_list] num = {1,2,3,4,5,6,7,8,9,0} d_set = set(d) empty = set() #print(set(n_list)) #print(d_set) #print(set(n_list) & d_set) while(1): n_list = list(str(n)) n_list = [int(num) for num in 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...
s376192340
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) for i in range(n,88889): for j in list(str(i).replace(""," ").split()): if j in d: 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...
s597758927
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) for i in range(n,90000): for j in list(str(i).replace(""," ").split()): if j in d: 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...
s691806871
p04045
Accepted
#C問題 N,K=map(int,input().split()) D=list(map(str,input().split())) for i in range(10*N): Nlist=list(str(N)) Nlen=len(Nlist) flag=0 for j in range(Nlen): if Nlist[j] in D: flag=1 break if flag == 0: print(int(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...
s273832684
p04045
Accepted
from sys import stdin input = stdin.readline N, K = [int(x) for x in input().rstrip().split()] D = [int(x) for x in input().rstrip().split()] ok = [x for x in range(10) if x not in D] tmp = N while 1: for y in str(tmp): if int(y) in ok: pass else: break else: # すべて使用可能 print(tmp) break tmp += 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...
s315710569
p04045
Accepted
n,k = map(int, input().split()) a = list(map(int, input().split())) d="" e=0 for i in range(100000): d=str(n+i) for j in range(k): e=e+d.count(str(a[j])) if e==0: print(int(d)) break e=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...
s646603437
p04045
Accepted
n,k=map(int,input().split());d=input().split() def judge(): global d,n for i in str(n): if i in d:return print(n) exit() while 1: judge() 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...
s243108771
p04045
Accepted
from functools import reduce def main(): # 一文字のみを読み込み # s = input().rstrip().split(' ') # スペース区切りで標準入力を配列として読み込み # s = input().rstrip().split(' ') # 位置文字ずつ標準入力を配列として読み込み # s = list(input().rstrip()) slist = input().rstrip().split(' ') N = int(slist[0]) K = int(slist[1]) 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...
s857688320
p04045
Accepted
n, k = (int(i) for i in input().split()) d = [i for i in input().split()] for i in range(n,n*100): flg=True for j in str(i): if j in d: flg=False break; if flg: 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...
s849126374
p04045
Accepted
import itertools import bisect def main(): N, K = map(int, input().split()) D = list(map(int, input().split())) P = [str(x) for x in range(10) if x not in D] num = [] for i in range(1, len(str(N))+2): for c in itertools.product(P, repeat=i): num.append(int("".join(c))) idx ...
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...