submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s004932144
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,input().split())) N -=1 N_str = str(N) while True: N += 1 N_str = str(N) for d in D: if d in N_str: break else: break print(N_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...
s626623991
p04045
Accepted
N,K = list(map(int, input().split())) D = set(input().split()) # シミュレーションでいける for ans in range(N,100000): if all(d not in D for d in str(ans)): print(ans) exit() raise AssertionError('バグってる')
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s330373769
p04045
Accepted
n,k =map(int,input().split()) d =list(map(int,input().split())) for i in range(n,10**n+1): for j in str(i): if int(j) in d: break else: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s492185875
p04045
Accepted
import sys import numpy as np input = sys.stdin.readline def log(*args): print(*args, file=sys.stderr) def main(): np.set_printoptions(threshold=20) n, k = map(int, input().rstrip().split()) ds = set(map(int, input().rstrip().split())) for i in range(n, 1000000): continue_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...
s283992221
p04045
Accepted
n,k=map(int, input().split(' ')) forbid= input().split(' ') def f(n): for digit in str(n): if digit in forbid: return False return True while f(n)== False: n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s391755201
p04045
Accepted
''' 研究室PCでの解答 ''' import math #import numpy as np import queue import bisect from collections import deque,defaultdict import heapq as hpq from sys import stdin,setrecursionlimit #from scipy.sparse.csgraph import dijkstra #from scipy.sparse import csr_matrix ipt = stdin.readline setrecursionlimit(10**7) mod = 10**9+7 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s310555816
p04045
Accepted
def main(): N, K = map(int, input().split()) d = set(map(str, input().split())) while (len(set(list(str(N))) & d) != 0): 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...
s304314989
p04045
Accepted
n, k = map(int, input().split()) d=list(input().split()) for i in range(n, 10**5): if all(str(i).count(k)<=0 for k in d): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s101021309
p04045
Accepted
import sys,math,collections,itertools,bisect input = sys.stdin.readline N,K=list(map(int,input().split())) D = list(map(int,input().split())) Ds = set([0,1,2,3,4,5,6,7,8,9])-set(D) if 0 in Ds: can = list(itertools.product(Ds,repeat = 5)) candi = [] for c in can: candi.append(10**4*c[0]+10**3*c[1]+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...
s109648019
p04045
Accepted
n, k =map(int, input().split()) a = list(map(str, input().split())) for i in range(n*10): z = 0 x = n+i y = str(x) for i in range(len(y)): if y[i] in a: z+=1 break if z == 0: 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...
s661532363
p04045
Accepted
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N, K, *D = map(int, read().split()) ng = [False] * 10 for d in D: ng[d] = True for n in range(N, 10 ** 5): n = 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...
s535418278
p04045
Accepted
N , K = map(int, input().split()) Dk = input().split() for i in range(N,10*N+1): if set(str(i))&set(Dk) == 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...
s059857809
p04045
Accepted
N,K = map(int,input().split()) D = set(input().split()) while len(set(str(N))&D): N+=1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s400317375
p04045
Accepted
N,K = map(int,input().split()) D = set(input().split()) for n in range(N,100000): if len(set(str(n))&D)==0: 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...
s843669443
p04045
Accepted
n, k = map(int, input().split()) D = set(list(input().split())) for i in range(n, n*10+1): 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...
s046213108
p04045
Accepted
amount,dislike = map(int,input().split()) l = list(map(str,input().split())) temp = {"0","1","2","3","4","5","6","7","8","9"} like = list(set(temp)-set(l)) i=0 for n in range(amount,100000): k =[] i = n k.append(str(i%10)) i = i-i%10 if n>=10: k.append(str(i%100//10)) i = i-i%100 if n>=100: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s704323956
p04045
Accepted
n, k = map(int, input().split()) a = list(map(str, input().split())) a = set(a) while True: f = 1 for c in str(n): if c in a: f = 0 break if f: 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...
s797800764
p04045
Accepted
n,k = map(int, input().split()) d = list(map(int,input().split())) for i in range(n,10**5+1): for j in str(i): if int(j) in d: break else: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s403723476
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) flg=False while True: nn=str(n) flg=True for i in range(len(nn)): if nn[i] in d: flg=False if flg: 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...
s165985532
p04045
Accepted
from itertools import product n,k = map(int, input().split()) d = list(map(int, input().split())) nums = [] for i in range(10): if i not in d: nums.append(i) m = str(n) for i in range(len(m), len(m)+2): for j in product(nums, repeat=i): ans = "" for k in j: ans += str(k) if int(ans) >= n: 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...
s457076196
p04045
Accepted
from collections import defaultdict dd = defaultdict(lambda:0) n, k = map(int, input().split()) li = list(map(str, input().split())) for i in li: dd[i] = 1 while True: n = str(n) b = True for i in n: if dd[i]==1: b = False break n = int(n) if b: print(n) break 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...
s922497505
p04045
Accepted
def main(): import sys def input(): return sys.stdin.readline().rstrip() n, k = map(int, input().split()) d = list(map(int, input().split())) s = [i for i in range(10) if i not in d] for i in range(n, 10*n+1): for j in map(int, list(str(i))): if j in d: 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...
s545172085
p04045
Accepted
import sys N, K = map(int, input().split()) D = set(map(int, input().split())) def check(n): m = set(str(n)) for c in m: if int(c) in D: return False return True for i in range(999999): if check(N+i): print(N+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...
s501427595
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) while True: a = [] m = n while m > 0: a.append(m % 10) m = m // 10 j = 0 for i in range(len(a)): if a[i] in d: break j += 1 if j == len(a): print(n) 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...
s607853108
p04045
Accepted
# -*- coding: utf-8 -*- import io import sys import math def format_multi_line_answer(lst): ans = "" ans += f"{len(lst)}\n" # Line count for y in lst: ans += f"{y}\n" return ans def solve(n,k_set): # implement process for i in range(n, sys.maxsize): s = set(str(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...
s724208863
p04045
Accepted
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline in_n = lambda: int(readline()) in_nn = lambda: map(int, readline().split()) in_nl = lambda: list(map(int, readline().split())) in_na = lambda: map(int, read().split()) in_s = lambda: readline().rstrip().decode('utf-8') def main(): N, K...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s649309223
p04045
Accepted
N, K = map(int, input().split()) Ds = set(input().split()) i = N while 1: S = str(i) flag = 1 for s in S: if s in Ds: flag = 0 break if flag == 1: print(i) exit() i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s844519146
p04045
Accepted
n,_=map(int,input().split()) m=set(input().split()) while True: for i in str(n): if i in m: n+=1 break else: break print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s075411086
p04045
Accepted
n, k = map(int, input().split()) D = set(list(input().split())) for price in range(n, 10000000): if len(set(list(str(price))) - D) == len(set(list(str(price)))): print(price) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s307175024
p04045
Accepted
def has_no(s, digits): for ch in s: if ch in digits: return False return True def digit(): N, K = [int(n) for n in input().split()] digits = input().split() for i in range(N, N*10): s = str(i) if has_no(s, digits): print(s) break digit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s879855431
p04045
Accepted
# 入力 N,K = list(map(int, input().split())) D = list(map(int, input().split())) availbale_numbers = [0,1,2,3,4,5,6,7,8,9] for i in D: availbale_numbers.remove(i) for i in range(N,99999): if(set(str(i)) <= set([str(a) for a in availbale_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...
s192457038
p04045
Accepted
# 入力 N,K = list(map(int, input().split())) D = list(map(int, input().split())) availbale_numbers = [0,1,2,3,4,5,6,7,8,9] for i in D: availbale_numbers.remove(i) for item1 in availbale_numbers: if(N <= int(('').join([str(item1)]))): print(('').join([str(item1)])) exit() for item1 in availba...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s541365566
p04045
Accepted
n,k=map(int,input().split()) hate_list=list(map(int,input().split())) p_list=[] ok_list=[] hate_list.append(10) s=0 for x in hate_list: while x>s: ok_list.append(s) s+=1 s+=1 ok_list.append(10) # print(ok_list) # nの桁をリスト化 ndgts=[] while n>0: ndgts.append(n%10) n//=10 flag=0 #necess...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s490350465
p04045
Accepted
N, K = map(int, input().split()) D = list(map(str, input().split())) T = True while T: x = str(N) p = 0 for i in range(len(x)): if x[i] in D: p = 1 if p == 0: T = False 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...
s276032799
p04045
Accepted
import io,sys sys.setrecursionlimit(10**6) def main(): n,k = map(int,input().split()) D = list(map(int,input().split())) while True: temp = n num = [] while temp > 0: num.append(temp%10) temp//=10 flag = True for i in 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...
s303263296
p04045
Accepted
#!/usr/bin/python # -*- coding: UTF-8 -*- import sys def input(): return sys.stdin.readline().strip() def _main(): n, k = input().split() x = set(input()) n_s = set(n) n_i = int(n) while True: if x & n_s: n_i += 1 n_s = set(str(n_i)) else: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s669028794
p04045
Accepted
# -*- coding: utf-8 -*- import sys,math,itertools input = sys.stdin.readline n, k = map(int, input().split()) d = [int(_) for _ in input().split()] d_set = set(d) d_all = set(range(10)) d_use = [str(a) for a in list(d_all - d_set)] keta = int(math.log10(n))+1 # l1 = [int(''.join(list(a))) if int(''.join(list(a)))>=n el...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s835835399
p04045
Accepted
# -*- coding: utf-8 -*- import sys,math,itertools input = sys.stdin.readline n, k = map(int, input().split()) d = [int(_) for _ in input().split()] d_set = set(d) d_all = set(range(10)) d_use = [str(a) for a in list(d_all - d_set)] keta = int(math.log10(n))+1 l1 = [int(''.join(list(a))) if int(''.join(list(a)))>=n 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...
s909775373
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) while True: flg = True lis = list(str(N)) for i in lis: if int(i) in D: flg = False if flg == True: 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...
s802599503
p04045
Accepted
import sys n, k = map(int, input().split()) d = list(map(int, input().split())) nums = [i for i in range(10)] canuse = [] for i in nums: if i not in d: canuse.append(i) for i in range(n,n*10): x = 0 for j in str(i): if int(j) not in canuse: break else: 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...
s113330058
p04045
Accepted
n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] ans = n f = False while True: for dd in d: if str(dd) in str(ans): f = True break if not f: break f = False 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...
s665959388
p04045
Accepted
n, k = map(int, input().split()) *excluded_digits, = input().split() i = 0 while i < n or any(ch in excluded_digits for ch in str(i)): i += 1 print(i)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s236892707
p04045
Accepted
def check(s,l): for i in s: if i in l: return False return True n,k = map(int,input().split()) l = "".join(input().split()) for s in [str(i) for i in range(n,100000)]: if check(s,l): print(s) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s582890218
p04045
Accepted
def has_no2(s, digits): for ch in s: if ch in digits: return False return True def main2(): N, K = [int(x) for x in input().split()] digits = ''.join(input().split()) for s in [str(i) for i in range(N, 100000)]: if has_no2(s, digits): print(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...
s015295283
p04045
Accepted
def has_no(s, digits): for ch in s: if digits.get(ch): return False return True def main(): N, K = [int(x) for x in input().split()] digits = {str(x): True for x in input().split()} for s in [str(i) for i in range(N, 100000)]: if has_no(s, digits): print(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...
s518440433
p04045
Accepted
import sys N, K = map(int, input().split()) D = list(map(int, sys.stdin.readline().rsplit())) for i in range(N, 100000): for d in D: if str(d) in str(i): break else: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s591501199
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) dp=[0]*10 for i in range(K): dp[D[i]]=1 for i in range(N,10**6+1): a=str(i) flag=True for j in range(len(a)): if dp[int(a[j])]==1: 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...
s992723961
p04045
Accepted
def main(): from collections import deque N,K = map(int,input().split()) D = list(set(range(10)) - set(map(int,input().split()))) D.sort() targets = deque(D) while True: t = targets.popleft() if N <= t: print(t) return t *= 10 for d in D: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s348164474
p04045
Accepted
n,k,*a=map(int,open(0).read().split()) for i in range(n,10**6): if all(str(j) not in str(i) for j in a): 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...
s873974865
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) for i in range(N, 100000): for j in D: if j in str(i): break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s398327507
p04045
Accepted
n, k = list(map(int, input().split())) d = list(input().split()) for i in range(n, 100000): for j in d: if j in str(i): break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s904029166
p04045
Accepted
n, k = map(int, input().split()) d = set(map(int, input().split())) s = set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) dd = s - d for i in range(n, 100001): ss = set([int(i) for i in list(str(i))]) if dd >= ss: 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...
s732051246
p04045
Accepted
n,k=map(int,input().split()) d=set(map(int,input().split())) i=n while True: temp=i flag=1 while temp>0: if temp%10 in d: flag=0 break temp//=10 if flag: 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...
s506150983
p04045
Accepted
n,k = map(int,input().split()) t = list(map(int,input().split())) for j in range(n,100000): h = str(j) u=0 for s in h: if int(s) in t: u+=1 break if u==0: print(h) 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...
s606087754
p04045
Accepted
n, k = map(int,input().split()) d = set(map(int,input().split())) for i in range(n, 100000): for j in str(i): if int(j) in d:break else: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s154609401
p04045
Accepted
import collections import heapq import math import random import sys input = sys.stdin.readline n, k = map(int, input().split()) d = list(map(int, input().split())) d = set(d) while True: found = True cur = n while cur: if cur % 10 in d: found = False break cur //= 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...
s401891910
p04045
Accepted
n, k = (input().split()) n = list(map(int, n)); dSet = set(map(int, input().split())) okList = [i for i in range(10) if i not in dSet] i = len(n) while i >= 0: i -= 1 if n[i] in okList: continue for y in okList: if n[i] < y: n[i] = y j = i+1 while j < 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...
s284241593
p04045
Accepted
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): from collections import deque n, k = map(int, readline().split()) d = list(map(int, readline().split())) e = [str(i) for i in range(10) if i not in d] que = deque([i for i in...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s132131118
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) ans = 99999 for i in range(99999, N-1, -1): for j in range(5): if 10**j > i: continue if (i//(10**j))%10 in D: break else: ans = i 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...
s515443448
p04045
Accepted
#ABC042_C N, K = map(int, input().split()) D = list(map(int, input().split())) while True: hantei = True for i in D: if str(i) in str(N): hantei = False if hantei==False: 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...
s753328463
p04045
Accepted
N, K = input().split() dislike = set(list(map(int, input().split()))) next_map = {} min_digit = 0 for i in range(10): for j in range(i,10): if j not in dislike: if i == 0: min_digit = j next_map.update({ i : j }) break next_map.update({ i : min_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...
s856364912
p04045
Accepted
a = input().split() tg = a[0] ok_nums = set(["1","2","3","4","5","6","7","8","9","0"]) ng_nums = set(input().split()) ok_nums = ok_nums - ng_nums rt = 0 i = int(tg) while True: if ok_nums >= set(d for d in str(i)): print(i) break else: 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...
s370050116
p04045
Accepted
a = input().split() tg = a[0] ok_nums = set(str(i) for i in range(10)) ng_nums = set(i for i in input().split()) ok_nums = ok_nums - ng_nums rt = 0 i = int(tg) while True: if ok_nums >= set(d for d in str(i)): print(i) break else: 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...
s354049996
p04045
Accepted
a = input().split() tg = a[0] ok_nums = set(str(i) for i in range(10)) ng_nums = set(i for i in input().split()) ok_nums = ok_nums - ng_nums rt = 0 i = int(tg) intg = int(tg) while intg > rt: if ok_nums >= set(d for d in str(i)): rt = i else: i+=1 print(rt)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s126365594
p04045
Accepted
D = [i for i in range(10)] N,K = map(int,input().rstrip().split(" ")) A = list(map(int,input().rstrip().split(" "))) flag = True for i in range(N,10 ** 6 + 1): flag = True for i2 in range(6): if i >= 10 ** i2 and (i // (10 ** i2)) % 10 in A: 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...
s809860664
p04045
Accepted
n, k = map(int, input().split()) dat = list(map(str,input().split())) for i in range(n, 1000001): s = str(i) did = True for j in range(len(s)): if s[j] in dat: did = False if did: 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...
s187822920
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) for num in range(n,100001): num=str(num) ok=True for c in num: if c in d: ok=False if ok: print(num) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s017407665
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) for i in range(n,100001): s = list(str(i)) sw = 0 for t in s: for j in range(k): if int(t) == d[j]: sw = 1 break if sw == 1: break if sw == 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...
s916801144
p04045
Accepted
N, K = map(int, input().split()) l = list(map(str, input().split())) for i in range (N, 100000): k = str(i) counter = 0 for j in range (0, K): if k.find(l[j]) >= 0: counter+=1 if counter == 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...
s334469638
p04045
Accepted
n,k=map(int,input().split()) s=set(input().split()) while True: l=list(str(n)) for i in l: if i in s: break else: break n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s532052674
p04045
Accepted
N,K=map(int,input().split()) D = set(input().split()) while True: if not set(str(N)) & D: 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...
s107800552
p04045
Accepted
N, K = map(int, input().split()) D = [str(i) for i in input().split()] answer = 0 while True: if not set(str(N)) & set(D): answer = N break else: N += 1 print(answer)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s993724080
p04045
Accepted
N, K = map(int, input().split()) P = list(map(int, input().split())) numbers = [0,1,2,3,4,5,6,7,8,9] use = [] for i in numbers: if not i in P: use.append(i) ul = [] if 0 in use: for u5 in [0,use[1]]: for u4 in use: for u3 in use: for u2 in use: for u1 in use: ul.append(u...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s898694942
p04045
Accepted
N, K = map(int,input().split()) d = list(input().split()) for n in range(N, N*10): for s in str(n): if s in d: 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...
s831000336
p04045
Accepted
n,k=map(int,input().split()) d=set([int(x) for x in input().split()]) for i in range(n,100001): flag=True for j in str(d): if j in str(i): flag=False break if flag==True: 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...
s436457052
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) for i in range(n,100000): #print(i) res = 0 for j in str(d): if j in str(i): res += 1 if res == 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...
s567278667
p04045
Accepted
n, k = map(int, input().split()) d = list(input().split()) while True: s_n = str(n) for num in d: flag = True if num in s_n: flag = False break if flag is True: 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...
s562749463
p04045
Accepted
n, k = map(int, input().split()) arr = list(map(int, input().split())) while True: check = True for x in arr: if str(x) in str(n): check = False if check: break n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s045645659
p04045
Accepted
N, K = map(int, input().split()) D = {i for i in range(10)} - set(map(int, input().split())) for i in range(N, 100000): if all(j in D for j in map(int, str(i))): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s344991990
p04045
Accepted
# ABC042C N,K=map(int,input().split()) out=N N=str(N) a = list(map(int, input().split())) while 1<2: N1=N i=0 for i in range(len(a)): if str(a[i]) in N: N=int(N) N+=1 N=str(N) if N1==N: 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...
s639842836
p04045
Accepted
import sys N, K = map(int, input().split()) d = list(map(str, input().split())) D = set(d) for i in range(N, 1000000): S = set(str(i)) T = True for s in S: if s in D: T = False break if T: 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...
s329888294
p04045
Accepted
from itertools import product n,k = map(int, input().split()) d = list(map(int, input().split())) nums = [] for i in range(10): if i not in d: nums.append(i) for i in range(len(str(n)), 6): for j in product(nums, repeat=i): t = "" if j[0] != 0: for k in j: t += str(k) if int(t) >= 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...
s175005079
p04045
Accepted
N,K = map(int,input().split()) D = input().split() for i in range(N,10*N): tmp = list(str(i)) for j in tmp: if j in D: break else: print(''.join(tmp)) 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...
s878559989
p04045
Accepted
def mi(): return map(int, input().split()) def ii(): return int(input()) def main(): N, K = mi() D = set(mi()) while True: if set(map(int, str(N))) & D: N += 1 else: print(N) return if __name__ == '__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s703217076
p04045
Accepted
N , L = map(int,input().split()) nols = list(map(str,input().split())) for i in range(10*N): pri = N + i pri = str(pri) if any(x in pri for x in nols): continue else: print(pri) 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...
s431352444
p04045
Accepted
import sys input = sys.stdin.readline #n = int(input()) #l = list(map(int, input().split())) ''' a=[] b=[] for i in range(): A, B = map(int, input().split()) a.append(A) b.append(B)''' a=list(map(str, [0,1,2,3,4,5,6,7,8,9])) n,k=map(int, input().split()) d=list(map(str, input().split())) for item in d: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s584768700
p04045
Accepted
import sys input = sys.stdin.readline #n = int(input()) #l = list(map(int, input().split())) ''' a=[] b=[] for i in range(): A, B = map(int, input().split()) a.append(A) b.append(B)''' a=list(map(str, [0,1,2,3,4,5,6,7,8,9])) n,k=map(int, input().split()) d=list(map(str, input().split())) for item in d: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s511902077
p04045
Accepted
import sys n,k=map(int,input().split()) d=list(map(int,input().split())) allowed=set() for i in d: allowed.add(i) for i in range(n,10**7): b=str(i) c=set() for j in range(len(b)): c.add(int(b[j])) if allowed.intersection(c)==set(): 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...
s087743975
p04045
Accepted
N,K = map(int, input().split()) D_list = set(list(map(int, input().split()))) bn = sorted(list((set([0,1,2,3,4,5,6,7,8,9]) - D_list))) res = 0 for v4 in bn: money = v4 if money >= N: print(money) exit() for i3 in bn: v3 = i3 * 10 for v4 in bn: money = v3+v4 if money >= ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s499856322
p04045
Accepted
import sys import numpy as np import random from decimal import Decimal import itertools import re import bisect from collections import deque, Counter from functools import lru_cache sys.setrecursionlimit(10**9) INF = 10**13 def LI(): return list(map(int, sys.stdin.buffer.readline().split())) def I(): return int(sys....
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s021336984
p04045
Accepted
N, K = map(int, input().split()) d = list(map(str, input().split())) like = [ str(i) for i in range(10)] like = list(set(like) ^ set(d)) Ans = 0 while( Ans == 0): if set(list(str(N))) <= set(like): print(N) Ans +=1 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...
s594959190
p04045
Accepted
N, K = list(map(int, input().split())) D = set(map(str, input().split())) ans = N while True: ans_set = set(str(ans)) if ans_set & D: ans += 1 else: 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...
s460206341
p04045
Accepted
amount, num = map(int, input().split()) hated_digit = list(map(str, input().split())) while True: check = 0 for hd in hated_digit: if hd not in str(amount): check += 1 else: amount += 1 if check == num: print(amount) 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...
s247495655
p04045
Accepted
amount, num = map(int, input().split()) hated_digit = list(map(str, input().split())) while True: check = 0 for hd in hated_digit: if hd not in str(amount): check += 1 else: amount += 1 if check == num: print(amount) 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...
s146233221
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) for i in range(n, 100000): for j in d: if str(j) in str(i): break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s240560533
p04045
Accepted
#!/usr/bin/env python3 n, k = map(int, input().split()) D = list(map(int, input().split())) paid = n while True: st = set(int(x) for x in str(paid)) l = len(st) if len([x for x in st if x not in D]) == l: print(paid) break paid += 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...
s965074556
p04045
Accepted
n,k=map(int,input().split()) D = list(map(str,input().split())) x = n while True: y = str(x) for i in y: if i in D: break else: ans = x break x += 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...
s496548696
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n, 10**5): num = str(i) for j in range(len(num)): if num[j] in d: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s411048812
p04045
Accepted
n, _ = map(int, input().split()) arr = list(map(str, input().split())) can_use = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} can_use -= set(arr) price = set(str(n)) while price - can_use: n += 1 price = 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...
s403191835
p04045
Accepted
n,k=map(int,input().split()) D = list(map(str,input().split())) x = n while True: y = str(x) for i in range(len(y)): if y[i] in D: break else: ans = x break x += 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...