submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s946522243
p04045
Wrong Answer
# C - こだわり者いろはちゃん # https://atcoder.jp/contests/abc042/tasks/arc058_a # 入力 1 # 1000 8 # 1 3 4 5 6 7 8 9 N,K = input().split() D = input().split() # Nの各桁をみて、嫌いな数字が入っていないかチェック # 嫌いな数字が入っていたら、その桁をインクリメントして、整数(N)を再生性する。 # これを嫌いな数字がなくなるまで繰り返す。 nums = list(N) # 各桁 i = 1 # 嫌いな数字が入っていたら、その桁をインクリメントして、整数(N)を再生性する。 while 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...
s845759903
p04045
Wrong Answer
n,k = map(int,input().rstrip().split()) dislikes = list(map(int,input().rstrip().split())) n = str(n) len_n = len(n) separate_n = [int(s) for s in n] pay = separate_n.copy() up_nextlevel = False for i in range(len(separate_n)-1,-1,-1): up_nextlevel = False if separate_n[i] in dislikes: for j in range(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...
s330382387
p04045
Wrong Answer
n,k = map(int,input().rstrip().split()) dislikes = list(map(int,input().rstrip().split())) n = str(n) len_n = len(n) separate_n = [int(s) for s in n] pay = separate_n.copy() up_nextlevel = False for i in range(len(separate_n)-1,-1,-1): up_nextlevel = False if separate_n[i] in dislikes: for j in range(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...
s343720675
p04045
Wrong Answer
n, k = map(int, input().split()) d = [int(d) for d in input().split()] n_len = len(str(n)) def rec_define_digit(i, s): ans = 100000 if i == n_len: val = int(s) if val >= n: return val else: return ans else: for x in range(10): if x not 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...
s020534167
p04045
Wrong Answer
import numpy as np n, k = map(int, input().split()) hate = list(map(int, input().split())) nums = list(range(10)) for num in hate: if num in nums: nums.remove(num) def make_numbers(x): out = "" x_dumy = x while x_dumy >0: out = str(nums[x_dumy%len(nums)]) + out x_dumy = 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...
s575643206
p04045
Wrong Answer
import numpy as np n, k = map(int, input().split()) hate = list(map(int, input().split())) nums = list(range(10)) for num in hate: if num in nums: nums.remove(num) def make_numbers(x): out = "" x_dumy = x while x_dumy >0: out = str(nums[x_dumy%len(nums)]) + out x_dumy = 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...
s088450887
p04045
Wrong Answer
import sys sys.setrecursionlimit(500000) n,k = map(int,input().split()) D = list(map(int,input().split())) ans = [] def dfs(p:str): if int(p)>=n: ans.append(int(p)) return if len(p)>len(str(n))+1: return for i in range(1,10): if not i in D: dfs(p+str(i)) for ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s773619793
p04045
Wrong Answer
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): N,K=map(int,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...
s136607459
p04045
Wrong Answer
n,k = map(int,input().split()) #入力 a = list(map(int,input().split())) #使用不可の数字 b = {0,1,2,3,4,5,6,7,8,9}-set(a) #使用可能な数字の集合 print(set([int(i) for i in list(str(n))])-b) while set([int(i) for i in list(str(n))])-b !=set() : # 使用可能な数字のみでなければ n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s367079336
p04045
Wrong Answer
n,k = map(int,input().split()) #入力 a = list(map(int,input().split())) #使用不可の数字 n2 = [int(i) for i in list(str(n))] #価格を分解 for i in range(len(n2)): while n2[i] in a :#使用不可ならば n2[i] += 1 if n2[i]>=10: n2[i] =1 print("".join([str(i) for i in n2]))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s737644203
p04045
Wrong Answer
n,k = map(int,input().split()) #入力 a = list(map(int,input().split())) #使用不可の数字 print(a) n2 = [int(i) for i in list(str(n))] #価格を分解 for i in range(len(n2)): while n2[i] in a :#使用不可ならば n2[i] += 1 if n2[i]>=10: n2[i] =1 print("".join([str(i) for i in n2]))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s493368518
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) lis = [] for i in range(10): if not i in d: lis.append(i) inf = 1001001001 ans = inf def dfs(s, n): if len(s) >= len(str(n)) + 2: if int(s) >= n: global ans ans = min(ans, int(s)) return else...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s396787625
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) lis = [] for i in range(10): if not i in d: lis.append(i) inf = 1001001001 ans = inf def dfs(s, n): if len(s) >= len(str(n)) + 1: if int(s) >= n: global ans ans = min(ans, int(s)) return else...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s344639005
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) lis = [] for i in range(10): if not i in d: lis.append(i) inf = 1001001001 ans = inf def dfs(s, n): if len(s) == 4: if int(s) >= n: global ans ans = min(ans, int(s)) return else: for ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s475533024
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) ns = len(str(n)) ok = [i for i in range(k) if i not in d] check = 1 for x in str(n): if int(x) in d: check = 0 break if check == 1: print(n) exit() ans = [int(x) for x in str(n)] while (1): ans[-1] += 1 for i in reversed(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s644980988
p04045
Wrong Answer
n, k = map(int, input().split()) dislike = list(map(int, input().split())) for i in range(n, 10001): a = str(i) # print(a) flag = True for j in range(len(a)): # print(a[j]) for k in dislike: # print(k) if int(a[j]) == k: 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...
s974021632
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) digitlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for d in D: digitlist.remove(d) Keta = len(str(N)) Ans = '' def clear(X): if len(X) == Keta: if int(X) >= N: print(X) exit() else: for i in digitlist: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s497621038
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) digitlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for d in D: digitlist.remove(d) Keta = len(str(N)) Ans = '' def clear(X): if len(X) == Keta: if int(X) >= N: print(X) exit() else: for i in digitlist: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s403386104
p04045
Wrong Answer
n,k = map(int,input().split()) d = list(map(str, input().split())) while True: print([i in d for i in list(str(n))]) if sum([i in d for i in list(str(n))]) == 0: 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...
s109392317
p04045
Wrong Answer
import sys sys.setrecursionlimit(10**6) input = lambda: sys.stdin.readline().rstrip() f_inf = float("inf") ### import itertools def cal(temp): keta = len(temp) num = 0 for t in range(keta): num += temp[t] * (10 ** (keta-t-1)) return num mini = float("inf") N,K = map(int,input().split()) D = set(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s831001621
p04045
Wrong Answer
K, N = map(int, input().split()) D = list(map(int, input().split())) D.sort() flag = False print(D) while True: K_str = str(K) for i in range(len(K_str)): for j in range(len(D)): if K_str[len(K_str)-1-i]==str(D[j]): flag=False break if j==len(D)-1: flag = True if not 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...
s295918966
p04045
Wrong Answer
def aa(K, D, digit): K_str = str(K) K_len = len(K_str) carry = False j=0 while j < len(D): if K_str[K_len-digit-1]==str(D[j]): K=K+10**digit K_str=str(K) if D[j]==9: carry = True j+=1 return K, carry K, N = map(int, input().split()) D = list(map(int, input().split())) D.so...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s851137352
p04045
Wrong Answer
K, N = map(int, input().split()) D = list(map(int, input().split())) D.sort() K_str = str(K) K_len = len(K_str) carry = False i=0 while i < K_len: j=0 while j < len(D): if K_str[K_len-i-1]==str(D[j]): K=K+10**i K_str=str(K) if D[j]==9: if j == K_len-1: carry = True 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...
s205979950
p04045
Wrong Answer
K, N = map(int, input().split()) D = list(map(int, input().split())) D.sort() K_str = str(K) K_len = len(K_str) carry = False i=j=0 while i < K_len: while j < len(D): if K_str[K_len-i-1]==str(D[j]): K=K+10**i K_str=str(K) if D[j]==9: if j == K_len-1: carry = True 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...
s627908709
p04045
Wrong Answer
K, N = map(int, input().split()) D = list(map(int, input().split())) D.sort() K_str = str(K) K_len = len(K_str) carry = False for i in range(K_len): for j in range(len(D)): if K_str[K_len-i-1]==str(D[j]): K=K+10**i K_str=str(K) if D[j]==9 and i==K_len-1: carry = True if carry: f...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s205537723
p04045
Wrong Answer
import sys import numpy as np input=sys.stdin.readline n,k=map(int,input().split()) d=list(map(int,input().split())) res=[] for i in range(10): if i not in d: res.append(i) ans=0 ansmax=0 ansmin=0 n_s=str(n) l=len(n_s) M=max(res) for i in range(l): ansmax+=M*10**(l-i-1) if n>ansmax: if res[0]!=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...
s739067190
p04045
Wrong Answer
import sys import numpy as np input=sys.stdin.readline n,k=map(int,input().split()) d=list(map(int,input().split())) res=[] for i in range(10): if i not in d: res.append(i) ans=0 ansmax=0 ansmin=0 n_s=str(n) l=len(n_s) M=max(res) for i in range(l): ansmax+=M*10**(l-i-1) if n>ansmax: if res[0]!=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...
s517964310
p04045
Wrong Answer
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, 10000): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s661750659
p04045
Wrong Answer
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...
s721034372
p04045
Wrong Answer
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)) D1 = list(set([i for i in range(1,10)])-set(D)) ans ='' for i in reversed(range(-len(str(N)),0)): if int(str(N)[i]) not in D: ans+=str(N)[i] elif i==-len(str(N)): ans+=str(min(D1))...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s131949013
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10000): 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...
s069772259
p04045
Wrong Answer
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) print(UN) 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): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s216911299
p04045
Wrong Answer
N, K = map(int, input().split()) D = [str(i) for i in input().split()] ans = N for i in range(N, 10002): 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...
s952115620
p04045
Wrong Answer
N, _ = map(int, input().split()) D = tuple(map(int, input().split())) total = 0 digit = 1 n = N while n: for i in range(10): if i < n % 10 or i in D or (n < 10 and not i): continue total += digit * i break n //= 10 digit *= 10 if total < N: for i in range(1, 10): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s166913291
p04045
Wrong Answer
N, _ = map(int, input().split()) D = tuple(map(int, input().split())) total = 0 digit = 1 n = N while n: for i in range(10): if i < n % 10 or i in D or (n < 10 and not i): continue total += digit * i break n //= 10 digit *= 10 print(total)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s933849943
p04045
Wrong Answer
N, _ = map(int, input().split()) D = tuple(map(int, input().split())) total = 0 digit = 1 n = N while n: for i in range(10): if i < n % 10 or i in D: continue total += digit * i break n //= 10 digit *= 10 if total < N: for i in range(1, 10): if i < n % 10 or 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...
s212712960
p04045
Wrong Answer
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...
s593059040
p04045
Wrong Answer
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...
s507728698
p04045
Wrong Answer
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...
s266933958
p04045
Wrong Answer
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...
s339776920
p04045
Wrong Answer
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...
s720308537
p04045
Wrong Answer
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...
s130650763
p04045
Wrong Answer
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...
s687833781
p04045
Wrong Answer
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 n = st...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s183085915
p04045
Wrong Answer
def cin(): return map(int,input().split()) def cina(): return list(map(int,input().split())) a,b = cin() a = list(str(a)) c = cina() d = {0,1,2,3,4,5,6,7,8,9} e = d.difference(c) s = "" check = False for i in a: replace = False rep = -1 for j in range(len(c)): if int(i)==c[j]: replace = 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...
s486860263
p04045
Wrong Answer
n, k = [int(i) for i in input().split()] dd = [int(i) for i in input().split()] flg = False for i in range(len(str(n))): first = int(str(n)[i]) if flg: first = 0 while first in dd: first += 1 flg = True print(first, end="") print()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s387207368
p04045
Wrong Answer
def cin(): return map(int,input().split()) def cina(): return list(map(int,input().split())) a,b = cin() a = list(str(a)) c = cina() d = {0,1,2,3,4,5,6,7,8,9} e = d.difference(c) s = "" check = False for i in a: replace = False rep = -1 for j in range(len(c)): if int(i)==c[j]: replace = 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...
s959929942
p04045
Wrong Answer
def cin(): return map(int,input().split()) def cina(): return list(map(int,input().split())) a,b = cin() a = list(str(a)) c = cina() d = {0,1,2,3,4,5,6,7,8,9} e = d.difference(c) s = "" for i in a: replace = False rep = -1 for j in range(len(c)): if int(i)==c[j]: replace = True break if 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...
s925357999
p04045
Wrong Answer
def cin(): return map(int,input().split()) def cina(): return list(map(int,input().split())) a,b = cin() a = list(str(a)) c = cina() d = {1,2,3,4,5,6,7,8,9} e = d.difference(c) s = "" for i in a: replace = False rep = -1 for j in range(len(c)): if int(i)==c[j]: replace = True break if rep...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s817809261
p04045
Wrong Answer
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 reversed(range(m)): d = (o // 10 ** i) % 10 ys = list(filter(lambda x: x >= d, xs)) if c: y = min(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s769361768
p04045
Wrong Answer
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 for i in range(m): d = (o // 10 ** i) % 10 ys = list(filter(lambda x: x >= d, xs)) if len(ys) == 0: y = min(xs) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s137241481
p04045
Wrong Answer
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...
s747219788
p04045
Wrong Answer
# -*- coding: utf-8 -*- def forgive(num): for i in range(10): if ((num + i) % 10) in unforgiven: continue else: return num + i N, K = map(int, input().split()) unforgiven = list(map(int, input().split())) unforgiven.sort() price = [int(x) for x in str(N)] purchase = 0 dig ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s453585441
p04045
Wrong Answer
# -*- coding: utf-8 -*- def forgive(num): for i in range(10): if ((num + i) % 10) in unforgiven: continue else: return num + i N, K = map(int, input().split()) unforgiven = list(map(int, input().split())) unforgiven.sort() price = [int(x) for x in str(N)] purchase = 0 dig ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s426790248
p04045
Wrong Answer
# -*- coding: utf-8 -*- N, K = map(int, input().split()) price = [int(x) for x in str(N)] hates = list(map(int, input().split())) hates.sort() purchase = [] #print(price) #print(hates) def dig_culc(num): for i in range(10): if ((num + i) % 10) in hates: continue else: purcha...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s907427327
p04045
Wrong Answer
# -*- coding: utf-8 -*- N, K = map(int, input().split()) price = [int(x) for x in str(N)] hates = list(map(int, input().split())) hates.sort() purchase = [] #print(price) #print(hates) def dig_culc(num): for i in range(10): if ((num + i) % 10) in hates: continue purchase.append((num + 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...
s515381582
p04045
Wrong Answer
N, K = input().split() D = [i for i in input().split()] flg = True ans = '' for n in N: if flg: st = int(n) else: st = 0 for i in range(st, 10): if str(i) not in D: if i != st: flg = False ans += str(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...
s607876713
p04045
Wrong Answer
N, K = input().split() D = [i for i in input().split()] flg = True ans = '' for n in N: if flg: st = int(n) else: st = 0 for i in range(st, 10): if str(i) not in D: ans += str(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...
s619570255
p04045
Wrong Answer
# -*- coding: utf-8 -*- n, k = map(int, input().split()) # 1の桁から順にチェックする price = list(map(int, list(str(n)))) hates = list(map(int, input().split())) dig_add = 0 #桁上がり purchase = [] def dig_culc(num): for j in range(10): if ((num + j) % 10) in hates: continue purchase.append((num + 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...
s140486350
p04045
Wrong Answer
# -*- coding: utf-8 -*- n, k = map(int, input().split()) # 1の桁から順にチェックする price = list(map(int, list(str(n)))) hates = list(map(int, input().split())) dig_add = 0 #桁上がり purchase = [] for num in reversed(price): num += dig_add dig_add = 0 for j in range(10): if ((num + j) % 10) in hates: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s644057578
p04045
Wrong Answer
inputNK = input().split(" ") N = int(inputNK[0]) K = int(inputNK[1]) dislike = input().split(" ") judge = True answer = 0 for i in range(N,10000): for number in dislike: if str(i).count(number) != 0: judge = False break if judge == True: answer = i break else: judge = True 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...
s621141665
p04045
Wrong Answer
inputNK = input().split(" ") N = int(inputNK[0]) K = int(inputNK[1]) dislike = input().split(" ") judge = True answer = 0 for i in range(N,10000): for number in dislike: if str(i).count(number) != 0: judge = False break if judge == True: answer = i break else: judge = True 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...
s277519734
p04045
Wrong Answer
import sys sys.setrecursionlimit(10**9) N, K = map(int, input().split()) D = set((map(int, input().split()))) ok = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - D) def dfs(s): if N <= int(s): return int(s) for i in range(len(ok)): return dfs(s+str(ok[i])) start = ok[0] if ok[0] != 0 else ok[1] print(dfs...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s670521836
p04045
Wrong Answer
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() print(now_num) if now_num >= n: break for x in ok_lst: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s529271095
p04045
Wrong Answer
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() print('now', now_num) if now_num >= n: break for x in o...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s500369258
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) OK = list({1, 2, 3, 4, 5, 6, 7, 8, 9} - set(D)) S = str(N) ans = [] def find_next(x): while True: x += 1 if x in OK: return str(x) for i in range(len(S)): if int(S[i]) in OK: ans += S[i] elif max(O...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s706033422
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(int,input().split())) 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 < k: if a[y-i+1] == d[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...
s570441076
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) OK = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(D)) S = str(N) ans = "" for i in range(len(S)): for j in OK: if j == int(S[i]): ans += str(j) break elif j > int(S[i]): ans += str(j) f...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s447206441
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) OK = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(D)) S = str(N) ans = "" for i in range(len(S)): for j in OK: if j >= int(S[i]): ans += str(j) 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...
s209782173
p04045
Wrong Answer
from itertools import product N, K = map(int, input().split()) A = [int(i) for i in input().split()] se = set(range(10)) for x in A: se ^= set([x]) ans = 10 ** 10 for x in product(se, repeat=5): M = 10000 * x[0] + 1000 * x[1] + 100 * x[2] + 10 * x[3] + x[4] if M >= N: ans = min(ans, M) 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...
s079890880
p04045
Wrong Answer
from itertools import product N, K = map(int, input().split()) A = [int(i) for i in input().split()] se = set(range(10)) for x in A: se ^= set([x]) ans = 10 ** 10 for x in product(se, repeat=4): M = 1000 * x[0] + 100 * x[1] + 10 * x[2] + x[3] if M >= N: ans = min(ans, M) 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...
s717418977
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(int,input().split())) 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 while i <= y: j = 0 while j < k: if a[y-i+1] == d[j]: a[y-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...
s262887388
p04045
Wrong Answer
n,k=list(map(int,input().split())) D=list(map(int,input().split())) like=[] for i in range(10): if not i in D: like.append(i) N=str(n) ans=[] for i in range(len(N)): for j in range(len(like)): if like[j]>=int(N[i]): ans.append(like[j]) break else: if like[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...
s603335170
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(int,input().split())) 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 while i <= y: j = 0 while j < k: if a[y-i+1] == d[j]: a[y-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...
s520867415
p04045
Wrong Answer
n,k=list(map(int,input().split())) D=list(map(int,input().split())) like=[] for i in range(10): if not i in D: like.append(i) N=str(n) ans=[] for i in range(len(N)): for j in range(len(like)): if like[j]>=int(N[i]): ans.append(like[j]) break else: if not like[...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s294821170
p04045
Wrong Answer
n,k=list(map(int,input().split())) D=list(map(int,input().split())) like=[] for i in range(10): if not i in D: like.append(i) N=str(n) ans=[] for i in range(len(N)): for j in range(len(like)): if like[j]>=int(N[i]): ans.append(like[j]) break else: for i in ran...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s954688739
p04045
Wrong Answer
n,k=list(map(int,input().split())) D=list(map(int,input().split())) like=[] for i in range(10): if not i in D: like.append(i) N=str(n) ans=[] for i in range(len(N)): for j in range(len(like)): if like[j]>=int(N[i]): ans.append(like[j]) break else: for i in ran...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s951662804
p04045
Wrong Answer
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(list(num)[-1] * len(n)): an...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s173531554
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(input().split()) for n in range(N, 10001): n = str(n) for s in 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...
s437649663
p04045
Wrong Answer
n,k = map(int,input().split()) D = list(map(int,input().split())) use = [i for i in range(10)] use = sorted(list(set(use)-set(D))) ans = '' for a in str(n): a = int(a) flg = False for j in use: if flg: continue if j>=a: flg = True ans += str(j) print(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s178069611
p04045
Wrong Answer
n,k = map(int,input().split()) D = list(map(str,input().split())) use = [str(i) for i in range(10)] use = set(use) - set(D) for x in range(n, 10010): flg = True for c in str(x): if c not in use: flg = False if flg: print(x) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s796532300
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = list() m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) j = 0 while j < k: if a[i] == d[j]: a[i] += 1 j+=1 m += a[i]*(10*...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s651022905
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (x**x) >0: y = x x += 1 i = 0 a = list() m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) j = 0 while j < k: if a[i] == d[j]: a[i] += 1 j+=1 m += a[i]*(10**...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s756661155
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 while x <4: if n // (x**x) >0: y = x x += 1 i = 0 a = list() m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) j = 0 while j < k: if a[i] == d[j]: a[i] += 1 j+=1 m += a[i]*(10**(y-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...
s622313735
p04045
Wrong Answer
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 res = f_inf 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 calc(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...
s059557905
p04045
Wrong Answer
import sys n, k = map(int, input().split(" ")) d = list(map(int, input().split(" "))) def f(curr): if curr >= n: print(curr) sys.exit(0) for i in filter(lambda x: x not in d, range(10)): if not (curr == 0 and i == 0): f(curr * 10 + i) f(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s864674658
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(map(int, input().split())) f = True while f: if set(str(N)) == set(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...
s967436231
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(map(int, input().split())) while True: if set(str(N)) == set(str(N)) - D: print(N) break else: N += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s763219908
p04045
Wrong Answer
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 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...
s805735814
p04045
Wrong Answer
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 c=1 k=0 break if 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...
s689118978
p04045
Wrong Answer
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 c=1 k=0 break if 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...
s362030189
p04045
Wrong Answer
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 c=1 k=0 break if 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...
s970380697
p04045
Wrong Answer
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 c=1 k=0 break if 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...
s511493927
p04045
Wrong Answer
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): if n%10+j+k in l: ans += n%10+j+k c=1 k=0 break if c ==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...
s949144718
p04045
Wrong Answer
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): if n%10+j+k in l: ans += n%10+j+k c=1 break if c ==0: ans +=m...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s211647836
p04045
Wrong Answer
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): if n%10+j+k in l: ans += n%10+j+k c=1 break if c ==0: ans +=m...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s853691282
p04045
Wrong Answer
import itertools def solve(n, k, xs): tmp = [str(i) for i in range(10) if i not in xs] str_len = len(str(n))+1 hoge = [i for i in map(lambda x: int("".join(x)), itertools.product(tmp, repeat=str_len)) if i >= n] return hoge[0] if __name__ == "__main__": n, k = [int(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...
s719652563
p04045
Wrong Answer
import sys N, K = map(int, input().split()) Ds = list(input()) 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...
s850844094
p04045
Wrong Answer
n, _ = map(int, input().split()) d = set(sorted(map(int, input().split()))) for q in range(10000): 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...
s953383246
p04045
Wrong Answer
import sys N, K = map(int, input().split()) Ds = list(input()) number = N-1 while True: number += 1 for j in range(K): if Ds[j] in str(number): break if j == K-1: 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...