submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s081361922
p04045
Wrong Answer
import sys N, _ = input().split() D = list(map(int, input().split())) E = [str(i) for i in [0,1,2,3,4,5,6,7,8,9] if i not in D] for n in N: if not n in E: for e in E: if e>n: n=e sys.stdout.write(n) break; else: sys.stdout.write(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...
s353007844
p04045
Wrong Answer
N, K = map(int,input().split()) D = list(map(int,input().split())) while True: for n in str(N): if(n in D): break else: break N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s045630867
p04045
Wrong Answer
n,k=map(int,input().split()) D=list(map(int,input().split())) nums=[i for i in range(10) if i not in D] ans="" def str_check(string): string=str(string) for i in string: if int(i) not in nums: return False return True for i in range(1,10001): if str_check(i)==True and n<=i: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s146737045
p04045
Wrong Answer
n,k=map(int,input().split()) D=list(map(int,input().split())) nums=[i for i in range(10) if i not in D] ans="" for i in str(n): if int(i) in nums: ans+=i else: tmp=100 for j in nums: if int(i)<=j: tmp=min(tmp,j) ans+=str(tmp) 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...
s544119115
p04045
Wrong Answer
#coding:utf-8 # O(Dlogn)解法? N,K=map(int, raw_input().split(" ")) D=map(int, raw_input().split(" ")) keta=len(str(N)) strN=str(N) ans1="" for x in range(keta-1): p=int(strN[keta-x-1]) d=0 for dd in range(10): if dd not in D: d=dd break ans1=str(d)+ans1 candidate=int(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s580641309
p04045
Wrong Answer
import bisect def main(): n, k = map(int, input().split()) d = [int(s) for s in input().split()] p = [i for i in range(10) if i not in d] print(solve(n, p)) def solve(n, p): def rec(n, r): if n == 0: s = ''.join(str(i) for i in reversed(r)) return int(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...
s475770781
p04045
Wrong Answer
price, num = input().split(" ") dislike = input().split(" ") for i in range(int(price), 10001): if set(dislike) & set(str(i)): continue 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...
s603085686
p04045
Wrong Answer
price, num = input().split(" ") dislike = input().split(" ") for i in range(int(price), 10001): if set(dislike) & set(str(i)): continue else: 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...
s886100503
p04045
Wrong Answer
n,k=map(int, input().split()) d_set=set(map(int, input().split())) for i in range(n, 88888): if bool(set([int(x) for x in str(n)]) & d_set ) is False: 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...
s126454565
p04045
Wrong Answer
n,k=map(int, input().split()) d_set=set(map(int, input().split())) for i in range(n, 10000): if bool(set([int(x) for x in str(n)]) & d_set ) is False: 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...
s638699472
p04045
Wrong Answer
n,k=map(int, input().split()) d_set=set(map(int, input().split())) for i in range(n, 10000): n += 1 if bool(set([int(x) for x in str(n)]) & d_set ) is False: 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...
s315972455
p04045
Wrong Answer
n,m=map(int,input().split()) A=set([str(s) for s in range(10)]) B=A-set(list(map(str,input().split()))) for s in range(n,10000): if set(list(str(s)))<=B: print(s) 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...
s269906222
p04045
Wrong Answer
n,m=map(int,input().split()) A=set([str(s) for s in range(10)]) B=A-set(list(map(str,input().split()))) print(B) for s in range(n,10000): print(set(list(str(s)))) if set(list(str(s)))<=B: print(s) 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...
s675278007
p04045
Wrong Answer
n,m=map(int,input().split()) A=set([s for s in range(10)]) B=A-set(list(map(int,input().split()))) B=set(list(map(str,list(B)))) for s in range(n,10000): if set(list(str(s)))<=B: print(s) 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...
s075750770
p04045
Wrong Answer
n,m=map(int,input().split()) A=set([s for s in range(10)]) B=A-set(list(map(int,input().split()))) B=set(list(map(str,list(B)))) for s in range(n,10000): print(set(list(str(s)))) if set(list(str(s)))<=B: print(s) 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...
s499365063
p04045
Wrong Answer
n,m=map(int,input().split()) A=set([s for s in range(10)]) B=A-set(list(map(int,input().split()))) B=set(list(map(str,list(B)))) print(B) for s in range(n,10000): print(set(list(str(s)))) if set(list(str(s)))<=B: print(s) 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...
s209968111
p04045
Wrong Answer
n,m=map(int,input().split()) A=[] B=list(map(int,input().split())) for t in range(10): if t not in B: A.append(t) A=set(list(map(str,A))) for s in range(n,10001): if set(list(str(s)))<=A: print(s) 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...
s329456932
p04045
Wrong Answer
N,K = map(int,input().split()) D = {int(n) for n in input().split()} a = {i for i in range(10)} N_hate = a.difference(D) for j in range(10001): if N <= j: L = {int(result) for result in str(j)} if N_hate != L: N_love = j break print(N_love)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s904972025
p04045
Wrong Answer
D, K = map(int, input().split()) S = set(map(str, input().split())) res = '' while True: s = str(D) l = len(s) - 1 count = 0 for i in range(l): if s[i] in S: break else: count += 1 if count == l: res = D break else: D += 1 print(res...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s167913801
p04045
Wrong Answer
D, K = map(int, input().split()) S = list(map(int, input().split())) l = [0] * 10 for i in range(len(S)): l[S[i]] = 1 lowest = str([x for x in range(len(l)) if l[x] == 0 and x != 0][0]) res = '' for x in str(D): if x == '1': res += lowest else: res += x print(res)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s939162545
p04045
Wrong Answer
N, K = map(int, input().split()) de_num = list(map(int, input().split())) ok_num = [] cand_num = [] ans_num = [] for i in range(10): if i not in de_num: ok_num.append(i) for i in ok_num: for j in ok_num: for k in ok_num: for l in ok_num: for m in ok_num: if len(str(N)) == 4: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s924735838
p04045
Wrong Answer
n,k = (int(i) for i in input().split()) d = list(int(i) for i in input().split()) def ketajudge(x): while x != 0: if x%10 in d: return False break else: if x//10 == 0: return True break x = x//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...
s872991599
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) std = list(range(10)) use = list(set(std) - set(D)) for i in range(N, 10001): base = list(map(int, list(set(list(str(i)))))) if list(set(base) - set(use)) == []: 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...
s538168989
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) std = list(range(10)) use = list(set(std) - set(D)) for i in range(N, 10001): base = list(map(int, list(set(list(str(i)))))) if list(set(base) - set(use)): 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...
s912890957
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) std = list(range(10)) use = list(set(std) - set(D)) for i in range(N, 10001): base = list(map(int, list(set(list(str(i)))))) if list(set(base)) == list(set(use)): 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...
s060304412
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) std = list(range(10)) use = list(set(std) - set(D)) for i in range(N, 10001): base = list(map(int, list(set(list(str(i)))))) if list(set(base) - set(use)) == []: 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...
s824525344
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) base = list(range(10)) use = list(set(base) - set(D)) for a in use: for b in use: for c in use: for d in use: ans = a*1000 + b*100 + c*10 + d if ans >= N: 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...
s269588227
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) base = list(range(10)) use = list(set(base) - set(D)) for i in range(len(str(N))): for a in use: for b in use: for c in use: for d in use: ans = a*1000 + b*100 + c*10 + 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...
s425165651
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(str,input().split())) for i in range(n,10000): for j in list(str(i).replace(""," ").split()): if j in d: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s354698116
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(str,input().split())) for i in range(n,10000): for j in list(str(i).replace(""," ").split()): if int(j) in d: break 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...
s424227905
p04045
Wrong Answer
#C - こだわり者いろはちゃん def minGE(d): for x in range(d,10): if not (x in D): # print(x) return x return 10 def minAll(d): for x in range(10): if not (x in D): return x def main(n): d = [n%10**i//10**(i-1) for i in range(5,0,-1)] same = True newN = 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...
s277168876
p04045
Wrong Answer
N, K = map(int, input().split()) d=list(map(int,(input().split()))) ans = 0 for i in range(N,10000): temp = str(i) n_len = len(temp) for j in range(n_len): if int(temp[j]) in d: break elif j == n_len-1: ans = 1 break if ans == 1: print(temp) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s270826470
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) R = N k = 1 while k <= N: if R // k % 10 in D: R += k else: k *= 10 print(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...
s237087321
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) l=[0,1,2,3,4,5,6,7,8,9] for i in range(k): l.remove(d[i]) L=[] for j1 in range(len(l)): for j2 in range(len(l)): for j3 in range(len(l)): for j4 in range(len(l)): for j5 in range(len(l)): L.append(l[j1]*10000+l[j2]*1000+l[j3]*...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s151485974
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) l=[0,1,2,3,4,5,6,7,8,9] for i in range(k): l.remove(d[i]) L=[] for j1 in range(len(l)): for j2 in range(len(l)): for j3 in range(len(l)): for j4 in range(len(l)): L.append(l[j1]*1000+l[j2]*100+l[j3]*10+l[j4]) L.append(10000) for k in ra...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s214912957
p04045
Wrong Answer
N,K=map(int,raw_input().split()) D=map(int,raw_input().split()) U=[i for i in range(10) if i not in D] Keta=1 while True: if N>U[-1]*(sum(10**(i) for i in range(Keta))): Keta+=1 else: break N_copy=N Result=[] for k in range(Keta): for u in U: if u*(10**(Keta-k-1))+U[-1]*(sum(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...
s445765640
p04045
Wrong Answer
import sys line = [] for i in sys.stdin.readlines(): line.append(i.rstrip()) data = line.pop(0).split(" ") num_list = line.pop().split(" ") def pick_up(num_list): use_list = ['0','1','2','3','4','5','6','7','8','9'] for i in num_list: use_list.remove(i) return use_list def advance(n_list, 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...
s728345955
p04045
Wrong Answer
import itertools import sys def main(): n,k = map(int, input().split()) ds = list(map(int, input().split())) canuse = [] for i in range(10): if not i in ds: canuse.append(str(i)) digit = len(str(n)) flt = list(filter(lambda x: x>=str(n)[0], canuse)) if len(flt)==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...
s667871390
p04045
Wrong Answer
import itertools import sys def main(): n,k = map(int, input().split()) ds = map(int, input().split()) canuse = [] for i in range(10): if not i in ds: canuse.append(str(i)) digit = len(str(n)) flt = list(filter(lambda x: x>=str(n)[0], canuse)) if len(flt)==0: if ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s457309373
p04045
Wrong Answer
import itertools def main(): n,k = map(int, input().split()) ds = map(int, input().split()) canuse = [i for i in range(10)] for d in ds: canuse.remove(d) canuse = [str(c) for c in canuse] digit = len(str(n)) ans = 10**6 for a in itertools.product(canuse, repeat=digit): x = int("...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s905728171
p04045
Wrong Answer
import sys def main(): n,k = map(int, input().split()) ds = map(int, input().split()) canuse = [i for i in range(10)] for d in ds: canuse.remove(d) digit = len(str(n)) string = str(n) flt = list(filter(lambda x: x!=0 and x>=int(string[0]), canuse)) if len(flt)==0: if 0 in canuse...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s822730425
p04045
Wrong Answer
# encoding: utf-8 N, K = map(int, input().split()) D = list(map(int, input().split())) Db = [] for Di in range(10): if Di not in D: Db.append(Di) # print("#", Db) for level in range(6): if N // (10 ** level) < 1: break # print("#", level) # memo = [None] * (5 * 10000) def pay(pos, tmp): # 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...
s838302191
p04045
Wrong Answer
# encoding: utf-8 N, K = map(int, input().split()) D = list(map(int, input().split())) Db = [] for Di in range(10): if Di not in D: Db.append(Di) # print("#", Db) for level in range(6): if N // (10 ** level) < 1: break # print("#", level) memo = [None] * (5 * 10000) def pay(pos, tmp): # 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...
s679505535
p04045
Wrong Answer
import itertools N,K = input().split() D = list(map(int,input().split())) int_list = set(range(10)) like = list(int_list - set(D)) like.sort() min_cost = 10**6 for e in itertools.product(like,repeat = len(N)): result = 0 for i in range(len(N)): result += e[i] * pow(10,i) if int(N) <= result < min_co...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s950694140
p04045
Wrong Answer
# input n, k = map(int, input().split()) D = list(map(int, input().split())) N = [int(x) for x in list(str(n))] D_inv = sorted(list(set(range(10)) - set(D))) m = len(N) + 1 # 置換が必要な桁 for i in range(len(N)): if N[i] in D: m = i break if m == len(N) + 1: print(n) exit() n = len(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...
s336921977
p04045
Wrong Answer
import copy def listToString(_list, split=""): maped_list = map(str, _list) # mapで要素すべてを文字列に mojiretu = split.join(maped_list) return mojiretu n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] ok = [1 for i in range(10)] for i in range(len(d)): ok[d[i]] = -1 # 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...
s725023711
p04045
Wrong Answer
N,K = map(int, input().split()) D = input().split() usable = set([str(i) for i in range(10)]) - set(D) for i in range(N, 10000): if set(list(str(i))).issubset(usable): 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...
s207412440
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = list(set(range(0, 10)) - hate_set) ans = "" if all(list(map(lambda x: int(x) in usable_list, [price[i] for i in range(len(price))]))): return price while le...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s180870681
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = list(set(range(0, 10)) - hate_set) ans = "" if all(map(lambda x: int(x) in usable_list, [int(price[i]) for i in range(len(price))])): return price while len...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s048619025
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = list(set(range(0, 10)) - hate_set) ans = "" if all([lambda x: int(x) in usable_list, [int(price[i]) for i in range(len(price))]]): return price while len(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...
s742930051
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = list(set(range(0, 10)) - hate_set) ans = "" while len(ans) >= len(price): if ans == price: return ans if ans == "" and min(usable_list) == 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...
s719172084
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = list(set(range(0, 10)) - hate_set) if all(map(lambda x: int(x) in usable_list, set([price[i] for i in range(len(price))]))): return price elif price[0] in usable...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s718492325
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = sorted(list(set(range(0, 10)) - hate_set)) if price[0] in usable_list: ans = price[0] elif price[0] not in usable_list and min(usable_list) is not 0: 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...
s650706806
p04045
Wrong Answer
def abc042_c(): price, len_hate_set = map(str, input().split()) hate_set = set([int(i) for i in input().split()]) usable_list = sorted(list(set(range(0, 10)) - hate_set)) if price[0] in usable_list: ans = price[0] elif price[0] not in usable_list and min(usable_list) is not 0: 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...
s207661984
p04045
Wrong Answer
N,K=map(int,input().strip().split()) D=list(map(int,input().strip().split())) X=[1,2,3,4,5,6,7,8,9,0] Y=list(set(D)^set(X)) YY=list(set(D)^set(X)) if 0 in YY: YY.remove(0) Z='' if max(Y)<int(str(N)[0]): Z+=str(min(YY)) for i in range(len(str(N))): Z+=str(min(Y)) print(Z) exit() for i in Y: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s974920659
p04045
Wrong Answer
N,K=map(int,input().strip().split()) D=list(map(int,input().strip().split())) X=[1,2,3,4,5,6,7,8,9,0] Y=list(set(D)^set(X)) YY=list(set(D)^set(X)) if 0 in YY: YY.remove(0) Z='' if max(Y)<int(str(N)[0]): Z+=str(min(YY)) for i in range(len(str(N))): Z+=str(min(Y)) print(Z) exit() for i in ra...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s772491900
p04045
Wrong Answer
N,K=map(int,input().strip().split()) D=list(map(int,input().strip().split())) X=[1,2,3,4,5,6,7,8,9,0] Y=list(set(D)^set(X)) Z='' for i in range(len(str(N))): for x in range(len(Y)): if int(str(N)[i])<=Y[x]: Z+=str(Y[x]) break print(Z)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s404529581
p04045
Wrong Answer
N,K = map(int,input().split()) L = list(map(int,input().split())) P = [] for i in range(10) : if i not in L : P.append(str(i)) A = list(str(N)) for i in range(len(A)) : if A[i] not in P : for j in range(len(P)) : if A[i] < P[j] : A[i] = P[j] break pri...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s199557117
p04045
Wrong Answer
N, K = list(map(int, input().strip().split(' '))) D = list(map(int,input().strip().split(' '))) flag = False while flag == False: arrayN = [int(x) for x in list(str(N))] for i in arrayN: if i in D: N+=1 break else: flag=True if flag: 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...
s317061426
p04045
Wrong Answer
n, k = map(int, input().split()) d = [int(i) for i in input().split()] N = [] while(n > 0): N.append(n % 10) n //= 10 N.reverse() m = N.__len__() d_c = [i for i in range(10)] for i in d: d_c.remove(i) for i in range(1,m): while(N[-i] in d): if N[-i] == 9: N[-i] = d_c[0] 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...
s520211253
p04045
Wrong Answer
n, k = map(int, input().split()) d = [int(i) for i in input().split()] N = [] while(n > 0): N.append(n % 10) n //= 10 N.reverse() m = N.__len__() d_c = [i for i in range(10)] for i in d: d_c.remove(i) for i in range(1,m): while(N[-i] in d): if N[-i] == 9: N[-i] = d_c[0] 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...
s399834412
p04045
Wrong Answer
# -*- coding: utf-8 -*- # スペース区切りの整数の入力 N, K = map(int, input().split()) # 複数行の数値の入力を整数として取得 D = input().split() D = list(map(lambda d: int(d), D)) len_list = [d_length == 1 for d_length in list(map(lambda d: len(str(d)), D))] if all(len_list): if len(str(N))==1: if N <= min(D): PAYMENT = 10 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...
s527727959
p04045
Wrong Answer
#! /usr/bin/python3 # こだわり者いろはちゃん / Iroha's Obsession """ 1≦N<10000 1≦K<10 0≦D1<D2<…<DK≦9 {D1,D2,…,DK}≠{1,2,3,4,5,6,7,8,9} """ N, K = map(int, input().split()) D = list(map(int, input().split())) test_mode = False def check_num(x, d, n): """ 金額xの中に中の文字があるか確認する関数。 x : 現在の金額(N, x+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...
s316503219
p04045
Wrong Answer
n,k = map(int, input().split()) d = list(input().split()) i = 0 while i<len(str(n)): while str(n)[-i-1] in d: n += 10**i i += 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...
s105407066
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(input().split()) frag = True ans = 0 for i in range(1000000): N += 1 if len(set(str(N)) & D) == 0: ans = N frag = False 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...
s408159125
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(input().split()) frag = True ans = 0 for i in range(900000): N += 1 if len(set(str(N)) & D) == 0: ans = N frag = False 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...
s089822358
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(input().split()) frag = True ans = 0 for i in range(100000): N += 1 if len(set(str(N)) & D) == 0: ans = N frag = False 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...
s839505751
p04045
Wrong Answer
N,K=map(int, input().split()) D=list(input()) for i in range(N,10001): flag=0 for j in list(str(i)): if j in D: flag=1 if flag==0: print(i) exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s436387327
p04045
Wrong Answer
N,K=map(int, input().split()) D=list(input()) for i in range(N,10000): flag=0 for j in list(str(i)): if j in D: flag=1 if flag==0: print(i) exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s221763338
p04045
Wrong Answer
n, k = map(int, input().split()) array = {int(x) for x in input().split()} mihon = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}^array for i in range(n, 10001): tmp = list(str(i)) tmp = {int(x) for x in tmp} if tmp.issubset(mihon) and i >= n: 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...
s151590329
p04045
Wrong Answer
n, k = map(int, input().split()) array = {int(x) for x in input().split()} mihon = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}^array for i in range(n, 10001): tmp = list(str(i)) tmp = {int(x) for x in tmp} if len(tmp.difference(mihon)) == 0 and i >= n: 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...
s745513475
p04045
Wrong Answer
iN,iK = [int(x) for x in input().split()] aD = [int(x) for x in input().split()] aUnList = sorted([x for x in range(10) if x not in aD]) aUnList.sort() sN = str(iN) iF = int(sN[0]) def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev): iL = len(sTarget) iF = int(sTarget[iPoint]) aUpper = [x for x in aUnList 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...
s512515476
p04045
Wrong Answer
n,d = map(int,input().split()) lis = list(map(str,input().split())) cou = n while 1: for i in range(d): if lis[i] in str(cou): break print(cou) exit() cou += 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...
s272075829
p04045
Wrong Answer
iN,iK = [int(x) for x in input().split()] aD = [int(x) for x in input().split()] aUnList = sorted([x for x in range(10) if x not in aD]) sN = str(iN) aRetList=[] bFlagUp = False for i in range(len(sN)-1,-1,-1): if bFlagUp : aUpper = [x for x in aUnList if x > int(sN[i])] if aUpper == [] : ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s924523592
p04045
Wrong Answer
iN,iK = [int(x) for x in input().split()] aD = [int(x) for x in input().split()] aUnList = sorted([x for x in range(10) if x not in aD]) sN = str(iN) aRetList=[] iFlagUp = False for i in range(len(sN)-1,-1,-1): if iFlagUp : aUpper = [x for x in aUnList if x > int(sN[i])] if aUpper == [] : ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s561769603
p04045
Wrong Answer
#!/usr/bin/python3 # -*- coding: utf-8 -*- n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] for i in range(n, 10001): f = True for si in str(i): if int(si) in d: f = False if f: 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...
s632342375
p04045
Wrong Answer
#!/usr/bin/python3 # -*- coding: utf-8 -*- n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] for i in range(n, 10000): f = True for si in str(i): if int(si) in d: f = False if f: 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...
s894254764
p04045
Wrong Answer
N, K = map(int, input().split()) inputs = [int(i) for i in input().split()] str_N = str(N) inputs_set = set(inputs) all_set = set({0,1,2,3,4,5,6,7,8,9}) rest_set = all_set - inputs_set ans = '' for i in range(len(str_N)): for rest in rest_set: if int(str_N[i]) <= rest: ans += str(rest) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s154263606
p04045
Wrong Answer
N, K = map(int, input().split()) inputs = [int(i) for i in input().split()] str_N = str(N) inputs_set = set(inputs) all_set = set({0,1,2,3,4,5,6,7,8,9}) rest_set = all_set - inputs_set ans = '' for i in str_N: for rest in rest_set: if int(i) <= rest: ans += str(rest) break 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...
s304494942
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) rec = [] if n == 0: for i in range(10): if i not in d: print(i) break else: while n > 0: mod = n % 10 n = n // 10 while mod in d: if mod == 9: 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...
s068880761
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) rec = [] while n > 0: mod = n % 10 n = n // 10 while mod in d: if mod == 9: n += 1 mod = 0 else: mod += 1 rec.append(mod) rec = reversed(rec) print("".join(map(str, rec)))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s169209353
p04045
Wrong Answer
(N,K)=map(int,input().split()) D=list(map(int,input().split())) ans="" while N>0: for i in range(10): if not N%10 in D: ans=str(N%10)+ans break else: N+=1 N//=10 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...
s135345338
p04045
Wrong Answer
N, K = map(int, input().split()) D = [int(x) for x in input().split()] def f(x): while True: if x in D: x += 1 else: return x X = [int(x) for x in str(N)] ans = '' for i in range(len(X)): if i == 0: ans += str(f(X[i])) else: y = f(X[i]) if y...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s074980810
p04045
Wrong Answer
N, K = map(int, input().split()) D = [Di for Di in input().split()] for n in range(N, 10001): n = str(n) flag = True for ni in n: if ni in D: flag = False break if flag: 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...
s198502702
p04045
Wrong Answer
N, K = map(int, input().split()) D = [Di for Di in input().split()] for n in range(N, 10000): n = str(n) flag = True for ni in n: if ni in D: flag = False break if flag: 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...
s510449706
p04045
Wrong Answer
a,b = map(int,input().split()) c = input().split() while 1: f = 1 s = str(a) for i in c: if i in s: f = 0 if f : break a += 1 print(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...
s140806406
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) i=0 while i<len(str(n)): while int(str(n)[len(str(n))-i-1]) in d: print(int(str(n)[len(str(n))-i-1]) ) n+=10**i i+=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...
s923560832
p04045
Wrong Answer
import itertools n, k = map(int, input().split()) array = {x for x in input().split()} num_array = {str(x) for x in range(10)} like_num = array^num_array res = float("inf") for i in range(1, 10001): tmp = set(list(str(i))) if tmp.issubset(like_num): if n <= i < res: res = i print(res)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s679598427
p04045
Wrong Answer
n, k = map(int, input().split(" ")) d = input().split(" ") m = 0 while m < len(str(n)): if str(n)[~m] in d: n += 10**m else: m += 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...
s997148906
p04045
Wrong Answer
n, k = map(int, input().split(" ")) d = input().split(" ") for i in range(len(str(n))): while str(n)[~i] in d: n += 10**i print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s657511655
p04045
Wrong Answer
n, k = map(int, input().split(" ")) d = input().split(" ") for i in range(len(str(n))): if str(n)[~i] in d: n += 10**i print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s745434542
p04045
Wrong Answer
n,k = map(int,input().split()) d = list(map(int,input().split())) remain = [i for i in list(range(10)) if i not in d] base = len(remain) def calcBase(num): res = [] while num>0: res.append(num%base) num //= base return res[::-1] i = 1 while 1: s = '' for c in calcBase(i): 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...
s443079972
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) n = list(str(n)) l = sorted(list(set(range(10)) - set(d))) ans = [] for i in range(len(n)): n[i] = int(n[i]) if n[i] in d: while n[i] in d: n[i] += 1 for k in range(len(n[:i])): ans.append(str(n[k])) ans.append(str(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...
s748755335
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) n = list(str(n)) ans = [] for i in n: i = int(i) while i in d: i += 1 ans.append(str(i)) print("".join(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...
s804174454
p04045
Wrong Answer
# -*- coding: utf-8 -*- """ Created on Sat Aug 4 15:31:00 2018 @author: maezawa """ n, k = list(map(int, input().split())) d = frozenset(list(map(str, input().split()))) ok = frozenset(list(map(str,range(10)))) - d for i in range(n, 10000): if frozenset(str(i)) <= ok: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s423236907
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(input().split()) res = 0 for i in range(N,10000): if res != 0: break counter = 0 for j in str(i): if j in D: break else: counter += 1 if counter == len(str(i)): res = i print(res)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s458464118
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(input().split()) res = 0 for i in range(N,10000): if res != 0: continue counter = 0 for j in str(i): if j in D: continue else: counter += 1 if counter == len(str(i)): res = i print(res)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s371920954
p04045
Wrong Answer
N,K = map(int,input().split()) D = list(map(int,input().split())) kazu = [i for i in range(10)] taisyou = [] for i in kazu: if not i in D: taisyou.append(i) ans ='' for i in list(str(N)): for j in taisyou: if j>=int(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...
s873817110
p04045
Wrong Answer
N, K = input().split() D = [int(x) for x in input().split()] L = [str(i) for i in range(10) if i not in D] ANS = '' for i, n in enumerate(N): if n in L: ANS += n elif int(L[-1]) > int(n): ANS += [l for l in L if int(l) > int(n)][0] ANS += L[0] * (len(N) - len(ANS)) break else: while 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...
s540315618
p04045
Wrong Answer
N, K = input().split() D = [int(x) for x in input().split()] L = [str(i) for i in range(10) if i not in D] MAX = int(L[0] * 5) ANS = '' for i, n in enumerate(N): if n in L: ANS += n elif int(L[-1]) > int(n): ANS += [l for l in L if int(l) > int(n)][0] ANS += L[0] * (len(N) - i - 1) break 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...