submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s864160136
p04045
Accepted
N, K = list(map(int, input().split())) D = list(map(int, input().split())) while True: for N_i in str(N): if int(N_i) in D: N += 1 break else: print(N) break
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...
s270468884
p04045
Accepted
n, k = (int(char) for char in input().split()) d = [int(i) for i in input().split()] ''' n = 10 k = 8 d = [0, 2, 3] ''' D = [i for i in range(10)] like_vals = [int(str(i)) for i in D if i not in d] i = 0 n = [int(str(n)[i]) for i in range(len(str(n)))] r = [-1] * len(n) while i < len(n): if n[i] in like_vals: ...
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...
s520919188
p04045
Accepted
from itertools import product def generator(ls, length): for i in product(*(ls for i in range(length))): yield "".join(i) def solve(ls, n): for i in generator(ls, len(n)): if n <= i: return i if ls[0] == "0": return ls[1] + "".join(ls[0] for i in range(len(n))) retu...
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...
s136630325
p04045
Accepted
n,k=map(int, input().split()) d=list(input().split()) ans=10000 for i in range(n,100000): for j in d: if str(i).count(j):break else: ans=i break print(ans)
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...
s553092332
p04045
Accepted
n,k = map(int,input().split()) d = list(map(str,input().split())) flg = True while flg: l = list() n_s = str(n) for i in n_s: if i in d: break else: print(n) flg = False break n = n +1 else: print(n)
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...
s998082072
p04045
Accepted
def m(): def is_included(i,d): s = str(i) for j in d: if str(j) in s: return True return False n, k = map(int, input().split()) d = list(map(int, input().split())) for i in range(n, n*10): if not is_included(i,d): return i retur...
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...
s538490405
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) for i in range(10*n+2): if i >= n: s = str(i) for j in range(len(s)): if int(s[j]) in d: break else: print(i) 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...
s735120669
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) def solve(): for i in range(10*n+2): if i >= n: s = str(i) for j in range(len(s)): if int(s[j]) in d: break else: print(i) return 0 solve()
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...
s749491146
p04045
Accepted
N,K = map(int, input().split()) D = input().split() for ans in range(N,N*10+1): ch_n = str(ans) cnt = 0 for c in ch_n: cnt += 1 if c in D: break if cnt == len(ch_n): print(ans) exit()
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...
s346796503
p04045
Accepted
def main(): N, K = map(int, raw_input().split()) D = raw_input().split() for i in range(N, N*10): if len(set(list(str(i))) & set(D)) == 0: print i break 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...
s575958080
p04045
Accepted
n,k = map(int, input().split()) d = set(input().split()) ans = 99999 for i in range(n, n*10): if set(str(i)) & d == set(): ans = i break print(ans)
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...
s053701914
p04045
Accepted
N, K = map(int, input().split()) d = set([int(i) for i in input().split()]) while True: e = {int(i) for i in str(N)} if d & e == set({}): 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...
s295399989
p04045
Accepted
N,K = map(int, input().split()) hate = [i for i in input().split()] j = 0 k = 0 while j >= 0: k = 0 for nums in hate: if nums in str(N): k += 1 else: pass if k == 0: 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...
s105043683
p04045
Accepted
def main(): N, K = map(int, input().split()) D = list(input().split()) while True: S = str(N) f = True for s in S: if s in D: f = False break if f: break N += 1 print(N) if __name__ == "__main__": m...
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...
s134023085
p04045
Accepted
def main(): N, K = map(int, input().split()) D = list(input().split()) i = 0 while True: S = str(N) f = True for s in S: if s in D: f = False break if f: break N += 1 print(N) if __name__ == "__main...
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...
s023047063
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) ans=10000 for i in range(n, n*10): if set(str(i)) & d == set(): ans=i break print(ans)
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...
s169384706
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) while True: if not set(str(N)) & D: 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...
s846590821
p04045
Accepted
N,K = map(int,input().split()) D = set(input().split()) while True: for c in str(N): if c in D: break else: print(N) exit() N += 1
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...
s416983751
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) while True: if not set(str(N)) & D: 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...
s268980885
p04045
Accepted
def main(): N, K = map(int, input().split()) *D, = map(int, input().split()) price = N while True: a = False for x in D: if str(x) in str(price): a = True break if not a: break price += 1 print(price) if __n...
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...
s621056185
p04045
Accepted
def find_next_valid_digit(d, bad_nums): next_digit = d while True: valid = True for c in str(next_digit): if int(c) in bad_nums: valid = False break if valid: break else: next_digit += 1 return next_digit if...
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...
s532262970
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10*n+1): judge=True num=list(str(i)) num=map(int,num) if set(num)&set(d): judge=False if judge: 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...
s932765737
p04045
Accepted
def main(): n, k = map(int, input().split()) d = set(map(int, input().split())) for i in range(n, 90000): for j in str(i): if int(j) in d: break else: print(i) break if __name__ == '__main__': main()
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...
s911952934
p04045
Accepted
x,n=[int(i) for i in input().split()] a=[i for i in input().split()] f=0 while True: for i in set(list(str(x))): if i in a: break else: print(x) break x+=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...
s982005369
p04045
Accepted
N, K = map(int, raw_input().split()) D = raw_input().split() while True: flag = True for i in range(0, len(str(N))): if str(N)[i] in D: flag = False break if flag: print N break else: N = N + 1
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...
s499192591
p04045
Accepted
def c_iroha_obsession(N, K, D): for ans in range(N, 10 * N + 1): for digit in str(ans): # 1桁ずつ調べる if int(digit) in D: # 嫌いな数字があった break else: # 嫌いな数字がなかった。このときのansが解 break return ans N,K = [int(i) for i in input().split()] D = [int(i) for i in input().s...
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...
s875626069
p04045
Accepted
n,k=map(int,input().split()) d=set(map(str,input().split())) while True: flag=True a=list(str(n)) for i in range(len(str(n))): if str(n)[i] in d: flag=False n+=1 break if flag: 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...
s805990068
p04045
Accepted
def check(d, x): x = str(x) for xx in x: if int(xx) not in d: return False return True n, k = map(int, input().split()) d = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ^ set(map(int, input().split())) i = n while 1: if check(d, i): break i += 1 print(i)
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...
s056153926
p04045
Accepted
l = list(map(int,input().split())) n,k = l[0],l[1] d = list(map(int,input().split())) for i in range(n,10*n+1): flag = 0 s = list(str(i)) for j in s: if int(j) in d: flag = 1 break if flag == 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...
s026199051
p04045
Accepted
def main(): N, K = map(int, input().split()) D = set(map(int, input().split())) for i in range(10): if i not in D: min_ = i break ans = [] apnd = ans.append num, top, i = N, 0, 0 while num > 0: while num % 10 in D: num += 1 to...
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...
s675256811
p04045
Accepted
N, K = map(int, input().split(' ')) hate = list(map(int, input().split(' '))) allow = set([0,1,2,3,4,5,6,7,8,9]) - set(hate) for i in range(N, 88889): tmp_set = set(map(int, list(str(i)))) if tmp_set <= allow: 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...
s490575432
p04045
Accepted
N,K = map(int,input().split()) ban = set(input().split()) while True: for c in str(N): if c in ban: break else: print(N) exit() N += 1
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...
s366228117
p04045
Accepted
n,k = [int(i) for i in input().split()] D = [i for i in input().split()] c = n def match(A,B): for a in A: if a in B: return True else: return False while True: if match(D,list(str(c))): c += 1 continue else: break print(c)
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...
s931703580
p04045
Accepted
n, k = map(int, input().split()) o = set(input().split()) while True: if set(str(n)).intersection(o): n += 1 else: 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...
s171222717
p04045
Accepted
N,M=map(int,input().split()) s=list(input().split()) q=1 while q==1: for i in list(str(N)): if i in s: N=N+1 break else: print(N) q=0
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...
s621961588
p04045
Accepted
N,K = map(int,input().split()) D = set(input().split()) while True: if not set(str(N)) & D: 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...
s889294465
p04045
Accepted
n, l = [int(i) for i in input().split()] d = {i for i in input().split()} while True: if not set(str(n)) & d: break n += 1 print(n)
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...
s178618659
p04045
Accepted
N, K = map(int,input().split()) D = list(map(int,input().split())) ans = N while True: str_a = str(ans) OK = True for s in str_a: if int(s) in D: OK = False break if OK: break 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...
s005624284
p04045
Accepted
n, k = list(map(int, input().split())) d = list(map(int, input().split())) if 0 in d: zero = True else: zero = False n_ok = {0} | set([0,1,2,3,4,5,6,7,8,9]) - set(d) n_oks = sorted(n_ok) #print(n_oks) def lowest(): for i in n_oks: for j in n_oks: for k in n_oks: for l i...
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...
s662529053
p04045
Accepted
n, k = list(map(int, input().split())) d = list(map(int, input().split())) if 0 in d: zero = True else: zero = False n_ok = {0} | set([0,1,2,3,4,5,6,7,8,9]) - set(d) n_oks = sorted(n_ok) #print(n_oks) def lowest(): for i in n_oks: for j in n_oks: for k in n_oks: for l i...
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...
s305613222
p04045
Accepted
N,K=map(int,input().split()) D=[int(i) for i in input().split()] T=[0 for i in range(10)] for i in D: T[i]=1 S=[] for i in range(10): if T[i]==0: S.append(i) import itertools L=[] R=[] if N>=1000: L=list(itertools.product(S,S,S,S)) R=sorted([int(str(i[0])+str(i[1])+str(i[2])+str(i[3])) for i in ...
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...
s122108311
p04045
Accepted
### -*- coding: utf-8 -*- INPUT = input() N = int(INPUT.split()[0]) # N_list = [int(x) for x in list(str(N))] # K = int(INPUT.split()[1]) D_list = map(int, input().split()) DIGITS = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0} # usable_digits = list(DIGITS - set(D_list)) usable_digits = DIGITS - set(D_list) while True: N_set ...
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...
s909756001
p04045
Accepted
l = list(map(int,input().split())) n = l[0] k = l[1] d = list(map(int,input().split())) n_str = list(str(n)) can_use = [] for i in range(10): can_use.append(i) for j in d: can_use.remove(j) for i in range(len(n_str)): j = int(n_str[i]) n_str[i] = j ss = [] for i in range(n * 10 + 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...
s122609494
p04045
Accepted
n, k = map(int, input().split()) l = list(map(int, input().split())) nums = [i for i in range(10) if not i in l] while True: total = 0 for num in nums: total += list(str(n)).count(str(num)) if total == len(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...
s418595035
p04045
Accepted
input_array = list(map(int,input().split())) N = input_array[0] input_array = list(map(int,input().split())) num = [1,1,1,1,1,1,1,1,1,1] ok = [] out = [] for l in range(len(input_array)): num[input_array[l]] = 0 for i in range(len(num)): if num[i] == 0: ok.append(i) while True: key = 0 for ...
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...
s734020243
p04045
Accepted
n,k = (int(i) for i in input().split()) d = [int(i) for i in input().split()] for i in range(n,88889): a = str(i) if all(int(j) not in d for j in a): print(i) break
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...
s684753809
p04045
Accepted
li_1 = list(map(int,input().split())) N = li_1[0] K = li_1[1] D = list(map(int,input().split())) minvalue=N temp=0 for i in range(10*N): i=i+N numtemp=i if numtemp>=10000: num_4=int(i/10000) i=i-10000*num_4 else: num_4=10 if numtemp>=1000: num_3=int(i/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...
s628513182
p04045
Accepted
from functools import reduce N, _ = [int(s) for s in input().split()] D = [s for s in input().split()] R = N while True: if reduce(lambda x, y: x and y, [s not in D for s in list(str(R))]): break R += 1 print(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...
s442370279
p04045
Accepted
a,b=map(int,(input().split())) c=set(input()) while sum(i in c for i in str(a))>0: a+=1 print(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...
s628552669
p04045
Accepted
from functools import reduce def obsession(n, disliked): def nearest(digit): for i in range(digit, digit + 10): mod10 = i % 10 if mod10 not in disliked: return (mod10, i != mod10) will_pay = list(map(int, str(n))) index = 0 while index < len(will_pay): ...
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...
s252052817
p04045
Accepted
import sys debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False if debug_mode: import os inf = open(os.path.basename(__file__).replace(".py", ".in")) def input(): return inf.readline() else: inf = sys.stdin # ============================================================== ...
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...
s243691418
p04045
Accepted
N,K=map(int,input().split()) A=[int(x) for x in input().split()] def check(a): a=str(a) for i in range(len(a)): if int(a[i]) in A: return False return True while not check(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...
s246427685
p04045
Accepted
n,k=map(int,input().split()) d=set(map(str,input().split())) for i in range(n,10*n): a=list(str(i)) a=set(a) if a&d==set(): 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...
s956927842
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) for i in range(n,100001): set_i=set(list(str(i))) for j in set_i: 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...
s197362302
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) ans=n p=0 for i in range(10*n+1): s=str(ans) for j in range(len(str(s))): if s[j] in d: break else: break ans+=1 print(ans)
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...
s848328033
p04045
Accepted
# -*- coding: utf-8 -*- """ https://beta.atcoder.jp/contests/abc042/tasks/arc058_a AC """ import sys from sys import stdin input = stdin.readline def solve(forbiddens, N): forbiddens = set(forbiddens) ans = N repeat = True while repeat: repeat = False num_s = str(ans) for ...
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...
s805171138
p04045
Accepted
# -*- coding: utf-8 -*- """ https://beta.atcoder.jp/contests/abc042/tasks/arc058_a """ import sys from sys import stdin input = stdin.readline def solve(forbiddens, N): forbiddens.sort() ans = N repeat = True while repeat: repeat = False num_s = str(ans) for s in num_s: ...
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...
s711734556
p04045
Accepted
price, num = map(int,input().split()) dislike = list(input().split()) ans = price p = 0 for i in range(10*price+1): s = str(ans) for j in range(len(str(s))): if s[j] in dislike: break else: break ans += 1 print(ans)
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...
s465752526
p04045
Accepted
def main(): n, k = map(int, input().split()) D = list(map(int, input().split())) while 1: f = 0 hoge = str(n) for i in range(len(hoge)): for j in range(k): if(int(hoge[i]) == D[j]): f = 1 break if f ...
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...
s275439687
p04045
Accepted
def c_IrohaObsession(N, K, D): d = [str(i) for i in D] i = N while True: for c in str(i): if c in d: break else: return i i += 1 N,K = [int(i) for i in input().split()] D = [int(i) for i in input().split()] print(c_IrohaObsession(N, K, D))
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...
s996179481
p04045
Accepted
(n, k), d = map(int, raw_input().split()), set(raw_input().split()) for _ in xrange(n, 100001): if not set(str(_)) & d: print _ 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...
s692800942
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, input().split())) for i in range(N, 100000): a = list(str(i)) a = set(a) if a & D == set(): 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...
s686126900
p04045
Accepted
def solve(d,s): for i in range(len(d)): if d[i] in s: return 1 return 0 N,K = map(int,input().split()) D = list(map(str,input().split())) m = N while solve(D,str(m)): m += 1 print(m)
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...
s764905909
p04045
Accepted
n=int(input().split()[0]) d=set(input()) while len(set(str(n))&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...
s658365704
p04045
Accepted
N,K=map(int,raw_input().split()) D=map(int,raw_input().split()) n=[0,1,2,3,4,5,6,7,8,9] a=[] #Allowed numbers for i in n: if i not in D: a.append(i) i=N while True: for j in D: if str(i).find(str(j))!=-1: break else: print str(i) break i+=1
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...
s145845445
p04045
Accepted
N, K = map(int, input().split()) D = input().split() for i in range(N, 100001): set_n = set(list(str(i))) for s in set_n: if s in D: break else: print(i) break
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...
s648834114
p04045
Accepted
[n, k] = map(int, raw_input().split()) d = raw_input().split() while True: ok = True for c in str(n): if c in d: ok = False break if ok: print n break n += 1
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...
s107705127
p04045
Accepted
n, k = list(map(int, input().split(" "))) d = list(map(int, input().split(" "))) def valid(n): while n > 0: digit = n % 10 if digit in d: return False n = int(n / 10) return True for num in range(n, 10 * n): if valid(num): print(num) break
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...
s044681363
p04045
Accepted
N, K = [int(n) for n in input().split()] D = set([int(n) for n in input().split()]) def digits(n): res = set() while n > 0: res = res.union(set([n%10])) n //= 10 return res for price in range(N, 10000000000000000): if digits(price).isdisjoint(D): 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...
s450434318
p04045
Accepted
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """042-c""" import sys def solve(dislike_digits_table, first_like_digit, N): """Solve.""" for i, _ in enumerate(N): c = N[i] while dislike_digits_table[int(c)]: if c == '9': if i == 0: return solve...
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...
s026895051
p04045
Accepted
import math a,b=(int(i) for i in input().split()) s=[int(i) for i in input().split()] n=[0,1,2,3,4,5,6,7,8,9] n1 = [val for val in n if val not in s] n1.sort() keta=int(math.log10(a) + 1) n_number=10-b aa=str(a) answer=[] OKANE1=0 OKANE2=0 OKANE3=0 OKANE4=0 OKANE5=0 for i in range(n_number+1): for j in range(n_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...
s837344789
p04045
Accepted
import sys N,K = list(map(int,input().split())) D = input().split() while True: breaked = False for i in range(len(str(N))): if str(N)[i] in D: breaked = True break if not(breaked): print(N) sys.exit() N += 1
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...
s464037232
p04045
Accepted
n, k = map(int, raw_input().strip().split()) l = map(int, raw_input().strip().split()) ls = [] for x in l: ls.append(str(x)) def has_string(ns): r = True for x in ls: if x not in ns: pass else: r = False return r while n < 100000: ns = str(n) if has_string(ns): print(ns) exit() else: n+=1
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...
s649714775
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) L = [i for i in range(10) if i not in D] A = [] for i in L: A.append(i) for i in L: for j in L: A.append(10*i+j) for i in L: for j in L: for k in L: A.append(100*i+10*j+k) for i in L: for j in L: for k in L: for l in L...
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...
s986285125
p04045
Accepted
from itertools import count def main(): N, K = map(int, input().split()) D_list = list(input().split()) for c in count(N): c = str(c) for d in D_list: if d in c: break else: print(c) return if __name__ == '__main__': main()...
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...
s043307632
p04045
Accepted
N, K = list(map(int, input().split(" "))) D = list(map(str, input().split(" "))) ans = N while(1): j = True for d in D: if d in str(ans): j = False break if j == True: break ans += 1 print(ans)
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...
s750636850
p04045
Accepted
nums = [int(x) for x in input().split()] N,K = nums[0],nums[1] D = set([int(x) for x in input().split()]) ans = N def solve(M): M = [int(x) for x in str(M)] for m in M: if m in D: return False return True while(1): if solve(ans): print(ans) break else: 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...
s844510754
p04045
Accepted
N, K = map(int, input().split()) D = list(map(str,input().split())) ans = N while sum([d in str(ans) for d in D]): 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...
s515963656
p04045
Accepted
a, _ = map(int, raw_input().split()) b = "".join(raw_input().split()) b = set(b) for i in xrange(a, 99999999): if b.isdisjoint(str(i)): print i break
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...
s566473380
p04045
Accepted
N,K = map(int, raw_input().split()) dislike = raw_input().split() like = [str(n) for n in range(10) if str(n) not in dislike] for n in range (N,100000): for d in str(n): if d in dislike: break else: print n break
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...
s292200461
p04045
Accepted
N, K = map(int, raw_input().split()) D = map(int, raw_input().split()) W = filter(lambda x: not x in D, range(10)) def dfs(x): if x >= N: return x return min([dfs(10*x + d) for d in W]) print min([dfs(i) for i in W if (i > 0)])
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...
s120728340
p04045
Accepted
def isValid(n,l): s = str(n) for c in s: if c in l: return False return True n,k = map(int, raw_input().split()) dls = raw_input().split() for i in range(n,100000): if isValid(i,dls): print i break
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...
s687109847
p04045
Accepted
# -*- coding: utf-8 -*- n,k = map(int,raw_input().split()) d = map(int,raw_input().split()) flg = 1 num = n-1 while(flg): num += 1 strnum = str(num) check = [strnum.find(str(i))+1 for i in d] flg = sum(check) 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...
s727651488
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) for i in range(N*10): n = str(N + i) ok = True for j in D: if n.find(str(j)) != -1: ok = False break if ok: 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...
s823272035
p04045
Accepted
import sys def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): N, K = map(int, input().split()) D = [str(i) for i in input().split()] ans = 0 for m in range(N, 10**6):...
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...
s440170617
p04045
Accepted
import itertools a=set([0,1,2,3,4,5,6,7,8,9]) n,_=map(int,input().split()) b=map(int,input().split()) l=len(str(n)) c=set(b)^a for i in range(l,l+2): for x in itertools.product(c,repeat=i): d=''.join(map(str,x)) if int(d)>=n:print(d);exit()
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...
s469971544
p04045
Accepted
from itertools import product N, K = [int(_) for _ in input().split()] D = set([int(_) for _ in input().split()]) valid = list(set(range(10)) - D) x = set() for r in range(1,6): for p in product(valid, repeat=r): x.add(int(''.join([str(i) for i in p]))) for n in sorted(x): if n >= N: 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...
s235004213
p04045
Accepted
n, k = map(int, input().split()) dislikes = list(map(int, input().split())) m = n while True: m = list(str(m)) l = [] for p in m: if int(p) not in dislikes: l.append(p) continue else: m = int(''.join(m))+1 break if len(l) >= 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...
s180779735
p04045
Accepted
def run_code(N, K, ds): dislike_digits_set = set(i for i in ds) avail_digits = [i for i in range(10) if i not in dislike_digits_set] avail_min = avail_digits[0] def get_next_digit(d): last = 10 for ad in (avail_digits + [last]): if ad >= d: if ad == last: ...
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...
s671202563
p04045
Accepted
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return list(map(int, input().split())) def II(): return int(input()) def LS(): return input().split() def S(): return input() def main(): n,k = LI() 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...
s063343244
p04045
Accepted
N, K = map(int, raw_input().split()) D = set(raw_input().split()) for i in xrange(N, 100000+1): if set(str(i)) & D == set(): print i exit()
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...
s431790064
p04045
Accepted
n,k=[int(i) for i in input().split()] d=[int(i) for i in input().split()] def check(num): for i in range(len(num)): for j in d: if int(num[i])==j: return False return True while(not check(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...
s618853722
p04045
Accepted
# coding: utf-8; def main(): num = [0,1,2,3,4,5,6,7,8,9] n, k = map(int, input().split()) d = list(map(int, input().split())) usable_num = list(set(num) - set(d)) while True: f = True for a in str(n): if int(a) not in usable_num: f = False ...
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...
s192324944
p04045
Accepted
# coding: utf-8; def main(): num = [0,1,2,3,4,5,6,7,8,9] n, k = map(int, input().split()) d = list(map(int, input().split())) usable_num = list(set(num) - set(d)) while True: if len(set(map(int, str(n))) - set(usable_num)) == 0: break else: n += 1 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...
s127921814
p04045
Accepted
from collections import defaultdict from itertools import combinations def func(i, d, now, use, st): if i >= d: st.append(now) return for x in use: func(i + 1, d, now + str(x), use, st) def solve(): n, k = map(int, input().split()) d = list(map(int, input().split())) us...
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...
s436959440
p04045
Accepted
n,k=map(int,raw_input().split()) d=set(map(int,raw_input().split())) chk=set([str(i) for i in range(10) if i not in d]) while 1: tmp=set(str(n)) if len(tmp&chk)==len(tmp): print n break n+=1
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...
s284598641
p04045
Accepted
n, k = map(int, input().split()) d = [int(i) for i in input().split()] ablenum = [int(i) for i in range(10)] lis_n = str(n) lis_n = list(lis_n) #print(lis_n) # 使用可能な数一覧 for i in d: ablenum.remove(i) #print(ablenum) flag_bigdigit = -1 # max(ablenum)より大きい桁があるかどうか for i in range(len(lis_n)): _i = len(lis_n) -...
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...
s789637562
p04045
Accepted
import sys N, K = map(int, sys.stdin.readline().split()) D = map(int, sys.stdin.readline().split()) for i in xrange(N * 10): if i >= N: temp = i isCorrect = True while temp > 0: if (temp % 10) in D: isCorrect = False break else: ...
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...
s661000810
p04045
Accepted
n,k=map(int,raw_input().split()) d=[i for i in raw_input().split()] while True: f=True for i in d: if i in str(n): f=False break if f: break n+=1 print(n)
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...
s901455089
p04045
Accepted
n,k=map(int,input().split()) d=[i for i in input().split()] while True: f=True for i in d: if i in str(n): f=False break if f: break n+=1 print(n)
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...