submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s909972478
p04045
Accepted
n, k = map(int, input().split()) d = set(map(str, input().split())) numbers = {str(i) for i in range(10)} available = numbers - d for i in range(n, 100000): nums = set(str(i)) if nums <= available: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s588043684
p04045
Accepted
from bisect import bisect_left from itertools import product N, K = map(int, input().split()) D = [int(i) for i in input().split()] ary = [] for n in range(10): if n not in D: ary.append(str(n)) l = [] for it in product(ary, repeat=len(str(N))): n = int(''.join(it)) l.append(n) if n > 10000: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s996768529
p04045
Accepted
def iroha(n): flag = False tmp = list(map(int, list(set(list(str(n)))))) for i in tmp: if D.count(i) != 0: return flag flag = True return flag N, K = map(int, input().split()) D = list(map(int, input().split())) while True: if iroha(N): 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...
s253173002
p04045
Accepted
N,K = map(int,input().split()) D = set(input().split()) while 1: E = set(str(N)) if not(D&E): print(N) break N+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s946955248
p04045
Accepted
N,K = map(int, input().split()) D = input().split() ans = N while True: tmp = str(ans) for t in tmp: if t in D: break else: break ans += 1 print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s675317576
p04045
Accepted
N ,K = map(int,input().split()) D = list(input()) now = N s = set(list(str(now))) d = set(D) while s & d != set(): now += 1 #print(now) s = set(list(str(now))) print(now)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s026883796
p04045
Accepted
import sys N,K,*vD=map(int,sys.stdin.buffer.read().split()) for x in range(N,10**5): if any(int(d) in vD for d in str(x)): continue print(x) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s328578676
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,1000000): f=1 for k in d: if str(k) in str(i): f=0 break if f: 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...
s397026552
p04045
Accepted
N,K = map(int,input().split()) D = list(input()) for i in range(N,10**5): si = str(i) f = True for digit in si: if digit in D: f = False continue if f: 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...
s007137992
p04045
Accepted
# 購入する数字N # 嫌いな数字の個数K N,K = map(int,input().split()) # 嫌いな数字をリストに入力 D = input().split() # Lから1づつ増やしていき、嫌いな数字が含まれていない事をチェックする # 最大計算量はNの10倍 # N=9999のときは、9999から99999まで計算すれば良い for n in range(N,10*N): # 数字nを一度文字列にする # setを使ってnとDを集合の要素にする # isdisjointは集合同士を比較して、 # 要素が1つもかぶらなければTrueを返す if set(str(n)).is...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s269368288
p04045
Accepted
a,b=map(int, input().split()) s = list(map(str,input().split())) num=int(a) D = set(s) numbers = {str(i) for i in range(10)} available = numbers - D for i in range(a,100000): nums = set(str(i)) if nums <= available: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s656450060
p04045
Accepted
N, K = [int(_) for _ in input().split()] D = [_ for _ in input().split()] # l = N, r = N * 10 for i in range(N, N * 10 + 1): if not any([s in D for s in str(i)]): print(i) exit() print('err')
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s457797619
p04045
Accepted
N, K = input().split() K = int(K) NL = list(map(int, N[::-1])) D = [int(_) for _ in input().split()] min_d = min([i for i in range(10) if i not in D]) mod_idx = -1 i = 0 while len(NL) > i: n = NL[i] for j in range(n, 10): if j in D: NL[i] += 1 mod_idx = i else: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s516582219
p04045
Accepted
N, K = map(int, input().split()) Dset = set(input().split()) while True: if Dset & set(str(N)) == set(): 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...
s956229945
p04045
Accepted
import sys def hantei(array,n): s = str(n) for i in range(len(s)): if int(s[i]) in array: return False return True n,k = map(int,input().split()) d = list(map(int,input().split())) while True: if hantei(d,n): print(n) sys.exit() n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s083932854
p04045
Accepted
import sys n,k=map(int,input().split()) d=list(input().split()) for i in range(n,100000): f=0 for j in d: if str(i).find(j) >= 0: break else: f+=1 if f == k: 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...
s542124859
p04045
Accepted
N, K = list(map(int, input().split())) D = list(map(int, input().split())) number = [i for i in range(10)] num_lis = list(set(number) - set(D)) ans=[] for i in range(N, 100000): a=i//10000 if bool((a not in D) or i <10000): b=i//1000 - 10*a if bool((b not in D) or i <1000): c=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...
s046386955
p04045
Accepted
n,k = map(int,input().split()) d = list(input().split()) ans = n while 1: a = str(ans) count = 0 for i in range(len(a)): if a[i:i+1] in d: count += 1 if count == 0: break else: 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...
s941254222
p04045
Accepted
N, _ = input().split(' ') N = int(N) dislikes = input().split(' ') while True: n_str = str(N) if not any([n in dislikes for n in n_str]): print(n_str) 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...
s411476721
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, input().split())) for i in range(N, 100000): if len(set(list(str(i))) & 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...
s691520559
p04045
Accepted
from sys import stdin n,k = [int(x) for x in stdin.readline().rstrip().split()] li = list(map(str,stdin.readline().rstrip().split())) for i in range(n,99999): yen = str(i) frag = 0 for j in yen: if j in li: frag = 1 if frag == 0: print(yen) 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...
s889599569
p04045
Accepted
import sys n, k = map(int, input().split()) d = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}-set(int(x) for x in input().split())) while True: ans = n while ans > 0: key = ans%10 if key in d: ans = ans//10 if ans == 0: print(n) sys.exit() continue else: break n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s763350703
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) while 1: hantei=0 for i in range(len(str(n))): #print(str(n)[i]) if int(str(n)[i]) in d: #1つでも嫌いな数字がある場合はその瞬間判定1にして次の数へ hantei=1 break if hantei==0: #嫌いな数字がない場合はその数字が正解なのでbreak 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...
s918433037
p04045
Accepted
NLinput = input() NLinput = [int(x) for x in NLinput.split()] N = NLinput[0] L = NLinput[1] input_D = input() D_list = set([int(x) for x in input_D.split()]) bill = N flag = True while flag: temp = set([int(x) for x in list(str(bill))]) if len(list(temp&D_list))==0: flag = False else: bil...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s087356770
p04045
Accepted
import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 input=lambda :sys.stdin.readline().rstrip() def resolve(): n,k=map(int,input().split()) D=set(map(int,input().split())) for i in range(n,100000): flag=True for s in str(i): if(int(s) in D): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s490085596
p04045
Accepted
N, K = list(map(int, input().split())) D = input().split() while True: if set(str(N)) & set(D) == set(): 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...
s964340348
p04045
Accepted
n, k = map(int,input().split()) d = set(input().split()) while len(d.intersection(set(list(str(n)))))>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...
s547488461
p04045
Accepted
n, k = map(int, input().split()) l=set(input().split()) while True: if set(str(n)) & l == set(): 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...
s330322138
p04045
Accepted
n,k=map(int,input().split()) L = set(input().split()) while True: if set(str(n)) & L == set(): 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...
s594427717
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) for i in range(n,100001): i=str(i) for j in i: if j in set(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...
s539916196
p04045
Accepted
n, k = list(map(int, input().split())) d = set(map(int, input().split())) while(True): if(not({int(c) for c in 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...
s316222638
p04045
Accepted
import sys input = sys.stdin.readline #str 注意 def main(): n,k = map(int,input().split()) d = [x for x in input().split()] d = set(d) while 1: if len(set(list(str(n))) & d)==0: print(n) exit() else: n +=1 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...
s140723501
p04045
Accepted
nums = input().split() s_N = str(nums[0]) i_N = int(nums[0]) K = int(nums[1]) nums2 = input().split() count = 0 while count < K: #x=嫌いな数候補 x = nums2[count] if x in s_N: i_N += 1 s_N = str(i_N) count = 0 else: count += 1 print(s_N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s044282904
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) i=n while True: h=list(str(i)) for u in h: if u in d: break else: 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...
s140430550
p04045
Accepted
#!/usr/bin/env python3 import sys, math, itertools, heapq, collections, bisect, fractions input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') sys.setrecursionlimit(10**8) inf = float('inf') ans = count = 0 n,k=map(int,input().split()) D=set(input().split()) while True: ns=str(n) for ni in ns: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s461030559
p04045
Accepted
N,K=map(int,input().split()) D=input().split() while 1: strN=str(N) flag=0 for n in range(len(strN)): if strN[n] in D: flag=1 break if flag: N+=1 else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s714055318
p04045
Accepted
import string n,k =[int(i) for i in input().split()] not_use=[int(i) for i in input().split()] use=[int(i) for i in string.digits if int(i) not in not_use] def check(n): for i in str(n): if(int(i) in not_use): return False return True x=n-1 while True: x+=1 if(check(x)==True): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s374484657
p04045
Accepted
NK=input().split() N=int(NK[0]) K=int(NK[1]) D=input().split() while (True): flag=0 for i in range(K): if(D[i] in str(N)): flag=1 if(flag==0): 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...
s940675311
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) for i in range(N*10): if i >= N: s = str(i) for j in s: if int(j) in D: break else: print(s) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s008723000
p04045
Accepted
import bisect N,K = map(int,input().split()) N = [int(n) for n in str(N)] D = set(map(int,input().split())) nums = [] for i in range(10): if i not in D:nums.append(i) nums.sort() i = len(N)-1 while i>=0: if N[i] not in nums: if nums[-1] < N[i]: prv_len = len(N) tmp_N = [int(s) for s in str(int(''....
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s558756580
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) def solve(): for i in range(10*N): if i >= N: s = str(i) for j in range(len(s)): if int(s[j]) in D: break else: print(i) return 0 solve()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s365968859
p04045
Accepted
n,k=map(int,input().split()) D=list(map(int,input().split())) L=D for i in range(9*n): for s in str(n+i): if int(s) in D: break else: print(n+i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s079914307
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...
s401319124
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) for i in range(N,100000): j=0 si=list(str(i)) for k in si: if int(k) in D: j=1 if j==0: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s326046026
p04045
Accepted
N,K = map(int,input().split()) D = set(map(int,input().split())) ans = N while(True): if any([i in D for i in list(map(int,str(ans)))]): ans += 1 else: 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...
s200833116
p04045
Accepted
n,k = map(int, input().split()) d = list(input().split()) ans = n while True: flag = False a = list(str(ans)) for dx in d: if dx in a: flag = True if flag: ans +=1 else: 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...
s786905631
p04045
Accepted
def main(): N, K = map(int, input().split()) D = list(str(x) for x in input().split()) while True: strN = str(N) flg = 0 for i in strN: if i in D: flg = 1 if flg == 0: print(N) break else: N += 1 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s160030490
p04045
Accepted
N, K = map(int, input().split()) li_n = list(map(int, input().split())) for i in range(N, 100000): if len(set(li_n)&set([int(y) for y in str(i)])) == 0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s654906543
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) while True: l = list(str(N)) for x in l: if x in D: N += 1 break else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s037948623
p04045
Accepted
N,K = [int(i) for i in input().split()] #D = [int(i) for i in input().split()]は数値代入 #文字列を複数代入 D = input().split() #集合に置き換える(型はset) D = set(D) use = set(['0','1','2','3','4','5','6','7','8','9']) use -= D for i in range(N,88889): if use >= set(str(i)): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s605143348
p04045
Accepted
N,K = [int(i) for i in input().split()] #D = [int(i) for i in input().split()]は数値代入 #文字列を複数代入 D = input().split() #集合に置き換える(型はset) D = set(D) use = set(['0','1','2','3','4','5','6','7','8','9']) use -= D for i in range(N,100*N): if use >= set(str(i)): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s068895118
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) x=list(range(1,100000)[::-1]) for i in d: a=[] for j in x: if i not in str(j): a.append(j) x=a import bisect as bi x=x[::-1] print(x[bi.bisect_left(x,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...
s952926367
p04045
Accepted
N, K = map(int, input().split()) D = set(map(int, input().split())) safe = set(range(10)) - D def test(N): return set((int(x) for x in str(N))) <= safe def F(N): while N % 10: if test(N): return N N += 1 N //= 10 x = F(N) y = min(safe) return 10 * x + y answer = F(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s572588784
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) while True: l = list(str(N)) for x in l: if x in D: N += 1 break else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s175966932
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n, 100001): flag = True for j in str(i): if j in d: flag = False 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...
s963192794
p04045
Accepted
#!/usr/bin/env python3 from collections import defaultdict import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline n, k = [int(item) for item in input().split()] d = [item for item in input().split()] for i in range(n, n+10**5): si = str(i) ok = True for item in d: if item in si: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s019337513
p04045
Accepted
# すべてを str型として読み込み、Kのみ int型に変換 N, Kstr = map(str, input().split()) # N: 元の数, K: NG数の数 K = int(Kstr) D = list(map(str, input().split())) # D: NG数のリスト # N = str(1000) # K = 8 # D = ('1', '3', '4', '5', '6', '7', '8', '9') def getMinimumOK(): # NGではない最小の数字を求める for i in range(0, 9): for j in range(1, K): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s228270189
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,input().split())) for h in range(N,100001): c = True for e in str(h): if e in D: c = False if c: print(h) 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...
s532338639
p04045
Accepted
N, K = map(int, input().split()) DL = list(map(int, input().split())) Dlist = [1,1,1,1,1,1,1,1,1,1] for i in range(len(DL)): Dlist[DL[i]]=0 while True: f = True Nx = str(N) for i in range(len(Nx)): if Dlist[int(Nx[i])] == 0: f = False if f: 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...
s707097911
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) flg = 0 flg2 = 0 while flg == 0: for i in range(len(str(n))): flg2 = 0 if int(str(n)[i]) in d: flg2 = 1 n += 1 break if flg2 == 0: flg = 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...
s225481149
p04045
Accepted
n,k = map(int,input().split()) D = list(map(int,input().split())) ans = n while True: if any( [x in D for x in list(map(int,str(ans)))] ): ans += 1 else: 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...
s378521550
p04045
Accepted
min = list(map(int,input().split()))[0] min = int(min) l = list(map(int,input().split())) while True: temp = min flag = True for i in range(len(str(min))): temp_ = temp % 10 if temp_ in l: min += 1 flag = False break else: temp //= 10 if i == len(str(min))-1 and flag: bre...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s496115702
p04045
Accepted
N,K = map(int,input().split()) Data = list(map(int,input().split())) def check(n): while n > 0: if n % 10 in Data: return False n //= 10 return True while True: if check(N): break N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s026740915
p04045
Accepted
cnt=[0,1,2,3,4,5,6,7,8,9] n,k=map(int,input().split()) d=list(map(int,input().split())) tmp=[] for i in range(k): cnt.remove(d[i]) def digit(x): xt=str(x) for i in range(len(xt)): if not int(xt[i]) in cnt: return False return True t=n while t>=n: if digit(t): print(t) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s309893103
p04045
Accepted
total, k = map(int, input().split()) ds = list(input().split()) for i in range(total,total*10+2): for d in ds: if d in list(str(i)): break else: print(i) 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...
s344246961
p04045
Accepted
total, k = map(int, input().split()) ds = list(input().split()) ans = total while True: flag = False for d in ds: if d in list(str(ans)): flag = True if flag: ans += 1 else: print(ans) 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...
s272592623
p04045
Accepted
def examC(): import bisect N, K = LI() D = list(map(str,input().split())) ansC = [] for i in range(100001): cur = str(i) k = 1 for s in cur: if s in D: k = 0 break if k==1: ansC.append(i) # print(ansC) k =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s061804694
p04045
Accepted
# coding: utf-8 # Your code here! N,K=map(int,input().split()) D=list(map(int,input().split())) temp=[] for i in range(10): if D.count(i)==0: temp.append(i) D=temp[:] preK=0 K=10-K opt=D[:] ans=10**18 for item in opt: if item>=N: ans=min(ans,item) for t in range(5): for d in D: f...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s839443693
p04045
Accepted
# python3 (3.4.3) import sys input = sys.stdin.readline # main N,K = map(int,input().split()) D = set(input().split()) for i in range(N,N*10+1): if not D&set(str(i)): break print(i)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s400265985
p04045
Accepted
N,K=map(int,input().split()) D=sorted(list(map(int,input().split()))) ans=0 L=[i for i in range(10) if i not in D] for i in range(N,10*N+1): I=[int(j) for j in list(str(i))] cnt=0 for j in I: if j not in L: break else: cnt+=1 if cnt==len(I): ans=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...
s705852185
p04045
Accepted
n, k = map(int,input().split()) x = n d = set(map(str,input().split())) can_use = {str(i) for i in range(10)} ^ d s_can_use = sorted(list(can_use)) for i in range(10**6): if set(list(str(x))) | can_use == can_use: print(n) break else: n += 1 x = 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...
s809555253
p04045
Accepted
n, k = map(int,input().split()) x = n d = set(map(str,input().split())) can_use = {str(i) for i in range(10)} ^ d s_can_use = sorted(list(can_use)) ''' for i in range(9): if set(list(str(x))) | can_use == can_use: print(n) break else: if s_can_use[0] == 0: ''' for i in range(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...
s383290511
p04045
Accepted
n, k = map(int, input().split()) D = set(input().split()) use = set(map(str, range(10))) use -= D for num in range(n, 100*n): if use >= set(list(str(num))): print(num) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s708702555
p04045
Accepted
n, k = map(int, input().split()) D = set(input().split()) use = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} use -= D use = list(use) l = len(str(n)) ans = use.copy() prev = use.copy() digit = 0 while digit <= l: temp = [] for x in prev: for v in use: temp.append(x+v) ans += 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...
s578636337
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) while True: l = [int(x) for x in str(N)] for e in l: if e in D: N += 1 break 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...
s271687269
p04045
Accepted
n,k=map(int,input().split()) d=set(list(map(int,input().split()))) def checkIfOk(num): while True: if num%10 in d: return False else: num=num//10 if num==0: return True while True: if checkIfOk(n): print(n) break n+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s645621324
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) ans = N - 1 while True: ans += 1 str_ans = list(map(int, str(ans))) ans_len = len(str(ans)) ans_check = 0 for i in range(ans_len): if str_ans[i] not in D: ans_check += 1 if ans_len == ans_check: 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...
s339516171
p04045
Accepted
n,k = [int(i) for i in input().split()] all_num = {'0','1','2','3','4','5','6','7','8','9'} l = all_num - {i for i in input().split()} for i in range(n,n*20): if not set(str(i)) - l: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s915507667
p04045
Accepted
import itertools N,K=map(int,input().split()) D=set(list(map(str,input().split()))) U=list({'0','1','2','3','4','5','6','7','8','9'}^D) U.sort() PRD1 = list(itertools.product(U, repeat=len(str(N)))) PRD2 = list(itertools.product(U, repeat=len(str(N))+1)) import sys for i in range(len(PRD1)): T=int(''.join(PRD1[i]...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s518687875
p04045
Accepted
# coding: utf-8 N, K = map(int, input().split()) D = list(map(str, input().split())) for tmp in range(N, 10*N+1): tmp_l = list(str(tmp)) cnt = 0 for t in tmp_l: if t in D: cnt += 1 if cnt == 0 and int(tmp) >= N: print(tmp) 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...
s307214067
p04045
Accepted
ns,k = input().split() nlist = set(input().split()) nslist = set(list(ns)) while nslist & nlist: ns = int(ns)+1 ns = str(ns) nslist = set(list(ns)) print(ns)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s966643733
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,input().split())) ans = 0 for j in range(N,10*N+1): f = True for k in D: if str(k) in str(j): f = False break if f: ans = j break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s805675295
p04045
Accepted
line=input().split() N=int(line[0]) K=int(line[1]) D=input().rstrip().split() for i in range(N,10*N+1): s=str(i) flag=True for x in D: if x in s: flag=False break if flag: print(s) break else: continue
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s877154062
p04045
Accepted
from sys import stdin def main(): lines = stdin.readlines() N = int(lines[0].split()[0]) Dk = lines[1].split() for i in range(N, 10 * N): for D in Dk: if D in str(i): break else: print(i) break return main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s303836398
p04045
Accepted
N,K=map(int,input().split()) D=input().split() r=N while True: if not any([c in D for c in 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...
s585463024
p04045
Accepted
#042c slow N,K = map(int, input().split()) D_set = set([int(e) for e in input().split()]) INF = 9999999999 OK_D = {0,1,2,3,4,5,6,7,8,9} - D_set OK_D_list = list(OK_D) OK_D_list.sort ans = [] pay = 0 def dfs(pos,pay): #print("#####################") #print(pay) #停止条件 #深さに限らず,任意の停止条件を書く if p...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s373833767
p04045
Accepted
import itertools N,K = map(int,input().split()) D = list(map(int,input().split())) A = [] for i in range(10): if i not in D: A.append(i) cmin = 100000 k = len(str(N)) for i in range(k,6): for x in itertools.product(A,repeat=i): cnt = 0 for j in range(i): cnt += x[j]*10**(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...
s805935525
p04045
Accepted
import string import sys N,K=[int(i) for i in input().split()] D=[int(i) for i in input().split()] use=[int(i) for i in string.digits if int(i) not in D] def check(use,x): for i in str(x): if(int(i) not in use): return False return x i=N-1 while True: i+=1 x=check(use,i) if(x!...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s678013944
p04045
Accepted
""" author : dokueki 1000 8 1 3 4 5 6 7 8 9 """ def check(x,arr): c=0 s = [int(i) for i in str(x)] for i in s: if i in arr: c+=1 if c==len(s): return True return False n, k = map(int, input().split()) a = list(map(int, input().split())) use,f = [],0 for i in range(0, 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...
s169042322
p04045
Accepted
N, K = map(int,input().split()) D = list(map(int,input().split())) a = 10 b = 10 c = 10 d = 10 e = 10 ans = 100000 for i in range(N,100000): if i >= 10000: a = i//10000 if i >= 1000: b = (i//1000)%10 if i >= 100: c = (i//100)%10 if i >= 10: d = (i//10)%10 e = i%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...
s138839675
p04045
Accepted
n,k= map(int, input().split()) d= list(input().split()) for i in range(n,10*n+1): x=str(i) ans=True for j in range(len(x)): if x[j] in d: ans=False if ans: 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...
s175920422
p04045
Accepted
n,k= map(int, input().split()) d= list(input().split()) for i in range(n,10*n+1): x=str(i) ans=True for j in range(len(x)): if x[j] in d: ans=False if ans: 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...
s848339530
p04045
Accepted
#!/usr/bin/env python3 import sys def solve(N: int, K: int, D: "List[int]"): while True: for d in D: strn=str(N) if str(d) in strn: break else: print(N) return N+=1 return def main(): def iterate_tokens(): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s976969959
p04045
Accepted
# -*-coding: utf-8 -*- #金額と個数の入力 sum,num = map(int,input().split()) #嫌いな数字の入力 dis = list(map(int,input().split())) pay = sum while True: flag = 0; str_pay = str(pay) for i in str_pay: if int(i) in dis: flag = 1 break if flag == 0: break else: pay = pay + 1 print(pay)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s859968388
p04045
Accepted
n, k = map(int, input().split()) d = list(input().split()) while 1: if all(dd not in str(n) for dd in d): print(n) break n = n+1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s283265605
p04045
Accepted
n, k = list(map(int,(input().split(' ')))) d = set(list(map(int,(input().split(' '))))) l = set(list(range(0,10))) like = l -d #print(like) #print(list(map(int,(str(10001))))) for i in range(n,100001): #print(i) if like >= set(list(map(int,(str(i))))): # print(list(like),list(map(int,(str(i))))) #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...
s814624324
p04045
Accepted
N,K=map(int,input().split()) D=list(input().split()) for i in range(N,10*N+1): s=str(i) flag=True for x in D: if x in s: flag=False break if flag: print(s) break else: continue
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s969266203
p04045
Accepted
#こだわりイロハちゃん n,k=map(int,input().split()) lists=list(map(int,input().split())) uselist=[] for i in range(k): uselist.append(str(lists[i])) flag=True flag2=True ans=str(n) while flag2: for i in range(len(ans)): if ans[i] in uselist: flag=False 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...
s250805284
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) use_list = [] for i in range(10): if i not in d: use_list.append(str(i)) for a in use_list: if int(a) >= n: print(int(a)) exit() for a in use_list: for b in use_list: if int(a+b) >= n: print(i...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s359273057
p04045
Accepted
tg = int(input().split(' ')[0]) target_int = set(list( str(tg) )) deny_int= set(input().split(' ')) while target_int - deny_int != target_int: tg= tg+1 target_int = set(list(str(tg))) print(tg)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...