submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s246674322
p04045
Accepted
n, k = map(int, input().split()) d = set(input()) 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...
s562389152
p04045
Accepted
def checkN(N,D): for each in N: if each in D: return False return True line1 = input().split(' ') N = line1[0] D = input().split(' ') i = -1 while not checkN(N, D): N = str(int(N)+1) # i -= 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...
s702025309
p04045
Accepted
def solve(price, usable): ans = price usable_set = set(usable) while True: ans_set = {int(i) for i in list(str(ans))} if ans_set <= usable_set: return ans ans += 1 if __name__ == "__main__": n,k = map(int,input().split()) d_list = [int(i) for i in input().split()] usable = [int(i) for 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...
s757011344
p04045
Accepted
n,_=map(int,input().split()) s=set(input()) while s&set(str(n)): n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s092919848
p04045
Accepted
n,_=map(int,input().split()) s=set(input().split()) while s&set(str(n)): n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s188842247
p04045
Accepted
n,k=map(int,input().split()) l=input().split() while 1: for i in str(n): if i in l: n+=1; break else: print(n); break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s283660903
p04045
Accepted
n,k = map(int,input().split()) d = input().split() def judge(strn): for i in strn: if i in d: return 0 else: continue return 1 while True: strn = str(n) if judge(strn): print(strn) 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...
s916920696
p04045
Accepted
N,_=map(int, input().split()) D=input().rstrip().split() n=N while True: flag=False s=list(str(n)) for i in s: if i in D: flag= True break if not flag: 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...
s989207957
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) for i in range(N, 100000): if not set(list(str(i))) & D: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s854748275
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(1,100001): if i<n: continue num=str(i) ok=True for nn in num: if int(nn) in d: ok=False break if ok: 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...
s852531689
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) import re L=[0,1,2,3,4,5,6,7,8,9] D=set(D) L=set(L) L_D =list(L-D) while True: Value=N S_value=str(Value) for j in range(len(L_D)): S_value=re.sub('{}'.format(L_D[j]),'',S_value) if S_value=='': print('{}'.format(Value)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s545285178
p04045
Accepted
n,k,*d=map(int,open(0).read().split()) while 1: for i in str(n): if int(i)in d: break else:print(n);break n+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s213668048
p04045
Accepted
n=int(input().split()[0]);d=set(input());print(min(i for i in range(n,99999)if not d&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...
s965608812
p04045
Accepted
n = int(input().split()[0]) d = set(input()) for i in range(n, 999999): if not set(str(i)) & d: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s336542214
p04045
Accepted
from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify import sys,bisect,math,itertools,fractions from decimal import Decimal sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readlin...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s229439531
p04045
Accepted
n,k=map(int,input().split()) d=list(input()) while True: ns=str(n) for i in d: if i in ns:break else: print(ns) 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...
s833498962
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) num=[] for i in range(10): if i not in d: num.append(i) #print(num) num.sort() digit=len(str(n)) ns=str(n) ans='' cnt=0 while cnt<digit: for i in num: if int(ns[cnt])>i:continue if int(ns[cnt])==i: ans+=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...
s692243014
p04045
Accepted
amount, num_cnt = map(int, input().split()) hate_list = input().split() payment = 0 for i in range(amount, 100000): nums = set(list(str(i))) flg = False for j in nums: if j in hate_list: flg = True break if not flg: payment = i break 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...
s688705644
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) possible=set() for i in range(0,10): if i not in d: possible.add(str(i)) for i in range(n,100000): i=str(i) for j in i: if j not in possible: 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...
s269448994
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) def ok(x): x = str(x) for i in range(len(x)): if int(x[i]) in d: return False return True for i in range(n,10**5): if ok(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...
s409239238
p04045
Accepted
n, k = map(int, input().split()) D = list(map(int, input().split())) def valid(x): for xx in str(x): if int(xx) in D: return False return True while True: if valid(n): print(n) break n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s585564460
p04045
Accepted
N,_ = map(int, input().split()) D = set(input().split()) for i in range(10 ** 6): S = set(list(str(N))) if not D & S: 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...
s370417127
p04045
Accepted
N, K = map(int, input().split()) D = set(list(input())) for k in range(N, 20 * N): if len(set(list(str(k))) & D) == 0: print(k) 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...
s143978970
p04045
Accepted
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s126867861
p04045
Accepted
N,K=map(int, input().split()) D=set(input().split()) def check(x): for c in str(x): if c in D: return False return True ans = N while not check(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...
s704606476
p04045
Accepted
N, K = map(int, input().split()) A = set(input().split()) for i in range(100001): S = set(list(str(N))) if not A & S: ans = N break N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s548416614
p04045
Accepted
def solve(): n,k = map(int,input().split()) d = set(map(int,input().split())) for i in range(n,100000): s = map(int,str(i)) flag = True for j in s: if j in d: flag = False if flag: print(i) return if __name__ == "__main__":...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s607552953
p04045
Accepted
import sys input = sys.stdin.readline N, K = map(int, input().split()) d = set(map(int, input().split())) for x in range(N, 10 ** 6): f = 1 for y in str(x): if int(y) in d: f = 0 break if f: print(x) 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...
s107745782
p04045
Accepted
N, K = [int(i) for i in input().split()] D = set([i for i in input().split()]) while True: res = str(N) for v in D: if v in res: break else: print(res) quit() 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...
s881437230
p04045
Accepted
def main(): N, K = (int(i) for i in input().split()) D = {i for i in input().split()} ans = N while any(a in D for a in str(ans)): ans += 1 print(ans) 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...
s495804474
p04045
Accepted
n, k = map(int, input().split()) D = list(map(int, input().split())) D = set(D) while True: s = list(str(n)) flag = True for i in range(len(s)): if int(s[i]) in D: flag = False if flag: break else: n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s243960614
p04045
Accepted
import itertools n, k = map(int, input().split()) d = input().split() for i in itertools.count(n): for k in str(i): if k 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...
s948985323
p04045
Accepted
# -*- coding: utf-8 -*- import sys import math import os import itertools import string import heapq import _collections from collections import Counter from collections import defaultdict from functools import lru_cache import bisect import re import queue from decimal import * class Scanner(): @staticmethod ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s250198887
p04045
Accepted
N, K = list(map(int, input().split())) D = set(input().split()) num = {str(i) for i in range(10)} - D while True: if set(str(N)) <= num: ans = N break else: N += 1 print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s745165780
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) ans = N while not set(str(ans)).isdisjoint(D): 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...
s304522432
p04045
Accepted
N,K = map(int,input().split()) List = list(input().split()) Digit = ['0','1','2','3','4','5','6','7','8','9'] for item in List: if item in Digit: Digit.remove(item) for i in range(N,10*N): if set(list(str(i))) <= set(Digit): 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...
s958713110
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) nums = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} dd = d ^ nums i = n while True: if dd >= set(list(str(i))): print(i) exit() 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...
s760919029
p04045
Accepted
# https://atcoder.jp/contests/abc042/tasks/arc058_a def exist(target, array): for token in list(str(target)): if token in array: return True return False n, _ = map(int, input().split()) d = input().split() x = n while True: if not exist(x, d): break x += 1 print(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...
s165716029
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) ans = N while not set(str(ans)).isdisjoint(D): 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...
s248592960
p04045
Accepted
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**8) INF = float("inf") def solve(N: int, K: int, D: "List[int]"): D = set([str(c) for c in D]) for ans in range(N, 10*N): if set(str(ans)).isdisjoint(D): print(ans) return return def main(): def iterate_tok...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s897422598
p04045
Accepted
n, k = map(int,input().split()) alg = set([0,1,2,3,4,5,6,7,8,9]) numeros = set(map(int, input().split())) def contem(num, numeros): for l in str(num): if int(l) in numeros: return False return True target = n while not contem(target,numeros): target += 1 print(target)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s308488503
p04045
Accepted
N, K = map(int, input().split()) D = {x for x in input().split()} for i in range(N, 100000): l = set(list(str(i))) if len(l & 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...
s786682777
p04045
Accepted
n,k=map(int,input().split()) s=set(input().split()) while 1: if set(list(str(n)))&s:n+=1 else:break print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s146211614
p04045
Accepted
n,k = map(int,input().split()) d = tuple(map(int, input().split())) flug = 1 while flug: flug = 0 n2 = list(map(int,str(n))) for i in n2: if i in d: n += 1 flug = 1 break print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s253462804
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) for i in range(1000000): if i < n: continue i1 = str(i) flag = True for j in range(len(i1)): if not flag: break i2 = int(i1[j]) if i2 in d: flag = False if not flag: con...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s169743773
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) possible = [str(i) for i in range(10) if str(i) not in d] for i in range(n,10**5): for j in str(i): if j not in possible: 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...
s879162161
p04045
Accepted
import itertools n, k = map(int, input().split()) d = list(map(int, input().split())) use = [i for i in range(10) if not i in d] p = list(itertools.product(use, repeat=len(str(n)))) ans = float('inf') for i in p: numlist = [] if i[0] != 0: for g in range(len(str(n))): numlist.append(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...
s978340048
p04045
Accepted
N,K = [int(i) for i in input().split()] D = sorted([int(i) for i in input().split()],reverse=True) def is_ok(x): while x!=0: if x%10 in D: return False x //=10 return True while True: if is_ok(N): print(N) break N+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s466035436
p04045
Accepted
n, k = map(int, input().split()) d = [ int(x) for x in input().split() ] def is_ok(x): while x != 0: if x % 10 in d: return False x //= 10 return True money = n while True: if is_ok(n): print(n) break n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s464669480
p04045
Accepted
import functools n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,n*11): count=0 l = [int(x) for x in list(str(i))] for j in l: #print(j) if j not in d : count+=1 if count==len(l): print( int(functools.reduce(lambda x, y: x + y, [str(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...
s851504662
p04045
Accepted
numbers = {str(i) for i in range(10)} N, K = map(int, input().split()) D = list(map(str, input().split())) D = set(D) available = numbers - D 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...
s860849307
p04045
Accepted
N, K = map(int, input().split()) List = list(map(int, input().split())) price = N - 1 while True: flag = True price += 1 price_str = str(price) for num in str(price_str): if int(num) in List: flag = False if flag == True: 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...
s343823516
p04045
Accepted
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s304997498
p04045
Accepted
n,k = [int(x) for x in input().split()] d = [int(x) for x in input().split()] for x in range(n, 100000): ans = 100000 tmp = True for y in str(x): if int(y) in d: tmp = False break if tmp: ans = min(ans,x) 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...
s734173012
p04045
Accepted
from sys import stdin from operator import itemgetter ##stdin = open("sample.txt") N, K = [int(x) for x in stdin.readline().rstrip().split()] d = stdin.readline().rstrip() D = d.replace(' ','') D_list = [D[i] for i in range(0, len(D), 1)] price = N buy = False while buy == False: price_str = str(price) 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...
s453446778
p04045
Accepted
N,K=map(int,input().split()) D=list(input().split()) D.insert(0,0) n=0 while True: n+=1 ok=True for i in list(str(n)): if i in D: ok=False break if ok and N<=n: 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...
s014191901
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) while True: ok = True for x in d: if x in str(n): ok = False break if ok: 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...
s229779396
p04045
Accepted
n,k=map(int,input().split()) D=set(map(int,input().split())) for i in range(n,10**5+10): S=list(str(i)) a=0 for j in range(len(S)): if int(S[j]) in D: a=1 break if a==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...
s938429185
p04045
Accepted
n, k = map(int, input().split()) d = list(input().split()) while True: ok = True for x in d: if x in str(n): ok = False break if ok: 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...
s383422064
p04045
Accepted
n, k = map(int,input().split()) l = set(map(str, input().split())) x = list(set(['0','1','2','3','4','5','6','7','8','9']) - l) y = len(str(n)) from itertools import product z = list(product(x, repeat = y)) z += list(product(x, repeat = y + 1)) for i in range(len(z)): z[i] = int(''.join(z[i])) z.sort() for j 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...
s662091906
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,input().split())) ind_f = lambda x:x in D for i in range(N,10*N): i_li = list(str(i)) if not any(map(ind_f, i_li)): 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...
s301883582
p04045
Accepted
# /usr/bin/python3 # -*- coding: utf-8 -*- from queue import Queue from queue import LifoQueue as Stack from math import sqrt, floor, ceil, log2 from fractions import gcd from itertools import permutations, combinations from operator import itemgetter from functools import cmp_to_key __MOD__=(10**9)+7 yn = 'YNeos' j...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s591681578
p04045
Accepted
N, K = map(int, input().split()) numbers = set(input().split()) num = N while True: l = set([s for s in str(num)]) if l.isdisjoint(numbers): print(num) break num += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s773495232
p04045
Accepted
n, k = map(int, input().split()) dlist = list(map(int, input().split())) # antilist = list(set([0,1,2,3,4,5,6,7,8,9]) - (dlist)) res = [] digit = len(str(n)) while True: ok = True for i in range(0, len(str(n))): num = n // 10 ** (i) % 10 if num in dlist: ok = False if ok: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s754782540
p04045
Accepted
#042_C n, k = map(int, input().split()) d = set(map(int, input().split())) d_ = list({i for i in range(0, 10)} - d) inf = 10 ** 7 def dfs(frm, cur): if frm == cur == 0: return inf if cur >= n: return cur x = 10 ** 7 for k in d_: x = min(x, dfs(cur, cur * 10 + 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...
s071236452
p04045
Accepted
from collections import deque N, K = map(int, input().split()) D = input().split() nums = list("0123456789") for d in D: nums.remove(d) def dfs(N, nums): ans = 10 ** 9 if "0" in nums: queue = deque(nums[1:]) else: queue = deque(nums) while queue: tmp = queue.pop() ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s205691400
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,n*10+1): N=list(str(i)) for j in range(len(N)): N[j]=int(N[j]) N=set(N) d=set(d) if N.isdisjoint(d): 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...
s273478224
p04045
Accepted
N,K = map(int, input().split()) Ds = list(map(int, input().split())) able = [] for i in range(10): if i in Ds:continue able.append(i) # print(able) sN = str(N) n = len(sN) m = able[0] #最小 if int(sN[0]) > max(able): if m == 0: ans = str(able[1]) + str(able[0]) * n else: ans = str(able...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s976118409
p04045
Accepted
N,K = map(int,input().split()) d = set(map(str,input().split())) OK = {str(i) for i in range(10)} - d for i in range(N,100000): if set(str(i)) <= OK: 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...
s865510212
p04045
Accepted
n, k = map(int, input().split()) hoge = input().split() def check(num): for i in range(k): if num.find(hoge[i]) >= 0: return False return True result = n while(True): if check(str(result)): break result += 1 print(result)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s331647276
p04045
Accepted
N, K = [int(i) for i in input().split(' ')] D = [int(i) for i in input().split(' ')] c = N while True: s = [int(i) for i in list(str(c))] flg = False for i in s: if i in D: flg = False break else: flg = True if flg: print(c) b...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s481566834
p04045
Accepted
N,K = list(map(int, input().split())) D = sorted(input().split()) W = [] for i in range(10): if str(i) not in D: W.append(i) while True: cnt = 0 for i in range(len(W)): cnt += str(N).count(str(W[i])) if cnt == len(str(N)): break N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s026801829
p04045
Accepted
""" kari1 = '2000 8' kari2 = '0 2 4 5 8 9' in1 = kari1.split() in2 = kari2 """ in1 = input().split() in2 = input() tukaeru = [] for num1 in range(10): if str(num1) not in in2: tukaeru.append(str(num1)) nedan = [] for num1 in range(len(in1[0])): nedan.append(in1[0][num1]) idx1 = 0 for item1 in nedan: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s763026049
p04045
Accepted
N, K, *D = open(0).read().split() N = int(N) for i in range(N, 10*N): S = str(i) flg = True for s in S: if s in D: flg = False break if flg: 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...
s933340728
p04045
Accepted
n, k = input().split() d = input().split() valid = [i for i in range(10) if str(i) not in d] ans = '' if valid[-1] < int(n[0]): if valid[0] == 0: ans += str(valid[1]) else: ans += str(valid[0]) ans += str(valid[0]) * len(n) elif valid[-1] == int(n[0]): for s in n: if s > str(val...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s679137151
p04045
Accepted
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 N,K=MI() D=LI() for i in range(N,10**5+1): ans=str(i) f=1 for j in range(K): 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...
s495512140
p04045
Accepted
n,k=map(int,input().split()) t=list(map(int,input().split())) while True: tab=0 for i in t: if str(i) in list(str(n)): tab+=1 if tab==0: 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...
s382499909
p04045
Accepted
n, k = map(int, input().split()) D = set(map(int, input().split())) num = set(i for i in range(10)) D = num - D for i in range(n, 100000): for _ in str(i): if int(_) not 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...
s272480751
p04045
Accepted
from sys import stdin lines = stdin.readlines() counter = [] each_line = [] for i, line in enumerate(lines): if i == 0: counter = [int(x) for x in (line.rstrip().split())] else: each_line = [str(x) for x in (line.rstrip().split())] str_n = str(counter[0]) digit = len(str_n) for num in range(c...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s754664613
p04045
Accepted
n, K = map(int, input().split()) d = [x for x in input().split()] e = set(d) ans = n while True: q = set(str(ans)) if len(q&e) == 0: break 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...
s438387568
p04045
Accepted
import sys N, _ = map(int, input().split()) D = input().split() answer = sys.maxsize for x in range(N, 100000): s = str(x) if all([y not in s for y in D]): answer = min(answer, x) 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...
s447170923
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...
s331593981
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, 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...
s509214438
p04045
Accepted
n, k = map(int, input().split()) num_list=list(map(int,input().split())) flag = False num = n while flag == False: str_num = str(num) flag = True for ban_num in num_list: if str(ban_num) in str_num: num = num + 1 flag = False break print(num)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s301032126
p04045
Accepted
n, k = map(int,input().split()) ds = set(input().split()) for i in range(n, n + 100000): ok = True for j in str(i): if j in ds: ok = False break if ok: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s667911895
p04045
Accepted
N,K = map(int,input().split()) D = list(input().split()) for i in range(N,N+100000): n = str(i) k = 1 for j in n: if j in D: k=0 break if k: 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...
s652219315
p04045
Accepted
n,k =map(int,input().split()) D = set(str(x) for x in input().split()) safe = set(range(10)) - D while D & set(str(n)): n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s955763969
p04045
Accepted
import sys sys.setrecursionlimit(10**6) n_price,k = map(str,input().split()) k = int(k) n_length = len(n_price) d_ng_list = list(input()) restrict = True answer = "" for s in range(10): if str(s) not in d_ng_list: min_number = str(s) break def find_number(i): global restrict if not restrict: return min_numbe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s841037298
p04045
Accepted
#nが小さいので全部試せる n,k = map(int,input().split( )) d= set(input().split( )) ans = n while True: tmp = set(str(ans)) flag = True for e in tmp: if e in d: flag = False ans += 1 break if flag: 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...
s923125347
p04045
Accepted
n,k=map(int,input().split()) D=input().split() for i in range(n,10**5): flag=True S=str(i) for s in S: if s in D: flag=False break if flag: ans=i break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s986749008
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) usenum = set() for i in range(10): if not i in D: usenum.add(str(i)) for i in range(N, N*10+1): t = set(str(i)) if t.issubset(usenum): 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...
s714352321
p04045
Accepted
N, K = map(int, input().split()) s = list(map(int, input().split())) all = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] usable = set(all) - set(s) i = 0 while i == 0: num = N l = list(map(int, list(str(num)))) wa = set(usable) | set(l) if wa == usable: i = i + 1 else: 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...
s511884595
p04045
Accepted
import sys readline = sys.stdin.buffer.readline n,k = map(int,readline().split()) lst1 = list(readline().rstrip().decode('utf-8').split()) i = n while True: flag = 0 for j in lst1: if j in str(i): i += 1 flag = 1 break if not 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...
s609955541
p04045
Accepted
n,k=map(int,input().split()) d=input().split() for i in range(n,10*n+1): i=str(i) check=1 for c in i: if c in d: check=0 if check==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...
s585850574
p04045
Accepted
n, k = map(int,input().split()) d = list(map(int,input().split())) for i in range(n,100001): x = 0 for j in str(i): if int(j) in d: x = 1 break if x == 1: pass else: break print(i)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s385035496
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,n*10+1): if all(d.count(int(j))==0 for j in str(i)): print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s183226518
p04045
Accepted
n,k=map(int,input().split()) d=set(input()) for i in range(n, 10000000): if len(set(str(i))&d)==0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s399432516
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) use = [i for i in range(10)] #使える数字 for i in range(K): use.remove(D[i]) ans = N while True: flag = True for item in list(str(ans)): if not (int(item) in use): flag = False if flag: break else: 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...
s799427172
p04045
Accepted
N,K = map(int,input().split()) D = list(map(str,input().split())) count = 0 while True: ans = N + count if len(set(D) & set(list(str(ans)))) == 0: break count += 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...
s321395682
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) while True: s=str(n) f=1 for i in range(len(s)): if s[i] in d: f=0 if f: 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...