submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s323124777
p04045
Accepted
import sys input = sys.stdin.readline def main(): N, K = [int(x) for x in input().split()] D = [int(x) for x in input().split()] Dset = set(D) for i in range(N, 1000000): for j in str(i): if int(j) in Dset: break else: print(i) 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...
s492158009
p04045
Accepted
n, k = input().split() ds = input().split() ns = {_n for _n in n} ds = { d for d in ds} result = 1 while(True): rs = {r for r in str(result)} if result >= int(n) and len(rs&ds) == 0 : print(result) break else: result += 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...
s834520334
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) ds = set(d) ans = n flag = True while flag: stans = str(ans) array = list(map(int, stans)) sa = set(array) if sa & ds == set(): flag = False else: ans += 1 print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s304202659
p04045
Accepted
N,K = list(map(int,input().split())) D = list(input().split()) ok = set(("0","1","2","3","4","5","6","7","8","9"))-set(D) def solve(str_num): ans = 100000 if str_num == "": for c in ok: if c == "0": continue ans = min(ans,solve(str_num+c)) else: 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...
s903439463
p04045
Accepted
n,k=map(int,input().split()) D=set(map(int,input().split())) for i in range(n,n*10+1): if i>=n and len(set(map(int,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...
s368942771
p04045
Accepted
import sys input = sys.stdin.readline from operator import itemgetter sys.setrecursionlimit(10000000) INF = 10**30 def main(): n, k = list(map(int, input().strip().split())) d = input().strip().split() ans = n while True: sans = str(ans) flag = False for c in sans: #...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s973821671
p04045
Accepted
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools from collections import deque sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 DR = [1, -1, 0, 0] DC = [0, 0, 1, -1] def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s756816369
p04045
Accepted
N,K = map(int, input().split()) lst = list(map(str, input().split())) while True: flag = True for elem in list(str(N)): if elem in lst: flag = False break if flag: 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...
s903318340
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) ok = [1] * 10 for i in d: ok[i] = 0 while 1: s = str(n) fin = 1 for c in s: fin &= ok[int(c)] if fin: print(s) exit() n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s511584678
p04045
Accepted
# -*- coding: utf-8 -*- import bisect import heapq import math import random import sys from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permut...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s183932847
p04045
Accepted
N, K = map(int, input().split()) D = input().split() while True: if any([c in D for c in str(N)]): 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...
s624284385
p04045
Accepted
N, K = map(int, input().split()) D = list(map(str, input().split())) while True: flg = True num = str(N) for i in range(len(num)): if num[i] in D: flg = False break if flg is True: print(int(num)) 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...
s119162255
p04045
Accepted
import sys input = sys.stdin.readline N, K = [int(x) for x in input().split()] D = [str(x) for x in input().rstrip().split()] D = set(D) for i in range(N, N + 10 ** 6): i_list = list(str(i)) flag = 1 for j in i_list: if j in D: flag = 0 break if flag: 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...
s421744213
p04045
Accepted
# https://atcoder.jp/contests/abc042/submissions/9653489 import itertools N, K = input().split() P = input().split() #使える数字 a= sorted(set([str(i) for i in range(10)])-set(P)) #同じ桁 b1 = itertools.product(a, repeat=len(N)) #繰り上がって一つ大きい桁 b2 = itertools.product(a, repeat=len(N)+1) ans=str() cnt=0 for i in b1: #print(ty...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s760959603
p04045
Accepted
n,k=map(int,input().split()) D=set(map(str,input().split())) for i in range(n,10*n): num=set(list(str(i))) if i>=n and len(D&num)==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...
s156034679
p04045
Accepted
n,k=map(int,input().split()) D=set(list(map(str,input().split()))) for i in range(n,10*n): num=set(list(str(i))) if i>=n and len(D&num)==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...
s442900040
p04045
Accepted
n,k=map(int,input().split()) D=set(list(map(int,input().split()))) for i in range(n,10*n): num=set(list(map(int,str(i)))) if i>=n and len(D&num)==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...
s969631449
p04045
Accepted
import itertools N, L = map(str, input().split()) P = list(map(str, input().split())) U = itertools.product(sorted(list(set([str(i) for i in range(10)])-set(P))),repeat=len(N)) F = itertools.product(sorted(list(set([str(i) for i in range(10)])-set(P))),repeat=len(N)+1) K = str() cnt=0 for i in U: #print(''.join(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...
s756752026
p04045
Accepted
N, K = map(int, input().split()) hate = set(map(str, input().split())) Nos = {str(i) for i in range(10)} while not set(list(str(N))) & hate == set(): 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...
s625381221
p04045
Accepted
N, K = map(int, input().split()) hate = set(map(str, input().split())) Nos = {str(i) for i in range(10)} available = Nos ^ hate while not set(list(str(N))) <= available: 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...
s054234540
p04045
Accepted
n, k = map(int,input().split()) dList = list(map(int,input().split())) minN = -1 for i in range(n,10*n+1): for j in range(len(str(i))): if dList.count(int(str(i)[j])) == 0: minN = i else: minN = -1 break if minN != -1: break print(minN)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s091570318
p04045
Accepted
n,k=map(int,input().split()) s=set(input().split()) #print(s) 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...
s589542829
p04045
Accepted
def main(): N,K = list(map(int,input().split())) D = set(list(input().split())) while True: s = set(list(str(N))) if len(s & D) == 0: print(N) break else: N+=1 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...
s771028140
p04045
Accepted
N,K = map(int,input().split()) D = input().split() num = set([str(i) for i in range(10)]) Ds = set(D) diff = num^Ds ans = N while True: strN = set(list(str(ans))) if strN - diff: 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...
s050013807
p04045
Accepted
N, K = map(int, input().split()) dislikes = input().split() for i in range(N, 100000): str_i = str(i) if any([d in str_i for d in dislikes]): continue print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s997162462
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) dic={} for i in d: dic[str(i)]=1 # print(dic) # s=str(n) # print(list(s)) while 1: s=str(n) # print(s) for i in range(len(s)): if s[i] in dic: break else: print(n) break n+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s657880398
p04045
Accepted
N, K = list(map(int, input().split())) D = list(map(str, input().split())) for i in range(N, 10**5): for c in str(i): if c 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...
s531152826
p04045
Accepted
nk=list(map(int,input().split())) d=list(map(int,input().split())) i=nk[0] ans=0 while ans==0: flag=0 for j in range(len(str(i))): if int(str(i)[j]) in d: flag=1 break if flag==0: ans=i i+=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...
s757255922
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) while True: p = str(n) flag = True for c in p: if c in d: flag = False if flag: 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...
s096621492
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) def ok(i): while i > 0: k = i%10 if k in d: return False i //= 10 return True while not ok(n): n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s036848601
p04045
Accepted
N,K=map(int,input().split()) D=list(input().split()) while True: A=str(N) count = 0 for i in range(len(A)): if A[i] in D: N+=1 break else: count +=1 if count == len(A): print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s964529910
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) for i in range(N, 10 * N + 1): A = list(map(int, str(i))) flag = 1 for a in A: if a in D: flag = 0 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...
s165358186
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) for i in range(n,10*n): a=str(i) b=len(a) ans=True for j in a: if j in d: ans=False break if ans: 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...
s488929274
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) while True: flag = True for i in str(n): if i in d: flag = False if flag: 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...
s141797748
p04045
Accepted
N, K = map(int, input().split()) D = set(list(input().split())) while True: if set(list(str(N))) & D: N += 1 else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s217249600
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, input().split())) for i in range(N, 10**5): for c in str(i): if c 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...
s837869104
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) E = [x for x in range(10) if x not in D] # print(N, K, D, E) def is_valid(n): while n > 0: d = n % 10 if d in D: return False n //= 10 return True ans = N while not is_valid(ans): 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...
s763195125
p04045
Accepted
import numpy as np import fractions as fra n,k=map(int,input().split()) d =[x for x in input().split()] def che(s):#string s for x in s: for y in d: if(x==y): return 0 return 1 for i in range(n,10**10): if(che(str(i))): print(i) exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s765342528
p04045
Accepted
import sys from copy import copy N, K, *D = map(int, open(0).read().split()) candidate = sorted(list({i for i in range(10)} - set(D))) like_integer = copy(candidate) # 1桁の場合を判定 for j in candidate: if j >= N: print(j) sys.exit() for i in range(1, 6): order = 10 ** i _candidate = [] fo...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s392140921
p04045
Accepted
#import sys #input = sys.stdin.buffer.readline def main(): N,K = map(int,input().split()) D = list(map(int,input().split())) use = [] for i in range(10): if i not in D: use.append(i) nl = [] for i in range(N,10*N+1): num = i ans = True while 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...
s107728779
p04045
Accepted
def ok(): for i in str(n): if int(i) in d: return False return True n,k=list(map(int,input().split())) d = list(map(int,input().split())) while True: if ok(): 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...
s176376815
p04045
Accepted
# -*- coding: utf-8 -*- import sys def input(): return sys.stdin.readline().strip() def list2d(a, b, c): return [[c] * b for i in range(a)] def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)] def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s355366470
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) use = [str(i) for i in range(10) if i not in d] mon5 = [int(i+j+k+l+m) for i in use for j in use for k in use for l in use for m in use if int(i+j+k+l+m)>=n] mon4 = [int(i+j+k+l) for i in use for j in use for k in use for l in use if int(i+j+k+l)>=n] mon3 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s553859811
p04045
Accepted
n, k = map(int, input().split()) set_D = set(map(int, input().split())) set_num = set() for i in range(10): set_num.add(i) set_use_num = set_num - set_D set_use_num = sorted(set_use_num) for j in range(n, 88889): Check = True for num in str(j): if int(num) not in set_use_num: Check =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s972512479
p04045
Accepted
n, k = map(int, input().split()) d = set(map(str, input().split())) amt = list(str(n)) if not len(d & set(amt)): print(n) else: n1 = n while True: n1 += 1 if len(set(list(str(n1))) & d) == 0: print(n1) 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...
s370322015
p04045
Accepted
n,k = input().split() d = input().split() ni = int(n) f = [] while True: for j in range(len(d)): if d[j] not in n: f.append(True) else: f.append(False) if False not in f: break f = [] ni += 1 n = str(ni) print(ni)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s614222014
p04045
Accepted
n,k = map(int,input().split()) d = input().split() x = n-1 while True: x += 1 s = str(x) f = 0 for t in d: if t in s: f = 1 if f == 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...
s943499685
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) for i in range(N,100000): j = i while j > 0: if j % 10 in D: break j = int(j/10) if j == 0: 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...
s999877894
p04045
Accepted
# https://atcoder.jp/contests/abc042/tasks/arc058_a # 最悪でも10**6探索する程度なのでNを一つづつ足して全探索でもよくね? N, K = list(map(int, input().split())) D = set(input().split()) def is_inD(n: int): tmp = set(str(n)) return tmp.isdisjoint(D) for i in range(N, N + 10 ** 6): if is_inD(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...
s151576327
p04045
Accepted
### N = int(input(()) N, M = map(int, input().split()) D = list(map(int, input().split())) for i in range(N,100000): j = i while j > 0: if j % 10 in D: break j = int(j/10) if j == 0: 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...
s892445700
p04045
Accepted
N,K=map(int,input().split()) D=list(map(str,input().split())) while True: flg=True for i in range(len(str(N))): #print(str(N)[i]) if str(N)[i] in D: #print("S",str(N)[i]) N+=1 flg=False break if flg: 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...
s033923766
p04045
Accepted
money, num = map(str, input().split()) hate = list(map(str, input().split())) for i in range(int(money), 100000): a = [hate_num for hate_num in hate if hate_num in str(i)] if a == []: print(str(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...
s888813293
p04045
Accepted
def problem_c(): N, K = map(int, input().split()) D = list(map(str, input().split())) numbers = {str(i) for i in range(10)} availables = set(numbers) - set(D) for i in range(N, 100000): nums = set(str(i)) if nums <= availables: print(i) return ########## pro...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s455973694
p04045
Accepted
N,K=map(int, input().split()) D=list(map(str, input().split())) for i in range(N,10**9): flg = True for j in str(i): if j in D: flg = False if(flg): 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...
s208031557
p04045
Accepted
price, _ = map(int, input().split()) hate = list(input().split()) while sum([i in hate for i in list(str(price))]) > 0: price += 1 print(price)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s114804750
p04045
Accepted
N, K = [int(i) for i in input().split()] d = [int(i) for i in input().split()] D = [1 if i not in d else 0 for i in range(10)] for a in range(N,10*N+1): for b in str(a): if D[int(b)] == 0: break else: print(a) 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...
s896674844
p04045
Accepted
import sys input = sys.stdin.readline N,K=map(int,input().rstrip().split()) D=list(map(int,input().rstrip().split())) sys.setrecursionlimit(10**6) def dfs(N): for i in range(K): if(str(N).find(str(D[i]))!=-1): dfs(N+1) return else: print(N) dfs(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...
s926406387
p04045
Accepted
n,k = map(int,input().split()) dl = list(map(str,input().split())) for i in range(100001): yen = n + i if set(list(str(yen))) & set(dl): continue else: print(yen) import sys 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...
s564169013
p04045
Accepted
N,K=[int(c) for c in input().split()] D=0 for c in input().split(): D|=(1<<int(c)) while(1): d=0; for c in str(N): d|=1<<int(c) if(d&D==0): 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...
s475478747
p04045
Accepted
def solve(target: int, dislike_numbers: set) -> int: for i in range(target, target * 10): used_numbers = set(int(n) for n in str(i)) if not used_numbers.intersection(dislike_numbers): return i target, n = map(int, input().split()) values = map(int, input().split()) print(solve(target, 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...
s535095681
p04045
Accepted
n, k = map(int, input().split()) one_to_nine = set([0,1,2,3,4,5,6,7,8,9]) a = set(list(map(int, input().split()))) a = one_to_nine - a a = list(a) for i in range(n, 100001): x = list(str(i)) flag = True for j in x: if int(j) in a: continue else: 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...
s271615075
p04045
Accepted
import bisect from itertools import product N, K = map(int, input().split()) D = map(int, input().split()) like_num = set(range(0,10)) ^ set(D) length = len(str(N)) for l in range(length, length+2): comb = [int("".join(map(str, a))) for a in product(like_num, repeat=l)] ind = bisect.bisect_left(comb, N) if 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...
s572442225
p04045
Accepted
from itertools import product N, K = map(int, input().split()) D = map(int, input().split()) like_num = set(range(10)) ^ set(D) length = len(str(N)) for i in range(length, length+2): for x in product(like_num,repeat=i): d=''.join(map(str,x)) if int(d)>=N: print(d) 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...
s435235964
p04045
Accepted
import math import fractions n, k = map(int, input().split()) d = [i for i in input().split()] i = n while 1: flag = 1 for j in d: if j in str(i): i += 1 flag = 0 break if flag: 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...
s152326336
p04045
Accepted
N,K = map(int,input().split()) D = set([i for i in map(str,input().split())]) for i in range(N,10**6): ng = 0 str_i = str(i) for s in str_i: if s in D: ng = 1 break if ng == 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...
s849145875
p04045
Accepted
n,k = map(int,input().split()) d = list(input().split()) for i in range(n,10**6+1): if any(x in set(str(i)) for x in d): continue 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...
s312144617
p04045
Accepted
n,k = map(int, input().split()) d = input().split() while True: s = str(n) for i in d: 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...
s824820725
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n, 10*n+1): num = list(str(i)) for j, n in enumerate(num): if n in d: break if j == len(num)-1: 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...
s659827613
p04045
Accepted
numbers = {str(i) for i in range(10)} N, K = map(int, input().split()) *D, = map(str, input().split()) D = set(D) available = numbers - D ans = 0 for i in range(N, 100000): nums = set(str(i)) if nums <= available: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s025481414
p04045
Accepted
n,k = map(int, input().split()) d = list(map(int, input().split())) a = [] for i in range(10): if i not in d: a.append(str(i)) ans = n while True: b = str(ans) if all([i in a for i in b]): 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...
s807763637
p04045
Accepted
N, X = map(int, input().split()) arr = list(input().split()) ans = 0 for i in range(N,10**7): flg = True s = str(i) for k in s: if str(k) in arr: flg = False break if flg: 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...
s086799001
p04045
Accepted
n, k =map(int,input().split()) d=list(map(int,input().split())) while any(int(x) in d for x in str(n)): n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s211857960
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) while any(int(x) in d for x in str(n)): n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s375336496
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) d = set([str(_d) for _d in d]) ans = n while True: f = True a = str(ans) for _a in a: if _a in d: f = False if f: print(ans) break 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...
s634200640
p04045
Accepted
N, K = list(map(int, input().split())) D = input().split() num = list(map(str, range(10))) for k in range(K): num.remove(D[k]) for I in range(N, 100000): if all([II in num for II in str(I)]): print(I) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s918373291
p04045
Accepted
n, k = input().split(' ') d = list(input().split(' ')) while any(x in d for x in n): n = str(int(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...
s467100606
p04045
Accepted
n, k = input().split(' ') d = list(input().split(' ')) while any(x in d for x in n): n = str(int(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...
s903636554
p04045
Accepted
import sys N, K = map(int, input().split()) st = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} dis = map(int, input().split()) for i in dis: st.remove(i) def dfs(num, pos, target): if pos == target: if num >= N: print(num) sys.exit() return for i in st: dfs(num * 10 + i, 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...
s033996820
p04045
Accepted
ip = input().split() N = int(ip[0]) K = int(ip[1]) Dinput = input().split() Ds = []#嫌いな数 for i in range(K): Ds.append(Dinput[i])#文字列 boolean = False n = N while boolean == False: str_n = list(str(n)) for d in range(K): if Ds[d] in str_n:#嫌いな文字がある場合 boolean = False 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...
s917196801
p04045
Accepted
n,k = list(map(int,input().split())) l = list(map(str,input().split())) while set(str(n))&set(l):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...
s076681594
p04045
Accepted
import sys if sys.platform =='ios': sys.stdin=open('Untitled.txt') input = sys.stdin.readline def INT(): return int(input()) def MAP(): return [int(s) for s in input().split()] N, K = MAP() A = MAP() while True: for s in str(N): if A.count(int(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...
s227279617
p04045
Accepted
n,a =map(int,input().split()) s=list(map(str,input().split())) while set(str(n))&set(s): 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...
s021350638
p04045
Accepted
import sys, math def input(): return sys.stdin.readline()[:-1] def main(): N, K = map(int,input().split()) D = set(list(input().split())) for k in range(N,100001): s = str(k) f = 0 for e in s: if e in D: f = 1 break if f == 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...
s620484185
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) while 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...
s279041729
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,map(int,input().split()))) n = N while True: s = str(n) S = set(list(s)) for c in S: if c in D: break else: break n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s226424222
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) def isAvailable(x): for c in str(x): if int(c) in d: return False return True while True: if isAvailable(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...
s367734864
p04045
Accepted
n, k = map(int, input().split()) d = input().split() while True: s = str(n) for x in d: if x 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...
s555967626
p04045
Accepted
n, k = map(int, input().split()) dislikes = input().split() payment = n while True: tmp = str(payment) for t in tmp: if t in dislikes: break else: break payment += 1 print(payment)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s670381993
p04045
Accepted
N,M=map(int,input().split()) T=list(map(int,input().split())) #N=9999 #M=1 #T=[1,3,4,5,6,7,8,9] #T=[] L=[] for i in range(10): if(not T.count(i)): L.append(i) l=len(str(N))+1 MIN=10**10 def calc(st): global MIN st=str(st) if(len(st)>l):return 0 for num in L: t=calc(st+str(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...
s649003468
p04045
Accepted
from collections import defaultdict, deque, Counter from heapq import heappush, heappop, heapify import math import bisect import random from itertools import permutations, accumulate, combinations, product import sys from pprint import pprint from copy import deepcopy import string from bisect import bisect_left, bise...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s218677840
p04045
Accepted
from collections import defaultdict, deque, Counter from heapq import heappush, heappop, heapify import math import bisect import random from itertools import permutations, accumulate, combinations, product import sys from pprint import pprint from copy import deepcopy import string from bisect import bisect_left, bise...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s044400733
p04045
Accepted
from itertools import * if __name__=="__main__": n,k = map(int,input().split(' ')) d = list(map(int,(input().split(' ')))) d = [i for i in range(10) if i not in d] ans = 1e10 keta = len(str(n)) for k in range(1,keta+2): for perm in product(d,repeat=k): num = 0 fo...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s350251158
p04045
Accepted
import sys import collections def solve(): input = sys.stdin.readline mod = 10 ** 9 + 7 n, k = list(map(int, input().rstrip('\n').split())) d = collections.defaultdict(int) for v in list(map(int, input().rstrip('\n').split())): d[str(v)] for i in range(n, 10 ** 10): s = 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...
s730943946
p04045
Accepted
import itertools n, k = map(int, input().split()) d = set(list(map(int, input().split()))) inzero = False if 0 in d: inzero = True d -= set([0]) can_use = set([0,1,2,3,4,5,6,7,8,9]) - d can_use = list(can_use) #全探索 ans = 10**6 def check(i): global ans x = int("".join(list(map(str, i)))) if inzero: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s884266114
p04045
Accepted
import sys n, k, *dislikes = sys.stdin.read().split() n = int(n) dislikes = set(dislikes) def main(): i = n while True: if set(str(i)) & dislikes: i += 1 continue return i if __name__ == '__main__': ans = main() 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...
s374833679
p04045
Accepted
import sys from string import digits from itertools import product from bisect import bisect_left as bi_l n, k, *dislikes = sys.stdin.read().split() def main(): likes = sorted(set(digits) - set(dislikes)) cand = product(likes, repeat=len(n)) *cand, = map(lambda x: int(''.join(x)), cand) cand.sort() ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s806579919
p04045
Accepted
n, k = map(int, input().split(' ')) d = input().split(' ') p = n while any(de in str(p) for de in d): p += 1 print(p)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s913703973
p04045
Accepted
def main(): N, K = list(map(int, input().split())) D = set(map(int, input().split())) ok_set = set([i for i in range(0,10)]) - D ok_list = list(ok_set) # print(ok_list) def is_ok(num): ans = True for si in str(num): n = int(si) if n not in ok_list: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s150163118
p04045
Accepted
def main(): N, K = list(map(int, input().split())) D = set(map(int, input().split())) OK_N = set([i for i in range(0, 10)]) - D OK_N = list(OK_N) l1 = [str(i)for i in OK_N] for _ in range(len(str(N)) - 1): tmp_l = [] for li in l1: # print(li) for ni in O...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s968258361
p04045
Accepted
from itertools import product n,k=map(int,input().split()) a=list(map(int,input().split())) ls=[0,1,2,3,4,5,6,7,8,9] nm=[] for i in ls: if i not in a: nm.append(i) b=[] for i in product(nm,repeat=5): b.append(10000*i[0]+1000*i[1]+100*i[2]+10*i[3]+i[4]) b.append(1000*i[0]+100*i[1]+10*i[2]+i[3]) b.append(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...