submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s574854859
p04045
Accepted
N,K= map(int,input().split()) D = [int(j) for j in input().split()] D2 = list(set([i for i in range(0,10)])-set(D)) def f(N,D): if len(set([int(i) for i in list((str(N)))])&set(D))==0: return True else: return False if len(D2) ==0: print(N) else: while not f(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...
s687408430
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) l = [i for i in range(10)] for i in range(K): l.remove(D[i]) ansl = [] def dfs(s): if len(s) < len(str(N))+1: for i in l: new = s+str(i) ansl.append(int(new)) dfs(new) dfs("") ansl.sort() for i in ansl: if i >= N: 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...
s298471923
p04045
Accepted
import sys input = sys.stdin.readline def readstr(): return input().strip() def readint(): return int(input()) def readnums(): return map(int, input().split()) def readstrs(): return input().split() def main(): N, _ = readnums() d = set(readstrs()) for i in range(N, 100000): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s392137580
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) use = [i for i in range(10)] for _d in d: use.remove(_d) while True: ok = True s = str(n) for i in range(len(s)): if int(s[i]) not in use: ok = False break if ok: 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...
s095038311
p04045
Accepted
N, K = map(int,input().split()) D = list(map(int,input().split())) OK = [] for i in range(10): if i not in D: OK.append(str(i)) #print(OK) sn = str(N) l = len(sn) ans = N*1 Flag = 0 while Flag == 0: sans = str(ans) if all(sans[i] in OK for i in range(len(sans))): Flag = 1 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...
s631001150
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,1000000): s=str(i) ok=True t_str="" for ss in s: if int(ss) in d: ok=False break t_str+=ss if ok: print(int(t_str)) 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...
s506154124
p04045
Accepted
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n, k = map(int, input().split()) D = set(list(map(int, input().split()))) def dfs(L): if len(L) == 6: return for i in range(10): if i not in D: L.appen...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s225448344
p04045
Accepted
N,K=map(int, input().split()) D=list(map(int, input().split())) for i in range(N,10**9): S=str(i) ok=True for s in S: if int(s) in D: ok=False if ok: 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...
s653086857
p04045
Accepted
def solve(): N, K = map(int, input().split()) D = list(map(int, input().split())) while True: S = list(str(N)) for s in S: if int(s) in D: break else: return N N += 1 print(solve())
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s716713076
p04045
Accepted
N, K = map(int, input().split()) D = set(list(map(str, input().split()))) def ok(s): for c in s: if c in D: return False return True i = N while True: s = str(i) if ok(s): print(s) exit() i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s378070431
p04045
Accepted
import itertools n,k = map(int, input().split()) d = list(input().split()) d = [str(i) for i in range(10) if str(i) not in d] ans = float("INF") for v in itertools.product(d, repeat=len(str(n))): if v[0] != "0" and int("".join(v)) >= n: if ans > int("".join(v)): ans = int("".join(v)) if ans == float("INF"): 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...
s713912505
p04045
Accepted
def main(): n,k = map(int,input().split()) d = set(input().split()) while True: if len(set(str(n))&d) == 0: print(n) return 0 n += 1 if __name__ == '__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s626880472
p04045
Accepted
import sys input=sys.stdin.readline n,k=map(int,input().split()) d=[int(i) for i in input().split()] for i in range(1,100001): if i<n: continue now=str(i) for j in now: if int(j) in d: break else: print(now) 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...
s898279903
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, range(10))) - set(list(input().split())) for i in range(N, 100 * N): if set(list(str(i))) <= 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...
s659928838
p04045
Accepted
n,k = map(int,input().split()) D = list(map(int,input().split())) ans = n while True: for i in list(map(int, str(ans))): if i in D: break else: print (ans) exit () ans += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s731761318
p04045
Accepted
from collections import deque n, k = map(int, input().split()) D = list(map(int, input().split())) # 1. 初期化 ok_lst = [x for x in range(0, 10) if x not in D] ok_lst.sort(reverse = True) stack = deque([x for x in ok_lst if x != 0]) ans_list = [] while len(stack) > 0: # 2. 現在の情報の取得 # 今回は現在の数字 now_num = stack...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s789191270
p04045
Accepted
n, k = map(int, input().split()) d = input().split() ans = n flag = True while flag: flag = False for x in d: if x in str(ans): ans += 1 flag = True continue 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...
s110690821
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) for j in range(n, 100000): flg=False for s in set(str(j)): if s in d: flg=True break if flg==False: print(j) 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...
s985186971
p04045
Accepted
ma = lambda :map(int,input().split()) n,k = ma() D = set(input().split()) for i in range(n,10*n+1): if set(list(str(i))) & D: pass 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...
s239047992
p04045
Accepted
n,k=map(int,input().split()) d=input().split() yet=True while yet: yet=False for i in list(str(n)): if i in d: yet=True break n+=1 print(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...
s745574367
p04045
Accepted
#!/usr/bin/env python3 import sys # import math # from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits # import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s) # from operator import itemgette...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s994049453
p04045
Accepted
# https://atcoder.jp/contests/abc042/tasks/arc058_a n, k = map(int, input().split()) nums = list(set([i for i in range(10)]) - set([int(i) for i in input().split()])) def dfs(nums, t, n, path): if int(t) >= n: path.append(int(t)) return if len(t) > 7: return for num in nums: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s283251369
p04045
Accepted
n, k = map(int, input().split()) d = list(map(int, input().split())) while True: for i in str(n): if int(i) in d: n += 1 break else: 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...
s836020738
p04045
Accepted
def main(): num = list(map(int,input().split())) bad = list(map(str,input().split())) while True : flg=0 for i in range(0,len(str(num[0]))): stnum=str(num[0]) if stnum[i] in bad: flg=1 break if flg==1: num[0]+=1 continue else: break print(num[0]) 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...
s690771995
p04045
Accepted
def main(): num = list(map(int,input().split())) bad = list(map(int,input().split())) while True : flg=0 for i in range(0,len(str(num[0]))): stnum=str(num[0]) if int(stnum[i]) in bad: flg=1 break if flg==1: num[0]+=1 continue else: break print(num[0]) 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...
s627587252
p04045
Accepted
N, K = map(int,input().split()) d = list(map(int,input().split())) price = N flag = "like" ans_flag = 0 while ans_flag == 0: for i in range(len(str(price))): if int(str(price)[i]) in d: flag = "dislike" if flag == "dislike": price +=1 flag ="like" else: ans_flag = 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...
s610056924
p04045
Accepted
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2 from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter, mul...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s831167046
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) while True: for i in str(N): if int(i) in D: N += 1 break else: 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...
s223945497
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) UN = [i for i in range(10)] for i in D: UN.remove(i) n = str(N) N_keta = len(n) for i in n: if int(i) not in UN: break else: print(N) exit() ex_0 = [i for i in UN if i > 0] if N_keta == 1: if N < max(UN): _11 =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s522746985
p04045
Accepted
def main(): from itertools import combinations_with_replacement,permutations n, k = map(int, input().split()) *d, = input().split() m = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} - set(d) m = list(m) m.sort() mm = "" if m[0] != "0": mm = m[0] else: mm = m[1] ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s998012456
p04045
Accepted
n,k = map(int,input().split()) s = set(input().split()) while True: l = 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...
s613137257
p04045
Accepted
N, K = map(int, input().split()) D = [str(i) for i in input().split()] ans = N for i in range(N, 100001): if set(list(str(i))) & set(D): gg = 1 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...
s213244105
p04045
Accepted
import numpy as np N, _ = map(int, input().split()) D = np.bincount(tuple(map(int, input().split())), minlength=10) while True: n = N while n: if D[n % 10]: break n //= 10 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...
s797229897
p04045
Accepted
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bi...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s966518355
p04045
Accepted
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] from collections import defaultdict, deque from sys import exit import heapq import math import copy from bi...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s614361955
p04045
Accepted
N,K=map(int,input().split()) Dlist=list(map(int,input().split())) flag=True i=0 while flag: ans=str(i) num=0 if i>=N: for j in range(len(ans)): if int(ans[j]) not in Dlist: num+=1 if num==len(ans): print(i) 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...
s578619676
p04045
Accepted
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections MOD = 10**9+7 MAX = 10**18 MIN = -10**18 n,k= map(int,input().split()) d = list(map(int,input().split())) able = [True]*10 for i in range(k): able[d[i]] = False use = ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s403135864
p04045
Accepted
n,k = map(int,input().split()) L = list(map(int,input().split())) num = [1,2,3,4,5,6,7,8,9,0] li = list(set(num).difference(set(L))) flag = False while True: n = str(n) for i in range(len(n)): if int(n[i]) in li: flag = True else: flag= False break if fla...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s214905944
p04045
Accepted
n, k = [int(i) for i in input().split()] dd = [int(i) for i in input().split()] ans = n flg = True while flg: for s in str(ans): if int(s) in dd: ans += 1 break else: flg = False print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s707184230
p04045
Accepted
def cin(): return map(int,input().split()) def cina(): return list(map(int,input().split())) a,b = cin() a = list(str(a)) x = [] for i in a: x.append(int(i)) c = cina() d = {0,1,2,3,4,5,6,7,8,9} e = d.difference(c) s = "" index = -1 test = 0 no = 0 for i in range(len(x)): check = False for j in 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...
s474753724
p04045
Accepted
n,k = input().split() hate_num = input().split() num = int(n) boo = False while(boo == False): dec = [] for i in str(num): dec.append(i not in hate_num) if(False not in dec): boo = True num += 1 print(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...
s350591390
p04045
Accepted
n, k = (int(x) for x in input().split()) ds = [int(x) for x in input().split()] xs = list(filter(lambda x: x not in ds, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])) o = n m = len(str(n)) ans = 0 c = False for i in range(m): d = (o // 10 ** i) % 10 ys = list(filter(lambda x: x >= d, xs)) if len(ys) == 0: if i ==...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s226734653
p04045
Accepted
n, k = map(int, input().split()) d = set(list(map(str, input().split()))) for i in range(n, 10**6): w = True idx = 0 i = str(i) while idx < len(str(i)): if i[idx] in d: w = False break idx += 1 if w: 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...
s709994065
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) n=[int(x) for x in str(n)] ok=[] for i in range(10): if i not in d: ok.append(i) import bisect for i in range(len(n)-1,-1,-1): if n[i]>ok[len(ok)-1]: for j in range(i,len(n)): n[j]=str(ok[0]) if i>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...
s892005760
p04045
Accepted
import itertools N, K = map(int,input().split()) D = list(map(int,input().split())) not_D = [] siharai = [] for i in range(0,10): if i not in D: not_D.append(i) #print(not_D) c = list(itertools.product(not_D,repeat = len(str(N)))) c += (list(itertools.product(not_D,repeat = len(str(N))+1))) for row in c: 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...
s582878443
p04045
Accepted
N,K = map(int, input().split()) D = list(map(int, input().split())) nums = set([0,1,2,3,4,5,6,7,8,9]) nums -= set(D) #print(nums) ans = [] def func(s, nums): global ans if len(s) >= len(str(N)): if int(s) >= N: ans.append(int(s)) if len(s) > len(str(N))+1: return ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s467178480
p04045
Accepted
N, K = map(int, input().split()) D = [i for i in input().split()] while True: if all(n not in D for n in str(N)): print(N) exit() else: N += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s979200204
p04045
Accepted
import itertools NK = input().split() N = NK[0] K = int(NK[1]) d = input().split() D = [int(s) for s in d] Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in D: Da.remove(i) Da_str = [str(j) for j in Da] a_1 = [''.join(j) for j in itertools.product(Da_str, repeat=len(N))] a_2 = [''.join(j) for j in itertools.prod...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s754281694
p04045
Accepted
import sys N, K = map(int, sys.stdin.readline().rstrip().split()) D = set(map(str, sys.stdin.readline().rstrip().split())) for i in range(N, N*10+1): price_str = str(i) for num_str in price_str: if num_str in D: break else: print(price_str) 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...
s778270318
p04045
Accepted
def main(): from sys import stdin n,k = map(int,stdin.readline().rstrip().split()) Ds = set(map(int,stdin.readline().rstrip().split())) ans = n while True: num = ans numset = set() while num != 0: r = num%10 num = num//10 numset.add(r) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s328356667
p04045
Accepted
import itertools n, k = input().split() d = list(map(int, input().split())) number = list(range(10)) number = [str(x) for x in number if x not in d] ans = [] for v in itertools.product(number, repeat=len(n)): if v[0] == "0": continue if int("".join(v)) >= int(n): ans.append(int("".join(v))) if not ans: for v 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...
s518172887
p04045
Accepted
import sys input = sys.stdin.readline def main(): N, K = map(int, input().split()) D = list(map(str, input().split())) for i in range(N, 10 ** 5): s = str(i) hated = False for d in D: if d in s: hated = True if not hated: ans = 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...
s256759607
p04045
Accepted
N, K = map(int, input().split()) lst = [int(x) for x in input().split()] while True: l = [s for s in str(N)] f = True for n in set([int(x) for x in l]): if n in lst: f = False break 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...
s484741025
p04045
Accepted
def main(): N, K = input().split(" ") D = list(input().split(" ")) use_num = list(set([str(i) for i in range(10)]) - set(D)) N = int(N) i = N while True: if not set(str(i)) <= set(use_num) and i >= N: i += 1 else: print(i) break if __name_...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s176411938
p04045
Accepted
from collections import deque n, k = map(int, input().split()) D = list(map(int, input().split())) ok_lst = [x for x in range(0, 10) if x not in D] stack = deque([x for x in ok_lst if x != 0]) while len(stack) > 0: now_num = stack.popleft() if now_num >= n: print(now_num) break for x in ok_l...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s077650897
p04045
Accepted
n, k = map(int, input().split()) d = list(map(str, input().split())) """ l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in range(k): for j in range(len(l)): if d[i] == l[j]: l.pop(j) break """ while True: tmp = list(str(n)) flag = True for i in range(len(d)): if d[i] in...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s860611475
p04045
Accepted
# -*- coding: utf-8 -*- # 1行目 N,L = map(int,input().split()) mylist = [] mylist = list(map(int,input().split())) #for i in range(N): # val = input() # if val: # mylist.append(val) # else: # break i = 0 result = 0 res_bool = False while result < 10 * N: result = N + i #print("i:{}".format(i)) for a in 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...
s614555966
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) ans = N while True: for i in D: if str(i) in str(ans): break else: 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...
s903242655
p04045
Accepted
n, k = map(int,input().split()) d = list(map(int,input().split())) s = 0 while s<k and s == d[s]: s += 1 x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 t = 0 while i <= y + t: j = 0 while 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...
s546642751
p04045
Accepted
N,k=map(int,input().split()) D=set(input().split()) for i in range(N,88889): for s in str(i): if s 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...
s624497142
p04045
Accepted
import itertools n,k = map(int,input().split()) li = list(map(int,input().split())) se = list(map(str,set([i for i in range(0,10)]) - set(li))) lee = len(str(n)) ans = 999999999999999999999 tmp = '' kumi_li = list(itertools.product(se, repeat=lee+1)) kumi_2_li = list(itertools.product(se, repeat=lee)) for k in kumi_li:...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s193705694
p04045
Accepted
from itertools import product N, K = map(int, input().split()) A = [int(i) for i in input().split()] se = set(range(10)) for a in A: se ^= set([a]) def check(str_num): for x in str_num: if not int(x) in se: return False return True while True: if check(str(N)): break 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...
s952365356
p04045
Accepted
import itertools N, K = map(int, input().split()) D = set(input().split()) n = [x for x in str(N)] num = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - D judge = "no" ans = N for i in n: if i in D: judge = "yes" break if judge == "yes": if ans < int(sorted(list(num))[-1] * len(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...
s413100509
p04045
Accepted
N, K = map(int, input().split()) D = set(input().split()) for n in range(N, 100001): for s in str(n): if s in D: break 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...
s708877089
p04045
Accepted
def getDigits(n): digits = [] while n > 0: digits.append(n % 10) n //= 10 return digits def firstValidNumber(n, digits): while True: isValid = True currentDigits = getDigits(n) for digit in currentDigits: if digit in digits: isValid = False break if isValid: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s555259063
p04045
Accepted
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 res = [] def resolve(): n, k = map(int, input().split()) D = set(list(map(int, input().split()))) Available = [] for i in range(10): if i not in D: Available.append(str(i)) def dfs(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...
s386205944
p04045
Accepted
import sys n, k = map(int, input().split(" ")) d = list(map(int, input().split(" "))) def f(): q = [] for i in filter(lambda x: x not in d, range(10)): q.append(i) while len(q) != 0: x = q.pop(0) if x >= n: print(x) break for i in filter(lambda ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s598066926
p04045
Accepted
N, K = map(int, input().split()) D = set(map(str, input().split())) f = True while f: if set(list(str(N))) == set(list(str(N))) - D: print(N) f = False 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...
s749776744
p04045
Accepted
N, K = map(int, input().split()) number =set(map(str, input().split())) flag = True while flag == True: temp = list(str(N)) if set(temp) == set(temp) - number: print(N) flag = False else: N = 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...
s826923287
p04045
Accepted
n , k = map(int, input().split()) ns = str(n) d = set(list(map(int,input().split()))) s = set([0,1,2,3,4,5,6,7,8,9]) l = s-d le = len(ns) ans = 0 c=0 k=0 for i in range(le): for j in range(10-n%10-k): if n%10+j+k in l: ans += n%10+j+k if j+k != 0: ans=int(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...
s174197055
p04045
Accepted
N, K = input().split() array = input().split() result = N while True: for a in array: if a in list(result): break else: break result = str(int(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...
s407249706
p04045
Accepted
n, k = map(int, input().split()) d = set(map(int, input().split())) while True: str_n = str(n) hantei = 1 for i in range(len(str_n)): if int(str_n[i]) in d: hantei = 0 if hantei == 1: 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...
s805244383
p04045
Accepted
def resolve(): N, K = list(map(int, input().split())) D = input().split() i = N while True: for s in str(i): if s in D: i += 1 break else: print(i) return raise Exception("unreachable!") if '__main__' == __name__: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s386771397
p04045
Accepted
n,k=map(int,input().split()) d=set(map(int,input().split())) d_=set((1,2,3,4,5,6,7,8,9,0)) abl=d_-d ans='' a0=True a1=True for i in str(n): if a0 and int(i) in abl: ans+=str(i) elif a0: b=[ai for ai in abl if int(i)<ai] if len(b)==0: a1=False break b.sort() ans+=str(b[0]) a0=Fals...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s780476131
p04045
Accepted
def solve(n, k, xs): tmp = n num = len(xs) while True: if num == len([i for i in xs if i not in str(tmp)]): break else: tmp += 1 return tmp if __name__ == "__main__": n, k = [int(i) for i in input().split()] xs = [i for i in input().split()] ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s618180582
p04045
Accepted
import math import fractions #import sys #input = sys.stdin.readline def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) # divisors.sort() return divisors def Valu...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s845965643
p04045
Accepted
printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 def ddprint(x): if DBG: print(x) n,k = inm() d = set(inl()) for i in rang...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s676073498
p04045
Accepted
n, k=map(int, input().split()) nums=input().split() nums=[int(x) for x in nums] def split_to1d(x): res=[] while True: y=x%10 res.append(y) z=x//10 if z<1: break x=z return res while True: num_list=split_to1d(n) for i, num in enumerate(num_list): is_ok=Tr...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s068284469
p04045
Accepted
n, _ = map(int, input().split()) d = set(sorted(map(int, input().split()))) for q in range(100000): if not set(sorted({int(str(q)[i]) for i in range(len(str(q)))})) & d: if q >= n: print(q) 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...
s646998833
p04045
Accepted
import sys N, K = map(int, input().split()) Ds = list(input().split()) number = N-1 while True: number += 1 ng = False for i in range(K): if Ds[i] in str(number): ng = True break if ng == False: print(number) sys.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...
s338484651
p04045
Accepted
n,k = map(int,input().split()) d = list(map(int,input().split())) sset = set(i for i in range(1,10)) - set(d) while True: for x in d: if str(x) in str(n): 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...
s731260387
p04045
Accepted
n,k = map(int, input().split()) d_set = {x for x in input().split()} for i in range(n, 100000): i_set = set(str(i)) if(len(i_set & d_set) == 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...
s963912647
p04045
Accepted
import sys readline = sys.stdin.readline def main(): N, K = map(int, readline().rstrip().split()) D = set(readline().rstrip().split()) for i in range(N, N*10+1): d = str(i) flg = True for e in d: if e in D: flg = 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...
s744186309
p04045
Accepted
import sys readline = sys.stdin.readline def main(): N, K = map(int, readline().rstrip().split()) D = list(map(int, readline().rstrip().split())) nums = [str(i) for i in range(10)] for d in D: nums.remove(str(d)) for i in range(N, N*10+1): d = str(i) flg = True for e...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s286433456
p04045
Accepted
#! python3 def main(): n, k = map(int, input().split()) hate = set(input().split()) while True: nset = set(list(str(n))) l = nset&hate if len(l) == 0: print(n) break 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...
s145688117
p04045
Accepted
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,1000001): for j in d: if str(i).count(str(j))>=1: 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...
s113088742
p04045
Accepted
if __name__ == '__main__': n, k = map(int, input().split()) lst = list(map(int, input().split())) while True: flag = True for char in str(n): if int(char) in lst: flag = False break if 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...
s442790010
p04045
Accepted
n,k = list(map(int, input().split())) d_ls = list(input().split()) check = n while True: can = True for letter in str(check): if letter in d_ls: can = False if can: break check += 1 print(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...
s056555262
p04045
Accepted
cost,n = map(int,input().split()) cash = [int(x) for x in input().split()] #account = cost - 1 flag = False while flag == False : flag = True for i in range(len(cash)): if str(cash[i]) in str(cost): flag = False break if flag == False: cost += 1 else:flag=True ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s677756862
p04045
Accepted
#!/usr/bin/env python3 import sys def solve(N: int, K: int, D: "List[int]"): while any([str(i) in str(N) for i in D]): N += 1 print(N) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your cust...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s843685734
p04045
Accepted
n, k = map(int, input().split()) D = list(input().split()) for i in range(n, n*10+1): t = str(i) isok = True for d in D: if d in t: isok = False break if isok: print(t) 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...
s824866894
p04045
Accepted
import sys import heapq, math from itertools import zip_longest, permutations, combinations, combinations_with_replacement from itertools import accumulate, dropwhile, takewhile, groupby from functools import lru_cache from copy import deepcopy N, K = map(int, input().split()) D = list(map(int, input().split())) def...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s278904736
p04045
Accepted
n,k = map(int, input().split()) d = list(input().split()) flag = True while flag: flag = False n_str = str(n) for i in d: if i in n_str: flag = True n += 1 break else: pass 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...
s495182644
p04045
Accepted
l=list(map(int,input().split())) d=list(map(int,input().split())) u={i for i in range(10)} d_bar=u-set(d) d_bar={str(i) for i in d_bar} n=l[0] n_set=set(str(n)) while True: if n_set<=d_bar: print(n) break n=n+1 n_set=set(str(n))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s143108495
p04045
Accepted
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) out = sorted(list(out)) res_list = [] flag = 0 for i in range(len(N)): if flag == 0: if len(set(N[i])&set(out)) == 1: res_list.append(N[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...
s497062333
p04045
Accepted
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) out = sorted(list(out)) res_list = [] flag = 0 for i in range(len(N)): if flag == 0: if len(set(N[i])&set(out)) == 1: res_list.append(N[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...
s258470486
p04045
Accepted
def chk(n,arr): while n>0: if n%10 in arr: return True n//=10 return False n,k = map(int,input().split()) arr = set(list(map(int,input().split()))) while chk(n,arr): 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...
s964087492
p04045
Accepted
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def contains_digit(number, digits): while number != 0: if number%10 in digits: return True number //= 10 return False def solve(): N, K = read_ints() d...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s422266427
p04045
Accepted
from collections import defaultdict n, k = map(int, input().split()) d = list(map(int, input().split())) nums = defaultdict(int) for i in range(len(d)): nums[d[i]] += 1 def judge(n, nums): n = str(n) for i in range(len(n)): if nums[int(n[i])] == 1: return False return True...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s320398162
p04045
Accepted
n,l=map(int,input().split()) dis=[i for i in input().split()] for i in range(n,10*n): if set(dis).isdisjoint(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...