submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s001140407
p04045
Wrong Answer
from itertools import product N, K = [int(_) for _ in input().split()] D = set([int(_) for _ in input().split()]) valid = list(set(range(10)) - D) for r in range(1,6): for p in product(valid, repeat=r): n = int(''.join([str(i) for i in p])) if n >= N: 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...
s916988309
p04045
Wrong Answer
from itertools import product N, K = [int(_) for _ in input().split()] D = set([int(_) for _ in input().split()]) valid = list(set(range(10)) - D) for p in product(valid, repeat=5): n = int(''.join([str(i) for i in p])) if n >= N: print(n) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s999050587
p04045
Wrong Answer
n, k = map(int, input().split()) result = [''] n = list(reversed(str(n))) dislikes = list(map(int, input().split())) for p in n: for x in range(10): if x not in dislikes and x>=int(p): #print("x is: ", x) result.append(str(x)) break if result[-1] < p: result.append('0') if result[-1] == ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s443006363
p04045
Wrong Answer
n, k = map(int, input().split()) result = [] n = list(str(n)) dislikes = map(int, input().split()) for p in n: for x in range(10): if x not in dislikes and x>=int(p): #print("x is: ", x) result.append(str(x)) break if result[-1] < p: result[-2] = str(int(result[-1])+1) result.appen...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s971920728
p04045
Wrong Answer
#N<10000, K<10なので上位桁から探索していってもせいぜい10^5くらい n, k = map(int, input().split()) n = str(n) dislikes = map(int, input().split()) result = [] for p in n: for x in range(10): if x not in dislikes and x>=int(p): result.append(str(x)) break print(''.join(result))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s792903077
p04045
Wrong Answer
N, K = [int(i) for i in input().split()] ds = [int(i) for i in input().split()] #N, K = (99999, 8) #ds = [0,1,2,3,4,5,6,7,9] def run_code(N, K, ds): dislike_digits_set = set(i for i in ds) avail_digits = [i for i in range(10) if i not in dislike_digits_set] avail_min = avail_digits[0] def get_next_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...
s177313759
p04045
Wrong Answer
N, K = [int(i) for i in input().split()] ds = [int(i) for i in input().split()] #N, K = (99999, 1) #ds = [0] def run_code(N, K, ds): dislike_digits_set = set(i for i in ds) avail_digits = [i for i in range(10) if i not in dislike_digits_set] avail_min = avail_digits[0] def get_next_digit(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...
s610702569
p04045
Wrong Answer
N, K = [int(i) for i in input().split()] ds = [int(i) for i in input().split()] def run_code(N, K, ds): dislike_digits_set = set(i for i in ds) avail_digits = [i for i in range(10) if i not in dislike_digits_set] avail_min = avail_digits[0] def get_next_digit(d): last = [10] for ad 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...
s678694380
p04045
Wrong Answer
N, K = map(int, raw_input().split()) D = set("".join(raw_input().split())) for i in xrange(N, 10000+1): if set(str(i)) & D == set(): 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...
s190838611
p04045
Wrong Answer
from collections import defaultdict from itertools import combinations def func(i, d, now, use, st): if i >= d: st.append(now) return for x in use: func(i + 1, d, now + str(x), use, st) def solve(): n, k = map(int, input().split()) d = list(map(int, input().split())) us...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s623163533
p04045
Wrong Answer
n, k = map(int, input().split()) d = [int(i) for i in input().split()] ablenum = [int(i) for i in range(10)] lis_n = str(n) lis_n = list(lis_n) print(lis_n) # 使用可能な数一覧 for i in d: ablenum.remove(i) print(ablenum) flag_bigdigit = -1 # max(ablenum)より大きい桁があるかどうか for i in range(len(lis_n)): _i = len(lis_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...
s383319367
p04045
Wrong Answer
n, k = map(int, input().split()) d = [int(i) for i in input().split()] ablenum = [int(i) for i in range(10)] lis_n = str(n) lis_n = list(lis_n) #print(lis_n) # 使用可能な数一覧 for i in d: ablenum.remove(i) #print(ablenum) flag_bigdigit = -1 # max(ablenum)より大きい桁があるかどうか for i in range(len(lis_n)): _i = len(lis_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...
s803031203
p04045
Wrong Answer
import sys N, K = map(int, sys.stdin.readline().split()) D = map(int, sys.stdin.readline().split()) invD = [] for i in xrange(10): if i not in D: invD.append(i) tempN = N sepN = [] while tempN > 0: sepN.append(tempN % 10) tempN /= 10 sepN.reverse() ret = 0 for i in xrange(len(sepN)): digit = 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...
s608338020
p04045
Wrong Answer
import sys N, K = map(int, sys.stdin.readline().split()) D = map(int, sys.stdin.readline().split()) invD = [] for i in xrange(10): if i not in D: invD.append(i) tempN = N sepN = [] while tempN > 0: sepN.append(tempN % 10) tempN /= 10 sepN.reverse() ret = 0 for i in xrange(len(sepN)): digit = 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...
s907238332
p04045
Wrong Answer
import sys N, K = map(int, sys.stdin.readline().split()) D = map(int, sys.stdin.readline().split()) invD = [] for i in xrange(10): if i not in D: invD.append(i) tempN = N ret = 0 digit = 1 while tempN > 0: for id in invD: if id >= (tempN % 10): ret += id * digit 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...
s004145461
p04045
Wrong Answer
n,k=map(int,input().split()) d=[i for i in input().split()] print(d) while True: f=True for i in d: if i in str(n): f=False break if f: 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...
s370579836
p04045
Wrong Answer
N, K = input().split() S = input().split() A = ['0','1','2','3','4','5','6','7','8','9'] for c in S: A.remove(c) ans = '' flag = True for i in range(len(N)): if N[i] in A: ans += N[i] else: for j in range(len(A)): if N[i] < A[j]: ans += A[j] flag = False break if not flag: for k in range(len(N...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s946851294
p04045
Wrong Answer
N, K = input().split() D = input().split() A = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] for c in D: A.remove(c) ans = '' for i in range(len(N)): if N[i] in A: ans += N[i] else: for j in range(len(A)): if N[i] < A[j]: ans += A[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...
s487701253
p04045
Wrong Answer
N, K = map(str, input().split()) D = list(map(int, input().split())) ans = "" kuriagari = 0 for i in reversed(range(len(str(N)))): n = int(N[i]) if kuriagari + n > 9: n = 0 kuriagari = 1 if n in D: while(1): if n in D: if n + 1 > 9: 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...
s665859693
p04045
Wrong Answer
N, K = map(str, input().split()) D = list(map(int, input().split())) ans = "" kuriagari = 0 for i in reversed(range(len(str(N)))): n = int(N[i]) if kuriagari + n > 9: n = 0 kuriagari = 1 if n in D: while(1): if n in D: if n + 1 > 9: 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...
s001041231
p04045
Wrong Answer
N, K = map(str, input().split()) D = list(map(int, input().split())) ans = "" kuriagari = 0 for i in reversed(range(len(str(N)))): n = int(N[i]) if kuriagari + n > 9: n = 0 kuriagari += 1 if n in D: while(1): if n in D: if n + 1 > 9: 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...
s719590760
p04045
Wrong Answer
N, K = map(str, input().split()) D = list(map(int, input().split())) ans = "" for i in range(len(str(N))): n = int(N[i]) if n in D: while(1): n += 1 if n in D: continue else: break ans += str(n) #ans += N[:i]+str(n)+N[i+1:] prin...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s562997603
p04045
Wrong Answer
n, k = [int(i) for i in input().strip(" ").split()] q = n not_liked = [int(i) for i in input().strip(" ").split()] liked = [i for i in range(10) if i not in not_liked] digits = list() while(n): digits.append(n%10) n //= 10 digits.reverse() ind = -2 for i in digits: if i not in liked: ind = digits.index(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...
s219718992
p04045
Wrong Answer
n, k = [int(i) for i in input().strip(" ").split()] q = n not_liked = [int(i) for i in input().strip(" ").split()] liked = [i for i in range(10) if i not in not_liked] digits = list() while(n): digits.append(n%10) n //= 10 digits.reverse() ind = -2 for i in digits: if i not in liked: ind = digits.index(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...
s590201924
p04045
Wrong Answer
n, k = [int(i) for i in input().strip(" ").split()] q = n not_liked = [int(i) for i in input().strip(" ").split()] liked = [i for i in range(10) if i not in not_liked] digits = list() while(n): digits.append(n%10) n //= 10 digits.reverse() ind = -2 for i in digits: if i not in liked: ind = digits.index(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...
s145493187
p04045
Wrong Answer
n, k = list(map(int, input().split())) not_liked = list(map(int, input().split())) liked = [i for i in range(10) if i not in not_liked] digits = list() while(n): digits.append(n%10) n = n // 10 js = list() jss = list() for i in digits: for j in liked: if j >= i: js.append(j) jss.append(js[:]) js.clear() k=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...
s759596572
p04045
Wrong Answer
n, k = map(int, raw_input().split()) l = map(int, raw_input().split()) temp = n a = [] while temp > 1: a.append(temp % 10) temp = int(temp / 10) for i in range(len(a)): if a[i] in l: while a[i] in l: a[i] += 1 if a[i] == 10: a[i] = 1 a[i + 1] += 1 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...
s587082681
p04045
Wrong Answer
n, k = map(int, raw_input().split()) l = map(int, raw_input().split()) temp = n a = [] while temp > 0: a.append(temp % 10) temp = int(temp / 10) for i in range(len(a)): if a[i] in l: while a[i] in l: a[i] += 1 ans = 0 a.reverse() for i in a: ans = ans * 10 + i 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...
s470549366
p04045
Wrong Answer
N, K = raw_input().split() D = raw_input().split() candi = [str(i) for i in xrange(10)] for d in D: candi.remove(d) def decide(i): if i >= len(N): return '' for c in candi: if N[i] == c: return c + decide(i+1) elif N[i] < c: return c + candi[0] * (len(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...
s040144181
p04045
Wrong Answer
N, K = raw_input().split() D = raw_input().split() candi = [str(i) for i in xrange(10)] for d in D: candi.remove(d) def decide(i): if i >= len(N): return '' for c in candi: if N[i] == c: return c + decide(i+1) elif N[i] < c: return c + candi[0] * (len(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...
s062528925
p04045
Wrong Answer
N, K = raw_input().split() D = raw_input().split() candi = [str(i) for i in xrange(10)] for d in D: candi.remove(d) def decide(i): if i >= len(N): return '' for c in candi: if N[i] == c: return c + decide(i+1) elif N[i] < c: return c + candi[0] * (len(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...
s120491110
p04045
Wrong Answer
N,K = map(int,raw_input().split(" ")) A = map(int,raw_input().split(" ")) n = [int(c) for c in str(N)] len_n = len(n) digits = [] for i in range(10): if not(i in A): digits.append(i) def need_big_keta(): if n[0] < digits[-1]: return False i=0 while i < len_n and n[i] == digits[-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...
s932601218
p04045
Wrong Answer
N,K = map(int,raw_input().split(" ")) A = map(int,raw_input().split(" ")) n = [int(c) for c in str(N)] len_n = len(n) digits = [] for i in range(10): if not(i in A): digits.append(i) def need_big_keta(): if n[0] < digits[-1]: return False i=0 while i < len_n and n[i] == digits[-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...
s958692523
p04045
Wrong Answer
class IrohasObsession: def getMinimumValue(self,n,k,d): nums=list(set(d)^set([0,1,2,3,4,5,6,7,8,9])) if not n: print min(nums); return for i in range(9999): digits=[int(str(n)[i]) for i in range(len(str(n)))] flag=1 for j in range(len(digits)): if not digits[j] in nums: flag=0 if flag: print n; 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...
s512282216
p04045
Wrong Answer
class IrohasObsession: def getMinimumValue(self,n,k,d): nums=list(set(d)^set([0,1,2,3,4,5,6,7,8,9])) for i in range(9999): digits=[int(str(n)[i]) for i in range(len(str(n)))] flag=1 for j in range(len(digits)): if not digits[j] in nums: flag=0 if flag: print n; return n+=1 print -1 if __name_...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s738414168
p04045
Wrong Answer
def solve(): n, _ = input().split() m = [int(i) for i in n] d = set(map(int, input().split())) ans = [''] * len(m) just = True for i in range(len(m)): if just: if m[i] not in d: ans[i] = m[i] else: for j in range(m[i] + 1, 11): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s866306292
p04045
Wrong Answer
def solve(): n, _ = input().split() m = [int(i) for i in n] d = set(map(int, input().split())) ans = [''] * len(m) just = True for i in range(len(m)): if just: if m[i] not in d: ans[i] = m[i] else: for j in range(m[i] + 1, 11): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s815050394
p04045
Wrong Answer
def solve(): n, _ = input().split() m = [int(i) for i in n] d = set(map(int, input().split())) ans = [''] * len(m) just = True for i in range(len(m)): if just: if m[i] not in d: ans[i] = m[i] else: for j in range(m[i] + 1, 11): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s992818085
p04045
Wrong Answer
def solve(): n, k = input().split() m = [int(i) for i in n] k = int(k) d = set(map(int, input().split())) ans = [''] * len(m) just = True for i in range(len(m)): if just: if m[i] not in d: ans[i] = str(m[i]) else: for j in (m[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...
s680753152
p04045
Wrong Answer
N,K = input().split() D = list(map(int,input().split())) def check(num,D): numStr = str(num) for i in range(len(numStr)): if int(numStr[i]) in D: return False return True n = int(N) for i in range(n,10000): if check(i,D): print( i ) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s921875152
p04045
Wrong Answer
N, K = map(int, raw_input().split()) D = map(str, raw_input().split()) for i in range(N, 10000): S = list(str(i)) for l in S: try: D.index(l) break except ValueError: 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...
s862403226
p04045
Wrong Answer
#coding: utf-8 #ABC042C n,k=map(int,raw_input().split()) d=map(int,raw_input().split()) e=[] for i in xrange(10): if i not in d: e.append(i) l=[int(x) for x in list(str(n))] i=0 while l[i] in e and i<len(l)-1: i+=1 while l[i] not in e: l[i]=l[i]+1 i+=1 while i<len(l): l[i]=0 i+=1 res=int(reduce(lambda x,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...
s424911683
p04045
Wrong Answer
N, K = map(int, input().split()) not_use = set(map(int, input().split())) # 使用不可な数字 def check(num): str_num = set([int(s) for s in str(num)]) tmp = (str_num & not_use) if(len(tmp) > 0): return False else: print(num) return True if __name__ == '__main__': while 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...
s294550739
p04045
Wrong Answer
N, K = map(int, input().split()) not_use = list(map(int, input().split())) # 使用不可な数字 def check(num): str_num = str(num) for s in str_num: if(int(s) in not_use): return False print(str_num) return True if __name__ == '__main__': while N < 10000: flag = check(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...
s142654389
p04045
Wrong Answer
N, K = map(int, input().split()) not_use = list(map(int, input().split())) # 使用不可な数字 def check(num): str_num = str(num) for s in str_num: if(int(s) in not_use): return False print(str_num) return True if __name__ == '__main__': while N < 10000: if(N == 9999): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s575914930
p04045
Wrong Answer
import sys S, K = input().split() Bad = list(map(int, input().split())) OK = sorted(set(range(10)) - set(Bad)) NotZero = sorted(set(OK) - set([0])) if str(OK[-1]) < S[0]: print(str(NotZero[0]) + str(OK[0]) * len(S)) sys.exit() count = [0] * 10 for c in str(S): count[ord(c) - ord('0')] += 1 greater = 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...
s911582509
p04045
Wrong Answer
import sys S, K = input().split() Bad = list(map(int, input().split())) OK = [chr(ord('0') + i) for i in range(10) if i not in Bad] NotZero = sorted(set(OK) - set(['0'])) ans = [] if OK[-1] < S[0]: print(NotZero[0] + OK[0] * len(S)) sys.exit() greater = 0 for i in range(len(S)): for d in OK: if i =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s610387519
p04045
Wrong Answer
import sys S, K = input().split() Bad = list(map(int, input().split())) OK = [chr(ord('0') + i) for i in range(10) if i not in Bad] ans = [] if OK[-1] < S[0]: for d in OK: if d > '0': ans.append(d) break for i in range(len(S)): ans.append(OK[0]) 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...
s473252069
p04045
Wrong Answer
# coding: utf-8 # Here your code ! import itertools ini = int(input().split(" ")[0]) try: negaset = [int(x) for x in input().split(" ")] except : print (ini) exit() okset = sorted([str(i) for i in range (10) if i not in negaset]) #print(ini,okset) for p in itertools.product(okset,repeat = 5): stp = 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...
s760131506
p04045
Wrong Answer
import itertools ini = int(input().split(" ")[0]) negaset = [int(x) for x in input().split(" ")] okset = sorted([str(i) for i in range (10) if i not in negaset]) #print(ini,okset) for p in itertools.product(okset,repeat = 5): stp = int("".join(p)) if stp >= ini: print(stp) 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...
s921332296
p04045
Wrong Answer
# coding: utf-8 # Here your code ! ini = input().split(" ")[0] negaset = [int(x) for x in input().split(" ")] okset = sorted([i for i in range (10) if i not in negaset]) #print(ini,okset) result = "" flag = False for i in [int(j) for j in ini]: if flag: result += "0" continue for k i...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s277896354
p04045
Wrong Answer
# coding: utf-8 # Here your code ! ini = input().split(" ")[0] negaset = [int(x) for x in input().split(" ")] okset = sorted([i for i in range (10) if i not in negaset]) #print(ini,okset) result = "" flag = False for i in [int(j) for j in ini]: if flag: result += str(okset[0]) continue ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s662470359
p04045
Wrong Answer
# coding: utf-8 # Here your code ! ini = input().split(" ")[0] negaset = [int(x) for x in input().split(" ")] okset = [i for i in range (10) if i not in negaset] #print(ini,okset) result = "" for i in [int(j) for j in ini]: if i in okset: result += str(i) continue for k in range(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...
s584787139
p04045
Wrong Answer
n,k=map(int,input().split()) drr=map(int,input().split()) digits = list(set([0,1,2,3,4,5,6,7,8,9])-set(drr)) p = len(digits) arr=[0] def inc(arr,p,pos): if arr[pos] == p-1: arr[pos]=0 if pos==len(arr)-1: arr.append(0) else: inc(arr,p,pos+1) else: arr[pos]+...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s208593410
p04045
Wrong Answer
n, k = map(int, input().split()) dislike = input().split() i = 1 while True: money = str(n * i) if len(set(money).intersection(dislike)) == 0: print(money) break 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...
s422501271
p04045
Wrong Answer
n, k = map(int, input().split()) dislike = list(map(str, input().split())) i = 1 flag = True while flag: money = str(n * i) for s in money: if s in dislike: flag = True break else: flag = False i += 1 print(money)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s370509432
p04045
Wrong Answer
#!/usr/bin/env python3 # -*- coding:utf-8 -*- def main(): N, K = map(int, input().split()) D = input().split() s = str(N) d = None for a, b in zip(sorted(map(int, D)), [1,2,3,4,5,6,7,8,9]): if a != b: d = str(b) break D = set(D) for i in range(N, 1 + int(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...
s935808359
p04045
Wrong Answer
def no_dislike_number(num, D): for digit in num: if int(digit) in D: return False return True # for dislike in D: # if dislike in num: # return False # return True MAX = 10000 N, K = map(int, input().split()) D = input().split() num = N while(True): if no_dis...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s456132965
p04045
Wrong Answer
#coding=UTF-8 mojir=input() hyo=mojir.split(' ') N=int(hyo[0]) K=int(hyo[1]) mojir=input() hyo=mojir.split(' ') D=[int(mono) for mono in hyo] kouho=N def usecheck(gaku): gakustr=str(gaku) keta=len(gakustr) dame=None for idx in range(0,keta,1): if gakustr[idx] in hyo: dame=idx ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s584493903
p04045
Wrong Answer
dislike = [] basic = ["0","1","2","3","4","5","6","7","8","9"] like = [] N = [] ans = "" def get_input(): cnt = 0 while True: a = input() yield ''.join(a) cnt += 1 if cnt >= 2: break if __name__ == "__main__": array = list(get_input()) intN,K = array[0].spl...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s713634997
p04045
Wrong Answer
# coding: utf-8 # Here your code ! N, K = map(int, raw_input().split(" ")) D = map(int, raw_input().split(" ")) nums = range(0,10) #好きな数字を昇順のリストに整理 like = list(set(nums).difference(set(D))) like.sort() #数字を上から1文字づつ処理 grade = len(str(N))-1 ans = 0 flag = False #上の桁で嫌いな数字があるか for i in str(N): if int(i) == 9 and 9 not...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s706616749
p04045
Wrong Answer
# coding: utf-8 # Here your code ! N, K = map(int, raw_input().split(" ")) D = map(int, raw_input().split(" ")) nums = range(0,10) #好きな数字を昇順のリストに整理 like = list(set(nums).difference(set(D))) like.sort() print like #数字を上から1文字づつ処理 grade = len(str(N))-1 ans = 0 flag = False #上の桁で嫌いな数字があるか for i in str(N): if 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...
s164644210
p04045
Wrong Answer
# coding: utf-8 # Here your code ! N, K = map(int, raw_input().split(" ")) D = map(int, raw_input().split(" ")) nums = range(0,10) #好きな数字を昇順のリストに整理 like = list(set(nums).difference(set(D))) like.sort() #数字を上から1文字づつ処理 grade = len(str(N))-1 ans = 0 flag = False #上の桁で嫌いな数字があるか for i in str(N): if int(i) == 9 and not 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...
s701958570
p04045
Wrong Answer
# coding: utf-8 # Here your code ! N, K = map(int, raw_input().split(" ")) D = map(int, raw_input().split(" ")) nums = range(0,10) #好きな数字を昇順のリストに整理 like = list(set(nums).difference(set(D))) like.sort() #数字を上から1文字づつ処理 grade = len(str(N))-1 ans = 0 flag = False #上の桁で嫌いな数字があるか for i in str(N): if int(i) not in like 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...
s601922079
p04045
Wrong Answer
# coding: utf-8 # Here your code ! N, K = map(int, raw_input().split(" ")) D = map(int, raw_input().split(" ")) nums = range(0,10) #好きな数字を昇順のリストに整理 like = list(set(nums).difference(set(D))) like.sort() #数字を上から1文字づつ処理 grade = len(str(N))-1 ans = 0 flag = False #上の桁で嫌いな数字があるか for i in str(N): if int(i) not in 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...
s794517815
p04045
Wrong Answer
catch = input() catch = catch.split(" ") N = list(catch[0]) K = int(catch[1]) OF = 0 for i in range(len(N)): N[i] = int(N[i]) kirai = [] catch = input() catch = catch.split(" ") for i in catch: kirai.append(int(i)) kirai.sort() for i in range(len(N)-1, 0, -1): while True: if N[i] >9: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s963853158
p04045
Wrong Answer
catch = input() catch = catch.split(" ") N = list(catch[0]) K = int(catch[1]) OF = 0 for i in range(len(N)): N[i] = int(N[i]) kirai = [] catch = input() catch = catch.split(" ") for i in catch: kirai.append(int(i)) kirai.sort() for i in range(len(N)-1, 0, -1): while True: if N[i] >9: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s687352305
p04045
Wrong Answer
import itertools N, K = map(int, raw_input().split()) d = map(int, raw_input().split()) d = set(d) ok = set(range(10)) - d ok = list(ok) ok = [str(i) for i in ok] i = len(str(N)) while True: for ele in itertools.product(ok, repeat=i): if int("".join(list(ele))) >= N: print "".join(list(ele)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s392106009
p04045
Wrong Answer
import itertools N, K = map(int, raw_input().split()) d = map(int, raw_input().split()) d = set(d) ok = set(range(10)) - d ok = list(ok) ok = [str(i) for i in ok] i = len(str(N)) while True: for ele in itertools.product(ok, repeat=i): if int("".join(list(ele))) > N: print "".join(list(ele)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s646834461
p04045
Wrong Answer
catch = input() catch = catch.split(" ") N = list(catch[0]) K = int(catch[1]) OF = 0 for i in range(len(N)): N[i] = int(N[i]) kirai = [] catch = input() catch = catch.split(" ") for i in catch: kirai.append(int(i)) kirai.sort() for i in range(len(N)-1, 0, -1): if N[i] >9: N[i-1] +=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...
s121212331
p04045
Wrong Answer
N, K = map(int, raw_input().split()) D = map(int, raw_input().split()) for i in range(N, 10001): flag = 0 for j in D: if str(j) in str(i): flag = 1 break if flag == 0: print i exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s540656309
p04045
Wrong Answer
n, _ = input().split(' ') o = set([d for d in range(10)]) d = set([int(t) for t in input().split(' ')]) o = list(o.difference(d)) o.sort() ans = [] for t in n: t = int(t) for tt in o: if tt >= t or (len(ans) != 0 and ans[0] > int(n[0])): ans.append(tt) break else: ans...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s930445574
p04045
Wrong Answer
def no_dislike_number(num, D): for dislike in D: if dislike in num: return False return True MAX = 10000 N, K = map(int, input().split()) D = input().split() for num in range(N, MAX+1): if no_dislike_number(str(num), D): print(num) 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...
s106109314
p04045
Wrong Answer
cond = [int(n) for n in input().split(" ")] exclude = {n for n in range(10)} answer = "" mo = {str(n) for n in input().split(" ")} exclude = exclude - mo for n in range(cond[0],10000): for m in [n for n in str(n)]: if m in mo: break else: print(n) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s258481383
p04045
Wrong Answer
n, _ = input().split(' ') o = set([d for d in range(10)]) d = set([int(t) for t in input().split(' ')]) o = list(o.difference(d)) o.sort() ans = [] for t in n: t = int(t) for tt in o: if tt >= t: ans.append(tt) break else: ans.append(o[0]) if int(''.join(map(str,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...
s573687668
p04045
Wrong Answer
def check_no_dislike_number(num, D): num_str = str(num) for dislike in D: if dislike in num_str: return False return True MAX = 10000 N, K = map(int, input().split()) D = input().split() for num in range(N, MAX): if check_no_dislike_number(num, D): print(num) 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...
s212702158
p04045
Wrong Answer
n, _ = input().split(' ') o = set([d for d in range(10)]) d = set([int(t) for t in input().split(' ')]) o = list(o.difference(d)) o.sort() for t in n: t = int(t) for tt in o: if tt >= t: print(tt, end='') 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...
s224468502
p04045
Wrong Answer
n, k = map(int,input().split()) d = list(map(str,input().split())) ans = n f = 0 while True: ansstr = list(str(ans)) l = len(ansstr) for i in range(l): if ansstr[i] in d: break else: f = 1 break if f: break ans += 1 print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s591589457
p04045
Wrong Answer
N, K = map(int, raw_input().split()) D = "".join(raw_input().strip().split()) for i in xrange(N, 10000+1): flag = True for c in str(i): if c in D: flag = False if flag: print i break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s333065695
p04045
Wrong Answer
N, K = map(int, raw_input().split()) D = "".join(raw_input().strip().split()) for i in xrange(N, 10000+1): flag = True for c in str(i): if c in D: flag = False if flag: print i __import__('sys').exit(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...
s734618616
p04045
Time Limit Exceeded
n,k = input().split() d = list(map(int,input().split())) num = [i for i in range(10)] poss = list(set(d) ^ set(num)) an = int(n) while True: sum = 0 for p in poss: sum += n.count(str(p)) if sum ==len(n): break else: an +=1 print(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...
s474099294
p04045
Time Limit Exceeded
n, k = map(int, input().split()) d = [int(i) for i in input().split()] for i in range(n, 10**5): tmp = i last = tmp % 10 while i > 0 and last not in d: tmp //= 10 last = tmp % 10 if tmp == 0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s952411409
p04045
Time Limit Exceeded
n,k=map(int,input().split()) d=set(map(int,input().split())) i=n while True: if not set((str(i)))&d: i+=1 else: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s764091511
p04045
Time Limit Exceeded
# -*- coding : utf-8 -*- N,k = map(int, input().split()) D = list(map(str, input().split())) while True : n_str = str(N) for d in D: if d in n_str: N += 1 break else: print(N) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s730625602
p04045
Time Limit Exceeded
n,k=map(int, input().split()) ds=list(map(str, input().split())) while (i in str(n) for i in ds): n+=1 print(str(n))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s800562269
p04045
Time Limit Exceeded
n, k = map(int, input().split()) d = list(map(int, input().split())) use = [i for i in range(10)] for _d in d: use.remove(_d) ok = True while True: s = list(str(n)) for _d in d: if str(_d) in s: ok = False break if ok: print(n) exit() 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...
s153100090
p04045
Time Limit Exceeded
l=list(map(int,input().split())) d=list(map(int,input().split())) u={i for i in range(10)} d_bar=u-set(d) n=l[0] n_list=list(int(j) for j in str(n)) while True: n_set=set(n_list) if n_set<=d_bar: print(n) else: n=n+1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s872885021
p04045
Time Limit Exceeded
l=list(map(int,input().split())) d=list(map(int,input().split())) N=l[0] K=l[1] d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() n=[int(k) for k in str(N)] dig1='' dig2=0 for i in range(len(n)): for j in range(len(d_bar)): p=dig1+str(d_bar[j]) if int(p)>l[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...
s297940050
p04045
Time Limit Exceeded
l=[2658,3] d=[2,4,5] d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() n=[int(k) for k in str(l[0])] for i in range(len(n)): dig1='' dig2=0 for j in range(l[1]): p=dig1.join(str(d_bar[j])) if int(p)>l[0]: dig2=dig2+int(dig1)*l[1]**(l[0]-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...
s025479588
p04045
Time Limit Exceeded
l=[2658,3] d=[2,4,5] d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() n=[int(k) for k in str(l[0])] for i in range(len(n)): dig1='' dig2=0 for j in range(l[1]): p=dig1.join(str(d_bar[j])) if int(p)>l[0]: break dig1=p dig2=dig2+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...
s550334109
p04045
Time Limit Exceeded
l=[2658,3] d=[2,4,5] d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() n=[int(k) for k in str(l[0])] for i in range(len(n)): dig1=0 dig2=0 for j in range(l[1]): p=dig1+d_bar[j]*10**(l[0]-i) if p>l[0]: break dig1=p dig2=dig2+d_b...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s134857948
p04045
Time Limit Exceeded
N, K = map(int, input().split()) D = list(map(int, input().split())) L=[] for i in range(0, 10): if i not in D: L.append("i") i = N while True: if set(list(str((i)))) <= set(L): print(i) break 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...
s796864511
p04045
Time Limit Exceeded
import sys sys.setrecursionlimit(10**8) def ii(): return int(sys.stdin.readline()) def mi(): return map(int, sys.stdin.readline().split()) def li(): return list(map(int, sys.stdin.readline().split())) def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)] def dp2(ini, i, j): return [[ini]*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...
s628545098
p04045
Time Limit Exceeded
n,k = map(int,input().split()) d = list(input().split()) ans = n flag = True while flag: for i in d: if flag :break if i in str(ans): x = len(str(ans)) - str(ans).index(i) - 1 ans += 10**x flag = False print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s786393346
p04045
Time Limit Exceeded
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] ans = n while (1): c = True b = n while (b != 0): b = b // 10 d = b % 10 if d in a: c = False break if (c): ans = n brea...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s907165393
p04045
Time Limit Exceeded
a, b=map(int,input().split()) l=list(map(int,input().split())) list_a= [int(s) for s in l] while True: for c in l: if c in list_a: a+=1 continue else: print(a) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s581185211
p04045
Time Limit Exceeded
N,K = map(int,input().split()) D = list(map(int,input().split())) num = {0,1,2,3,4,5,6,7,8,9} Ds = set(D) diff = num^Ds ans = N while True: strN = str(N) flag = False for i in strN: if int(i) not in diff: flag = True if flag: ans += 1 else: break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s435268470
p04045
Time Limit Exceeded
import string n,k =[int(i) for i in input().split()] not_use=[int(i) for i in input().split()] use=[int(i) for i in string.digits if int(i) not in not_use] def check(n): for i in str(n): if(int(i) in not_use): return False return True x=n-1 while True: x+=1 if(check(x)==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...
s485019854
p04045
Time Limit Exceeded
n, k = map(int, input().split()) money = n dislike_digits = list(map(int, input().split())) ok = False found = False while not ok: money_digits = [int(mon) for mon in str(money)] for digit in money_digits: for dis_digit in dislike_digits: if digit == dis_digit: found = 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...
s561672901
p04045
Time Limit Exceeded
import numpy as np n = list(map(int, input().split())) d = np.array(list(map(int, input().split()))) a = len(str(n[0])) x = np.zeros(a + 1) for i in range(a + 1): x[i] = (n[0] % np.power(10, a - i + 1)) // np.power(10, a - i) i = 0 while i != a: i += 1 while np.any(d == x[i]): x[i] += 1 x...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...