submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s125748411
p04045
Wrong Answer
import sys import itertools readline = lambda:sys.stdin.readline().rstrip() N,K = readline().split() dd = {int(s) for s in readline().split()} table = [None] * 10 a = 10 for i in range(9,-1,-1): if i not in dd: a = i table[i] = a nn = [int(n) for n in N] mm = [table[n] for n in nn] tab_min = min(x for ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s609271063
p04045
Wrong Answer
import sys import itertools readline = lambda:sys.stdin.readline().rstrip() N,K = readline().split() dd = {int(s) for s in readline().split()} table = [None] * 10 a = 10 for i in range(9,-1,-1): if i not in dd: a = i table[i] = a nn = (int(n) for n in N) mm = [table[n] for n in nn] tab_min = min(x for ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s117068557
p04045
Wrong Answer
import sys import itertools readline = lambda:sys.stdin.readline().rstrip() N,K = readline().split() dd = {int(s) for s in readline().split()} table = [None] * 10 a = 10 for i in range(9,-1,-1): if i not in dd: a = i table[i] = a nn = (int(n) for n in N) mm = [table[n] for n in nn] tab_min = min(x for ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s544245884
p04045
Wrong Answer
def main(): n, k = map(int, input().split()) d = list(input().split()) for i in range(n, 10000): if checknum(i, d): print(i) break def checknum(n, d): for s in str(n): if d.count(s) > 0: return False return True if __name__ == '__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s402228966
p04045
Wrong Answer
def main(): n, k = map(int, input().split()) d = list(map(int, input().split())) a = n for i in range(n, 10000): if checknum(i, d): a = i break print(a) def checknum(n, d): for s in str(n): if d.count(int(s)) > 0: return False return True if __name__ == '__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s074856841
p04045
Wrong Answer
def main(): n, k = map(int, input().split()) d = list(map(int, input().split())) a = 0 for i in range(n, 10000): if checknum(i, d): a = i break print(a) def checknum(n, d): for s in str(n): if d.count(int(s)) > 0: return False return True if __name__ == '__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s606353920
p04045
Wrong Answer
# /usr/bin/env python3 # https://atcoder.jp/contests/abc042/tasks/arc058_a def check_digit(d, target): for i in range(target, 10): if i not in d: return False, i else: return True, min(list(set(range(0, 10)) - set(d))) n, k = [int(x) for x in input().split()] d = [int(x) for x 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...
s384826154
p04045
Wrong Answer
#!/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 for ii in range(0, 4): b = n // pow(10, ii) d = b % 10 if b == 0: break if d in a: c = False br...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s752869754
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(0, 10): if i not in a: like.append(i) ans = -1 while (1): c = True for ii in range(0, 4): b = n // pow(10, ii) d = b % 10 if b == 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...
s722462693
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(0, 10): if i not in a: like.append(i) ans = -1 while (1): c = True for ii in range(0, 4): b = int((n / pow(10, ii))) % 10 if b 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...
s734165343
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(0, 10): if i not in a: like.append(i) ans = -1 try: while (1): c = True for ii in range(0, 4): b = int((n / pow(10, ii))) % 10 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...
s855562055
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(0, 10): if i not in a: like.append(i) ans = -1 try: while (1): c = True for ii in range(3, 0, -1): b = (n // pow(10, ii)) % 10 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...
s335836677
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(0, 10): if i not in a: if i != 0: like.append(i) b = sorted(like) k = b[0] ans = k * 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...
s830571818
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(0, 10): if i not in a: like.append(i) b = sorted(like) k = b[0] if b[0] != 0 else b[1] ans = k * 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...
s262526782
p04045
Wrong Answer
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] for i in range(1, 10): if i not in a: like.append(i) b = sorted(like) k = b[0] if b[0] != 0 else b[1] ans = k * 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...
s701503820
p04045
Wrong Answer
import sys N, K = map(int, input().split()) D = list(map(int, input().split())) for n in range(N, 10000+1): li = list(str(n)) for i in li: if int(i) in D: break else: print(n) sys.exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s769134093
p04045
Wrong Answer
import sys N, K = map(int, input().split()) D = list(map(int, input().split())) for n in range(N, 10000): li = list(str(n)) for i in li: if int(i) in D: break else: print(n) sys.exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s829270482
p04045
Wrong Answer
# /usr/bin/env python3 # https://atcoder.jp/contests/abc042/tasks/arc058_a n, k = [int(x) for x in input().split()] d = [int(x) for x in input().split()] ans = 0 for i in range(len(str(n)) + 1): target = n // (10**i) % 10 if i == len(str(n)) and target == 0: break for j in range(target, 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...
s267242710
p04045
Wrong Answer
# /usr/bin/env python3 # https://atcoder.jp/contests/abc042/tasks/arc058_a n, k = [int(x) for x in input().split()] d = [int(x) for x in input().split()] ans = 0 for i in range(len(str(n)) + 1): target = n // (10**i) % 10 for j in range(target, 10): if j not in d: ans += 10**i * j ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s070488580
p04045
Wrong Answer
# /usr/bin/env python3 # https://atcoder.jp/contests/abc042/tasks/arc058_a n, k = [int(x) for x in input().split()] d = [int(x) for x in input().split()] ans = 0 for i in range(len(str(n))): target = n // (10**i) % 10 for j in range(target, 10): if j not in d: ans += 10**i * j 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...
s027964885
p04045
Wrong Answer
from itertools import product N, K = map(int, input().split()) D = list(map(int, input().split())) L = [] for i in range(10): if not i in D: L.append(i) keta = len(str(N)) flg = 0 # 与えられた桁と同じ桁数で終わるとき for num in product(L, repeat = keta): num = list(num) num.reverse() # print(num) val = 0 for i in range(keta):...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s441061834
p04045
Wrong Answer
from itertools import product N, K = map(int, input().split()) D = list(map(int, input().split())) L = [] for i in range(10): if not i in D: L.append(i) keta = len(str(N)) flg = 0 # 与えられた桁と同じ桁数で終わるとき for num in product(L, repeat = keta): num = list(num) num.reverse() # print(num) val = 0 for i in range(keta):...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s651811395
p04045
Wrong Answer
from itertools import product N, K = map(int, input().split()) D = list(map(int, input().split())) L = [] for i in range(10): if not i in D: L.append(i) keta = len(str(N)) flg = 0 # 与えられた桁と同じ桁数で終わるとき for num in product(L, repeat = keta): num = list(num) num.reverse() # print(num) val = 0 for i in range(keta):...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s860489226
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) for i in range(10000): ok = True for di in d: if str(di) in str(i): ok = False break if ok and i >= n: break print(i)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s598656511
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) usable = [] non_zero_usable = [] for i in range(10): if i not in d: usable.append(i) if i != 0: non_zero_usable.append(i) su = sorted(usable) zu = sorted(non_zero_usable) ans = '' for i, v in enumerate(list(str(n))): v = int(v) 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...
s554374576
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(str,input().split())) for k in range(100*N): N += 1 for j in range(len(str(N))): if str(N)[j] in D: break else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s835770663
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(str,input().split())) for k in range(9*N+1): N += 1 for j in range(len(str(N))): if str(N)[j] in D: break else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s768333566
p04045
Wrong Answer
from functools import lru_cache N, K = map(int, input().split()) D = input().split() O = [] for c in "0123456789": if c not in D: O.append(c) # N = 523 # D = 2 3 #@lru_cache() def func(s, i, over): if i == len(s): return "" # d < N[0] if over: return O[0] + func(s, i+1, over=...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s420454715
p04045
Wrong Answer
from functools import lru_cache N, K = map(int, input().split()) D = input().split() O = [] for c in "0123456789": if c not in D: O.append(c) # N = 523 # D = 2 3 #@lru_cache() def func(s, i, over): if i == len(s): return "" # d < N[0] if over: return O[0] + func(s, i+1, over=...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s945860452
p04045
Wrong Answer
from functools import lru_cache N, K = map(int, input().split()) D = input().split() O = [] for c in "0123456789": if c not in D: O.append(c) # N = 523 # D = 2 3 #@lru_cache() def func(s, i, over): if i == len(s): return "" # d < N[0] if over: return O[0] + func(s, i+1, over=...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s630583245
p04045
Wrong Answer
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_upper...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s183031469
p04045
Wrong Answer
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_upper...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s345546784
p04045
Wrong Answer
n, k = map(int, input().split()) d = set(map(int, input().split())) inf = 10 * n + 1 stop = len(str(n)) + 1 num = [] for i in range(10): if i in d: pass else: num.append(i) def dfs(pos, x): if pos == stop: if x >= n: return x else: return inf re...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s009921933
p04045
Wrong Answer
n, k = map(int, input().split()) d = set(map(int, input().split())) inf = 10 * n + 1 stop = len(str(n)) num = [] for i in range(10): if i in d: pass else: num.append(i) ans = 0 for i in num: if i >= int(str(n)[0]): ans = i break # 同じ桁数で超えない場合 if ans == 0: stop += 1 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...
s479675961
p04045
Wrong Answer
n, k, *d = open(0).read().split() over = False ans = 0 for i in n: if over: for j in range(10): if not str(j) in d: ans = ans*10 + j break else: for j in range(int(i), 10): if not str(j) in d: over = (str(j)!=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...
s503433763
p04045
Wrong Answer
n, k, *d = open(0).read().split() over = False ans = 0 for i in n: if over: for j in range(10): if not str(j) in d: ans = ans*10 + j break else: for j in range(int(i), 10): if not str(j) in d: over = (str(j)!=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...
s804638195
p04045
Wrong Answer
n, k = map(int, input().split()) dl = set(input().split()) for i in range(n, 10000): if set(str(i)).intersection(dl) == set(): 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...
s687967952
p04045
Wrong Answer
n, k = map(int, input().split()) d_i = set(map(int, input().split())) full = set(range(10)) useableList = full - d_i useable_Top = full - d_i - set([0]) answer = [] isTop = True isMatch = True for x in str(n): if isMatch and int(x) in useableList: answer.append(x) elif isTop and int(x) > max(useable_Top): answe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s420388327
p04045
Wrong Answer
n, k = map(int, input().split()) d_i = set(map(int, input().split())) full = set(range(10)) useableList = full - d_i useable_Top = full - d_i - set([0]) answer = [] isTop = True for x in str(n): if isTop and int(x) in useableList: answer.append(x) elif isTop and int(x) > max(useable_Top): answer.append(min(usea...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s405156886
p04045
Wrong Answer
n, k = map(int, input().split()) d_i = set(map(int, input().split())) full = set(range(10)) useableList = full - d_i useable_Top = full - d_i - set([0]) answer = [] isTop = True for x in str(n): if int(x) in useableList: answer.append(x) elif isTop and int(x) > max(useable_Top): answer.append(min(useable_Top)* ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s969432582
p04045
Wrong Answer
s = input().split(" ") n = int(s[0]) numbers = [ i for i in input() if i != " "] for i in range(n, 10001): found = False snum = str(i) for num in numbers: if num in snum: found = True break if found == False: 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...
s808316840
p04045
Wrong Answer
nk = list(map(int, input().split())) N = nk[0] K = nk[1] d = input().split() a = True for i in range(N, 20001): a = True for j in d: if str(i).count(j) > 0: a = False break if a: 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...
s575481300
p04045
Wrong Answer
nk = list(map(int, input().split())) N = nk[0] K = nk[1] d = input().split() a = True for i in range(N, 10001): a = True for j in d: if str(i).count(j) > 0: a = False break if a: 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...
s730973616
p04045
Wrong Answer
# AtCoder Beginner Contest 042 # C - こだわり者いろはちゃん / Iroha's Obsession D = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] N, K = map(int, input().split()) l = input().split() for i in range(K): D.pop(D.index(int(l[i]))) X = '' for i in range(3,-1,-1): for j in range(len(D)): if D[j] >= N//(10**i): X = X + str...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s237026706
p04045
Wrong Answer
N, _ = list(map(int, input().split())) d = set(list(input().replace(" ", ""))) for i in range(1,100000001): n = str(N*i) ns = set(list(n)) flg = False for t in ns: if t in d: flg = True break if flg == False: print(n) exit() print(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...
s557468948
p04045
Wrong Answer
N, _ = list(map(int, input().split())) d = set(list(input().replace(" ", ""))) for i in range(1,1000001): n = str(N*i) ns = set(list(n)) flg = False for t in ns: if t in d: flg = True break if flg == False: print(n) exit() print(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...
s239257608
p04045
Wrong Answer
N, _ = list(map(int, input().split())) d = set(input().replace(" ", "")) for i in range(1,1000001): n = str(N*i) ns = set(list(n)) flg = False for t in ns: if t in d: flg = True break if flg == False: print(n) exit() print(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...
s370492449
p04045
Wrong Answer
N, _ = list(map(int, input().split())) d = set(input().replace(" ", "")) for i in range(1,100001): n = str(N*i) ns = set(list(n)) flg = False for t in ns: if t in d: flg = True break if flg == False: print(n) exit() print(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...
s812951862
p04045
Wrong Answer
in_len = input().split(" ") in_d = input().split(" ") in_n = in_len[0] in_k = int(in_len[1]) cmp_len = ['0','1','2','3','4','5','6','7','8','9'] use_num = sorted(list(set(cmp_len) - set(in_d)), reverse=False) use_cnt = 10 - in_k out = [] for i in range(len(in_n)): for j in range(use_cnt): if(i == 0 and in_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...
s645999431
p04045
Wrong Answer
in_len = input().split(" ") in_d = input().split(" ") in_n = in_len[0] in_k = int(in_len[1]) cmp_len = ['0','1','2','3','4','5','6','7','8','9'] use_num = sorted(list(set(cmp_len) - set(in_d)), reverse=False) use_cnt = 10 - in_k out = [] for i in range(len(in_n)): for j in range(use_cnt): if(in_n[i] <= use_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...
s093752371
p04045
Wrong Answer
in_len = input().split(" ") in_d = input().split(" ") in_n = in_len[0] in_k = int(in_len[1]) cmp_len = ['0','1','2','3','4','5','6','7','8','9'] use_num = sorted(list(set(cmp_len) - set(in_d)), reverse=False) use_cnt = 10 - in_k out = [] for i in range(len(in_n)): for j in range(use_cnt): if(in_n[i] <= use_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...
s915839531
p04045
Wrong Answer
import sys input = sys.stdin.readline def main(): N, K = [int(x) for x in input().split()] D = [int(x) for x in input().split()] Dset = set(D) for i in range(N, 10000): for j in str(i): if int(j) in Dset: break else: print(i) return ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s214349114
p04045
Wrong Answer
N,K = list(map(int,input().split())) D = list(input().split()) ok = set(("0","1","2","3","4","5","6","7","8","9"))-set(D) def solve(str_num): ans = 100000 if str_num == "": for c in ok: if c == "0": continue ans = min(ans,solve(str_num+c)) else: for...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s331446776
p04045
Wrong Answer
N,K = list(map(int,input().split())) D = list(input().split()) ok = set(("0","1","2","3","4","5","6","7","8","9"))-set(D) def solve(str_num): ans = 100000 if str_num == "": for c in ok: if c == "0": continue ans = min(ans,solve(str_num+c)) else: for...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s127519020
p04045
Wrong Answer
n,k=map(int,input().split()) D=set(map(int,input().split())) for i in range(n,n*10+1): if i>=n and len(set(str(i))&D)==0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s975321799
p04045
Wrong Answer
N, K = map(int, input().split()) D = input().split() ans = '' kuriagari = 0 for c in reversed(str(N)): c = str(int(c) + kuriagari) if int(c) > 9: kuriagari = 1 c = '0' else: kuriagari = 0 while True: if c in D: if c == '9': kuriagari += 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...
s721229495
p04045
Wrong Answer
import sys input = sys.stdin.readline N, K = [int(x) for x in input().split()] D = [str(x) for x in input().rstrip().split()] D = set(D) for i in range(N, N + 10 ** 4): i_list = list(str(i)) flag = 1 for j in i_list: if j in D: flag = 0 break if flag: 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...
s156780458
p04045
Wrong Answer
import sys input = sys.stdin.readline N, K = [int(x) for x in input().split()] D = [str(x) for x in input().rstrip()] D = set(D) for i in range(N, N + 10 ** 4): i_list = list(str(i)) for j in i_list: if j in D: break print(i) sys.exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s104350040
p04045
Wrong Answer
# https://atcoder.jp/contests/abc042/submissions/9653489 import itertools N, K = input().split() P = input().split() #使える数字 a= sorted(set([str(i) for i in range(10)])-set(P)) #同じ桁 #b1 = itertools.product(a, repeat=len(N)) #繰り上がって一つ大きい桁 b2 = itertools.product(a, repeat=len(N)+1) ans=str() cnt=0 """ for i in b1: #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...
s096016231
p04045
Wrong Answer
# https://atcoder.jp/contests/abc042/submissions/9653489 import itertools N, K = input().split() P = input().split() #使える数字 a= sorted(set([str(i) for i in range(10)])-set(P)) #同じ桁 b1 = itertools.product(a, repeat=len(N)) #繰り上がって一つ大きい桁 b2 = itertools.product(a, repeat=len(N)+1) ans=str() cnt=0 for i in b1: #print(ty...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s433879903
p04045
Wrong Answer
# https://atcoder.jp/contests/abc042/submissions/9653489 import itertools N, K = input().split() P = input().split() #使える数字 a= sorted(set([str(i) for i in range(10)])-set(P)) #同じ桁 b1 = itertools.product(a, repeat=len(N)) #繰り上がって一つ大きい桁 b2 = itertools.product(a, repeat=len(N)+1) ans=str() cnt=0 for i in b1: #print(ty...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s019453854
p04045
Wrong Answer
n,k=map(int,input().split()) D=list(map(int,input().split())) A=[i for i in range(10) if i not in D] num=list(map(int,str(n).zfill(10))) ans="" for i in range(10): for j in A: if num[i]<=j: ans +=str(j) break for i in range(len(list(str(n))),10): rate=int("".join(ans[-i:])) 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...
s831431446
p04045
Wrong Answer
n,k=map(int,input().split()) D=list(map(int,input().split())) A=[i for i in range(10) if i not in D] num=list(map(int,str(n).zfill(5))) ans="" for i in range(5): for j in A: if num[i]<=j: ans +=str(j) break for i in range(len(list(str(n))),6): rate=int("".join(ans[-i:])) if r...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s480072791
p04045
Wrong Answer
n,k=map(int,input().split()) D=list(map(int,input().split())) A=[i for i in range(10) if i not in D] num=list(map(int,str(n).zfill(5))) ans="" for i in range(5): for j in A: if num[i]<=j: ans +=str(j) break print(int("".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...
s233885208
p04045
Wrong Answer
n,k=map(int,input().split()) D=list(map(int,input().split())) A=[i for i in range(10) if i not in D] num=list(map(int,str(n))) ans="" for i in range(len(num)): for j in A: if num[i]<=j: ans +=str(j) break 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...
s347347123
p04045
Wrong Answer
N, L = map(str, input().split()) K = N P = list(map(str, input().split())) U = sorted(list(set([str(i) for i in range(10)])-set(P))) #K = str() for i in range(len(N)): if N <= K: if N[i] in P: #print(N[i]) for j in U: if j >=N[i]: N=N.replace(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...
s066066920
p04045
Wrong Answer
import itertools N, L = map(str, input().split()) P = list(map(str, input().split())) U = itertools.combinations_with_replacement(list(set([str(i) for i in range(10)])-set(P)),10-len(P)) K = str() for i in U: K = ''.join(i) if K>=N: print(K) 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...
s682904861
p04045
Wrong Answer
N, L = map(str, input().split()) K = int(N) P = list(map(str, input().split())) U = sorted(list(set([str(i) for i in range(10)])-set(P))) for i in range(len(N)): if int(N) <= K: if N[i] in P: for j in U: if j >=N[i]: N=N.replace(N[i],j) bre...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s309912900
p04045
Wrong Answer
N, L = map(str, input().split()) P = list(map(str, input().split())) U = sorted(list(set([str(i) for i in range(10)])-set(P))) #print(U) for i in range(len(N)): #print(N[i]) if N[i] in P: #print(N[i]) for j in U: #print(j) if j >=N[i]: N=N.replace(N[i],j) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s088893912
p04045
Wrong Answer
N, L = map(str, input().split()) P = list(map(str, input().split())) U = sorted(list(set([str(i) for i in range(10)])-set(P))) #print(U) for i in range(len(N)): #print(N[i]) if N[i] in P: print(N[i]) for j in U: print(j) if j >=N[i]: N=N.replace(N[i],j) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s358371252
p04045
Wrong Answer
import os if __name__ == "__main__": temp = input().split(" ") N = temp[0] L = int(temp[1]) D = list(map(int, input().split(" "))) like = [] for i in range(0, 10): if D.count(i) == 0: like.append(i) ans = [] for n in N: for l in like: 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...
s485946340
p04045
Wrong Answer
N, K = map(int, input().split()) dislikes = input().split() for i in range(N, 10000): str_i = str(i) if any([d in str_i for d in dislikes]): continue 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...
s225733419
p04045
Wrong Answer
N, K = map(int, input().split()) dislikes = input().split() for i in range(N, 10000): str_i = str(i) if all([d not in str_i for d in dislikes]): 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...
s459331694
p04045
Wrong Answer
N, K = map(int, input().split()) dislikes = [i for i in input().split()] ans = [] is_zero = True for i in range(N, 10000): str_i = str(i) if all([d not in str_i for d in dislikes]): print(i) is_zero = False break if is_zero: print(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...
s524347922
p04045
Wrong Answer
N, K = map(int, input().split()) dislikes = [i for i in input().split()] ans = [] is_zero = False for i in range(N, 10000): str_i = str(i) if all([d not in str_i for d in dislikes]): print(i) is_zero = True break if is_zero: print(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...
s991034802
p04045
Wrong Answer
N, K = map(int, input().split()) dislikes = [i for i in input().split()] ans = [] for i in range(N, 10000): str_i = str(i) if all([d not in str_i for d in dislikes]): 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...
s049681682
p04045
Wrong Answer
import itertools list_of_num = list(range(10)) inputs = input().split(' ') n, k = int(inputs[0]), int(inputs[1]) [list_of_num.remove(int(i))for i in input().split(' ')] if len(str(n)) == sum([1 for i in list(str(n)) if int(i) in list_of_num]): print(n) else: list_of_num = [str(i) for i in list_of_num] 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...
s842493724
p04045
Wrong Answer
import itertools list_of_num = list(range(10)) inputs = input().split(' ') n, k = int(inputs[0]), int(inputs[1]) [list_of_num.remove(int(i))for i in input().split(' ')] if len(str(n)) == sum([1 for i in list(str(n)) if int(i) in list_of_num]): print(n) else: list_of_num = [str(i) for i in list_of_num] 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...
s658547005
p04045
Wrong Answer
list_of_num = list(range(10)) inputs = input().split(' ') n, k = int(inputs[0]), int(inputs[1]) [list_of_num.remove(int(i))for i in input().split(' ')] if list_of_num[0] == 0: print(n*list_of_num[1]) else: print(n* list_of_num[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...
s243775670
p04045
Wrong Answer
N, K = list(map(int, input().split())) D = list(map(int, input().split())) for i in range(N, 10**5): for c in str(i): if c in D: break else: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s518848312
p04045
Wrong Answer
import os if __name__ == "__main__": temp = input().split(" ") N = temp[0] L = int(temp[1]) D = list(map(int, input().split(" "))) D.sort() like = [] for i in range(0, 10): if D.count(i) == 0: like.append(i) ans = [] for n in N: for l 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...
s605742183
p04045
Wrong Answer
nk=list(map(int,input().split())) d=list(map(int,input().split())) i=nk[0] ans=0 while ans==0: flag=0 for j in range(len(str(i))): if str(i)[j] in d: flag=1 break if flag==0: ans=i i+=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...
s131658728
p04045
Wrong Answer
N, K = map(int,input().split()) D = list(map(str,input().split())) num = N ans = False while True: numstr = list(str(num)) for i in range(len(numstr)): if numstr[i] in D: num += 10**(len(numstr)-1-i) break if i == len(numstr) - 1: ans = num if ans != False...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s300154967
p04045
Wrong Answer
N, K = map(int,input().split()) D = list(input().split()) num = N ans = False while True: numstr = list(str(num)) for i in range(len(numstr)): if numstr[i] in D: num += 10**(len(numstr)-1-i) break ans = num if ans != False: 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...
s280282713
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) M=str(N) hako=[] for i in range(len(M)): hako.append(int(M[i])) j = 0 while j < len(hako): if hako[j] in D: if j >= 1: if hako[j] == 9: hako[j] -= 9 else: hako[j] += 1 else: j += 1 p...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s945552125
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) M=str(N) hako=[] for i in range(len(M)): hako.append(int(M[i])) j = 0 while j < len(hako): if hako[j] in D: hako[j] += 1 else: j += 1 print(*hako,sep="")
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s059633820
p04045
Wrong Answer
N,K = map(int, input().split()) *D, = map(int, input().split()) l = [0,1,2,3,4,5,6,7,8,9] for i in range(len(D)): l.remove(D[i]) l = set(l) for n in range(N,10000,1): j = set(list(map(int, list(str(n))))) if l>=j: 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...
s598545206
p04045
Wrong Answer
N,K = map(int, input().split()) *D, = map(int, input().split()) l = [0,1,2,3,4,5,6,7,8,9] for i in range(len(D)): l.remove(D[i]) l = set(l) for n in range(N,10000,1): j = set(list(map(int, list(str(n))))) if l==j: 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...
s211218038
p04045
Wrong Answer
from itertools import product n,k = map(int,input().split()) dd = list(map(int,input().split())) for i in range(n,10000): flag=True tmp = i while True: if (tmp % 10) in dd: flag = False tmp = tmp//10 if tmp<=0 : break 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...
s176660175
p04045
Wrong Answer
from itertools import product n,k = map(int,input().split()) dd = list(map(int,input().split())) for i in range(n,10000): flag=True tmp = i while tmp>0: if (tmp % 10) in dd: flag = False tmp = tmp//10 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...
s318917418
p04045
Wrong Answer
from itertools import product n,k = map(int,input().split()) dd = list(map(int,input().split())) figs = list(map(str, list(set(range(10)) - set(dd)))) a = list(product(figs, figs, figs, figs)) a = sorted([int(''.join(v)) for v in a]) ans = 0 for ai in a: if ai >= n: ans = ai 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...
s347116282
p04045
Wrong Answer
from itertools import product n,k = map(int,input().split()) dd = list(map(int,input().split())) figs = list(map(str, list(set(range(10)) - set(dd)))) a = list(product(figs, figs, figs, figs)) a = [int(''.join(v)) for v in a] ans = 0 for ai in a: if ai >= n: ans = ai 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...
s520958680
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) E = [x for x in range(10) if x not in D] # print(N, K, D, E) def is_valid(n, d): q = (n % (10 ** d)) // (10 ** (d - 1)) # print(n, d, q) return q in E ans = N d = 1 while d <= len(str(N)): if is_valid(ans, d): d += 1 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...
s828596509
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) E = [x for x in range(10) if x not in D] # print(N, K, D, E) def is_valid(n, d): q = (n // (10 ** d)) % 10 # print(q) return q in E ans = N d = 1 while d < len(str(N)): if is_valid(ans, d): d += 1 else: ans += 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...
s303590348
p04045
Wrong Answer
n,k=list(map(int,input().split())) d = list(map(int,input().split())) i =1 while True: if 10**(i-1)>n: break #i桁目の数字を取得 tmp = (n%(10**i))//(10**(i-1)) if tmp not in d: i+= 1 continue else: n+=10**(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...
s433052914
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) use = [str(i) for i in range(10) if i not in d] mon = [int(i+j+k+l+m) for i in use for j in use for k in use for l in use for m in use if int(i+j+k+l+m)>=n] print(min(mon))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s791231220
p04045
Wrong Answer
n, k = map(int, input().split()) set_D = set(map(int, input().split())) set_num = set() for i in range(10): set_num.add(i) set_use_num = set_num - set_D set_use_num = sorted(set_use_num) str_n = str(n) len_n = len(str_n) for j in range(5-len_n): str_n = '0' + str_n # 10000の位からcheck digit_count = 0 Ans_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...
s203435376
p04045
Wrong Answer
import itertools N, K = list(map(int, input().split())) D = set(input().split()) diff = set([str(n) for n in range(10)]) - D lenN = len(str(N)) + 1 lists = list(itertools.product(list(diff), repeat=lenN)) lists = sorted([int("".join(l)) for l in lists]) for l in lists: if l >= N: print(l) 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...
s697237046
p04045
Wrong Answer
import itertools N, _ = list(map(int, input().split())) D = set(input().split()) diff = set([str(n) for n in range(10)]) - D lenN = len(str(N)) lists = list(itertools.product(list(diff), repeat=lenN)) lists = sorted([int("".join(l)) for l in lists]) for l in lists: if l >= N: print(l) 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...
s990135665
p04045
Wrong Answer
N,K=(int(x) for x in input().split()) dis_list=(input().split()) price_list=range(N,10000) dis_count=0 for price in price_list: dis_count=0 for i in dis_list: if i in str(price): dis_count+=1 if dis_count==0: print(price) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...