submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s637791360
p04045
Wrong Answer
n,k=map(int,input().split()) hate_list=list(map(int,input().split())) p_list=[] ok_list=[] hate_list.append(10) s=0 for x in hate_list: while x>s: ok_list.append(s) s+=1 s+=1 ok_list.append(10) print(ok_list) # nの桁をリスト化 ndgts=[] while n>0: ndgts.append(n%10) n//=10 flag=0 #necessal...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s871479946
p04045
Wrong Answer
n,k=map(int,input().split()) hate_list=map(int,input().split()) p_list=[] ok_list=[] s=0 for x in hate_list: while x>s: ok_list.append(s) s+=1 s+=1 ok_list.append(10) # nの桁をリスト化 ndgts=[] while n>0: ndgts.append(n%10) n//=10 flag=0 #necessality of a comparison for y in reversed(ndgts...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s461342443
p04045
Wrong Answer
n,k=map(int,input().split()) hate_list=map(int,input().split()) p_list=[] ok_list=[] s=0 for x in hate_list: while x>s: ok_list.append(s) s+=1 s+=1 ok_list.append(10) # nの桁をリスト化 ndgts=[] while n>0: ndgts.append(n%10) n//=10 flag=0 #necessality of a comparison for y in reversed(ndgts...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s065767565
p04045
Wrong Answer
n,k=map(int,input().split()) hate_list=map(int,input().split()) payment_list=[] ok_list=[] s=0 for x in hate_list: while x>s: ok_list.append(s) s+=1 s+=1 ok_list.append(10) ndgts=[] while n>0: ndgts.append(n%10) n//=10 # print(ndgts) flag=True for y in reversed(ndgts): if flag == ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s757489083
p04045
Wrong Answer
def main(): n,k = map(int,input().split()) D = list(map(int,input().split())) num = [x for x in range(10) if x not in D] ans = [] while n > 0: x = n%10 n //= 10 flag = True for i in range(len(num)): if x <= num[i]: flag = False ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s904978020
p04045
Wrong Answer
def main(): n,k = map(int,input().split()) D = list(map(int,input().split())) num = [x for x in range(10) if x not in D] ans = [] while n > 0: x = n%10 n //= 10 flag = True for i in range(len(num)): if x <= num[i]: flag = False ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s937583151
p04045
Wrong Answer
# -*- coding: utf-8 -*- import sys,math,itertools input = sys.stdin.readline n, k = map(int, input().split()) d = [int(_) for _ in input().split()] d_set = set(d) d_all = set(range(10)) d_use = [str(a) for a in list(d_all - d_set)] keta = int(math.log10(n))+1 l1 = [int(''.join(list(a))) if int(''.join(list(a)))>=n 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...
s773516287
p04045
Wrong Answer
n, k = map(int, input().split()) D = set(list(input().split())) for price in range(n, 10001): if len(set(list(str(price))) - D) == len(set(list(str(price)))): 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...
s096258984
p04045
Wrong Answer
n,k = map(int,input().split()) l = [int(i) for i in input().split()] nl = list(str(n)) N = map(int,nl) r = [] for i in N: for j in l: if i == j: i = i+1 else: r.append(i) break r1 = map(str,r) print("".join(r1))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s452823549
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) dp=[0]*10 for i in range(K): dp[D[i]]=1 for i in range(N,10**6+1): a=str(i) flag=True for j in range(len(a)): if dp[int(a[j])]==1: flag=False break if flag: 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...
s488233649
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) dp=[0]*10 for i in range(K): dp[D[i]]=1 for i in range(N,10**5+1): a=str(i) flag=True for j in range(len(a)): if dp[int(a[j])]==1: flag=False break if flag: 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...
s777146979
p04045
Wrong Answer
import math N, K = map(int, input().split()) l = list(map(int, input().split())) num = [i for i in range(10)] for i in l: num.remove(i) # print(num) keta = int(math.log10(N)) digit = int(10**keta) ans = 0 if num[0] == 0: ans += digit * num[1] digit /= 10 for i in range(keta): ans += digit * 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...
s480001739
p04045
Wrong Answer
n,k,*a=map(int,open(0).read().split()) for i in range(n,10**6): if not set(str(i))&set(a): 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...
s608527471
p04045
Wrong Answer
N, K = map(int, input().split()) D = [int(i) for i in input().split()] l = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] for i in range(K): l.remove(D[i]) n = [int(x) for x in str(N)] c = len(n) l_max = l[0] l_min = l[-1] p = 0 q = 0 r = 1 for _ in range(c): p += r * l_max q += r * l_min r *= 10 if N > p: b = r*m...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s471509885
p04045
Wrong Answer
N, K = map(int, input().split()) D = [int(i) for i in input().split()] l = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] for i in range(K): l.remove(D[i]) n = [int(x) for x in str(N)] c = len(n) l_max = l[0] l_min = l[-1] if N > 1111 * l_max: b = 10000*min([i for i in l if i>0]) + 1111*l_min else: a = [l_max] * c 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...
s769426898
p04045
Wrong Answer
from bisect import * n, k = map(int,input().split()) d = list(map(int,input().split())) use_num = [] for i in range(10): if i in d:continue use_num.append(i) str_n = str(n) res = 0 for i in str_n: temp = bisect_left(use_num, int(i)) if temp == len(use_num): add = use_num[0] * 10 else:...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s265306388
p04045
Wrong Answer
n, k = map(int, input().split()) d = set(map(int, input().split())) s = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} a = s - d l = list(map(int, list(str(n)))) for i, ni in enumerate(l): for j, nj in enumerate(a): if ni <= nj: l[i] = nj break print(''.join(map(str, l)))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s717786699
p04045
Wrong Answer
N,K = map(int,input().split()) D = list(map(int,input().split())) allowed = list(range(10)) for d in D: allowed.remove(d) # L = list(map(int,list(str(N))[::-1])) b = 0 # for n in L: lenN = len(str(N)) while b < lenN: base = 10**b target = N//base%10 if target not in allowed: next = target + 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...
s088386316
p04045
Wrong Answer
n, k = (input().split()) n = list(map(int, n)); dSet = set(map(int, input().split())) okList = [i for i in range(10) if i not in dSet] i = len(n) while i >= 0: i -= 1 if n[i] in okList: continue for y in okList: if n[i] < y: n[i] = y j = i+1 while j < len(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s736636640
p04045
Wrong Answer
n, k = (input().split()) n = list(map(int, n)); dSet = set(map(int, input().split())) okList = [i for i in range(10) if i not in dSet] i = len(n) while i >= 0: i -= 1 if n[i] in okList: continue for y in okList: if n[i] < y: n[i] = y break else: if 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...
s323780850
p04045
Wrong Answer
n, k = (input().split()) n = list(map(int, n)); dSet = set(map(int, input().split())) okList = [i for i in range(10) if i not in dSet] i = len(n) while i >= 0: i -= 1 if n[i] in okList: continue for y in okList[::-1]: if n[i] > y: if i - 1 < 0: n = [0] + n ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s511003199
p04045
Wrong Answer
n, k = (input().split()) n = list(map(int, n)); dSet = set(map(int, input().split())) okList = [i for i in range(10) if i not in dSet] i = len(n) while i >= 0: i -= 1 if n[i] in okList: continue for y in okList[::-1]: if n[i] > y: if i - 1 < 0: n = [0] + n ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s341739880
p04045
Wrong Answer
def main(): n, k = input().split() ds = list(map(int, input().split())) p_num = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(ds)) p_num.sort() ans = [] if max(p_num) < int(n[0]): if (min(p_num) != 0): ans.append(str(p_num[0])) else: ans.append(str(p_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...
s527004663
p04045
Wrong Answer
def main(): n, k = input().split() ds = list(map(int, input().split())) p_num = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(ds)) p_num.sort() ans = [] if max(p_num) < int(n[0]): if (min(p_num) != 0): ans.append(str(p_num[0])) else: ans.append(str(p_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...
s142801173
p04045
Wrong Answer
def main(): n, k = input().split() ds = list(map(int, input().split())) p_num = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(ds)) p_num.sort() ans = [] if max(p_num) < int(n[0]): if (min(p_num) != 0): ans.append(str(p_num[0])) else: ans.append(str(p_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...
s455290192
p04045
Wrong Answer
N, K = input().split() dislike = set(list(map(int, input().split()))) next_map = {} min_digit = 0 for i in range(10): for j in range(i,10): if j not in dislike: if i == 0: min_digit = j next_map.update({ i : j }) break next_map.update({ i : min_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...
s494157540
p04045
Wrong Answer
N, K = input().split() dislike = set(list(map(int, input().split()))) next_map = {} min_digit = 0 for i in range(10): for j in range(i,10): if j not in dislike: if i == 0: min_digit = j next_map.update({ i : j }) break next_map.update({ i : 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...
s205031243
p04045
Wrong Answer
D = [i for i in range(10)] N,K = map(int,input().rstrip().split(" ")) A = list(map(int,input().rstrip().split(" "))) A.reverse() ans = 100000 for i in A: D.pop(i) p = len(D) for i in range(p ** 6): R = 0 for i2 in range(7): if i >= p ** i2: R += D[(i // (p ** i2)) % p] * (10 ** i2) 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...
s306004600
p04045
Wrong Answer
D = [i for i in range(10)] N,K = map(int,input().rstrip().split(" ")) A = list(map(int,input().rstrip().split(" "))) A.reverse() ans = 100000 for i in A: D.pop(i) p = len(D) for i in range(p ** 5 + 1): R = 0 for i2 in range(6): if i >= p ** i2: R += D[(i // (p ** i2)) % p] * (10 ** i2) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s701757873
p04045
Wrong Answer
D = [i for i in range(10)] N,K = map(int,input().rstrip().split(" ")) A = list(map(int,input().rstrip().split(" "))) A.reverse() ans = 100000 for i in A: D.pop(i) p = len(D) for i in range(p ** 5 + 1): R = 0 for i2 in range(6): if i > p ** i2: R += D[(i // (p ** i2)) % p] * 10 ** i2 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s453145632
p04045
Wrong Answer
D = [i for i in range(10)] N,K = map(int,input().rstrip().split(" ")) A = list(map(int,input().rstrip().split(" "))) A.reverse() ans = 100000 for i in A: D.pop(i) print(D) p = len(D) for i in range(p ** 5 + 1): R = 0 for i2 in range(6): if i > p ** i2: R += D[(i // (p ** i2)) % p] * 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...
s589491641
p04045
Wrong Answer
n,k=map(int,input().split()) d=list(input().split()) for num in range(n,20001): num=str(num) ok=True for c in num: if c in d: ok=False if ok: print(num) 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...
s747987503
p04045
Wrong Answer
N,K=map(int,input().split()) D = set(map(int,input().split())) notD = [str(i) for i in list(set([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) ^ D)] strN = list(str(N)) result = list(str(N)) for i in range(len(strN)): if i == 0: if strN[i] not in notD: for j in notD: if j == '0': continue if int(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s492520819
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) d = range(10) n = set(d) - set(D) number = set() for x in str(N): number.add(int(x)) if n >= number: 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...
s676767844
p04045
Wrong Answer
n,k=map(int,input().split()) d=set([int(x) for x in input().split()]) for i in range(n,10001): flag=True for j in str(d): if j in str(i): flag=False break if flag==True: 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...
s506051785
p04045
Wrong Answer
n,k=map(int,input().split()) d=set([int(x) for x in input().split()]) s=set([1,2,3,4,5,6,7,8,9,0]) s=list(s-d) s.sort() #print(s) ans="" x=str(n) i=0 while i<len(x): for j in s: if j>=int(x[i]): ans+=str(j) break 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...
s325518161
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) for i in range(n,10001): #print(i) res = 0 for j in str(d): if j in str(i): res += 1 if res == 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...
s086526963
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n,10001): #print(i) res = 0 for j in d: if j in str(i): res += 1 if res == 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...
s518767250
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n,10001): res = 0 for j in d: if j in str(i): res += 1 if res == 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...
s545556039
p04045
Wrong Answer
import sys N, K = map(int, input().split()) d = list(map(int, input().split())) D = set(d) N = str(N) l = len(N) M = 0 A = False for i in range(l - 1, -1, -1): if A: for m in range(10): if not m in D: M += m * 10 ** i break else: n = int(N[l - 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...
s939591071
p04045
Wrong Answer
import sys N, K = map(int, input().split()) d = list(map(int, input().split())) D = set(d) N = str(N) l = len(N) M = 0 for i in range(l - 1, -1, -1): n = int(N[l - i - 1]) if n in D: a = True for m in (n + 1, 10): if not m in D: M += m * 10 ** i a = Fa...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s753022842
p04045
Wrong Answer
import sys N, K = map(int, input().split()) d = list(map(int, input().split())) D = set(d) N = str(N) l = len(N) M = 0 for i in range(l - 1, -1, -1): n = int(N[l - i - 1]) if n in D: for m in (n + 1, 10): if not m in D: M += m * 10 ** i print(M) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s909959997
p04045
Wrong Answer
import sys N, K = map(int, input().split()) d = list(map(int, input().split())) D = set(d) N = str(N) l = len(N) M = 0 for i in range(l - 1, -1, -1): n = int(N[l - i - 1]) if n == 0: continue if n in D: for m in (n + 1, 10): if not m in D: M += m * 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...
s590023025
p04045
Wrong Answer
import sys input = sys.stdin.readline #n = int(input()) #l = list(map(int, input().split())) ''' a=[] b=[] for i in range(): A, B = map(int, input().split()) a.append(A) b.append(B)''' a=list(map(str, [0,1,2,3,4,5,6,7,8,9])) n,k=map(int, input().split()) d=list(map(str, input().split())) for item in 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...
s525420136
p04045
Wrong Answer
N,K = map(int, input().split()) Dislike = list(map(int,input().split())) Like = [] for i in range(10): if i not in Dislike: Like.append(i) D = [] while(N): D.append(N%10) N //=10 nod = len(D) for i in range(nod//2): temp = D[i] D[i] = D[nod-i-1] D[nod-i-1] = temp ND=[] for i in D: 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...
s282844051
p04045
Wrong Answer
import sys n,k=map(int,input().split()) d=list(map(int,input().split())) allowed=set() for i in range(10): allowed.add(i) for i in d: allowed.remove(i) for i in range(n,10**7): b=str(i) c=set() for j in range(len(b)): c.add(b[j]) if allowed.intersection(c)==set(): 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...
s225446353
p04045
Wrong Answer
N,K = map(int, input().split()) D_list = set(list(map(int, input().split()))) bn = sorted(list((set([0,1,2,3,4,5,6,7,8,9]) - D_list))) res = 0 for i0 in bn: v0 = i0 * 100000 for i1 in bn: v1 = i1 * 1000 for i2 in bn: v2 = i2 * 100 for i3 in bn: v3 = i3 *...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s291929910
p04045
Wrong Answer
''' ## ## ####### # # ###### ## ## ## ## ### ## ## ## ## # # # ## ######### ####### # # ## ''' import sys import math # sys.setrecursionlimit(10**6) def get_ints(): return map(int, input().strip().split()) def get_list(): return list(get_ints()) def 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...
s204871872
p04045
Wrong Answer
N, K = map(int, input().split()) d = list(map(str, input().split())) def answer(N,d): ans = N while True: sra = str(ans) for i in range(len(sra)): if sra[i] in d: ans = int(sra) + 1 break return sra print(answer(N,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...
s619267395
p04045
Wrong Answer
#!/usr/bin/env python3 import sys n, k = map(int, input().split()) D = list(map(int, input().split())) for i in range(1, 100): total = n * i st = set(int(x) for x in str(total)) l = len(st) if len([x for x in st if x not in D]) == l: print(total) 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...
s929705160
p04045
Wrong Answer
#!/usr/bin/env python3 import sys n, k = map(int, input().split()) try: sl = input() except EOFError: print(n) sys.exit(0) ds = set(map(int, sl.split())) for i in range(1, 100): total = n * i st = set(int(x) for x in str(total)) l = len(st) if len([x for x in st if x not in ds]) == l: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s701477351
p04045
Wrong Answer
#!/usr/bin/env python3 n, k = map(int, input().split()) ds = set(map(int, input().split())) for i in range(1, 100): total = n * i st = set(int(x) for x in str(total)) l = len(st) if len([x for x in st if x not in ds]) == l: print(total) 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...
s789892497
p04045
Wrong Answer
n,k=input().split() d=set(range(10))-set(map(int,input().split())) p=0 l=[0]*10 for i in range(10): if i in d: l[p:i+1]=[i for j in range(i-p+1)] p=i+1 if p!=10: d.discard(0) i=min(d)*10 l[p:]=[i for j in range(10-p)] #print(l) p=0 t=len(n) for i in range(t): p+=10**(t-i-1)*l[int(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...
s902494878
p04045
Wrong Answer
n,k=input().split() d=set(range(10))-set(map(int,input().split())) p=0 l=[0]*10 for i in range(10): if i in d: l[p:i+1]=[i for j in range(i-p+1)] p=i+1 if p!=10: d.discard(0) i=min(d)*10 l[p:]=[i for j in range(10-p)] print(l) p=0 t=len(n) for i in range(t): p+=10**(t-i-1)*l[int(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...
s358855708
p04045
Wrong Answer
n,k=input().split() d=set(range(10))-set(map(int,input().split())) p=0 l=[0]*10 for i in range(10): if i in d: l[p:i+1]=[i for j in range(i-p+1)] p=i+1 if p!=10: d.discard(0) i=min(d)*10 l[p:]=[i for j in range(10-p)] #print(l) p=0 t=len(n) for i in range(t): p+=10**(t-i-1)*l[int(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...
s742622717
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n, 10000): num = str(i) for j in range(len(num)): if num[j] in d: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s890587053
p04045
Wrong Answer
from collections import Counter def ok(n, D): # Dに含まれる数字をnで使っていたらFalse counter = Counter(str(n)) for d in D: if counter[str(d)] > 0: return False return True def main(): N, K = list(map(int, input().split(' '))) D = list(map(int, input().split(' '))) print(ok(1334, [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...
s198939782
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(str, input().split())) for i in range(n, 10000): flag = True for j in list(str(i)): if j in d: flag = False break if flag: 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...
s305889047
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) keta = int(len(str(n))) ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0})) ans = '' for i in reversed(range(keta)): val = int(str(n)[i]) candidate = [j for j in ok if j >= val] if candidate: ans += str(min(candidate)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s052990253
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) keta = int(len(str(n))) ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0})) ans = '' for i in reversed(range(keta)): val = int(str(n)[i]) candidate = [j for j in ok if j >= val] if candidate: ans += str(min(candidate)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s494096316
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) keta = int(len(str(n))) ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0})) ans = '' for i in reversed(range(keta)): val = int(str(n)[i]) candidate = [j for j in ok if j >= val] if candidate: ans += str(min(candidate)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s851235619
p04045
Wrong Answer
import sys # import re import math import collections # import decimal import bisect import itertools import fractions # import functools import copy import heapq import decimal # import statistics import queue import numpy as np sys.setrecursionlimit(10000001) INF = 10 ** 16 MOD = 10 ** 9 + 7 ni = lambda: int(sys.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...
s533227350
p04045
Wrong Answer
import sys # import re import math import collections # import decimal import bisect import itertools import fractions # import functools import copy import heapq import decimal # import statistics import queue import numpy as np sys.setrecursionlimit(10000001) INF = 10 ** 16 MOD = 10 ** 9 + 7 ni = lambda: int(sys.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...
s448933161
p04045
Wrong Answer
import sys # import re import math import collections # import decimal import bisect import itertools import fractions # import functools import copy import heapq import decimal # import statistics import queue import numpy as np sys.setrecursionlimit(10000001) INF = 10 ** 16 MOD = 10 ** 9 + 7 ni = lambda: int(sys.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...
s547156091
p04045
Wrong Answer
import sys # import re import math import collections # import decimal import bisect import itertools import fractions # import functools import copy import heapq import decimal # import statistics import queue import numpy as np sys.setrecursionlimit(10000001) INF = 10 ** 16 MOD = 10 ** 9 + 7 ni = lambda: int(sys.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...
s623949343
p04045
Wrong Answer
N,K=map(int, input().split()) a=[int(i) for i in input().split()] b=[0,1,2,3,4,5,6,7,8,9] for i in a: if i in b: b.remove(i) c=[] for i in str(N): if int(i) in b: c.append(int(i)) else: for j in b: if j > int(i): c.append(j) break if len(c) > 0: d=[str(i) for i in c] 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...
s210433001
p04045
Wrong Answer
N,K=map(int, input().split()) a=[int(i) for i in input().split()] b=[0,1,2,3,4,5,6,7,8,9] for i in a: if i in b: b.remove(i) c=[] for i in str(N): if int(i) in b: c.append(int(i)) else: for j in b: if j > int(i): c.append(j) break d=[str(i) for i in c] ans="".join(d) 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...
s490468697
p04045
Wrong Answer
N, K = map(str,input().split(' ')) D = set(map(str,input().split(' '))) n=set(map(str,D)) ans = '' t = list(map(int,list({'1','2','3','4','5','6','7','8','9'} - n))) t.append(0) t.sort() for i in N: for j in t: if j >= int(i): ans+=str(j) break if ans and int(ans) >= int(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...
s503860296
p04045
Wrong Answer
N, K = map(str,input().split(' ')) D = set(map(str,input().split(' '))) ans = '' t = list(map(int,list({'1','2','3','4','5','6','7','8','9'} - D))) t.append(0) t.sort() if N[0] in t: for i in N: ans2 = ans for j in t: if j >= int(i): ans+=str(j) 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...
s624980902
p04045
Wrong Answer
N, K = map(str,input().split(' ')) D = set(map(str,input().split(' '))) ans = '' t = list(map(int,list({'1','2','3','4','5','6','7','8','9'} - D))) t.append(0) t.sort() if N[0] in t: for i in N: ans2 = ans for j in t: if j >= int(i): ans+=str(j) 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...
s260718702
p04045
Wrong Answer
N, K = map(str,input().split(' ')) D = set(map(str,input().split(' '))) ans = '' t = list(map(int,list({'1','2','3','4','5','6','7','8','9'} - D))) t.append(0) t.sort() if N[0] in t: ans += N[0] else: ans+=str(t[1]) for i in N[1::]: ans2 = ans for j in t: if j >= int(i): ans+=str(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...
s465542969
p04045
Wrong Answer
N, K = map(str,input().split(' ')) D = set(map(str,input().split(' '))) n=set(map(str,D)) ans = '' t = list(map(int,list({'1','2','3','4','5','6','7','8','9'} - n))) t.sort() t.append(0) for i in N: for j in t: if j >= int(i): ans+=str(j) break if len(ans) == len(N): print(a...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s423742591
p04045
Wrong Answer
N, K = map(str,input().split(' ')) D = set(map(str,input().split(' '))) n=set(map(str,D)) ans = '' t = list(map(int,list({'1','2','3','4','5','6','7','8','9'} - n))) t.append(0) t.sort() for i in N: for j in t: if j >= int(i): ans+=str(j) break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s876940099
p04045
Wrong Answer
# -*- coding : utf-8 -*- n, k = map(int, input().split()) D = input().split() D = list(map(int, D)) E = [0,1,2,3,4,5,6,7,8,9] for i in range(len(D)): E.remove(D[i]) for i in range(n, 10 * n+1): a = i //1000 m = i - a*1000 b = m //100 l = m - b*100 c = l // 10 d = l - c*10 if a in E and b in E and 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...
s456033458
p04045
Wrong Answer
n,k=map(int, input().split()) d=set(input().split()) candidate_num=list(set(['0','1','2','3','4','5','6','7','8','9'])-d) candidate_num.sort() from itertools import product candidate=list(product(candidate_num, repeat=len(str(n)))) ans=10**9+7 for candidate_i in candidate: c_i=int(''.join(list(candidate_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...
s196114126
p04045
Wrong Answer
def ret_num(num, val): for i in num: if i > val: return i all_num=[0,1,2,3,4,5,6,7,8,9] (val, dis)=[int(x) for x in input().split()] dis_num=[int(x) for x in input().split()] num=[] for i in all_num: if i not in dis_num: num.append(i) ans=[] while val > 0: if val % 10 in num: ans.append(val%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...
s932986361
p04045
Wrong Answer
import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) from collections import Counter, deque from collections import defaultdict from itertools import combinations, permutations, accumulate, groupby, product from bisect import bisect_left,bisect_right from heapq import heapify, heappop, heappush from math ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s110807102
p04045
Wrong Answer
class A: def solve(self): [a, b, c] = sorted([int(x) for x in input().split(" ")]) if a == 5 and b == 5 and c == 7: print("YES") else: print("NO") class B: def solve(self): [n, l] = [int(x) for x in input().split(" ")] strings = [] 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...
s245394046
p04045
Wrong Answer
from itertools import * N,K = map(int,input().split()) D = list(map(int,input().split())) num = [] for i in range(10): if i not in D: num.append(str(i)) ans = 10**18 for i in product(num,repeat=len(str(N))): money = int(''.join(list(i))) if N <= money : ans = min(ans,money) 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...
s246890887
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) available = [i for i in range(10) if i not in D] values = available.copy() idx = int(values[0] == 0) while True: base = values[idx] * 10 for a in available: n = base + a if n >= N: print(n) quit() values.append(n) idx +...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s758248478
p04045
Wrong Answer
from itertools import product n, k = input().split() a = list(input().split()) l = set([str(i) for i in range(10)]).difference(a) ni = int(n) for j in range(len(n), len(n)+2): for i in product(l, repeat=j): t = ''.join(i) if int(t) >= ni: print(t) 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...
s944062960
p04045
Wrong Answer
from collections import deque n,k = map(int,input().split()) d = set(list(map(int,input().split()))) a = list({0,1,2,3,4,5,6,7,8,9} - d) a.sort() que = deque() que.append(0) while que: ans = que.popleft() if ans >= n: print(ans) exit() for i in a: que.append(ans*10 + i) prin...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s561573397
p04045
Wrong Answer
[n,k] = [int(i) for i in input().split()] d = [int(i) for i in input().split()] ls = [] iter = 0 for i in range(10): try: if i != d[iter]: ls.append(str(i)) else: iter += 1 except: ls.append(str(i)) pass #print(ls) ans = 10 ** 5 for i in range(len(ls)): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s655413769
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) canidates = [i for i in range(10) if i not in d] ok = False ans = 10**9 def bfs(s): global ans if len(s) == len(str(n)): res = int(s) if res >= n and res < ans: ans = res else: for i in canidates: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s247454910
p04045
Wrong Answer
n,k=map(int, input().split()) ds=list(map(str, input().split())) while True: for i in ds: if i in str(n): n+=1 break break print(str(n))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s261096389
p04045
Wrong Answer
n,k=map(int, input().split()) ds=list(map(str, input().split())) while True: for i in ds: if i in str(n): n+=1 continue break print(str(n))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s083920588
p04045
Wrong Answer
N, K = map(int, input().split()) D = input().split() i = 0 while i < 1: i = 1 for n in str(N): if n in D: i = 0 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...
s668177631
p04045
Wrong Answer
N, K = map(int, input().split()) D = input().split() n = 1 i = 0 while i < 1: Ans = str(N * n) n += 1 i = 1 for ans in Ans: if ans in D: i = 0 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...
s283027115
p04045
Wrong Answer
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s928862075
p04045
Wrong Answer
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s554830587
p04045
Wrong Answer
n , k = map(int,input().split()) d = set(list(map(int,input().split()))) kouho =list({0,1,2,3,4,5,6,7,8,9} - d) kouho.sort() def f(now): if now >= n: print(now) exit() for i in kouho: if now != 0 or i != 0: f(now*10 + i) f(0)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s708219590
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) like = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] ans = '' result_list = list(set(like) - set(d)) result_list.sort() for i in str(n): for result in result_list: if int(i) == result == 0: ans = ans + '0' break elif int(i...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s724908376
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) like = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] ans = '' result_list = list(set(like) - set(d)) for i in str(n): for result in result_list: if int(i) == result == 0: ans = ans + '0' elif int(i) <= result: ans = 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...
s071501016
p04045
Wrong Answer
l = list(map(int, input().split())) N = l[0] K = l[1] s = list(map(int, input().split())) number = [0,1,2,3,4,5,6,7,8,9] not_in = [] for i in range(10): if i not in s: not_in.append(i) result = "" flg = 0 upper = str(N)[0] for j in not_in: if int(upper) <= j: flg = 1 if flg == 0: N = "10" + 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...
s024971416
p04045
Wrong Answer
l = list(map(int, input().split())) N = l[0] K = l[1] s = list(map(int, input().split())) number = [0,1,2,3,4,5,6,7,8,9] not_in = [] for i in range(10): if i not in s: not_in.append(i) result = "" for i in str(N): for j in not_in: if int(i) <= j: result += str(j) break print(result)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s904940112
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) #嫌いな数字を変更する def change_number(x): #足す数を格納しておく変数 tmp = 0 #嫌いな数字が含まれている間 while x in d: x += 1 tmp += 1 #繰り上がる場合に調整 if x == 10: x = 0 return tmp #1の位 x = str(n)[-1:] n += change_number(int(x)) #10の位 if n >= 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...
s327954958
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) ans = '' #嫌いな数字を変更する def change_number(x): #足す数を格納しておく変数 tmp = 0 #嫌いな数字が含まれている間 while x in d: x += 1 tmp += 1 #繰り上がる場合に調整 if x == 10: x = 0 return tmp #1の位 x = str(n)[-1:] n += change_number(int(x)) #10の位 if 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...
s324656011
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(map(int, input().split())) ans = '' #嫌いな数字を変更する def change_number(x): #足す数を格納しておく変数 tmp = 0 #嫌いな数字が含まれている間 while x in d: x += 1 tmp += 1 #繰り上がる場合に調整 if x == 10: x = 0 return tmp #1の位 x = str(n)[-1:] n += change_number(int(x)) #10の位 if 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...
s672476965
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) number=[i for i in range(10) if i not in D] #N以上の最小値をnumberの数値だけで表せ #0が許されるなら、末端は #K*5* for i in range(N,10001): c=0 for j in str(i): if int(j) not in number: c=1 break if c==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...
s805155949
p04045
Wrong Answer
# C - こだわり者いろはちゃん # https://atcoder.jp/contests/abc042/tasks/arc058_a n,k = input().split() d = list(map(int,input().split())) tmp =[] for i in list(n): ni = int(i) while True: if ni in d: ni += 1 else: tmp.append(ni) break print("".join(list(map(str,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...