submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s667732845
p04045
Accepted
import sys import bisect all_flg = False n, k = [int(i) for i in sys.stdin.readline().split()] d_ls = [int(i) for i in sys.stdin.readline().split()] candidate = [i for i in range(10) if i not in d_ls] set_candidate = set(candidate) len_cand = len(candidate) last_ans = n while True: ans = list(str(last_ans)) flg...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s876120861
p04045
Accepted
import sys input = sys.stdin.readline def isOk(n, D): while n > 0: if n % 10 in D: return False n //= 10 return True def main(): N, K = map(int, input().split()) D = set(map(int, input().split())) ans = 0 for i in range(N, 10**5): if isOk(i, 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...
s949844698
p04045
Accepted
n, k = map(int, input().split()) d = set(map(str, input().split())) for i in range(n, 10*n): if len(d & set(str(i))) == 0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s435199067
p04045
Accepted
N, K = map(int, input().split()) D = set(list(map(int, input().split()))) for i in range(N, 100001): tmp = i while tmp > 0 and tmp % 10 not in D: tmp = tmp // 10 if tmp == 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...
s848377980
p04045
Accepted
n, k = map(int, input().split()) dis = input().split() m = n while True: m = str(m) for d in dis: if d in m: break else: print(m) exit() m = int(m) + 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s155966160
p04045
Accepted
price, size = map(int, input().split()) dislikes = list(map(int, input().split())) likes = list(set(range(10)) - set(dislikes)) digits = [int(digit) for digit in str(price)] r_digits = list(reversed(digits)) res = [] for i in range(len(r_digits)): if r_digits[i] in likes: res.append(r_digits[i]) elif ma...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s444109196
p04045
Accepted
N, K = map(int, input().split()) d = list(map(int, input().split())) a = [] for i in range(10): if d.count(i) == 0: a.append(i) ans = [] def dfs(s): if int(s) >= N or len(s) > 6: return s for i in a: S = dfs(s + str(i)) if int(S) >= N: ans.append(int(S)) retur...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s899089799
p04045
Accepted
n,k = map(int,input().split()) nums =set(input().split()) i = n while True: i = str(i) for num in nums: if num in i: break else: print(i) exit() i =int(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...
s768028434
p04045
Accepted
N, K = map(int, input().split()) D = [_ for _ in input().split()] t = N while 1: s = str(t) flg = True for i in range(len(s)): if s[i] in D: flg = False if flg: res = t break t += 1 print(res)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s971516089
p04045
Accepted
val, size = map(int, input().split()) disabledList = [int(x) for x in input().split()] # number enableList = list(set(range(10)) - set(disabledList)) # number resultList = [] # str, must reverse isTenOver = False for char in reversed(list(str(val))): targetInt = int(char) if isTenOver: targetInt += 1 if targe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s204601028
p04045
Accepted
N,K = map(int,input().split()) D = tuple(input().split()) for i in range(N,N*10): flag = True for d in str(i): if d in D: flag = False break if flag: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s576131558
p04045
Accepted
N,K = map(int,input().split()) D = set(list(map(int,input().split()))) for i in range(N,10*N): ans = [] ans += str(i) sA =set(map(int,ans)) if sA&D == set(): 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...
s366918327
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) num = n while True: if len(set(list(str(num))) & d) == 0: print(num) break num += 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...
s277844139
p04045
Accepted
p, _ = [int(x) for x in input().split(' ')] v = set([str(x) for x in range(10)]) - set(input().split(' ')) for x in range(p, 100000): if all([s in v for s in str(x)]): print(x) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s826143685
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) for i in range(n, 10*n): if len(set(str(i)) & d) == 0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s852155532
p04045
Accepted
# C - こだわり者いろはちゃん / Iroha's Obsession N, K = map(int, input().split()) D = set(input().split()) set_str_N = set(str(N)) while len(set_str_N & D) > 0: N = N + 1 set_str_N = set(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...
s280627115
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) all_num = [i for i in range(10)] not_d = list(set(all_num) - set(d)) not_d_str = [str(i) for i in not_d] #print(set(not_d_str)) ans = [] for i in range(n, 10 * n): if set(list(str(i))).issubset(set(not_d_str)): 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...
s534466843
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) all_num = [i for i in range(10)] not_d = list(set(all_num) - set(d)) not_d_str = [str(i) for i in not_d] ans = [] for i in range(n, 10 * n): if set(list(str(i))).issubset(set(not_d_str)) and i >= n: 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...
s240408950
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) nd = list() for i in range(10): if i not in d: nd.append(i) a = n for i in range(10*n): if set([int(m) for m in list(str(a+i))]) == set(list(set([int(m) for m in list(str(a+i))]) & set(nd))): print(a+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...
s851453973
p04045
Accepted
n,k=map(int,input().split()) l=input().split() def check(s): for i in s: if i in l: return 0 return 1 for x in range(n,10**9): if check(str(x)): print(x) 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...
s299687744
p04045
Accepted
def slove(): import sys import collections input = sys.stdin.readline n, k = list(map(int, input().rstrip('\n').split())) d = collections.defaultdict(int) for i in list(map(int, input().rstrip('\n').split())): d[i] for i in range(n, 10 ** 10): s = str(i) b = 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...
s816183205
p04045
Accepted
n,k = map(int,input().split()) memo = list(map(int,input().split())) d = [] for i in range(10): if not(i in memo): d.append(i) N = n flug = False while(1): n_st = list(str(n)) n_st = list(map(int,n_st)) for i in range(len(n_st)): if not(n_st[i] in d): break if 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...
s553391169
p04045
Accepted
# -*- coding: utf-8 -*- price, count = list(map(int, input().split())) hate_numbers = list(map(int, input().split())) def is_ok(hates, price): for h in hates: if str(h) in list(str(price)): return False return True for p in range(1, 100000): if is_ok(hate_numbers, p) is False: continue if p >= 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...
s197439984
p04045
Accepted
def main(): n, k = map(int, input().split()) d = set(list(map(str, input().split()))) checker = 1 while checker: if set(list(str(n))).isdisjoint(d): print(n) checker = 0 else: n += 1 if __name__ == '__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s285476539
p04045
Accepted
N,K=map(int,input().split()) li=list(map(int,input().split())) N_keta=list(map(int,str(N))) for n in range(100000): count=0 for k in range(len(N_keta)): if N_keta[k] in li: count=1 break if count==0: print(N) break else: N+=1 N_keta=list(map(int,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...
s752128258
p04045
Accepted
n, k = map(int, input().split()) d = set(map(str, input().split())) num = {str(i) for i in range(10)} available = num - d ans = 0 for i in range(n, 10**5): 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...
s527187266
p04045
Accepted
N, K = map(int, input().split()) l = set(input().split()) i = N while(True): if(len(l & set(str(i))) == 0): print(i) break i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s899712447
p04045
Accepted
n,k=map(int,input().split()) d = list((input().split())) for i in range(n, 1000000): r = [x for x in list(str(i))] if list(set(r)&set(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...
s735622207
p04045
Accepted
# ABC042 C Iroha's Obsession N,K = map(int,input().split()) D = tuple(map(str,input().split())) for i in range(N,1000000): S = str(i) is_iroha = True for s in S: if s in D: is_iroha = False break if is_iroha: print(S) 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...
s508018936
p04045
Accepted
N,K = map(int,input().split()) D = set(list(map(int,input().split()))) for i in range(N,100001): tmp = i while tmp > 0 and tmp % 10 not in D: tmp = tmp // 10 if tmp == 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...
s629517878
p04045
Accepted
N,K=map(int,input().split()) D=list(map(str,input().split())) for i in range(N,10*N+1): if len(set(D)& set(list(str(i))))==0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s506011827
p04045
Accepted
# At BC 042 C (300) # find first digit (from the left) # that needs to be changed. # if that digit is incremented, then # decrement everything after it as much as possible # if that digit has to be decremented, then increase (or insert) a digit # before that digit and then decrement everything after the incremente...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s562036834
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) n = set(str(N)) ans = N while True: for t in n: if t in D: break else: print(ans) exit() ans += 1 n = set(str(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...
s688738404
p04045
Accepted
#! /usr/bin/env python # -*- coding: utf-8 -*- import pdb import sys F = sys.stdin N, K = F.readline().rstrip().split() N = int(N) K = int(K) D = list(map(str,F.readline().rstrip().split())) answer = None # pdb.set_trace() while answer is None: Nstr = str(N) for i in range(len(Nstr)): if Nstr[i] in ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s386272032
p04045
Accepted
if __name__ == "__main__": n, k = input().split() hate = input() if k == 1 else [x for x in input().split()] like = [str(x) for x in range(0, 10) if str(x) not in hate] found = False while not found: for i in range(len(n)): if len(like) < len(hate): if i == len...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s328538526
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) ans = n flag = True while flag: flag = False for i in d: if str(ans).count(i) != 0: flag = True ans += 1 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...
s150811885
p04045
Accepted
import collections n, k = map(int, input().split()) counter = collections.Counter(list(map(int, input().split()))) for i in range(n, 100000): ok = True x = i while x > 0: ok = counter[x % 10] == 0 x //= 10 if not ok: break if ok: 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...
s429547589
p04045
Accepted
def check(x, d): str_x = str(x) for s in str_x: if s in d: return False return True n, k = map(int, input().split()) d = list(input().split()) for x in range(n, 10**10): if check(x, d): print(x) 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...
s087318452
p04045
Accepted
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) def main(): n, k = map(int, input().split()) d = set(map(int, input().split())) safe = set(range(10)) - d def test(n): return set(int(x) for x in str(n)) <= safe def f(n): while n % 10: if test(n): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s929094410
p04045
Accepted
#!/usr/bin/env python3 import sys def solve(N: int, K: int, D: "List[int]"): d = set(map(str, D)) while set(str(N))&d: N += 1 print(N) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s751677948
p04045
Accepted
#!/usr/bin/env python3 import sys def solve(N: int, K: int, D: "List[int]"): while(True): nl = list(map(int,list(str(N)))) f = True for i in range(len(nl)): if(nl[i] in D): f = False if(f): print(N) exit() else: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s542924089
p04045
Accepted
def check(price, disabled_digits): price = int(price) disabled_digits = set(disabled_digits) while not set(str(price)).isdisjoint(disabled_digits): price += 1 return price def main(): price, k = input().split() disabled_digits = input().split() print(check(price, disabled_digits)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s107832313
p04045
Accepted
class Price: ALL_DIGITS = set(list(map(str, range(10)))) def __init__(self, required_price, disabled_digits): self.required_price = '0' + str(required_price) self.disabled_digits = set(disabled_digits) self.available_digits = sorted( list(self.ALL_DIGITS - self.disabled_digi...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s711612704
p04045
Accepted
N, K = list(map(int, input().split())) D = set(input().split()) for i in range(N,100000): 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...
s584895563
p04045
Accepted
def main(): N, K = map(int, input().split()) lst_D = list(input().split()) cost = N while True: for c in str(cost): if c in lst_D: break else: # break しなかったときのみ実行される print(cost) break cost += 1 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...
s554188017
p04045
Accepted
def judge(lst_D, number): str_number = str(number) for d in lst_D: if d in str_number: return False return True def main(): N, K = map(int, input().split()) lst_D = list(input().split()) cost = N while True: if judge(lst_D, cost): print(cost) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s257196242
p04045
Accepted
N, K = map(int, input().split()) D = {str(i) for i in range(0,10)} - set(input().split()) for i in range(N, 10 * N): num = set(str(i)) if num <= 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...
s546814630
p04045
Accepted
n, k = map(int, input().split()) d = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(map(int, input().split()))) for i in range(10-k): d[i] = str(d[i]) for i in range(n, 10 ** 10): f = 0 for j in range(len(str(i))): if str(i)[j] in d: f += 1 if f == len(str(i)): print...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s050271191
p04045
Accepted
K, N = map(int, input().split()) D = list(map(int, input().split())) L = [i for i in range(10) if i not in D] if int(len(str(K)) * str(L[-1])) < K: if L[0] != 0: print(str(L[0]) * (len(str(K)) + 1)) else: print(str(L[1]) + len(str(K)) * str(L[0])) else: for i in range(10 ** (len(str(K)) - 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...
s790975266
p04045
Accepted
N, K = map(int,input().split()) num_list =[] num_list = input().split() use_num = [s for s in ["0","1","2","3","4","5","6","7","8","9"] if s not in num_list] flag = False answer = [] for i in range(1,len(str(N))+1): tmp = str(N)[-i] if(flag): flag=False if(tmp==str(9)): answer.inser...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s950436794
p04045
Accepted
n,k = map(int, input().split()) d = set(list(map(str, input().split()))) cost = n while True: li = list(str(cost)) if all(i not in d for i in li): break else: cost += 1 print(cost)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s900108819
p04045
Accepted
n, k = map(int, input().split()) d_array = [str(x) for x in input().split()] price = 0 while True: flag = True for s in str(price): if s in d_array: flag = False if price >= n and flag: print(price) break price+=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...
s512581333
p04045
Accepted
# ダサい解き方だが桁上がり等を考えてややこしい実装をして間違うよりは良い # def check_digit(v, d): # if v in d: # # if v == '9': # return check_digit(str(int(v) + 1), d) # else: # return v n, k = input().split() d = input().split() ans = [] while True: if all(map(lambda x: x not in d, 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...
s555209752
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) ans = N while ans <= 10**6: flg = True for i in range(len(str(ans))): if int(str(ans)[i]) in D: flg = False if flg == True: print(ans) exit() else: ans += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s467912157
p04045
Accepted
n, k = map(int, input().split()) t = list(input().split()) while True: m = str(n) # 文字列に変換 found = True for i in range(len(m)): if m[i] in t: found = False if found: 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...
s902332970
p04045
Accepted
from sys import stdin N,K = [int(x) for x in stdin.readline().rstrip().split()] D = [(x) for x in stdin.readline().rstrip().split()] for i in range(N,N+10**7): if not (set(str(i)) & set(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...
s474078263
p04045
Accepted
n, k = map(int, input().split()) num_list = list(map(str, input().split())) ans = n flg = False while flg == False: flg = True for i in str(ans): if i in num_list: flg = False ans += 1 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...
s017054676
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) OK = {str(x) for x in range(10)} - D while True: if set(str(N)) <= OK: ans = N break else: N += 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...
s110840275
p04045
Accepted
N,K = map(int, input().strip().split(' ')) D = set(input().strip().split(' ')) now = N while True: if len(set(str(now)) & D) == 0: print(now) break else: now += 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...
s206989906
p04045
Accepted
def c_iroha_obsession(): # 1種しか使えない場合でも、Nの桁数+1だけ並べればいい。2種以上ならより小さい N, K = [int(i) for i in input().split()] D = set(input().split()) for ans in range(N, 10 * N + 1): if set(str(ans)) & D == set(): return ans # ansが含む数字の集合とDの合併が空集合なら条件を満たす return None print(c_iroha_obsession())
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s991558160
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) C=[] for i in range(0,10): if i not in D: C.append(i) #print(C) for i in range(N,10**10): cnt=0 for j in list(map(int,list(str(i)))): if j in C: cnt+=1 if len(str(i))==cnt: 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...
s435397313
p04045
Accepted
n, k = map(int, input().split()) d = list(input().split()) pay = n while True: dislike = False for ele in d: if ele in str(pay): dislike = True break if dislike: pay += 1 else: break print(pay)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s951057667
p04045
Accepted
import numpy as np n = list(map(int, input().split())) d = np.array(list(map(int, input().split()))) a = len(str(n[0])) x = np.zeros(a + 1) for i in range(a + 1): x[i] = (n[0] % np.power(10, a - i + 1)) // np.power(10, a - i) i = 0 while i != a: i += 1 while np.any(d == x[i]): x[i] += 1 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...
s771713505
p04045
Accepted
#N円の品物、K個の嫌いな数字 N, K = map(int, input().split()) #いろはちゃんの嫌いな数字のリスト d_list = map(int, input().split()) d_set = set(d_list) num_set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} #いろはちゃんの好きな数字のセット fav_num = d_set ^ num_set #N ~ 10Nの間の数字で、fav_numの中の数字のみから作られる #payを1つずつ探す for pay in range(N, 10*N): num_N = list(map(int, str(pay))...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s282832613
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) for i in range(N, 10**5): if set(str(i)) & D == set(): print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s111760973
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) like = set(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]) - d for i in range(n, 100000): used = set(str(i)) if used <= like: 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...
s407605015
p04045
Accepted
N, K = tuple(map(int, input().split())) D = list(map(int, input().split())) set_D = set(D) i = N while True: tmp_set = set([int(c) for c in str(i)]) if len(set_D.intersection(tmp_set)) > 0: i += 1 continue else: break print(i)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s563233137
p04045
Accepted
N, K = map(int, input().split()) ok = [True]*10 d = [int(s) for s in input().split()] for i in d: ok[i] = False ans = 0 for i in range(N, 10*N+1): j = i while j > 0 and ok[j%10]: j //= 10 if j == 0: 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...
s361268843
p04045
Accepted
inp=input().split(" ") N=int(inp[0]) K=int(inp[1]) dislike=input().split(" ") like=[] for i in range(0,10): if str(i) not in dislike: like.append(str(i)) def search_min(n,like): n=str(n) if len(n)==1: for i in like: if i>=n: return i else: if n[0] in l...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s192953577
p04045
Accepted
# O(k + log(n)) n, k = map(int,input().split()) D = list(input().split()) E = [0] * 20 for i in D: j = int(i) E[j] = 1 E[10 + j] = 1 # print(E) F = [0] * 10 r = 0 for l in range(10): # print(l, r) while l > r or E[r] == 1: r += 1 F[l] = r-l # print(F) for i in range(10): if F[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...
s333368212
p04045
Accepted
n, k = map(int, input().split()) l = list(map(int, input().split())) use_d = [] for i in range(10): if i not in l: use_d.append(i) use_d.sort() m = str(n) ds = [] import itertools for i in itertools.product(use_d, repeat=len(m)): d = int("".join(str(x) for x in i)) ds.append(d) ds.sort() import bisect 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...
s381757715
p04045
Accepted
import sys sys.setrecursionlimit(10**6) N, K = map(int, input().split()) D = set(map(int, input().split())) INF = 10**9 ans = INF def dfs(price): if price > 10*N: return INF if not D & set(map(int, list(str(price)))): return price return dfs(price + 1) ans = min(ans, dfs(N)) 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...
s108611428
p04045
Accepted
import sys input = sys.stdin.readline n,k=map(int,input().split()) d=list(input().split()) for _ in range(n,100000): string=str(_) check=0 for i in string: if i in d: check=1 if check==0: print(_) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s067329556
p04045
Accepted
import sys input = sys.stdin.readline def main(): N, K = map(int, input().split()) d = set(input().strip().split()) tmp = N while True: s = set(list(str(tmp))) if len(s & d) == 0: print(tmp) break tmp += 1 if __name__ == "__main__": main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s257761061
p04045
Accepted
n, k = map(int, input().split()) d = {str(x) for x in input().split()} a = {str(x) for x in range(10)} l = a - d while True: if all(j in l for j in str(n)): 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...
s939741251
p04045
Accepted
def resolve(): n, k = map(int, input().split()) d = list(input().split()) l = len(str(n)) for i in range(n, 10 * n + 1): if all(c not in d for c in str(i)): print(i) return 0 if __name__ == "__main__": resolve()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s663758475
p04045
Accepted
n,k=map(int,input().split()) s=set(input().split()) for i in range(n,10**5): if set(list(str(i)))&s==set(): print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s981308579
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) d = list(map(str, D)) while True: if all(c not in d for c in str(N)): break N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s856122731
p04045
Accepted
from collections import Counter,defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue sys.setrecursionlimit(10**8) mod = 10**9+7 def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) def inpl_str(): return list(sys.stdin.readline().split()) def inpln...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s526131419
p04045
Accepted
N, K = map(int, input().split()) sample = [1*i for i in range(10)] D = list(map(int,input().split())) sa = set(sample) - set(D) sa_list = list(sa) total_fee = N while 1: list_total_fee = list(map(int, str(total_fee))) if set(list_total_fee).issubset(sa_list): print(total_fee) exit(0) else:...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s800271980
p04045
Accepted
n, k = map(int, input().split()) d = {str(x) for x in input().split()} a = {int(x) for x in range(10)} l = a - d for i in range(n,100000+1): i2 = str(i) for j in range(len(i2))[::-1]: if i2[j] in d: break else: print(i2) 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...
s874003889
p04045
Accepted
n, k = map(int, input().split(" ")) list_k = list(map(int, input().split(" "))) list_use_num = [] for i in range(10): if i not in list_k: list_use_num.append(i) check_num = n while True: list_check_num = list(map(int, str(check_num))) if set(list_check_num).issubset(list_use_num): print(check_num) 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...
s154120833
p04045
Accepted
n,k=map(int,input().split()) D=list(map(int,input().split())) for i in range(n,100*n): if all([int(x) not in D for x in str(i)]): print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s234640511
p04045
Accepted
def is_OK(i, not_dislike): dig_OK = [] tmp = str(i) i_list = [int(tmp[j]) for j in range(len(tmp))] for l in i_list: if l in not_dislike: dig_OK.append(True) else: dig_OK.append(False) return all(dig_OK) N, K = list(map(int, input().split())) D = [int(a) 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...
s076403181
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10*n): str_i=str(i) if all(int(j) not in d for j in str_i): 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...
s969768579
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) c = list(range(10)) #num = list(filter(lambda x: x not in d, c)) while n: a = list(str(n)) if list(filter(lambda x: int(x) in d, a)) == []: 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...
s333652562
p04045
Accepted
#C N,K = map(int,input().split()) lst = list(map(str,input().split())) ans = 0 while True: flag = len(list(set(lst) & set(list(str(ans))))) if ans >= N and flag == 0: break ans += 1 print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s544685265
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...
s801028367
p04045
Accepted
n,k = map(int,input().split()) d = [int(i) for i in input().split()] ans = 10**6 for i in range(10**6): if ans != 10**6: break cnt = i if n > cnt: continue while cnt != 0: if cnt % 10 in d: break if cnt < 10: ans = i break cnt...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s930793021
p04045
Accepted
N,K=map(int,input().split()) D=list(input().split()) temp=N f=False while f==False: num=set(list(str(temp))) f=True for i in num: if i in D: f=False break if f==True: print(temp) exit() temp+=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...
s197685504
p04045
Accepted
c = 0 f = True N, K = map(int, input().split()) ld = list(map(str, input().split())) while f: i = 0 N_str = str(N) for i in range(K): # print(i) if ld[i] in N_str: N += 1 break elif i == K-1: f = 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...
s692215154
p04045
Accepted
n, k = map(int, input().split()) d = input().split() possible = False while not possible: n_str = str(n) possible = True for di in d: if di in n_str: possible = False n += 1 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...
s985965081
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) value = n while(1): value_list = [s for s in str(value)] flag = 0 for i in d: if i in value_list: flag = 1 break if flag: value += 1 else: break print(value)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s788240765
p04045
Accepted
n, k = map(int,input().split()) d = list(map(str,input().split())) ans=0 # ans を用意する 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 #各桁がd にあるか調べて、あったら 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...
s626271589
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...
s746711703
p04045
Accepted
n,k=map(int,input().split()) d=input().split() while 1: t=0 p=list(str(n)) q=len(p) for c in range(q): if t==1: break for b in range(k): if p[c]==d[b]: r=10**(q-c-1) n=int(n/r+1)*r t=1 break if 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...
s013126239
p04045
Accepted
n,k=map(int,input().split()) d=input().split() while 1: t=0 p=list(str(n)) q=len(p) for c in range(q): if t==1: break for b in range(k): if p[c]==d[b]: n=n+1 t=1 break if t==0: 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...
s480792378
p04045
Accepted
N,K=map(int,input().split()) A=list(map(int,input().split())) flag=0 B=[0]*10 for i in range(len(A)): B[A[i]]+=1 for i in range(N,100000): flag = 0 k = str(i) for j in range(len(k)): if B[int(k[j])]==1: flag=1 if flag==0: print(k) exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s519323065
p04045
Accepted
N,K=map(int,input().split()) A=list(map(int,input().split())) flag=0 B=[0]*10 for i in range(len(A)): B[A[i]]+=1 for i in range(N,100000): flag = 0 k = str(i) for j in range(len(k)): if B[int(k[j])]==1: flag=1 if flag==0: print(k) exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s906468833
p04045
Accepted
n,k =map(int, input().split()) #d = list(map(int, input().split())) d = list(input().split()) #print(d) def check(kakaku, negative_number): check_sum = 1 for i in negative_number: if i in str(kakaku): #print(i) check_sum = 0 break else: pass return check_sum while check(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...