submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s537535533
p04045
Wrong Answer
import sys N, K = map(int, input().split()) Ds = list(input()) for i in range(N, 1000000): for j in range(K): if Ds[j] in str(i): break if j == K-1: print(i) sys.exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s628734605
p04045
Wrong Answer
import sys N, K = map(int, input().split()) Ds = list(input()) for i in range(N,100001): for j in range(K): if Ds[j] in str(i): break if j == K-1: print(i) sys.exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s079637420
p04045
Wrong Answer
n,k = map(int, input().split()) d_set = {x for x in input().split()} for i in range(n,10001): i_set = set(list(str(i))) if(len(d_set & i_set) == 0): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s034106370
p04045
Wrong Answer
#!/usr/bin/env python3 import sys def solve(N: int, K: int, D: "List[int]"): new = "" ok = False for s in str(N): if ok: s = "0" while int(s) in D: s = str(int(s) + 1) ok = True new += s print(new) return # Generated by 1.1.6 https://gi...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s684436287
p04045
Wrong Answer
n,k = map(int, input().split()) d = list(input().split()) flag = True while flag: n_str = str(n) for i in d: if i in n_str: break else: flag = False break n += 1 print(n-1)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s521078950
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) out = sorted(list(out)) res_list = [] flag = 0 for i in range(len(N)-1, -1, -1): if flag == 0: if len(set(N[i])&set(out)) == 1: res_list.appe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s835769536
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) out = sorted(list(out)) res_list = [] flag = 0 for i in range(len(N)-1, -1, -1): if flag == 0: if len(set(N[i])&set(out)) == 1: res_list.appe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s758636715
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) out = sorted(list(out)) res_list = [] flag = 0 for i in range(len(N)-1, -1, -1): if flag == 0: if len(set(N[i])&set(out)) == 1: res_list.appe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s993109073
p04045
Wrong Answer
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): N, K = read_ints() digits = list(range(10)) ds = read_ints() for d in ds: digits.remove(d) prefixes = [] already = False for i, c in enumerate(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...
s300882914
p04045
Wrong Answer
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): N, K = read_ints() digits = list(range(10)) ds = read_ints() for d in ds: digits.remove(d) prefixes = [] for i, c in enumerate(str(N)): chosen =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s871033559
p04045
Wrong Answer
def check(x,d): s=str(x) flag=True for i in range(len(s)): if int(s[i]) not in d: flag=False return flag n,k=map(int,input().split()) a=[int(x) for x in input().split()] d=[] for i in range(10): if i not in a: d.append(i) l=len(str(n)) final=10**l flag=False #print(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...
s809001160
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) len_N = len(N) res = '' flag = 0 tmp = sorted(list(out)) #print(tmp) for i in range(len_N): if len(set(N[i])&out) != 0 and flag == 0: res+=N[i] e...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s674836129
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) len_N = len(N) res = '' flag = 0 tmp = sorted(list(out)) #print(tmp) for i in range(len_N): if len(set(N[i])&out) != 0 and flag == 0: res+=N[i] e...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s456661613
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) len_N = len(N) res = '' flag = 0 tmp = list(out) print(tmp) for i in range(len_N): if len(set(N[i])&out) != 0 and flag == 0: res+=N[i] elif len(s...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s026153061
p04045
Wrong Answer
N, K = map(str, input().split()) D = map(str, input().split()) D = set(D) # 集合に変換 number = {'0','1','2','3','4','5','6','7','8','9'} # 集合 out = D^number #print(out) len_N = len(N) res = '' flag = 0 tmp = list(out) for i in range(len_N): if len(set(N[i])&out) != 0 and flag == 0: res+=N[i] elif len(set(N[i])&ou...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s154205160
p04045
Wrong Answer
N, K = tuple(map(int, input().split())) D = tuple(map(int, input().split())) Da = set(range(10)) - set(D) ans = [9, 9, 9, 9] div = 1000 for d in range(4): b = int(N/div) ans[d] = b while ans[d] in D and not (d == 0 and ans[d] == 0): ans[d] += 1 if not b == ans[d]: ans[d+1:] = [min(Da)]*(3-d) 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...
s460750320
p04045
Wrong Answer
N, K = tuple(map(int, input().split())) D = tuple(map(int, input().split())) Da = set(range(10)) - set(D) ans = [9, 9, 9, 9] div = 1000 for d in range(4): if not ans[d] == 9: break b = int(N/div) ans[d] = b while ans[d] in D and not (d == 0 and ans[d] == 0): ans[d] += 1 if not b == ans[d]: ans[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...
s353868674
p04045
Wrong Answer
N, K = tuple(map(int, input().split())) D = tuple(map(int, input().split())) Da = set(range(10)) - set(D) ans = [9, 9, 9, 9] div = 1000 for d in range(4): if not ans[d] == 9: break b = int(N/div) ans[d] = b while ans[d] in D and not (d == 0 and ans[d] == 0): ans[d] += 1 if not b == ans[d]: ans[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...
s867280854
p04045
Wrong Answer
def abc042_c(): n, _ = map(int, input().split()) D = list(map(int, input().split())) for i in range(n, 10000): like = True for s in str(i): if int(s) in D: like = False break if like: print(i) return abc042_c()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s793334078
p04045
Wrong Answer
n, k = map( int, input().split()) hate = set( input().split()) usable = sorted( list( {str(i) for i in range(10)} - hate)) l = len(str(n)) def check(l): num = [] if l == 1: for i in usable: num.append(int(i)) if l == 2: for ii in usable: for i in usable: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s688063862
p04045
Wrong Answer
import sys stdin = sys.stdin inf = 1 << 60 mod = 1000000007 ni = lambda: int(ns()) nin = lambda y: [ni() for _ in range(y)] na = lambda: list(map(int, stdin.readline().split())) nan = lambda y: [na() for _ in range(y)] nf = lambda: float(ns()) nfn = lambda y: [nf() for _ in range(y)] nfa ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s184652173
p04045
Wrong Answer
import sys stdin = sys.stdin inf = 1 << 60 mod = 1000000007 ni = lambda: int(ns()) nin = lambda y: [ni() for _ in range(y)] na = lambda: list(map(int, stdin.readline().split())) nan = lambda y: [na() for _ in range(y)] nf = lambda: float(ns()) nfn = lambda y: [nf() for _ in range(y)] nfa ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s205911330
p04045
Wrong Answer
import sys stdin = sys.stdin inf = 1 << 60 mod = 1000000007 ni = lambda: int(ns()) nin = lambda y: [ni() for _ in range(y)] na = lambda: list(map(int, stdin.readline().split())) nan = lambda y: [na() for _ in range(y)] nf = lambda: float(ns()) nfn = lambda y: [nf() for _ in range(y)] nfa ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s703276508
p04045
Wrong Answer
import sys stdin = sys.stdin inf = 1 << 60 mod = 1000000007 ni = lambda: int(ns()) nin = lambda y: [ni() for _ in range(y)] na = lambda: list(map(int, stdin.readline().split())) nan = lambda y: [na() for _ in range(y)] nf = lambda: float(ns()) nfn = lambda y: [nf() for _ in range(y)] nfa ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s233716712
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10001): for x in d: if str(x) in str(i): break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s728873555
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) print(d) for i in range(n,10001): for x in d: if str(x) in str(i): break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s733683112
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(input().split()) ans, i, OK = str(N), 0, False while not OK: OK = True digit = len(ans) for i in range(digit): if ans[i] in D: ans = str(int(ans) + 10 ** (digit - i - 1)) OK = 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...
s008809184
p04045
Wrong Answer
import sys n,k = map(int,input().split()) dn = list(map(int,input().split())) d = set([0,1,2,3,4,5,6,7,8,9]) for i in dn: d.remove(i) d = list(d) def dfs( s , n ): i = 0 if len(s) == n: ans.append(s) return else: a = int(s[len(s)-1]) for j in d: dfs( s + 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...
s201953489
p04045
Wrong Answer
import sys n,k = map(int,input().split()) dn = list(map(int,input().split())) d = set([0,1,2,3,4,5,6,7,8,9]) for i in dn: d.remove(i) d = list(d) def dfs( s , n ): i = 0 if len(s) == n: ans.append(s) return else: a = int(s[len(s)-1]) for j in d: dfs( s + 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...
s614402845
p04045
Wrong Answer
N, L = map(int, input().split()) hates = list(map(str, input().split())) for i in range(N, 10000): nums = list(str(i)) com = set(nums) & set(hates) if len(com) == 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...
s687093008
p04045
Wrong Answer
N, L = map(int, input().split()) hates = list(map(str, input().split())) for i in range(N, 9999): nums = list(str(i)) com = set(nums) & set(hates) if len(com) == 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...
s333927286
p04045
Wrong Answer
N, L = map(int, input().split()) hates = list(map(str, input().split())) for i in range(N, 9999): nums = list(str(i)) com = set(nums) & set(hates) if len(com) == 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...
s895525071
p04045
Wrong Answer
N, L = map(int, input().split()) hates = list(map(str, input().split())) for i in range(N, 9999): nums = list(str(i)) com = set(nums) & set(hates) print(com) if len(com) == 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...
s470103063
p04045
Wrong Answer
# ABC042C n, k = map(int, input().split()) d = list(map(int, input().split())) digits = set(range(10)) - set(d) ans = [] for s in reversed(str(n)): for d in digits: if int(s) <= d: ans.insert(0, str(d)) 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...
s174980849
p04045
Wrong Answer
lis=list(map(int,input().split())) hate=list(map(int,input().split())) a=str(lis[0]) love=[] ans=0 sw=0 swn=0 for i in range(10): if i not in hate: love+=[i] for i in a: if sw!=1: n=int(i) for j in love: if j==n: ans=ans*10+j elif j>n: ans=ans*10+j sw=1 else: 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...
s114663434
p04045
Wrong Answer
def main(): N, K = (int(_) for _ in input().split()) D = [int(_) for _ in input().split()] n = set(range(0, 10)) n = list(n - set(D)) m = list(set(n + [0])) ret = 10 ** 10 for a in m: for b in n: for c in n: for d in n: for e in n: cc = int(str(a) + str(b) + str(c) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s691138540
p04045
Wrong Answer
n,k=map(int,input().split()) d=set(list(map(str,input().split()))) print(d) for i in range(n,10*n): flag=0 sn=str(i) for j in sn: if j in d: flag=1 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...
s230535816
p04045
Wrong Answer
n,k=map(int,input().split()) d=set(list(map(int,input().split()))) for i in range(n,100*n): flag=0 sn=str(i) for j in sn: if j in d: flag=1 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...
s010397865
p04045
Wrong Answer
n,k=map(int,input().split()) d=set(list(map(int,input().split()))) for i in range(n,100*n): flag=0 sn=str(n) for j in sn: if j in d: flag=1 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...
s464924604
p04045
Wrong Answer
n,k=map(int,input().split()) d=set(list(map(int,input().split()))) dd=set([0,1,2,3,4,5,6,7,8,9]) ddd=dd-d keta=len(str(n)) kuriage=0 result="" for i in range(1,keta+1): x=int(str(n)[keta-i]) if kuriage==1: x+=1 kuriage=0 if x==10: kuriage=1 temp=10 for j in ddd: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s745755141
p04045
Wrong Answer
n,k = map(int,input().split()) d = list(map(int,input().split())) for i in range(10001): nn = n+i cnt = 0 for j in d: if str(j) in str(nn): break else: cnt += 1 if cnt == len(d): print(nn) 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...
s758955267
p04045
Wrong Answer
INT_MAX=10**18+7 MOD=10**9+7 def INPUT():return list(int(i) for i in input().split()) def LIST_1D_ARRAY(n):return [0 for _ in range(n)] def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)] ################################################################################# n,k=INPUT() A=INPUT() accepted=...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s937614957
p04045
Wrong Answer
N,K =input().split() listA=list(map(int,input().split())) for i in range(10001): if i >= int(N): ans=str(i) num=0 for j in range(len(ans)): if int(ans[j]) not in listA: num += 1 if num == len(ans): 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...
s145238161
p04045
Wrong Answer
import sys N,K = map(int, input().split()) *D, = input().split() for n in range(N, 10000, 1): L = list(str(n)) flg = 0 for l in L: if (l in D) or n<N: flg = 1 break if flg==0: 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...
s436762346
p04045
Wrong Answer
n,k,*d=map(int,open(0).read().split()) c=0 for i in range(10000): if n<=i: for j in str(i): if not int(j) in d: c+=1 if c==len(str(i)): print(i) exit() c=0
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s798210958
p04045
Wrong Answer
n,k,*d=map(int,open(0).read().split()) c=0 for i in range(10000): if n<=i: for j in str(i): if not int(j) in d: c+=1 if c==len(str(i)): print(i) break else: c=0 continue 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...
s525846929
p04045
Wrong Answer
from collections import deque n, k = map(int, input().split()) org = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} kod = set(map(int, input().split())) ele = list(org ^ kod) que = deque(ele) if n < 10: for i in ele: if i >= n: print(i) exit() while que: x = que.popleft() for i in 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...
s758915235
p04045
Wrong Answer
from collections import deque n, k = map(int, input().split()) org = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} kod = set(map(int, input().split())) ele = list(org ^ kod) que = deque(ele) while que: x = que.popleft() for i in ele: y = 10 * x + i if y >= n: print(y) exit() e...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s437351147
p04045
Wrong Answer
from collections import deque n, k = map(int, input().split()) org = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} kod = set(map(int, input().split())) ele = list(org ^ kod) que = deque(ele) while que: x = que.popleft() for i in ele: y = 10 * x + i if y > n: print(y) exit() el...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s567908565
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) def calc(): global N, D while(True): for i in D: if str(i) in str(N): N += 1 break return calc() 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...
s266469084
p04045
Wrong Answer
n, k = [int(x) for x in input().split()] kl = [int(x) for x in input().split()] ans = [] for i in range(10): if i not in kl: a = n*i b = [str(x) for x in str(a)] count = 0 for j in range(len(b)): if b[j] not in kl: count += 1 if count == len(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...
s794262319
p04045
Wrong Answer
n, k = [int(x) for x in input().split()] kl = [int(x) for x in input().split()] ans = [] for i in range(10): if i not in kl: a = n*i b = [str(x) for x in str(a)] for j in range(len(b)): if b[j] not in kl: ans.append(a) ans.sort() if min(ans) != 0: print(min...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s672832425
p04045
Wrong Answer
N ,K = map(int,input().split()) D = [int(n) for n in input().split()] flag = False for i in range(N,10000): N = i while i > 0: flag = True if i%10 in D: flag = False break else: i //=10 if flag == True: 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...
s878472965
p04045
Wrong Answer
N, K = [int(i) for i in input().split(" ")] D = input().split(" ") for i in range(N, 10000): if len(list(set(D) & set(str(i)))) == 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...
s534893511
p04045
Wrong Answer
a, b = map(int, input('').split(' ')) c = input('').split(' ') for i in range(a, 10000): for j in range(len(str(i))): if str(i)[j] in c: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s888288681
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) strN = str(N) setN = set(list(map(int, strN))) setD = set(D) if len(setN.intersection(setD)) == 0: print(N) exit() usable = [v for v in range(0, 10) if v not in D] # print(N) # print(usable) # print(D) # 末尾から順番に決める ans = "" for id, j in e...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s774850294
p04045
Wrong Answer
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...
s131823003
p04045
Wrong Answer
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...
s638264738
p04045
Wrong Answer
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...
s959252319
p04045
Wrong Answer
a = input('') b = input('') num = b.split(' ') price = int(a.split(' ')[0]) f = False for i in range(price, 10000): for j in range(len(str(i))): if str(i)[j] in num: break else: 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...
s323217954
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) n = N while True: tmp = n ng = False while tmp > 0: ng = ng or tmp%10 in D tmp //= 10 if ng: 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...
s560043717
p04045
Wrong Answer
import sys input_methods=['clipboard','file','key'] using_method=1 input_method=input_methods[using_method] IN=lambda : map(int, input().split()) mod=1000000007 #+++++ def next(v, cu): for i in cu: if i >= v: return i else: return -1 def main(): n, k = IN() al = list(IN()) cu=[] for i in range(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...
s159320028
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...
s601653402
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...
s781984901
p04045
Wrong Answer
n,k = map(int,input().split()) d = list(input().split()) ans = n while True: flag = False 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 = True if flag:continue print(ans) 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...
s974401356
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) A=[0,1,2,3,4,5,6,7,8,9] for i in range(0,K): A.remove(D[i]) A=sorted(A) B=A B.append(0) ans=0 M=str(N) L=len(M) if A[0]==0: ans+=111111*A[1] else: ans+=111111*A[0] if L==5: for q in range(0,11-K): for w in range(0,10-K): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s452741658
p04045
Wrong Answer
N, K = map(int, input().split()) D = set(input().split()) i = N while True: flg = True for j in str(i): if int(j) in D: flg = False break if flg == True: print(i) exit() i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s182857575
p04045
Wrong Answer
# C - こだわり者いろはちゃん # https://atcoder.jp/contests/abc042/tasks/arc058_a # 入力 1 # 1000 8 # 1 3 4 5 6 7 8 9 N,K = input().split() D = input().split() # Nの各桁をみて、嫌いな数字が入っていないかチェック # 嫌いな数字が入っていたら、その桁をインクリメントして、整数(N)を再生性する。 # これを嫌いな数字がなくなるまで繰り返す。 nums = [n for n in N] # 各桁 i = 1 # 嫌いな数字が入っていたら、その桁をインクリメントして、整数(N)を再生性する。 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s826380287
p04045
Wrong Answer
# C - こだわり者いろはちゃん # https://atcoder.jp/contests/abc042/tasks/arc058_a # 入力 1 # 1000 8 # 1 3 4 5 6 7 8 9 print("test") N,K = input().split() D = input().split() # Nの各桁をみて、嫌いな数字が入っていないかチェック # 嫌いな数字が入っていたら、その桁をインクリメントして、整数(N)を再生性する。 # これを嫌いな数字がなくなるまで繰り返す。 nums = [n for n in N] # 各桁 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...
s398472706
p04045
Wrong Answer
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n, k = map(int, readline().split()) d = list(input().split()) for check in range(n, 10 ** 4 + 1): flag = True for i in str(check): if i in d: fl...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s194052996
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) A=[0,1,2,3,4,5,6,7,8,9] for i in range(0,K): A.remove(D[i]) A=sorted(A) ans=999999 #小さい順に数字を作る for q in range(0,10-K):#100000担当 for w in range(0,10-K):#10000担当 for e in range(0,10-K):#1000担当 for r in range(0,10-K):#100担当 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s866407300
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) A=[0,1,2,3,4,5,6,7,8,9] for i in range(0,K): A.remove(D[i]) A=sorted(A) ans=99999 #小さい順に数字を作る for q in range(0,10-K):#100000担当 for w in range(0,10-K):#10000担当 for e in range(0,10-K):#1000担当 for r in range(0,10-K):#100担当 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s330658261
p04045
Wrong Answer
# C - こだわり者いろはちゃん # https://atcoder.jp/contests/abc042/tasks/arc058_a # 入力 1 # 1000 8 # 1 3 4 5 6 7 8 9 N,K = input().split() D = input().split() one_to_ten = ["0","1","2","3","4","5","6","7","8","9","10"] can_use = list(set(one_to_ten) - set(D)) can_use = sorted([int(c) for c in can_use]) print(can_use) tmp = [] ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s636027914
p04045
Wrong Answer
# C - こだわり者いろはちゃん # https://atcoder.jp/contests/abc042/tasks/arc058_a # 入力 1 # 1000 8 # 1 3 4 5 6 7 8 9 N,K = input().split() D = input().split() one_to_ten = ["0","1","2","3","4","5","6","7","8","9","10"] can_use = list(set(one_to_ten) - set(D)) print(can_use) tmp = [] for n in N: i = 0 if n in can_use: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s218193377
p04045
Wrong Answer
N, K = [int(i) for i in input().split(' ')] dislikes = [int(i) for i in input().split(' ')] final_res = [] num = 0 for ch in str(N): num = int(ch) while True: if num in dislikes: num += 1 else: final_res.append(num) break for i in final_res: 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...
s417924141
p04045
Wrong Answer
#!/usr/bin/env python3 # 全探索だが、Nを超える場合があるので注意 n,k = map(int,input().split()) s = str(n) d = list(map(int,input().split())) #すでにsortされている convert = [0]*10 # convert[i] はi 以上で使える数字ないなら10 for j in range(10): i = j while True: if i not in d: break elif i == 10: break else: 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...
s733425775
p04045
Wrong Answer
#!/usr/bin/env python3 # 全探索だが、Nを超える場合があるので注意 n,k = map(int,input().split()) s = str(n) d = list(map(int,input().split())) #すでにsortされている convert = [0]*10 # convert[i] はi 以上で使える数字ないなら10 for j in range(10): i = j while True: if i not in d: break elif i == 10: break else: 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...
s064910064
p04045
Wrong Answer
#!/usr/bin/env python3 # 全探索だが、Nを超える場合があるので注意 n,k = map(int,input().split()) s = str(n) d = list(map(int,input().split())) #すでにsortされている convert = [0]*10 # convert[i] はi 以上で使える数字ないなら10 for j in range(10): i = j while True: if i not in d: break elif i == 10: break else: 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...
s205566385
p04045
Wrong Answer
#!/usr/bin/env python3 n,k = map(int,input().split()) s = str(n) d = list(map(int,input().split())) for i in range(n,10000): # i の中にd に含めれるものがないか1つづつ見ていく str_i = str(i) ok = 1 for j in str_i: if int(j) in d: ok = 0 break if ok: 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...
s832344200
p04045
Wrong Answer
# coding: utf-8 # Your code here! def keta(n): cnt = 0 while(n > 0): cnt += 1 n = n//10 return cnt n, k = list(map(str, input().split())) flag = 0 d = [i for i in input().split()] for i in n: if i in d: flag += 1 if flag: n = int(n) tmp = [] for i in range(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...
s290356266
p04045
Wrong Answer
import sys n,k=map(int,input().split()) d=list(map(int,input().split())) count=0 for i in range(n,10001): for j in range(len(str(i))): if str(i)[j] in str(d): break else: count+=1 if count==len(str(i)): print(i) sys.exit() count=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...
s661976151
p04045
Wrong Answer
import sys n,k=map(int,input().split()) d=list(map(int,input().split())) count=0 for i in range(n,10001): for j in range(len(str(i))): if str(i)[j] in str(d): break else: count+=1 if count==len(str(i)): 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...
s837785552
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) while True: for s in str(N): if s in D: N+=1 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...
s456698172
p04045
Wrong Answer
from collections import deque N,K=map(int,input().split()) D=list(map(int,input().split())) like=list(range(1,10)) dislike0=False for s in D: if s==0: dislike=True else: like.remove(s) like.sort() q=deque(like) if not dislike0: like.insert(0,0) while q: num=q.popleft() if 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...
s809772695
p04045
Wrong Answer
# -*- coding: utf-8-*- strs = [] n,k = map(int,input().split()) hates = list(input().split()) give = n while(True): stri = str(give) for hate in hates: if hate in stri: give = give + 1 break else: print(give) 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...
s885012848
p04045
Wrong Answer
import itertools n,k = map(int,input().split()) unlike = list(map(int,input().split())) like = [] for i in range(0,10): if not(i in unlike): like.append(i) if unlike == [0]: print(n) exit() i = 1 ans = 0 while(i < 99): current = list(itertools.product(like,repeat=i)) for j in range(len(curre...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s199160422
p04045
Wrong Answer
n, k = map(int, input().split()) D = set([i for i in range(10)]) - set(map(int, input().split())) D = sorted(list(D)) def dfs(i): i = str(i) if int(i)>=n: return int(i) for d in D: return dfs(i+str(d)) def dfs_(i): i = str(i) if int(i)>=n: return int(i) for d in D[::-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...
s531851730
p04045
Wrong Answer
n, k = map(int, input().split()) D = set([i for i in range(10)]) - set(map(int, input().split())) D = sorted(list(D)) def dfs(i): i = str(i) if int(i)>=n: return int(i) for d in D: return dfs(i+str(d)) def dfs_(i): i = str(i) if int(i)>=n: return int(i) for d in D[::-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...
s275560476
p04045
Wrong Answer
n, k = map(int, input().split()) D = set([i for i in range(10)]) - set(map(int, input().split())) D = sorted(list(D)) def dfs(i): if int(i)>=n: return print(i) for d in D: return dfs(i+str(d)) if D[0] == 0: dfs(str(D[1])) else: dfs(str(D[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...
s576910761
p04045
Wrong Answer
N, K = map(int, input().split()) num = ["0","1","2","3","4","5","6","7","8","9"] dis = input().split() can_use = sorted(list(set(num)-set(dis)), reverse=True) sN = str(N) L = len(sN) ans = "" if sN[0] in can_use: ans += sN[0] else: if can_use[0] == "0": ans += can_use[1] else: ans += can_u...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s653057830
p04045
Wrong Answer
line1 = input().split(' ') N = line1[0] D = input().split(' ') i = -1 while i > -len(N)-1: while (N[i] in D[:int(line1[1])]): j = abs(i) k = (10**(j-1)) N = str(int(N)+k) 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...
s467232135
p04045
Wrong Answer
line1 = input().split(' ') N = line1[0] D = input().split(' ') i = -1 while i > -len(N)-1: while (N[i] in D): j = abs(i) k = (10**(j-1)) N = str(int(N)+k) 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...
s151122028
p04045
Wrong Answer
line1 = input().split(' ') N = line1[0] D = input().split(' ') # print(D) i = -1 while i > -len(N)-1: # print("here") while (N[i] in D): j = abs(i) k = 1 while j > 1: k *= 10 j -= 1 N = str(int(N)+k) 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...
s411154961
p04045
Wrong Answer
N,K = map(int,input().split()) List = list(input().split()) Digit = ['0','1','2','3','4','5','6','7','8','9'] for item in List: Digit.remove(item) for i in range(N,10001): fig = list(str(i)) figs = set(fig) if figs <= set(Digit): 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...
s894596427
p04045
Wrong Answer
def main(): t = input().split() dis = list(map(int, input().split())) like = [] for i in range(0,10): if i not in dis: like.append(i) ans = [] digit = False for i in range(len(t[0])): if digit: break ans.append(-1) for j, v in enumerat...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s040360150
p04045
Wrong Answer
def main(): t = input().split() dis = list(map(int, input().split())) like = [] for i in range(0,10): if i not in dis: like.append(i) ans = [] digit = False for i in range(len(t[0])): if digit: break ans.append(-1) for j, v in enumerat...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s332667975
p04045
Wrong Answer
def main(): t = input().split() dis = list(map(int, input().split())) like = [] for i in range(0,10): if i not in dis: like.append(i) ans = [] digit = False for i in range(len(t[0])): if digit: break ans.append(-1) for j, v in enumerat...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s331633633
p04045
Wrong Answer
def main(): t = input().split() dis = list(map(int, input().split())) like = [] for i in range(0,10): if i not in dis: like.append(i) ans = [] for i in range(len(t[0])): ans.append(-1) for j, v in enumerate(like): if int(t[0][i]) <= v: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s425489678
p04045
Wrong Answer
def main(): t = input().split() dis = list(map(int, input().split())) like = [] for i in range(0,10): if i not in dis: like.append(i) ans = [] for i in range(len(t[0])): for v in like: if int(t[0][i]) <= v: ans.append(str(v)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s003394563
p04045
Wrong Answer
def check(array, string): for i in array: if i in string: return False return True N, K = map(int, input().split()) D = input().split() for i in range(1, 10001): if check(D, str(i)) and i >= N: print(i) exit(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...