submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s695772692 | p04045 | Accepted | N,K=map(int,input().split())
D=[int(x) for x in input().split()]
D=set(D)
kouho=N
while(1):
lenkouho=len(str(kouho))
flag=1
for i in range(lenkouho):
if int(str(kouho)[i]) in D:
flag=0
if flag==1:
print(kouho)
break
kouho+=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... |
s773593542 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
s = set(D)
for i in range(N, 10**6+1):
l = [j for j in str(i)]
flag = True
for n in l:
if int(n) in s:
flag = False
break
if flag:
ans = i
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... |
s778118972 | p04045 | Accepted | import sys
input = sys.stdin.readline
from collections import defaultdict
n,k= map(int, input().split())
d= list(map(int, input().split()))
d=set(d)
for i in range(n,pow(10,5)):
a=set()
v=str(i)
for j in range(len(v)):
a.add(int(v[j]))
if a.isdisjoint(d):
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... |
s462150082 | p04045 | Accepted | # bsdk idhar kya dekhne ko aaya hai, khud kr!!!
# import math
# from itertools import *
# import random
# import calendar
import datetime
# import webbrowser
# f = open("input.txt", 'r')
# g = open("output.txt", 'w')
# n, m = map(int, f.readline().split())
n, k = map(int, input().split())
dislike = list(map(int, inpu... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s833351283 | p04045 | Accepted | def dfs(A: list):
if len(A) > nn:
return
if len(A) and (x := int("".join(A))) >= n and ans[0] > x:
ans[0] = x
return
for v in d:
if v == "0" and len(A) == 0:
next
A.append(v)
dfs(A)
A.pop()
n, k = map(int, input().split())
d = sorted(lis... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s336932876 | p04045 | Accepted | def dfs(A: list):
if len(A) > len(str(n))+1:
return
if len(A) and (x := int("".join(A))) >= n and ans[0] > x:
ans[0] = x
return
for v in d:
if v == "0" and len(A) == 0:
next
A.append(v)
dfs(A)
A.pop()
n, k = map(int, input().split())
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... |
s583915685 | p04045 | Accepted | import sys
def check(pay, like):
str_pay = str(pay)
like = ''.join(like)
for p in str_pay:
for lk in like:
if p == lk:
return False
return True
N, K = map(int, input().split())
D = []
D = list(map(int, input().split()))
str_D = []
for s in D:
str_D.append(st... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s775211917 | p04045 | Accepted | n, k = list(map(int,input().split()))
a = list(map(str,input().split()))
while True:
for j in str(n):
if j in a:
break
else:
break
n += 1
print(n) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s886011784 | p04045 | Accepted | #1000 8
#1 3 4 5 6 7 8 9
n,k = map(int, raw_input().split())
s = set(map(int, raw_input().split()))
letters = [u for u in range(10) if u not in s]
def dfs(u,n,letters):return min([dfs(u*10 +l,n,letters) for l in letters if u or l]) if u < n else u
print dfs(0,n,letters) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s270031235 | p04045 | Accepted | #1000 8
#1 3 4 5 6 7 8 9
n,k = map(int, raw_input().split())
s = set(map(int, raw_input().split()))
letters = [u for u in range(10) if u not in s]
def dfs(u,n,letters):
if u >= n:
return u
return min([dfs(u*10 +l,n,letters) for l in letters if u or l])
print dfs(0,n,letters) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s818713736 | p04045 | Accepted | import itertools
def main():
N, K = [int(n) for n in input().split(" ")]
D = [1] * 10
for d in input().split(" "):
D[int(d)] = 0
L = [str(i) for i, v in enumerate(D) if v == 1]
digit = len(str(N))
cand = []
for n in list(itertools.product(L, repeat=digit)):
p = int("".join(list(n)))
if p >= N:
cand.ap... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s246218984 | p04045 | Accepted | total, k = map(int, input().split())
d = list(map(int, input().split()))
def total_to_digits(total):
return map(int, list(str(total)))
def find_lowest_denomination(total, d):
res = None
for i in range(total, 99999):
digits = list(total_to_digits(i))
if not (set(digits) & set(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... |
s328330624 | p04045 | Accepted | N, K = [int(x) for x in input().split()]
D = input().split()
for payment in range(N, 10*N+1):
if all(char not in D for char in str(payment)):
print(payment)
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... |
s679159867 | p04045 | Accepted | #
# abc042 c
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s962308847 | p04045 | Accepted | #
# abc042 c
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s125953278 | p04045 | Accepted | N, K = map(int, input().split())
S = set(input().split())
while True:
L = list(str(N))
for i in L:
if i in S:
break
else:
break
N += 1
print(N) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s317338238 | p04045 | Accepted | n, k = map(int, input().split())
arr = list(map(int, input().split()))
inf = float('inf')
min_cost = inf
for amount in range(n, 100000):
for i, e in enumerate(arr):
if str(e) in str(amount):
break
if i == len(arr)-1:
min_cost = min(min_cost, amount)
print(min_cost) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s864121596 | p04045 | Accepted | '''
Created on 2020/08/25
@author: harurun
'''
def main():
import sys
pin=sys.stdin.readline
pout=sys.stdout.write
perr=sys.stderr.write
N,K=map(int,pin().split())
D=list(map(int,pin().split()))
# l=[0,1,2,3,4,5,6,7,8,9]
# for i in D:
# l.remove(i)
j=N
while True:
for k in 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... |
s822414374 | p04045 | Accepted | N, K = map(int, input().split())
A = set(map(int, input().split()))
while 1:
B = set(map(int, list(str(N))))
if len(A & B) == 0:
print(N)
break
N += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s695925969 | p04045 | Accepted | N,K,*dd = map(int, open(0).read().split())
valid = [1] * 10
for d in dd:
valid[d] = 0
digits = [i for i,v in enumerate(valid) if v]
num_digit = len(str(N))
from itertools import product
from sys import exit
for ans_digit in [num_digit, num_digit+1]:
for x in product(digits, repeat=ans_digit):
x = int(... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s482361067 | p04045 | Accepted | from itertools import combinations_with_replacement
n, k = map(int, input().split())
d = [int(x) for x in input().split()]
dd = set(list(range(10))) - set(d)
x = str(n)
lst = []
dd = list(dd)
dd.sort()
sel = []
for i in dd:
if int(x[0]) <= i and len(sel) < 3: sel.append(i*10**(len(x)-1))
if len(sel) < 2:
if le... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s464200110 | p04045 | Accepted | n, k = map(int, input().split())
d = set(input().split())
while True:
s = str(n)
flag = True
for c in s:
if c in d:
flag = False
if flag:
print(n)
break
n += 1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s518663570 | p04045 | Accepted | nk = list(map(lambda x: int(x), input().split(" ")))
n = nk[0]
k = nk[1]
ds = input().split(" ")
res = n
while True:
is_ok = [str(res).find(d) == -1 for d in ds]
if all(is_ok):
break
else:
res = res + 1
print(res)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s544982661 | p04045 | Accepted | import sys
import math
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT() : return int(input())
def MAP() : return map(int,input().split())
def LIST() : return list(MAP())
def NIJIGEN(H): return [list(input()) for i in range(H)]
N,K=MAP()
L=list(input().split())
L=set(L)
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... |
s937943882 | p04045 | Accepted | # 24
import sys
def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input(... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s416999636 | p04045 | Accepted | # 24
import sys
def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input(... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s295336532 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
can_use = []
for i in range(10):
if (i in D):
continue
else:
can_use.append(i)
while True:
str_N = str(N)
flag = True
for i in range(len(str_N)):
if int(str_N[i]) in D:
N += 1
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... |
s410851690 | p04045 | Accepted | N,K = (int(T) for T in input().split())
D = input().split()
for TN in range(N,100000):
StrN = str(TN)
Flag = True
for TS in StrN:
if TS in D:
Flag = False
break
if Flag:
print(TN)
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... |
s792411000 | p04045 | Accepted | N,K=map(int,input().split())
D=set(input().split())
while set(str(N))&D:
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... |
s739377663 | p04045 | Accepted | from collections import defaultdict
digit = []
def check(n):
global digit
while n:
rem = n%10
for i in digit:
if i==rem:
return False
n = n//10
return True
def main():
global digit
n , k = map(int , input().split())
digit = list(map(int , input().split()))
ans = n
while (check(n))==False:
n = 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... |
s233228873 | p04045 | Accepted | n,k = map(int,input().split())
d = list(map(int,input().split()))
while(True):
x = n
while(x):
if x%10 in d:
break
x//=10
else:
print(n)
quit(0)
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... |
s989477594 | p04045 | Accepted | n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(1,10**5+1):
if i>=n:
p=str(i)
ch=0
for y in range(len(p)):
if int(p[y]) in a:
ch+=1
if ch==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... |
s459095189 | p04045 | Accepted | n, k = map(int, input().split())
d = list(input().split())
flag = True
while True:
strn = str(n)
for i in d:
if i in strn:
n += 1
break
else:
flag = False
break
print(n) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s253487204 | p04045 | Accepted | n, k = [int(x) for x in input().split()]
d_set = set(input().split())
while True:
if len(set(str(n)).intersection(d_set)) == 0:
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... |
s963689222 | p04045 | Accepted | N, K = map(int, input().split())
D = set(input().split())
for i in range(N, 10**5):
if not set(str(i)) & D:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s050836967 | p04045 | Accepted | kingaku, n = input().split()
no_num = input().split()
ok_num = [str(i) for i in range(10) if not str(i) in no_num]
result = []
for i in kingaku:
for j in ok_num:
if i == j:
result.append(j)
break
elif i < j:
result.append(j)
print("".join(result).lju... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s839401567 | p04045 | Accepted | kingaku, n = input().split()
no_num = input().split()
ok_num = []
result = []
for i in range(10):
if not str(i) in no_num:
ok_num.append(str(i))
set_flg = False
for i in kingaku:
set_flg = True
for j in ok_num:
if i == j:
set_flg = False
result.append(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... |
s109710417 | p04045 | Accepted | kingaku, n = input().split()
no_num = input().split()
result = []
ok_num = []
kuriage_num = [-1, 0]
def kuriage(l):
for i in ok_num:
if result[l] < i:
kuriage_num = [l, i]
return
if l <= 0:
return
return kuriage(l-1)
#使える数字のリストを作成
for i in range(10):
if not 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... |
s315300178 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
d = set()
for i in range(K):
d.add(str(D[i]))
# print(d)
for i in range(N, 100000):
flag = True
s = str(i)
li = list(s)
for nowletter in li:
if nowletter in d:
flag = False
if flag:
print(i)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s675452240 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
d = set()
for i in range(K):
d.add(str(D[i]))
for i in range(N, 100000):
s = str(i)
li = list(s)
nowset = set(li)
if not nowset & d:
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... |
s282197722 | p04045 | Accepted | k,n=map(int,input().split())
l=set(input().split())
for i in range(k,10**6):
if (set(str(i)).isdisjoint(l)):
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... |
s437254142 | p04045 | Accepted | N, K = input().split()
D = set(map(int,input().split()))
C = list({0,1,2,3,4,5,6,7,8,9}-D)
C.sort()
num = len(N)
def minimum(x,ans):
ans += str(min(C))*x
return ans
ans = ''
if C[-1]<int(N[0]):
C_0 = list(set(C)-{0})
ans += str(min(C_0))
ans = minimum(num,ans)
print(ans)
exit()
points = ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s094472520 | p04045 | Accepted | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
N, K = map(int, input().split())
D = set(input().split())
for I in range(N,10**6):
if set(str(I)).isdisjoint(D):
print(I)
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... |
s800173446 | p04045 | Accepted | from collections import deque
N, K = map(int, input().split())
nums = list(map(str, input().split()))
can_use_nums = set([str(i) for i in range(10)])
for num in nums:
can_use_nums.remove(num)
# print(can_use_nums)
queue = deque([[num] for num in can_use_nums if num != '0'])
# print(queue)
min_num = float('inf')
wh... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s862516002 | p04045 | Accepted | N, _ = input().split()
N = int(N)
dislike = list(map(int, input().split()))
like = []
f = True
l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
x = N
for i in l:
if i not in dislike:
like.append(i)
like = list(str(like))
dislike = list(str(dislike))
while f:
x = list(str(x))
for i in x:
if i not in dislik... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s734501556 | p04045 | Accepted | # @oj: atcoder
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-08-13 22:50
# @url:https://atcoder.jp/contests/abc042/tasks/arc058_a
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
from decimal import *
# region fastio
BUFSIZE = 8192
BUFSIZE = 8192
class ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s759659495 | p04045 | Accepted | import sys
n, k = map(int, input().split())
d = set(input().split())
for i in range(n, n*10):
a = set(str(i))
for l, m in enumerate(a):
if m in d:
break
elif l == len(a)-1:
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... |
s327875575 | p04045 | Accepted | n,k,*d=map(int,open(0).read().split())
for p in range(n,10**5):
tmp=p
d1=tmp%10
while tmp>0 and d1 not in d:
tmp//=10
d1=tmp%10
if tmp==0:
print(p)
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... |
s532066095 | p04045 | Accepted | n, k = map(int, input().split())
D = list(map(str, input().split()))
money = n
ok = True
while True:
for d in D:
if d in str(money):
ok = False
break
if ok:
print(money)
break
money += 1
ok = True | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s311021426 | p04045 | Accepted | N,K = map(int,input().split())
A = set(map(int,input().split()))
#A = set(A)
ok = []
for i in range(10):
if i not in A:
ok.append(i)
#print(ok)
while True:
nstr = str(N)
nstr = list(nstr)
#print(nstr)
Flag = True
for x in nstr:
x = int(x)
if x in A:
Flag = False
break
#print(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... |
s922438929 | p04045 | Accepted | n, k = map(int, input().split())
dlst = list(map(int, input().split()))
ans = n
while 1:
for num in dlst:
if str(num) in str(ans):
break
else:
print(ans)
exit()
ans += 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... |
s073321785 | p04045 | Accepted | n, k = map(int, input().split())
d = set(map(int, input().split()))
ok = set(range(10))
ans = 0
for i in range(n, 100000):
ans = i
flag = False
while i != 0:
if i % 10 in d:
flag = True
break
i = i // 10
if not flag:
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... |
s023089751 | p04045 | Accepted | N,K=map(int,input().split())
D=set(input().split())
for i in range(N,N+10**6+5):
if not set(str(i)).intersection(D):
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... |
s533710138 | p04045 | Accepted | N,K,*D = map(int, open(0).read().split())
Ds = set(D)
item = set([0,1,2,3,4,5,6,7,8,9]) - Ds
strs = set(str(x) for x in item)
for i in range(N,10000):
s = set(str(i))
if s.issubset(strs):
print(i)
break
else:
il = list(item)
il.sort()
if il[0] == 0:
ans = [str(il[1])] + ([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... |
s604196490 | p04045 | Accepted | N, L = map(int, input().split())
S = {int(x) for x in input().split()}
flag = False
while 1:
if N%10 in S:
N += 1
continue
if int((N%100-N%10)/10) in S and N >= 10:
N += 1
continue
if int((N%1000-N%100)/100) in S and N >= 100:
N += 1
continue
if int((N%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... |
s400881817 | p04045 | Accepted | N, L = map(int, input().split())
S = {int(x) for x in input().split()}
flag = False
while flag == False:
if N%10 in S:
N += 1
continue
if int((N%100-N%10)/10) in S and N >= 10:
N += 1
continue
if int((N%1000-N%100)/100) in S and N >= 100:
N += 1
continue
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... |
s788009978 | p04045 | Accepted | N,K=map(int,input().split())
d=list(map(int,input().split()))
flag=0
for i in range(100000):
S=N+i
flag=0
for j in range(len(str(S))):
if int(str(S)[j]) not in d:
flag+=1
if flag==len(str(S)):
print(S)
break
else:
continue
bre... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s984933742 | p04045 | Accepted | n,k = map(int ,input().split())
d = set(input().split())
while True:
if not set(str(n)) & d:
print(n)
break
else:
n = n+1
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s990190429 | p04045 | Accepted | from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")
# 処理内容
def main():
N, K = map(int, input().split())
D = list(map(int, input().split()))
ng = [False]*10
for d in D:
ng[d] = True
for 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... |
s549438539 | p04045 | Accepted | from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s331204546 | p04045 | Accepted | n, k = map(int, input().split())
d = set(input().split())
while True:
if not set(str(n)) & d:
print(n)
break
else:
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... |
s273085120 | p04045 | Accepted | N,K=map(int, input().split(" "))
s=input().split(" ")
i=N
while i < 10*N:
j = list(str(i))
if not set(j).isdisjoint(set(s)): #NがSを含むとき
i += 1
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... |
s784124201 | p04045 | Accepted | n, k = map(int, input().split())
dlst = list(input().split())
while 1:
for num in dlst:
if num in str(n):
break
else:
print(n)
break
n += 1
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s346966338 | p04045 | Accepted | def main():
n, k = input().split()
a=set(input().split())
while True:
n1=set(n)
if n1 & a == set():
print(n)
break
else:
n=int(n)
n+=1
n=str(n)
if __name__=="__main__":
main()
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s473576048 | p04045 | Accepted | from itertools import product
n,k = map(int, input().split())
d = list(map(int, input().split()))
nums = []
for i in range(10):
if i not in d: nums.append(i)
m = len(str(n))
for i in range(m, m+2):
for j in product(nums, repeat=i):
ans = ""
for k in j: ans += str(k)
if int(ans) >= n:
print(ans)
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s405731370 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
while True:
sN = str(N)
flag = False
for ins in D:
if str(ins) in sN:
flag = True
break
if flag:
#print(out)
N += 1
else:
break
print(N) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s372110551 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
for i in range(n, 10 * n + 1):
flag = False
for j in str(i):
if int(j) in d:
flag = True
break
if flag:
continue
exit(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... |
s263527952 | p04045 | Accepted | N, K = [1000, 8]
DRR = [1, 3, 4, 5, 6, 7, 8, 9]
N, K = [9999, 1]
DRR = [0]
N, K = list(map(int,input().split()))
DRR = list(map(int,input().split()))
def calculate(n, k, drr):
dislikes = set()
for i in range(k):
dislikes.add(drr[i])
while not condition(n, dislikes):
n += 1
print... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s147344631 | p04045 | Accepted | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,100000):
num=list(str(i))
num1=0
for j in range(len(num)):
if num[j] in d:
num1=1
break
if num1==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... |
s587820047 | p04045 | Accepted | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,100000):
i2=str(i)
for m in d:
if m in i2:
break
else:
print(i)
exit()
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s691850913 | p04045 | Accepted | def check(n,s):
v=str(n)
for i in v:
if i in s:
return False
return True
def solve():
n,k=map(int,input().split())
s=input().split()
s=set(s)
while True:
if check(n,s):
print(n)
break
else:
n+=1
for _ in range(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... |
s916632686 | p04045 | Accepted | from sys import stdin,stdout
import bisect
import math
def st():
return list(stdin.readline().strip())
def inp():
return int(stdin.readline())
def li():
return list(map(int,stdin.readline().split()))
def mp():
return map(int,stdin.readline().split())
def pr(n):
stdout.write(str(n)+"\n")
def... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s625121520 | p04045 | Accepted | i = 0
k_n = []
k_n_all = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
p_price, k_number = map(int, input().split())
k_n = map(int, input().split())
result_number = list(set(k_n_all) - set(k_n))
result_price = p_price
while True:
x = 0
y = 0
z = list(map(int, str(result_price)))
while x < len(z):
if z[x] in ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s936180610 | p04045 | Accepted | import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s262602436 | p04045 | Accepted | n,k=map(int,input().split())
a=list(input().split())
ans=0
for i in range(n,100001):
cnt=list(str(i))
for j in range(len(cnt)):
if cnt[j] in a:
ans=1
break
if ans==0:
print(i)
exit()
else:
ans=0
continue
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s012168952 | p04045 | Accepted | n,k=map(int,input().split())
D=input().split()
while True:
l=list(str(n))
for i in l:
if i in D:
break
else:
break
n+=1
print(n) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s435647470 | p04045 | Accepted | def main():
n,k = map(int,input().split())
D = set(map(int,input().split()))
while True:
flg = 0
for i in str(n):
i = int(i)
if i in D:
flg = 1
break
if flg == 0:
break
n+=1
print(n)
main() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s605797254 | p04045 | Accepted | import math
import collections
import fractions
import itertools
import functools
import operator
def solve():
n, k = map(int, input().split())
d = list(map(int, input().split()))
cuse = list(set(d) ^ set(range(10)))
for i in range(n, 200000):
nyoso = list(set(map(int, list(str(i)))))
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... |
s527824464 | p04045 | Accepted | N, K = map(int, input().split())
D = set(input().split())
for n in range(N, N * 10 + 1):
ok = True
for c in str(n):
if c in D:
ok = False
if ok:
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... |
s158997430 | p04045 | Accepted | import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# map(int, input().split()... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s572934047 | p04045 | Accepted | n,k = map(int,input().split())
d = list(map(int,input().split()))
allowed = {i for i in range(10) if i not in d}
maxn = 10**5
for k in range(1,maxn+1):
if k >= n and all(int(c) in allowed for c in str(k)):
print(k)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s551296223 | p04045 | Accepted | n,k=map(int,input().split())
ar=list(map(int,input().split()))
def f(n):
s=str(n)
for el in ar:
if(str(el) in s):
return 0
return 1
while(not f(n)):
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... |
s485044357 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
allowed = {i for i in range(10) if i not in d}
MAXN = 10 ** 5
def answer():
for k in range(1, MAXN + 1):
if k >= n and all(int(c) in allowed for c in str(k)):
return k
answer = answer()
print(answer)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s601862228 | p04045 | Accepted | def main():
n,k=input().split()
a=set(input().split())
while True:
n1=set(n)
if n1 & a == set():
print(n)
break
else:
n=int(n)
n+=1
n=str(n)
if __name__=="__main__":
main()
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s687475566 | p04045 | Accepted | N, K = map(int, input().split())
D = set(list(input().split()))
while N < 10 ** 6:
if len(set(list(str(N))) & D) == 0:
print(N)
exit()
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... |
s569454616 | p04045 | Accepted | n,k=[int(i) for i in input().split()]
d=[i for i in input().split()]
i=n
while True:
check=0
for number in d:
if not number in str(i):
continue
else:
check=1
break
if check==0:
print(i)
break
else:
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... |
s212208690 | p04045 | Accepted | n,k = map(int,input().split())
d = list(map(int,input().split()))
n_str = str(n)
l = len(n_str)
a = [i for i in range(10) if i not in d]
#同じ桁の時
ans = ""
for i in range(l):
for j in a:
if j == int(n_str[i]):
ans += str(j)
break
elif j > int(n_str[i]):
ans += 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... |
s978488807 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(str, input().split()))
while True:
n = str(N)
nn = str(N)
for o in nn:
if o in D:
N += 1
nn = str(N)
break
if n == nn:
break
print(N) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s164562489 | p04045 | Accepted | # -*- coding: utf-8 -*-
def main():
N, K = map(int, input().split())
D = list(map(int, input().split()))
numList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
num = set()
for i in numList:
if i not in D:
num.add(i)
for i in range(N, N * 10 + 1):
setI = set(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... |
s042096602 | p04045 | Accepted | import sys
import numpy as np
from heapq import heappush, heappop
from bisect import bisect_left as bi_l, bisect_right as bi_r
from collections import deque, Counter, defaultdict
from itertools import combinations, product
import string
inf = float('inf')
MOD = 10**9+7
# MOD = 998244353
class NumberTheory():
def ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s457435739 | p04045 | Accepted | n, k = map(int, input().split())
D = list(map(int, input().split()))
def xInD(x):
while x > 0:
lsd = x % 10
if lsd in D:
return False
x //= 10
return True
while True:
if xInD(n):
print (n)
break
else:
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... |
s186906396 | p04045 | Accepted | n,k=map(int,input().split())
lst=list(input())
while True:
ans=True
s=str(n)
for i in s:
if i in lst:
ans=False
break
if ans==True:
print(n)
break
n+=1 | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s550428069 | p04045 | Accepted | n, k = map(int, input().split())
data = list(map(int, input().split()))
ng = set(data)
for i in range(n, 10*n+1):
if all(int(c) not in ng for c in str(i)):
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... |
s848845333 | p04045 | Accepted | from itertools import product
N,K = list(map(int,input().split()))
D = list(map(int,input().split()))
D_ = [_ for _ in range(10) if _ not in D]
D_.sort()
break_flag=False
for s_ in D_:
if break_flag:
break
elif s_ == 0:
continue
for p in product(D_,repeat=len(str(N))-1):
ans=int(st... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s570788491 | p04045 | Accepted | N, K = map(int, input().split())
num = list(map(int, input().split()))
kirai = [0]*10
for i in num:
kirai[i] = 1
MAXX = 100000
for n in range(N, MAXX):
tmp = n
good = True
while tmp > 0:
d = tmp % 10
tmp = tmp//10
if kirai[d]:
good = False
break
if go... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s952517505 | p04045 | Accepted | n,_ = map(int,input().split())
d = list(input().split())
flg=True
while flg:
flg=False
for i in str(n):
if i in d:
flg=True
n+=1
break
print(n) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s476142617 | p04045 | Accepted | import copy
n,k=map(int,input().split())
d=list(map(int,input().split()))
ans=n
while True:
flag=True
c=copy.deepcopy(str(ans))
for i in range(len(c)):
if int(c[i]) in d:
flag=False
break
if flag:
print(ans)
exit()
ans+=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... |
s563786484 | p04045 | Accepted | n, k = map(int, input().split())
d = sorted(list(map(int, input().split())))
for i in range(n, 100000):
for j in d:
if str(i).count(str(j)) != 0:
break
else:
print(i)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s218504922 | p04045 | Accepted | import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
N,K = MI()
D = LI()
A = [] # 使ってよい数字
for i in range(10):
if not i in D:
A.append(i)
def f(x):
if x <= max(A):
for i in range(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... |
s608192107 | p04045 | Accepted | N, K = map(int, input().split())
D = input().split()
for i in range(N, N+100000):
if any(s in D for s in str(i)):
pass
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.