submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s189807609
p04045
Accepted
N, K = map(int, input().split()) D = input().split() for n in range(N, 100000): if all(d not in str(n) for d in D): 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...
s399456607
p04045
Accepted
N, K = map(int, input().split()) D = [str(i) for i in input().split()] search = True while search: for i in str(N): if not i in D: search = False continue N += 1 search = True break print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s129518135
p04045
Accepted
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0 # abcde s=input() s='abcde' # abcde s=list(input()) s=['a', 'b', 'c', 'd', 'e'] # 5(1つだけ) a=int(input()) a=5 # 1 2 | x,y = s_inpl() | x=1,y=2 # 1 2 3 4 5 ... n   li = input().split() li=['1','2','3',...,'n'] # 1 2 3 4 5 ... n   li = inpl() li=[1,2,3,4,5,...,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...
s290803596
p04045
Accepted
# coding: UTF-8 N, _ = input().split() N = int(N) dislike_nums = input().split() def contains_dislike_number(num): for n in dislike_nums: if n in str(i): return True return False for i in range(N, 10*N+1): if not contains_dislike_number(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...
s937489161
p04045
Accepted
n,k = map(int,input().split()) d = set(input()) while len(set(str(n))&d): n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s736814111
p04045
Accepted
n,k = map(int,input().split()) D = list(input().split()) while True: if any (d in str(n) for d in D): 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...
s669995053
p04045
Accepted
#!/usr/bin/env python3.4 # -*- coding: utf-8 -*- # arc058_a # input N, K = map(int, input().split()) D = input().split() # getans def is_in_d(s): for d in D: if d in s: return True return False for i in range(100000): ans = str(N+i) if not is_in_d(ans): break # output 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...
s274464992
p04045
Accepted
n , a = map(int, input().split()) X = list(map(int, input().split())) def detecter(n): A = list(str(n)) for i in A: if(int(i) in X): return False return True while(not(detecter(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...
s208058595
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) for i in range(N,100000): Ai=str(i) if all((str(j) not in Ai)for j in D): 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...
s423556133
p04045
Accepted
n,k = map(int,input().split()) D = set([int(d) for d in input().split()]) num = set([0,1,2,3,4,5,6,7,8,9]) D = list(num - D) D.sort(reverse=True) _ = 10**7 def abcC(x, ans): if len(x) == len(str(n))+3: return ans if n <= int(x) < ans: ans = int(x) elif n > int(x): for i 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...
s258537835
p04045
Accepted
n, k = map(int, input().split()) #d = list(map(int, input().split())) d = input().split() while 1: temp = list(str(n)) for c in d: #print(c, temp) if c in temp: #print('a') break else: print(n) exit() n += 1 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...
s688569923
p04045
Accepted
#ABC042C N,K=map(int,input().split()) D=list(map(int,input().split())) E=[0]*10 for d in D: E[d]=1 while(1): for n in str(N): if E[int(n)]==1: 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...
s799480785
p04045
Accepted
n, k = map(int, input().split()) list = list(map(int, input().split())) def valid(x): while x: if (x % 10) in list: return 0 x //= 10 return 1 cur = n while True: if valid(cur): break cur += 1 print(cur)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s413219879
p04045
Accepted
n,k=input().split() n=int(n) k = int(k) bl=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] L = [int(x) for x in input().split()] for i in L: x = int(i) bl[x]=1 while True: s = str(n) flag=0 for i in s: if bl[int(i)]==1: n = n + 1 flag = 1 break if flag == 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...
s905013228
p04045
Accepted
n,k = map(int, input().split()) s = input().split() t = 1 for i in range(10 * n): n2 = list(str(n)) for j in range(len(n2)): if s.count(n2[j]) == 1: n = n + 1 t = 0 break if t == 1: break else: t = 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...
s408150628
p04045
Accepted
n=int(input().split()[0]);a=set(input()) while a&set(str(n)):n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s301029019
p04045
Accepted
import sys N, K = map(int, input().split()) D = list(input().split()) D = set(D) for i in range(N, 100 * N): if D & set(str(i)): continue else: 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...
s491030703
p04045
Accepted
N,K = map(int,input().split()) D = [str(i) for i in input().split()] #print(D) #print(list(str(N))) while 1: check = True for i in D: if i in list(str(N)): check = False break if check: 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...
s468859311
p04045
Accepted
n,k=map(int,input().split()) d=set(input().split()) while len(d&set(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...
s810772020
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) a=[] for i in range(10): sum=0 for x in d: if x==i: break else: sum+=1 if sum==k: a.append(i) a=set(a) for i in range(n,10*n+1): b=[] x=len(str(i)) y=str(i) for j in range(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...
s775731074
p04045
Accepted
l=[str(x) for x in range(100000)] n,k=map(int,input().split()) l2=list(map(str,input().split())) ind=l.index(str(n)) while True: a=l[ind] f=False for x in l2: if x in a: f=True if not f: break ind+=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...
s633192269
p04045
Accepted
n,l = map(int,input().split()) x = [ int(i) for i in input().split() ] a = [ 0 for i in range(10) ] for i in x: a[i] = 1 def check(n): s = str(n) for i in s: if a[int(i)] == 1: return False return True while check(n) == False: 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...
s594697653
p04045
Accepted
n,k = map(int,input().split()) d = list(input().split()) while True: flag = True for i in range(len(str(n))): if str(n)[i] in d: flag = False if flag: print(n) exit() 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...
s461048771
p04045
Accepted
import sys N,K = [int(n) for n in input().split()] D = set([str(n) for n in input().split()]) # OK = sorted(list(set([0,1,2,3,4,5,6,7,8,9]) - D)) for i in range(N,100001): stri = set(list(str(i))) find = True for d in D: if d in stri: find = False break if find: 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...
s217336624
p04045
Accepted
n, k = map(int, input().split()) A = set([int(i) for i in input().split()]) num = set([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) - A for i in range(n, n * 10 + 1): for j in list(str(i)): if int(j) not in num: 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...
s582380423
p04045
Accepted
price, n = [int(i) for i in input().split(' ')] exclude_nums = [int(i) for i in input().split(' ')] nums = set([i for i in range(0,10)]) for num in exclude_nums: nums.discard(num) while True: safe = True for num in str(price): if int(num) in nums: pass else: price ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s887898893
p04045
Accepted
N,K=map(int,input().split()) D=set(input().split()) while len(D&set(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...
s597560947
p04045
Accepted
n,k=[int(i) for i in input().split()] d=[i for i in input().split()] num=[i for i in range(1,10) if (i in d)==False] def check(number): s=str(number) result=True for i in range(len(s)): if s[i] in d: result=False return result if check(n): print(n) else: while True: 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...
s552524474
p04045
Accepted
#!usr/bin/env python3 from collections import defaultdict from heapq import heappush, heappop import sys import math import bisect import random def LI(): return list(map(int, sys.stdin.readline().split())) def I(): return int(sys.stdin.readline()) def LS(): return list(map(list, sys.stdin.readline().split())) def 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...
s175966376
p04045
Accepted
N,K = map(int, input().split()) D = list(map(int, input().split())) CANUSE = [x for x in filter(lambda x: not x in D, range(0,10))] candidates = [] q = [("")] # print(CANUSE) while q: s = q.pop() if len(s) >= 6: continue if ( int(s) if s != "" else 0 ) >= N: candidates.append(int(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...
s668781958
p04045
Accepted
def validate(n, d: set) -> bool: while n > 0: # print(n) r = n%10 if r in d: return False n //= 10 return True def solve(n, d): d = set(d) for i in range(n, 10**6): if validate(i, d): return i return -1 def main(): n, k = map(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...
s194813515
p04045
Accepted
N, _ = map(int, input().split()) D = list(map(int, input().split())) E = [str(i) for i in [0,1,2,3,4,5,6,7,8,9] if i not in D] E while not all(n in E for n in str(N)): N+=1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s677333387
p04045
Accepted
BASE, N = map(int, input().split()) NGs = input().split() def solve(): def is_valid(num): s_num = str(num) for ng in NGs: if s_num.count(ng): return False return True # print(BASE, N) # print(NGs) num = BASE while not is_valid(num): 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...
s495217072
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) x=0 p=n while x==0: q=list(str(p)) x=1 for y in q: if y in d: p+=1 x=0 break print(p)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s578816511
p04045
Accepted
N, K = map(int,input().split()) D = input().split() while True: for n in str(N): if(n in D): break else: 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...
s070826995
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) M = N while 1: flag = False for x in str(M): if int(x) in D: flag = True break if flag == True: M += 1 else: print(M) 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...
s362568877
p04045
Accepted
import itertools N, M = map(int, input().split()) L = list(map(str, input().split())) tmp = [0 for _ in range(10)] seq = [] for i in range(10 ** 5): tmp = str(i) flag = True for j in range(len(tmp)): if tmp[j] in L: flag = False if i >= N and flag == True: res = 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...
s001585308
p04045
Accepted
n, k = map(int, input().split()) d = list(input()) b = any(i in str(n) for i in d) while b == 1: n += 1 b = any(i in str(n) for i in d) 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...
s999004719
p04045
Accepted
n,k=map(int,input().split()) D=list(map(int,input().split())) nums=[i for i in range(10) if i not in D] def str_check(string): string=str(string) for i in string: if int(i) not in nums: return False return True for i in range(1,100000): if str_check(i)==True and n<=i: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s996997851
p04045
Accepted
# -*- coding: utf-8 -*- def main(): n, k = map(int, input().split()) d = list(map(int, input().split())) like_numbers = [i for i in range(10) if i not in d] digit_count = len(list(map(str, list(str(n))))) digit = [0] * digit_count ans = list() def dfs(count): if count == digit_cou...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s933234914
p04045
Accepted
import itertools def main(): n, _ = map(int, input().split()) d = [int(s) for s in input().split()] p = [i not in d for i in range(10)] print(solve(n, p)) def solve(n, p): def check(i): if i == 0: return True if not p[i % 10]: return False return ch...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s373107406
p04045
Accepted
#coding:utf-8 # O(Dlogn)解法? N,K=map(int, raw_input().split(" ")) D=map(int, raw_input().split(" ")) keta=len(str(N)) strN=str(N) ans1="" for x in range(keta-1): p=int(strN[keta-x-1]) d=0 for dd in range(10): if dd not in D: d=dd break ans1=str(d)+ans1 candidate=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...
s193983926
p04045
Accepted
def contains_digit(n: int, d: set): flag = False while n > 0: flag = flag or (n % 10 in d) n //= 10 return flag N, K = map(int, input().split()) D = set(list(map(int, input().split()))) for i in range(N, N*10): if not contains_digit(i, D): 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...
s170358664
p04045
Accepted
price, num = input().split(" ") dislike = input().split(" ") for i in range(int(price), 100000): if set(dislike) & set(str(i)): continue else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s420849260
p04045
Accepted
n,k=map(int, input().split()) d_set=set(map(int, input().split())) for i in range(n, 100000): if bool(set([int(x) for x in str(n)]) & d_set ) is False: 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...
s300521149
p04045
Accepted
n=input()[:-2] s=sorted(set(range(10))-set(map(int,input().split()))) s=[str(i)for i in s] if all(i in s for i in n): print(n) exit() f=0 t='' for i in n: if f: t+=s[0] elif i in s: t+=i else: for j in s: if int(j)>int(i): t+=str(j) f=1 break else: break els...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s484812280
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) i = N while True: flg = True for j in str(i): if int(j) in D: flg = False break if flg == True: print(i) exit() i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s595675351
p04045
Accepted
N,K = map(int,input().split()) D = {int(n) for n in input().split()} for j in range(N,N*10): if N <= j: L = {int(result) for result in str(j)} if D.isdisjoint(L): D_love = j break print(D_love)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s568378311
p04045
Accepted
N,K =map(int,input().split()) D =[i for i in input().split()] s =True while True: Ns =str(N) for i in D: if i in Ns: s =False if not s: s =True 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...
s371577606
p04045
Accepted
D, K = map(int, input().split()) S = set(input().split()) while any((c in S) for c in str(D)): D += 1 print(D)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s558390075
p04045
Accepted
def foo(D, S): while any((c in S) for c in str(D)): D += 1 return D D, K = map(int, input().split()) S = set(map(str, input().split())) print(foo(D, 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...
s515355254
p04045
Accepted
n, k = map(int, input().split()) A = list(input().split()) for i in range(n * 10): for j in str(n + i): if j in A: break else: print(n + 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...
s772362142
p04045
Accepted
N, K = map(int, input().split()) D = input().split() def isok(yen, D): flag = True for y in yen: if y in D: flag = False break return flag while True: if isok(str(N), D): 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...
s538721266
p04045
Accepted
n, k = map(int, input().split()) A = list(input().split()) for i in range(10 * n): for a in A: if a in str(n + i): break else: ans = n + 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...
s768502161
p04045
Accepted
N, K = map(int, input().split()) Hate = list(map(int, input().split())) D = [d for d in range(10) if d not in Hate] D0 = D[:] if 0 not in D: D0.insert(0, 0) for d4 in D0: for d3 in D0: for d2 in D0: for d1 in D0: for d0 in D: M = 10000 * d4 + 1000 * d3 + 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...
s106784413
p04045
Accepted
N, K = map(int, input().split()) de_num = list(map(int, input().split())) ok_num = [] cand_num = [] ans_num = [] #print(de_num) for i in range(10): if i not in de_num: ok_num.append(i) #print(ok_num) for i in ok_num: for j in ok_num: for k in ok_num: for l in ok_num: for m in ok_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...
s079848467
p04045
Accepted
n,k = (int(i) for i in input().split()) d = list(int(i) for i in input().split()) def ketajudge(x): while x != 0: if x%10 in d: return False break else: if x//10 == 0: return True break x = x//10 for i in range(10*n): judge = n+i if ketajudge(judge) == 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...
s737478466
p04045
Accepted
from itertools import product as p n,k=map(int,input().split()) *d,=map(int,input().split()) cd={i for i in range(10)}-set(d) *a,=filter(lambda x:x>=n,sorted([int("".join(map(str,i))) for i in p(cd,repeat=1)])) *b,=filter(lambda x:x>=n,sorted([int("".join(map(str,i))) for i in p(cd,repeat=2)])) *c,=filter(lambda x: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...
s253817260
p04045
Accepted
N,K=map(int,input().split()) D=set(input()) while sum(i in D for i in 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...
s464213871
p04045
Accepted
def dfs(x): if x > N * 10: return if x >= N: cand.append(x) for y in not_dislike: dfs(x*10 + y) N, K = map(int, input().split()) D = set(int(x) for x in input().split()) not_dislike = set(range(10)) - D cand = [] for x in not_dislike-set([0]): dfs(x) print(min(cand, key=lambda ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s025549365
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) for i in range(N, N*10): for j in map(str, D): if j in list(str(i)): 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...
s501154480
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) for i in range(N, N*10): for j in D: if j in list(str(i)): break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s841130144
p04045
Accepted
n=int(input().split()[0]) d=input().split() while True: v=True for i in str(n): if i in d: v=False break if v: 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...
s676311593
p04045
Accepted
price, amount = map(int, input().split()) hate_set = set(input().split()) while True: price_set = set([ a for a in str(price)]) if hate_set & price_set == set(): break else: price += 1 print(price)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s623361867
p04045
Accepted
N,K=map(int,input().split()) hate = input().split() def check(number,hate): for i in range(K): if str(number).count(hate[i])!=0:return False return True number=N while not check(number,hate): number+=1 print(number)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s043738683
p04045
Accepted
N, K = map(int,input().split()) L = list(map(int,input().split())) for i in range(N,100000): flag = 0 for x in str(i): if int(x) in L: flag = 1 if flag == 0: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s736358032
p04045
Accepted
N, K = map(int, input().split()) D = list(input()) flag = True while flag: flag = False tmp = str(N) for d in D: if d in tmp: N += 1 flag = True break print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s309238193
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) for i in range(n,100000): for j in list(str(i).replace(""," ").split()): if j in d: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s466940646
p04045
Accepted
N,K = map(int,input().split()) dislike = [i for i in input().split()] for num in range(N,10**6): ok = True for s in str(num): if s in dislike: ok = False if ok : print(num) 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...
s498013804
p04045
Accepted
n, k = map(int, input().split()) a = input().split() d = [int(m) for m in a] aset = set(a) i = n while True: k = list(str(i)) klen = len(k) for j in range(klen): if k[j] in aset: i += 10 ** (klen - j - 1) i -= i % (10 ** (klen - j - 1)) break else: pri...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s864650522
p04045
Accepted
N, K = map(int, input().strip().split()) setD = set(input().strip().split()) for i in range(N, 100000): if not setD.intersection(set([c for c in 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...
s346004348
p04045
Accepted
n,k=input().split() n=int(n) k=int(k) d=input().split() d=list(map(int,d)) a=[0]*10 flag=True for i in d: a[i]+=1 while 1: flag=True tmp=n while tmp!=0: if(a[tmp%10]!=0): flag=False n+=1 break tmp//=10 if flag==True: print(n) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s436177929
p04045
Accepted
n, k = [int(x) for x in input().split()] d = set([x for x in input().split()]) while len(set(str(n)) & d): n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s044260342
p04045
Accepted
N,K = map(int,input().split()) D = set(input().split()) for i in range(N,100000): # 禁止文字との共通集合がなければ良い 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...
s424594026
p04045
Accepted
n, k = map(int, input().split()) like = list(map(str, set(range(10)) - set(map(int, input().split())))) while True: count = 0 for c in str(n): if c in like: count += 1 if count == len(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...
s225873593
p04045
Accepted
n, k = map(int, input().split()) d = input().split() for r in range(n, n*10): s = "{}".format(r) for x in d: if x in s: break #for else構文 for 文が全て終わった時に実行される else: print(r) 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...
s372948149
p04045
Accepted
from itertools import product n, k = map(int, input().split()) d = list(map(int, input().split())) a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(d) a = sorted(list(a)) l = len(str(n)) c = "" for i in range(l): c += str(a[-1]) if int(c) < n: if a[0] == 0: ans = str(a[1]) else: 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...
s329691541
p04045
Accepted
N, K = map(int, input().split()) d=list(map(int,(input().split()))) ans = 0 for i in range(N,100000): temp = str(i) n_len = len(temp) for j in range(n_len): if int(temp[j]) in d: break elif j == n_len-1: ans = 1 break if ans == 1: print(temp) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s457967544
p04045
Accepted
N, K = map(int, input().split()) D = input().split() for R in range(N, N * 10): S = '{}'.format(R) for d in D: if d in S: break else: print(R) 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...
s542570946
p04045
Accepted
def fukumu(D, kazu): for i in str(kazu): if D.count(i) == 0: continue else: return True return False def keisan(N, D): kazu = N while fukumu(D, kazu): kazu += 1 return kazu N, K = [int(i) for i in input().split()] D = input().split() print(keisan(N,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...
s735973512
p04045
Accepted
n,k = map(int,input().split()) B = list(map(int,input().split())) A = [i for i in range(0,10)] for number in B: A.remove(number) for i in range(n,10*n+1): for j in str(i): if not int(j) in A: 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...
s954921802
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) l=[0,1,2,3,4,5,6,7,8,9] for i in range(k): l.remove(d[i]) L=[] for j1 in range(len(l)): for j2 in range(len(l)): for j3 in range(len(l)): for j4 in range(len(l)): for j5 in range(len(l)): L.append(l[j1]*10000+l[j2]*1000+l[j3]*...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s301908590
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) ok = [i for i in range(10) if i not in d] ans = [] def solve(pay): if pay == "00000": return if pay != "" and int(pay) >= n: ans.append(pay) return for c in ok: solve(pay + str(c)) return solve("") print(min(list(map(int, 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...
s571937624
p04045
Accepted
N,K=map(int,raw_input().split()) D=map(int,raw_input().split()) U=[i for i in range(10) if i not in D] Keta=1 while True: if N>U[-1]*(sum(10**(i) for i in range(Keta))): Keta+=1 else: break N_copy=N Result=[] for k in range(Keta): for u in U: if u*(10**(Keta-k-1))+U[-1]*(sum(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...
s194269054
p04045
Accepted
n, k = map(int, input().split()) a = [int(x) for x in input().split()] while True: s = str(n) poss = False for i in s: if int(i) in a: poss = True break if not poss: print(n) exit(0) 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...
s089631802
p04045
Accepted
import sys line = [] for i in sys.stdin.readlines(): line.append(i.rstrip()) data = line.pop(0).split(" ") num_list = line.pop().split(" ") def pick_up(num_list): use_list = ['0','1','2','3','4','5','6','7','8','9'] for i in num_list: use_list.remove(i) return use_list def advance(n_list, 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...
s246751058
p04045
Accepted
import itertools import sys def main(): n,k = map(int, input().split()) ds = list(map(int, input().split())) for i in range(n, 10**6): s = str(i) for d in ds: if str(d) in s: f = False break else: f = True 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...
s156021457
p04045
Accepted
# encoding: utf-8 N, K = map(int, input().split()) D = list(map(int, input().split())) Db = [] for Di in range(10): if Di not in D: Db.append(Di) # print("#", Db) for level in range(6): if N // (10 ** level) < 1: break # print("#", level) # memo = [None] * ((level + 1) * 10000) def pay(pos, tmp): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s186654048
p04045
Accepted
# encoding: utf-8 N, K = map(int, input().split()) D = list(map(int, input().split())) Db = [] for Di in range(10): if Di not in D: Db.append(Di) # print("#", Db) for level in range(6): if N // (10 ** level) < 1: break # print("#", level) memo = [None] * ((level + 1) * 10000) def pay(pos, tmp): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s274273426
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) for i in range(N, 10000 * 10): if len(set(str(N)) & D) >= 1: N += 1 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...
s212455262
p04045
Accepted
def main(): n, _ = map(int, input().split()) ds = set(input().split()) while any(c in ds for c in iter(str(n))): n += 1 print(n) 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...
s398717305
p04045
Accepted
import sys n, k = map(int, input().split()) D = [int(x) for x in input().split()] def dfs(s: str, m: int) -> None: if s != "" and int(s) >= n: print(s) sys.exit() if len(s) == m: return for i in range(10): if i not in D: dfs(str(i) + s, m) for i in range(sy...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s477308134
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) for i in range(10**6): if len(set(str(N)) & D) >= 1: N += 1 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...
s656757457
p04045
Accepted
import itertools N,K = input().split() D = list(map(int,input().split())) int_list = set(range(10)) like = list(int_list - set(D)) like.sort() min_cost = 10**6 for e in itertools.product(like,repeat = len(N)): result = 0 for i in range(len(N)): result += e[i] * pow(10,i) if int(N) <= result < min_co...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s845881929
p04045
Accepted
N,K=map(int,input().split()) D=set(input().split()) for i in range(N,10**10): if set(str(i)) & 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...
s695200099
p04045
Accepted
n, k = map(int, input().split()) D = input().split() D_inv = set([str(i) for i in range(10)]) - set(D) ans = n while not set(list(str(ans))).issubset(D_inv): 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...
s183246245
p04045
Accepted
# input n, k = map(int, input().split()) D = list(map(int, input().split())) N = [int(x) for x in list(str(n))] D_inv = sorted(list(set(range(10)) - set(D))) m = len(N) + 1 # 置換する桁 for i in range(len(N)): if N[i] in D: m = i break if m == len(N) + 1: print(n) exit() n = len(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...
s910040309
p04045
Accepted
N, K = map(int, input().split(" ")) list_num = ["0","1","2","3","4","5","6","7","8","9"] D = input().split(" ") use_num = list(set(list_num) - set(D)) ok = [] for a in use_num: ok.append(a) for b in use_num: ok.append(a+b) for c in use_num: ok.append(a+b+c) for d in 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...
s938410891
p04045
Accepted
N, K = [int(_) for _ in input().split()] D = [int(_) for _ in input().split()] for i in range(N, 100000): is_possible = True for d in D: if str(d) in str(i): is_possible = False break if is_possible: 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...
s102458951
p04045
Accepted
n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] ok = [1 for i in range(10)] for i in range(len(d)): ok[d[i]] = -1 for i in range(n, 100000): complete = True for j in range(len(str(i))): if ok[int(str(i)[j])] == -1: complete = False break 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...