submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s448917907
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) usable = set(range(10)) - set(d) while True: if {int(i) for i in set(list(str(n)))} <= usable: print(n) exit() else: n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s778489503
p04045
Accepted
a,b = map(int,input().split()) li1 = set(map(int,input().split())) li2 = {1,2,3,4,5,6,7,8,9,0} nu = list(li1^li2) i = 1 while True: aa = list(str(a)) aa = [int(x) for x in aa] if set(aa).issubset(set(nu)): print(a) break a += 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...
s075289270
p04045
Accepted
N, K = map(int, input().split()) D = [int(i) for i in input().split()] num = N flag = True while flag: for i in D: if str(i) in str(num): num += 1 break else: print(num) flag = False
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s631478966
p04045
Accepted
import sys N, K = map(int,input().split()) D = list(map(str, input().split())) D_ava = list(map(str,[i for i in range(1,10) if i not in D])) for s in range(N, 10**5+1): ss = list(set(str(s))) cond = True for sss in ss: if sss in D: cond = False break if cond == True: print(s) sys.exit() else: conti...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s959679438
p04045
Accepted
n,m=map(int,input().split()) l=list(map(int,input().split())) ans=n while 1: hoge=list(str(ans)) flag=0 for i in range(len(l)): flag+=hoge.count(str(l[i])) if(flag==0): print(ans) exit() ans+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s807080052
p04045
Accepted
n,k=map(int,input().split()) d = [i for i in range(10)] din = list(map(int,input().split())) for i in din: d.remove(i) flg = 0 for i in range(n,100000): for j in range(len(din)): #嫌いな数値が居た場合 if str(din[j]) in str(i): flg=1 break if flg == 0: 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...
s635061168
p04045
Accepted
N, K = map(int, input().split()) D = set(map(int, input().split())) while True: for i in str(N): if int(i) in D: N += 1 break else: print(N) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s221886327
p04045
Accepted
n, k = map(int, input().split()) d = input().split() while True: not_in = True for i in range(k): if d[i] in str(n): not_in = False break if not_in: 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...
s621469473
p04045
Accepted
import sys N, K = map(int, input().split()) d = list(map(int, input().split())) for i in range(N, 10 ** 7): ansb = True for j in d: if str(i).count(str(j)) != 0: ansb = False break if ansb: 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...
s707996288
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) isNotMin = True temp = N * 1 while isNotMin: for i in str(temp): if int(i) in D: temp += 1 isNotMin = True break else: isNotMin = False 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...
s505570100
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,100000): flag=0 for j in str(i): if int(j) in d: flag=1 break if flag==0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s553159748
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) while True: for i in str(N): if int(i) in D: N += 1 break else: print(N) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s350799316
p04045
Accepted
N,K = list(map(int,input().split())) array = list(map(int,input().split())) # N=1000 # K=8 # array = [1,3,4,5,6,7,8,9] # Farray = [0,1,2,3,4,5,6,7,8,9] # array = set(Farray)-set(array) # array = list(map(int,array)) i=0 result=[] #桁上がり未考慮だった。 # while i<len(str(N)): # j=0 # for j in range(len(array)): # ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s359536564
p04045
Accepted
def f(S): SS = str(S) for d in D: if d in SS: return True return False N, K = map(int, input().split()) D = input().split() while f(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...
s269927001
p04045
Accepted
import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools,pdb sys.setrecursionlimit(10**7) inf = 10 ** 20 eps = 1.0 / 10**10 mod = 10**9+7 dd = [(-1, 0), (0, 1), (1, 0), (0, -1)] ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)] def ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s674736883
p04045
Accepted
N,K = input().split() D = set(input().split()) while not set(N).isdisjoint(D): N=str(int(N)+1) else: print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s357780380
p04045
Accepted
n, k = map(int, input().split()) dislike = [str(i) for i in input().split()] strn = str(n) while(1): flag = 1 for i in range(len(strn)): if strn[i] in dislike: flag = 0 if flag == 1: print(n) break else: n += 1 strn = str(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s374742895
p04045
Accepted
from sys import stdin, setrecursionlimit setrecursionlimit(10 ** 7) N, K = [int(x) for x in stdin.readline().rstrip().split()] D = [int(x) for x in stdin.readline().rstrip().split()] L = [x for x in range(10) if x not in D] def dfs(n): if n != '': if n[0] == '0': return 10 ** 7 elif...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s909124790
p04045
Accepted
N,K=map(int,input().split()) D=set(input().split()) while 1: l=str(N) for i in range(len(l)): if l[i] in D: break else: print(N) break N+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s722894227
p04045
Accepted
n,k=map(int,input().split()) d=[i for i in input().split()] while True: s=str(n) s=list(s) check=0 for i in s: if i in d: break check+=1 if check==len(s): print(''.join(s)) 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...
s835526789
p04045
Accepted
from sys import stdin, setrecursionlimit setrecursionlimit(10 ** 7) N, K = [int(x) for x in stdin.readline().rstrip().split()] D = [int(x) for x in stdin.readline().rstrip().split()] L = [x for x in range(10) if x not in D] ans = 10 ** 7 def dfs(n): global ans if n != '' and n[0] == '0': return ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s681648580
p04045
Accepted
a, n = map(int, input().split()) b = list(map(str, input().split())) c = str(a) while True: check = True for i in range(len(c)): if c[i] in b: c = str(int(c) + 1) check = False break if check: print(c) 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...
s926808340
p04045
Accepted
def main(): n,k=map(int,input().split()) a=input() for i in range(n,100000): bl = 1 for j in str(i): if j in a: bl=0 continue if bl: return i print(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...
s599513285
p04045
Accepted
n,k = map(int,input().split()) ng = set(list(input().split())) while True: if len(set(str(n))&ng)==0: break else: n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s673794601
p04045
Accepted
n, k = input().split() d = set(input().split()) while not set(n).isdisjoint(d): n = str(int(n) + 1) else: print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s556760773
p04045
Accepted
n, k = input().split() d = set(input().split()) while True: if set(n).isdisjoint(d): print(n) break else: n = str(int(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...
s997334942
p04045
Accepted
def main(): n, k = (int(i) for i in input().split()) d = {i for i in input().split()} while set(str(n)) & d: 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...
s154682709
p04045
Accepted
import sys stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline() n, k = na() ddd = input().split() for i in range(n, 100000): flag = True for c in str(i): if c in ddd: flag = False break if flag: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s142620610
p04045
Accepted
import itertools N, K = map(int,input().split()) D = list(map(int,input().split())) N = str(N) d = [] d_min = 10 for i in range(10): if i in D: continue else: if i != 0: d_min = min(d_min, i) d.append(str(i)) if '0' in d: ans = str(d_min) + '0' * len(N) else: ans = 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...
s287037655
p04045
Accepted
n,k = map(int, input().split()) List = [int(i) for i in input().split()] for i in range(n,10**6): flag = 0 # Listに入っていたら1にする for j in str(i): if int(j) in List: # intかstrに型を揃える flag = 1 break 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...
s431277226
p04045
Accepted
N, K = map(int, input().split()) Dlist = list(map(int, input().split())) alist = list(set([0,1,2,3,4,5,6,7,8,9]) - set(Dlist)) if sum(x==0 for x in alist) == 0: b = min(alist) else: b = min(list(set(alist)-set([0]))) strN = str(N) c = "" ans = "" flag = True for i in range(len(strN)): iN = int(strN[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...
s818116107
p04045
Accepted
n, k = map(int, input().split()) d = input().split() while True: ns = str(n) exists_dislike_number = False for ds in d: if ns.count(str(ds)) > 0: exists_dislike_number = True if exists_dislike_number: 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...
s340425471
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,input().split())) while(1): a = str(N) if not any(i in a for i in 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...
s595300731
p04045
Accepted
def is_correct(disabled, val): for c in str(val): if c in disabled: return False return True def main(): n, k = [int(x) for x in raw_input().split(' ')] disabled = [x for x in raw_input().split(' ')] while not is_correct(disabled, n): n += 1 print(n) 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...
s350026453
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) while 1<2: nn=list(map(int,list(str(n)))) if len(set(nn+d))<len(set(nn))+len(set(d)): 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...
s519375207
p04045
Accepted
s=input().split() money,num=int(s[0]),int(s[1]) no_list=input().split() while True: flag=0 for money_element in list(str(money)): if money_element in no_list: flag=1 money+=1 break if flag==0: print(money) 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...
s585057911
p04045
Accepted
s=input().split() money,num=int(s[0]),int(s[1]) no_list=input().split() for i in range(money,100000): flag=0 for money_element in list(str(i)): if money_element in no_list: flag=1 break if flag==0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s083140077
p04045
Accepted
n,k=map(int,input().split()) d=[int(i) for i in input().split()] d=set(d) i=0 while True: s=str(n) c=0 for i in s: if int(i) in d: break else: c+=1 if c==len(s): 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...
s728719308
p04045
Accepted
import itertools N,K= map(int,input().split()) D = set(input().split()) while len(set(str(N))&D) != 0: 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...
s792695338
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) a = n f = False while f == False: li = [] for i in str(a): li.append(int(i)) if set(li) & set(d) == set(): print(a) f = True else: a += 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...
s360656603
p04045
Accepted
N, K = [x for x in input().split()] D = [x for x in input().split()] M = N while True: N_ = 0 for i,n in enumerate(N): if n in D: N_ += (int(n) + 1) * 10 ** (len(N) - 1 - i) break else: N_ += int(n) * 10 ** (len(N) - 1 - i) else: break N = str(N_) print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s353090955
p04045
Accepted
n, k = (int(x) for x in input().split()) dislike_numbers = input().split() for i in range(n, 99999): if all(dn not in str(i) for dn in dislike_numbers): 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...
s926350984
p04045
Accepted
# -*- coding: utf-8 -*- import sys import copy import collections from bisect import bisect_left from bisect import bisect_right from collections import defaultdict from heapq import heappop, heappush, heapify import math import itertools import random # NO, PAY-PAY #import numpy as np #import statistics #from statis...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s970227031
p04045
Accepted
# -*- coding: utf-8 -*- import sys import copy import collections from bisect import bisect_left from bisect import bisect_right from collections import defaultdict from heapq import heappop, heappush, heapify import math import itertools import random # NO, PAY-PAY #import numpy as np #import statistics #from statis...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s219825813
p04045
Accepted
N, K = map(int, input().split()) Ds = set(input().split()) n = N while set(str(n)) & Ds: 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...
s270896576
p04045
Accepted
n, k = map(int, input().split()) ds = list(map(int, input().split())) nums = [] for x in range(10): if x in ds: nums.append(1) else: nums.append(0) res = 0 for x in range(n, n*10): ys = list(map(int,list(str(x)))) flag = False for y in ys: if nums[y]: flag = Tr...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s524001121
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) num = [0 for _ in range(10)] for v in d: num[int(v)] = 1 for j in range(10 * n): v = n + j v_l = list(str(v)) flag = True for i in v_l: if num[int(i)] == 1: flag = False break if flag: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s940223314
p04045
Accepted
# https://atcoder.jp/contests/abc042/tasks/arc058_a # C - こだわり者いろはちゃん / Iroha's Obsession import copy N, K = list(map(int, input().split())) d_list = list(map(int, input().split())) # 一番上の桁から見ていく use_list = list(set(range(10)) - set(d_list)) n_list = [int(x) for x in list(str(N))] # 各桁ごとに、使える数字を使っているかどうか洗い出す keta_li...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s264722549
p04045
Accepted
def main(): N, K = map(int, input().split()) D = [int(d) for d in input().split()] F = [] for i in range(10): if i not in D: F.append(i) l = len(str(N)) cand = [""] for _ in range(l): temp = [] for s in cand: for f in F: temp.append(s+str...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s250434854
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) flag=False while True: yen=str(n) for i in range(len(yen)): if int(yen[i]) in d: n+=1 flag=True break if flag: flag = False continue 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...
s985553277
p04045
Accepted
from collections import defaultdict from heapq import heappush, heappop import math import bisect import random def LI(): return list(map(int, input().split())) def I(): return int(input()) def LIM(): return list(map(lambda x:int(x) - 1, input().split())) def LS(): return input().split() def S(): return input() def IR...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s366812124
p04045
Accepted
N, K= map(int, input().split()) dislike_number = set(map(int, input().split())) num = set([i for i in range(10)]) ok_num = list(num - dislike_number) ok_num = sorted(ok_num) max_len = len(str(N)) widths=[str(max(ok_num))]*(max_len+1) min_value=10**(max_len+1) for i in range(0,max_len+1): if i==0: 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...
s987588167
p04045
Accepted
N,K = map(int,input().split()) d = list(map(int,input().split())) while(True): n = str(N) flag = True for i in range(len(n)): if(int(n[i]) in d): flag = False break if(flag): break else: N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s820515605
p04045
Accepted
n, k = list(map(int, input().split())) set_d = set(map(int, input().split())) g = n while(True): set_g = set(str(g)) set_g = [int(i) for i in set_g] for i in set_g: if i in set_d: g += 1 break else: break print(g)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s564390955
p04045
Accepted
import sys sys.setrecursionlimit(12345678) import itertools from collections import Counter from collections import defaultdict from collections import deque import bisect from heapq import heappush, heappop def main(): n, k = map(int, input().split()) dl = set(map(int, input().split())) for i in range(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...
s402934314
p04045
Accepted
import sys sys.setrecursionlimit(1000000) input = sys.stdin.readline N, K = map(int, input().split()) D = input().split() # 使える数字は? nums = [] for c in list('0123456789'): if c in D: pass else: nums.append(c) #print(nums) ret = [] def dfs(next_value, nums, ans): ans += next_value 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...
s918350864
p04045
Accepted
import sys n,k=map(int,input().split()) d=list(input().split()) for i in range(n,100000): ans=list(str(i)) flag=0 for x in ans: if x in d: flag=1 if flag==0: print(''.join(ans)) 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...
s331277804
p04045
Accepted
def main(): n, k = map(int, input().split()) d = list(input().split()) i = n while True: stri = list(str(i)) flg = True for j in d: if j in stri: flg = False if flg: print(i) return i += 1 if __name__ == '__mai...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s851156474
p04045
Accepted
n, _ = [int(x) for x in input().split()] dn = set(input().split()) i = n answer = n while len(set(str(n)) & dn) > 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...
s343885779
p04045
Accepted
N,K = map(int, input().split()) l = list(map(int, input().split())) num = [i for i in range(10) if i not in l] #print(l) while True: N_str = str(N) frag = 0 for i in range(len(N_str)): if int(N_str[i]) in l: #print("yes") frag = 1 break if frag == 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...
s356775731
p04045
Accepted
# -*- coding: utf-8 -*- numbers = {str(i) for i in range(10)} N, K = map(int, input().split()) *D, = map(str, input().split()) D = set(D) available = numbers - D ans = 0 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...
s896029220
p04045
Accepted
N,K = map(int, input().split()) l = list(map(int, input().split())) num = [i for i in range(10) if i not in l] #print(l) while True: N_str = str(N) frag = 0 for i in range(len(N_str)): if int(N_str[i]) in l: #print("yes") frag = 1 break if frag == 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...
s127935562
p04045
Accepted
n,k=map(int,input().split()) d=set(map(str,input().split())) i=n a=[] for j in range(len(str(n))): a.append(str(n)[j]) a=set(a) while i<10**5+1: if len(a&d)==0: print(i) exit() else: i+=1 a=[] for j in range(len(str(i))): a.append(str(i)[j]) a=set(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...
s650697011
p04045
Accepted
n,k=map(int,input().split()) d=[int(i) for i in input().split()] while True: s=str(n) if not any(tmp in s for tmp in str(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...
s817819492
p04045
Accepted
inputted = input().split(" ") N=int(inputted[0]) K=int(inputted[1]) s = [i for i in input() if i != ' '] num=0 while True: num+=1 match=[i for i in str(num) if i in s] if num>=N and len(match)==0: print(num) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s004649809
p04045
Accepted
[N,K] = list(map(int, input().split())) D = [x for x in input().split()] while True: S = str(N) if not any(d in S for d in 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...
s945159965
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) while True: for n_str in str(N): if int(n_str) in D: N += 1 break else: print(N) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s129362950
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) def judge(x,y): X=str(x) ret=1 for i in X: if(i in y): ret=0 break return ret while(True): if(judge(n,d)==1): break else: n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s764197306
p04045
Accepted
# 2019/08/17 n,k=map(int,input().split()) d=set(list(input().split())) for i in range(n,10*n): if any([j in d for j in list(str(i))]): continue print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s866962155
p04045
Accepted
N, K = map(int, input().split()) Ds = set(input().split()) for i in range(N, 100000): s = str(i) ng = any(map(lambda c: c in Ds, s)) if not(ng): r = i break 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...
s315034864
p04045
Accepted
N, K = map(int, input().split()) D = [x for x in input().split()] while True: S = str(N) if not any(d in S for d in 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...
s776009748
p04045
Accepted
n, k = map(int, input().split()) dlist = input().split() flg = True while flg: s = str(n) for t in s: if t in dlist: n += 1 break else: flg = False 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...
s700441292
p04045
Accepted
N,n=map(int,input().split()) dislike=input().split() count=0 while(1): flag=1 for i in range(n): if dislike[i] in str(N+count): flag=0 break if flag: print(N+count) break count+=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...
s595994390
p04045
Accepted
n, k = map(int, input().split()) d_array = [int(x) for x in input().split()] for i in range(n, 100000): flag = True price = str(i) for d in d_array: str_d = str(d) if str_d in price: flag = False else: 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...
s272123430
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) ans = N flg = True while flg: s = str(ans) for c in s: if c in D: ans += 1 break else: flg = False 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...
s449258984
p04045
Accepted
def C_IrohasObsession(): N, K = map(int, input().split()) D = list(map(int, input().split())) ans = 0 for x in range(N, 10000): for y in str(x): if int(y) in D: break else: ans = int(x) break if N > ans: for x in range(1,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...
s820461848
p04045
Accepted
def C_IrohasObsession(): N, K = map(int, input().split()) D = list(map(int, input().split())) ans = 0 for x in range(N, 100000): for y in str(x): if int(y) in D: break else: ans = int(x) break print(ans) if __name__ == "__main__": ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s013525221
p04045
Accepted
N_str, K=input().split() K=10-int(K) N_digit=list(map(int,list(N_str))) D=sorted(list(map(int,input().split()))) D=[d for d in range(10) if d not in D] l_digit=[n>D[-1] for n in N_digit] if any(l_digit): N_n=l_digit.index(True) if not any([n is not D[-1] for n in N_digit[0:N_n]]): out=list(str(D[1] if D[0]==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...
s770659626
p04045
Accepted
n,K = map(int,input().split()) use = [0,1,2,3,4,5,6,7,8,9] useless = list(map(int,input().split())) for i in range(K): use.remove(useless[i]) k = 10 - K time = [0] def suc(time): now = 0 while True: if now >= len(time): time.append(0) break elif time[now] != k-1: time[now] += 1 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...
s786496520
p04045
Accepted
n, k = map(int,input().split()) d = list(map(str,input().split())) ans = 0 for i in range(n,100000): s = str(i) pay = True for j in range(len(s)): if s[j] in d: pay = False break if pay: ans = i break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s964951199
p04045
Accepted
import itertools n, k = map(int, input().split()) d = list(map(int, input().split())) ls = [] for i in range(10): if i not in d: ls.append(i) mp = 10 ** 9 for j in range(len(str(n)), 7): for i in itertools.product(ls, repeat=j): m = int("".join(map(str, i))) if m >= n: mp = m...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s199341735
p04045
Accepted
n,k = map(int,input().split()) d = list(map(str,input().split())) a = 0 #フラグ for i in range(n,100000): for j in d: if j in str(i): # もしも嫌いな文字dが含まれていたらこの文字iはだめ a = 1 #フラグをダメにする 次の値段にアップ break elif j == d[-1]: a=0 #最後までまわった⇨全て含まれない⇨フラグ0に if a==0: 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...
s197677499
p04045
Accepted
n,k = map(int,input().split()) l = set(input().split()) ans = n flag = True while len(set(str(ans))&l) > 0: 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...
s666847674
p04045
Accepted
# -*- coding: utf-8 -*- # スペース区切りの整数の入力 N, K = map(int, input().split()) # 文字列用のリスト インプットをブランクで区切りリスト化 k = input() s = [int(j) for j in k.split(" ")] valIn = 0 # Nの桁毎の分解 def digit(i): if i > 0: return digit(i//10) + [i%10] else: return [] def irohacheck(n): global valIn valIn = 0 # 分解した数値をリス...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s911037151
p04045
Accepted
n , k= map(int, input().split()) d = list(map(str, input().split())) while 1: for i in str(n): if i in d: break else: print(n) break n+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s644310106
p04045
Accepted
n,k = map(int,input().split()) alllst = ['0','1','2','3','4','5','6','7','8','9'] dislike = [str(i) for i in input().split()] lst = set(alllst) - set(dislike) while True: st = set(str(n)) if st.issubset(lst): 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...
s731471112
p04045
Accepted
import sys, math, itertools, bisect, copy, re from collections import Counter, deque, defaultdict # from itertools import accumulate, permutations, combinations, takewhile, compress, cycle # from functools import reduce # from math import ceil, floor, log10, log2, factorial # from pprint import pprint INF = float('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...
s636973749
p04045
Accepted
N, K = map(int, input().split()) nums = list(input().split()) for i in range(N, 100000): checked = True for char in str(i): if char in nums: checked = False break if checked: 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...
s749727604
p04045
Accepted
n, l = map(int, input().split()) s = input().split() def is_hate(nums, price): for n in nums: if str(n) in str(price): return True else: return False while(is_hate(s, 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...
s970303334
p04045
Accepted
n, l = map(int, input().split()) s = input().split() def is_hate(nums, price): for n in nums: if str(n) in str(price): return True else: return False while(is_hate(s, 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...
s316942478
p04045
Accepted
n, k = map(int, input().split()) a = input().split() for i in range(10*n - n): c = str(n+i) for j in a: if j in c: break else: ans = c 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...
s642136722
p04045
Accepted
#find set of numbers iroha like tmp = raw_input("").split(' ') n = int(tmp[0]) k = int(tmp[1]) tmp = raw_input("") exclude_set = map(int, tmp.split(' ')) def binarySearch(arr, target): l = 0 r = len(arr) - 1 while l <= r: m = (l + r)//2 if arr[m] == target: return True elif arr[m] > target: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s337319192
p04045
Accepted
cost, hate = map(int, input().split()) hate_num = list(map(int, input().split())) hate_str = list(str(hate_num)) pay = cost flag = True while flag: pay_str = list(str(pay)) for i in range(len(pay_str)): if set([pay_str[i]]) - set(hate_str) != set([pay_str[i]]): pay += 1 flag = 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...
s561783286
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) number_set = {0,1,2,3,4,5,6,7,8,9} for i in D: number_set.remove(i) while True: N_str = str(N) list_N = list(N_str) list_N = [int(n) for n in list_N] N_set = set(list_N) if N_set <= number_set: 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...
s574491006
p04045
Accepted
#!/usr/bin/env python3 import sys sys.setrecursionlimit(300000) def solve(N: int, K: int, D: "List[int]"): tmp = N while True: i = tmp ng = False while i > 0: if (i % 10) in D: ng = True break i //= 10 if not ng: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s013803455
p04045
Accepted
n_yen, k = map( int, input().split( ' ' ) ) unlike_numbers = set( map( int, input().split( ' ' ) )) #like_numbers = set(range(10)) - unlike_numbers #print( like_numbers ) n_yen_str = str( n_yen ) each_strs = [ int( each ) for each in n_yen_str ] #print ( each_strs ) for paid_yen in range( n_yen, 10* n_yen ): paid_y...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s837273096
p04045
Accepted
n,k=[s for s in input().split()] n=int(n) k=int(k) hate=list(map(int, input().split())) #hate取得 like=[] hate.sort() like.sort() for i in range(10): #like取得 if i not in hate: like.append(i) pointer=0 for ichi in like: #1桁の場合 if ichi>=n: kane=ichi pointer=1 break if pointer==0: #2桁の場合 for ju in like: for...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s482385124
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) for i in range(N, 1000000): tmp = list(str(i)) count = 0 for j in range(len(tmp)): if tmp[j] not in D: count += 1 if count == len(tmp): ans = ''.join(tmp) 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...
s440727449
p04045
Accepted
n, k = map(int,input().split()) l = list(input().split()) #print(l) l1 = [i for i in range(10) if i not in l] #print(l1) for i in range(n,100000): l2 = [False]*len(str(i)) for j in range(len(str(i))): if str(i)[j] not in l: l2[j] = True a = i else: break if all(l2): print(a) brea...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s455875978
p04045
Accepted
n, k = map(int, input().split()) d = set(map(str, input().split())) num = n while d.intersection(set(str(num))): num += 1 print(num)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...