submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s805566451 | p04045 | Time Limit Exceeded | import numpy as np
n = list(map(int, input().split()))
d = np.array(list(map(int, input().split())))
a = len(str(n[0]))
x = np.zeros(a + 1)
for i in range(a + 1):
x[i] = (n[0] % np.power(10, a - i + 1)) // np.power(10, a - i)
i = 1
while 1:
while np.any(d == x[i]):
x[i] += 1
x[i + (i != 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... |
s295299195 | p04045 | Time Limit Exceeded | import numpy as np
n = list(map(int, input().split()))
d = np.array(list(map(int, input().split())))
while 1:
a = (n[0] % 10000) // 1000
b = (n[0] % 1000) // 100
c = (n[0] % 100) // 10
e = n[0] % 10
f = n[0] // 10000
if np.any(d == f):
n[0] = f * 10000
elif np.any(d == 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... |
s952535489 | p04045 | Time Limit Exceeded | import numpy as np
n = list(map(int, input().split()))
d = np.array(list(map(int, input().split())))
while 1:
a = n[0] // 1000
b = (n[0] % 1000) // 100
c = (n[0] % 100) // 10
e = n[0] % 10
if np.any(d == a):
n[0] = (a + 1) * 1000
elif np.any(d == b):
n[0] = a * 1000 + 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... |
s381453967 | p04045 | Time Limit Exceeded | n,k=map(int,input().split())
d=input().split()
while 1:
t=0
p=list(str(n))
q=len(p)
for c in range(q):
if t==1:
break
for b in range(k):
if p[c]==d[b]:
n=n+10**c
t=1
break
if t==0:
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... |
s569994818 | p04045 | Time Limit Exceeded | from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 7)
N, K = [int(x) for x in stdin.readline().rstrip().split()]
D = [int(x) for x in stdin.readline().rstrip().split()]
L = [x for x in range(10) if x not in D]
ans = 10 ** 7
def dfs(n):
if len(n) >= len(str(N)):
if int(n) >= N and n[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... |
s618864654 | p04045 | Time Limit Exceeded | #入力
n, k = map(int, input().split())
d = input().split()
while (n < 10000):
a = str(n)
flag = 1
for i in range(len(a)):
for j in range(k):
if a[i] != d[j]:
flag += 1
else:
n += 1
break
if (flag % (k+1)) != 0:
break
if flag == len(a) * (k+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... |
s343633844 | p04045 | Time Limit Exceeded | n,k=map(int,input().split())
d=input().split()
stopcode=False
while stopcode==False:
for i in range(len(str(n))):
if str(n)[i] in d:
n+=1
break
elif i==len(str(n)):
stopcode=True
break
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... |
s988675402 | p04045 | Time Limit Exceeded | n,k=map(int,input().split())
d=input().split()
stopcode=False
while stopcode==False:
for i in range(len(str(n))):
if str(n)[i] in d:
n+=1
break
elif i==range(len(str(n))):
stopcode=True
break
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... |
s607024239 | p04045 | Time Limit Exceeded | n, k = map(int, input().split())
d_list = list(map(int, input().split()))
def is_dislike_number(number, dislike_list):
if number in dislike_list:
return True
else:
return False
while True:
for i, num in enumerate(str(n)):
num = int(num)
if is_dislike_number(num, d_list):
n += 1
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... |
s030106341 | p04045 | Time Limit Exceeded | N,K=map(int,input().split())
Ds=list(input().split())
Di=list(map(int,Ds))
nex=[1]*10
for i in reversed(Di):
nex[i-1]=nex[i]+1
def check(n):
ns = str(N)
for nss in ns:
if nss in Ds:
return False
return True
def next(i):
global N
ns='{0:0>4}'.format(N)
t=nex[int(ns[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... |
s425089828 | p04045 | Accepted | n, k = map(int,input().split())
D = list(map(int,input().split()))
f = [0]*10
for d in D:
f[d] = 1
while True:
check = str(n)
for c in check:
if f[int(c)]:
n += 1
break
else:
print(check)
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... |
s587101487 | p04045 | Accepted | n, k = map(int, input().split())
D = list(map(int, input().split()))
for i in range(n, 100000):
m = str(i)
count = 0
for j in range(len(m)):
if int(m[j]) in D:
break
else:
count += 1
if count == len(m):
print(i)
exit()
print(0) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s277496455 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
ng = [False] * 10
for i in d:
ng[i] = True
def ok(n):
global ng
while n > 0:
if ng[n%10]:
return False
n //= 10
return True
while not ok(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... |
s075777169 | p04045 | Accepted | n,k=map(int,input().split())
d=set(input().split())
while True:
if len(set(str(n))&d) != 0:
n+=1
else:
print(n)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s183595560 | p04045 | Accepted | n,t = [int(x) for x in input().split()]
d = [int(x) for x in input().split()]
def check(x) -> bool:
while x>0:
a = x%10
if a in d:
return False
x//=10
return True
while check(n)==False:
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... |
s139397342 | p04045 | Accepted | n, k = input().split()
d = list(map(int, input().split()))
a = []
for i in range(10):
if i not in d:
a.append(i)
n = list(map(int, list(n)))
for i in range(len(n)):
if n[i] in d:
ind = i
done = False
while not done:
for j in range(n[ind]+1, 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... |
s321910275 | p04045 | Accepted | def is_dislike(N, ds):
num = N
while(True):
if (num % 10) in ds:
return True
else:
num = int(num / 10)
if num == 0:
break
return False
nk = list(map(int,input().split()))
N = nk[0]
K = nk[1]
ds = list(map(int,input().split()))
while(True):
if is_dislike(N, ds):
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... |
s972999559 | p04045 | Accepted | n,k = map(int,input().split())
d=set(input().split())
while True:
if len(set(str(n))&d)!=0:
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... |
s203685541 | p04045 | Accepted | n,k=map(int,input().split())
d=set(input().split())
while True:
if len(set(str(n))&d) != 0:
n+=1
else:
print(n)
break
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s458292969 | p04045 | Accepted | n,k = map(int,input().split())
d = set(list(map(int,input().split())))
def solve(n):
digits = str(n)
for digit in digits:
if int(digit) in d:
return False
return True
while True:
if solve(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... |
s892259645 | p04045 | Accepted | N, K = map(int, input().split())
bl = set(input().split())
while True:
if len(set(str(N)) & bl) != 0:
N += 1
else:
print(N)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s425861130 | p04045 | Accepted | n, k = list(map(int, input().split()))
d = list(input().split())
ans = n
find = False
while find == False:
p = str(ans)
find = True
for i in range(len(p)):
if p[i] in d:
find = False
break
if find == False:
ans += 1
print(ans)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s074533691 | p04045 | Accepted | N, K = map(int, input().split())
D = list(input().split())
while True:
n = str(N)
for i in range(K):
f = 0
if D[i] in n:
N += 1
f = 1
break
if f == 0:
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... |
s704129368 | p04045 | Accepted | N, K = map(int, input().split())
unlike_list = set(map(str, input().split()))
def judge(num):
for i in str(num):
if i in unlike_list:
return False
return True
ans = False
while not ans:
if judge(N):
ans = True
else:
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... |
s220152830 | p04045 | Accepted | def main():
N, K = map(int, input().split())
A_list = list(map(str, input().split()))
use_list = ["0","1","2","3","4","5","6","7","8","9"]
list_A = list(set(use_list) - set(A_list))
#print("list_A", list_A)
for i in range(100000) :
ans = N + i
#print("ans", ans)
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... |
s227193801 | p04045 | Accepted | # N, Kの入力受付
N, K = map(int, input().split())
# Dの入力受付
D = set(input().split())
# 0-9とDの差集合作成、リスト化してEに代入
E = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - D
# Nに1ずつ足して条件に合う最初の数字を特定する
result = False
while result == False:
for i in str(N):
if not i in E:
N = N + 1
result = 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... |
s810874346 | p04045 | Accepted | n,k=map(int,input().split())
d=list(map(int,input().split()))
def f(x):
x=str(x)
x=list(x)
for i in x:
if int(i) in d:
return False
return True
ans=n
while f(n)==False:
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... |
s003836122 | p04045 | Accepted | n,k=map(int,input().split())
d=list(map(int,input().split()))
def f(x):
x=str(x)
x=list(x)
for i in x:
if int(i) in d:
return False
return True
ans=n
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... |
s060469086 | p04045 | Accepted | n, k= input().split()
l = list(map(int,input().split()))
checkNum=[i for i in range(11)]
def find(x):
while x!=checkNum[x]:
checkNum[x]=checkNum[checkNum[x]]
x=checkNum[x]
return x
for i in l:
checkNum[find(i)]=checkNum[find(i+1)]
fin=""
for i in range(len(n)):
first=int(n[i])
k=f... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s333887526 | p04045 | Accepted | # coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, h... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s457709051 | p04045 | Accepted | # coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, h... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s581451720 | p04045 | Accepted | n, k = map(int,input().split())
a = list(input().split())
for i in range(n, 100001):
flg = True
s = str(i)
for j in range(len(s)):
if s[j] in a:
flg = False
break
if flg:
break
print(i) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s178016770 | p04045 | Accepted | n, k = map(int, input().split())
dl = list(map(int, input().split()))
i = n
while True:
money = list(map(int, str(i)))
for m in money:
if dl.count(m) != 0:
break
else:
print(i)
break
i += 1
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s634706502 | p04045 | Accepted | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s520829394 | p04045 | Accepted | import sys
import numpy as np
from numba import njit, i4
read = sys.stdin.readline
if sys.argv[-1] == 'ONLINE_JUDGE':
from numba.pycc import CC
cc = CC('unko')
@cc.export('main', '(i4, i4, i4[:])')
def main(n, k, a):
for i in np.arange(n, 100000):
ok = 1
j = i
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s488036922 | p04045 | Accepted | import sys
import numpy as np
from numba import njit, i4
read = sys.stdin.readline
@njit((i4, i4, i4[:]), cache=True)
def main(n, k, a):
for i in np.arange(n, 100000):
ok = 1
j = i
while j:
m = j % 10
for l in a:
if m == l:
ok = 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... |
s264626736 | p04045 | Accepted | import sys
import numpy as np
read = sys.stdin.readline
def main(n, k, a):
for i in np.arange(n, 100000):
ok = True
for j in str(i):
ok &= j not in a
if ok:
print(i)
break
if __name__ == '__main__':
n, k = np.fromstring(read(), dtype=np.int32, sep=... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s340061597 | p04045 | Accepted | import sys
import numpy as np
read = sys.stdin.readline
def main(n, k, a):
for i in np.arange(n, 100000):
ok = True
j = i
while j:
ok &= j % 10 not in a
j //= 10
if ok:
print(i)
break
if __name__ == '__main__':
n, k = np.fromstr... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s352599230 | p04045 | Accepted | from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from bisect import bisect_left,bisect_right
from math import sqrt,gcd,ceil,floor,factorial
# from ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s449927326 | p04045 | Accepted | N,K = map(int,input().split())
D = list(map(int,input().split()))
E = []
for i in range(10):
if i not in D:
E.append(i)
E = sorted(E)
N = str(N)
ind = len(N)
for i in range(len(N)):
if int(N[i]) not in E:
ind = i
break
if ind==len(N):
print(N)
else:
flag = 0
x = ""
for 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... |
s447743562 | p04045 | Accepted | N, K = map(int, input().split())
l = list(map(str, input().split()))
for i in range (N, 100000):
k = str(i)
counter = 0
for j in range (0, K):
if k.find(l[j]) >= 0:
counter+=1
if counter == 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... |
s185478784 | p04045 | Accepted | N, K = map(int, input().split())
D = set(map(str, input().split()))
M = N
while (True):
if len(set(str(M)) & D) == 0:
break
M += 1
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... |
s842789638 | p04045 | Accepted | N, K = map(int,input().split())
D = set(input().split())
for k in range(N,10**9):
f = 1
for e in str(k):
if e in D:
f = 0
break
if f == 1:
print(k)
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... |
s301445106 | p04045 | Accepted | import sys
import numpy as np
read = sys.stdin.readline
def main(n, k, a):
for i in range(n, 100000):
s = np.array(list(map(int, str(i))), dtype=np.int64)
ok = True
for j in s:
ok &= j not in a
if ok:
print(i)
break
if __name__ == '__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... |
s783832224 | p04045 | Accepted | import itertools
n,k = map(int, input().split())
d = list(map(int, input().split()))
safe = [i for i in range(10) if i not in d]
n_l = list(map(int, list(str(n))))
if len(set(safe)&set(n_l)) == len(set(n_l)):
print(n)
exit()
for v in itertools.product(safe, repeat=len(str(n))):
if v[0] == 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... |
s271523429 | p04045 | Accepted | N, K, *D = map(int, open(0).read().split())
D = set(str(d) for d in D)
for i in range(N, 100_000):
if set(str(i)) & D:
continue
print(i)
break
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s996403373 | p04045 | Accepted | import sys
input = sys.stdin.readline
import math
def INT(): return int(input())
def MAPINT(): return map(int, input().split())
def LMAPINT(): return list(map(int, input().split()))
def STR(): return input()
def MAPSTR(): return map(str, input().split())
def LMAPSTR(): return list(map(str, input().split()))
f_inf = f... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s656500754 | p04045 | Accepted | #!/usr/bin/env python
# coding: utf-8
# In[21]:
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)):
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s487496822 | p04045 | Accepted | # coding:UTF-8
import sys
def resultSur97(x):
return x % (10 ** 9 + 7)
if __name__ == '__main__':
# ------ 入力 ------#
nk = list(map(int, input().split())) # スペース区切り連続数字
x = nk[1]
dList = list(map(int, input().split())) # スペース区切り連続数字
# ------ 処理 ------#
f = 0
n = nk[0]
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... |
s457525529 | p04045 | Accepted | import sys
from sys import exit
from collections import deque
from copy import deepcopy
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import redu... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s951496722 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
def f(n, x):
if n==0:
if x >= N:
print(x)
exit()
return
for i in range(10):
if i in D:
continue
f(n-1, x*10+i)
f(len(str(N)), 0)
ans = ""
for i in range(1, 10):
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... |
s117766184 | p04045 | Accepted | def iparse():
return list(map(int, input().split()))
n, k = iparse()
d = iparse()
for i in range(n, 5000000):
tmp = i
f = True
while tmp > 0:
x = tmp % 10
if x in d:
f = False
break
tmp //= 10
if f:
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... |
s558257243 | p04045 | Accepted | n, _ = map(int, input().split())
d = list(input().split())
def val(n):
for i in str(n):
if i in d:
return
print(n)
exit()
while True:
val(str(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... |
s216416166 | p04045 | Accepted | n,k = map(int,input().split())
if k == 0:
print(n)
exit()
dislike = list(input().split())
ans = n-1
flag = 1
while flag == 1:
ans+=1
flag = 0
for i in str(ans):
if i in dislike:
flag = 1
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... |
s693539875 | p04045 | Accepted | n,k = [int(x) for x in input().split()]
ds = {int(x) for x in input().split()}
ns = {0,1,2,3,4,5,6,7,8,9} -ds
#print(ds)
#print(ns-ds)
temp=0
d ={}
a=1
b = {}
m = len(str(n)) +1
over=False
while(a<=m and not over ):
c = []
d = 10**(a-1)
for v in ns:
if a>1:
for bv in b[a-1]:
t = v*d + bv
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s173840474 | p04045 | Accepted | from itertools import product
N, K = map(int, input().split())
D = list(map(int, input().split()))
canuse = {0,1,2,3,4,5,6,7,8,9} - set(D)
canuse = list(canuse)
ans = float("inf")
for d in range(1, 6):
for num in product(canuse, repeat=d):
number = ""
for m in num:
number += str(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... |
s968240137 | p04045 | Accepted | import itertools
def cal(N, target_num, keta):
answer = float('inf')
for p in itertools.product(target_num, repeat=keta):
temp = 0
for i, num in enumerate(p):
temp += num * 10**i
if temp >= N:
answer = min(answer, temp)
return answer
if __name_... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s284094619 | p04045 | Accepted | import itertools
N, K = map(int, input().split()) # N円の品物、K個の嫌いな数字
D = set(list(map(int, input().split()))) # 嫌いな数字のリスト
base = set(range(10))
target_num = base - D
keta = len(str(N))
answer = float('inf')
for p in itertools.product(target_num, repeat=keta):
temp = 0
for i, num in enumerate(p):
temp +... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s454544675 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
s = {'0','1','2','3','4','5','6','7','8','9'} - set(str(d))
ans = n
while (s >= set(str(n))) == False:
n += 1
if (s >= set(str(n))) == True:
ans = n
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... |
s841925737 | p04045 | Accepted | N,K=map(int,input().split())
D=list(map(int,input().split()))
while True:
S=str(N)
flag=True
for x in S:
if int(x) in D:
flag=False
if flag==True:
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... |
s421866810 | p04045 | Accepted | def main():
N, K = map(int, input().split())
D = list(input().split())
for i in range(N,100000):
a = str(i)
flag = True
for d in D:
if d in a:
flag = False
break
if flag:
print(i)
exit()
if __name__ =... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s736328705 | p04045 | Accepted | def is_bad_nums(j: int, d: []) -> bool:
while j:
if j % 10 in d:
return True
j //= 10
return False
def answer(n: int, k: int, d: []) -> int:
for i in range(n, 100000):
if is_bad_nums(i, d):
continue
return i
def main():
n, k = map(int, 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... |
s787609951 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
num = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
num = str(list(set(num) ^ set(D)))
ans = str(N)
clear = 0
while clear == 0:
for i in range(len(ans)):
if not ans[i] in num:
break
if i == len(ans) - 1:
clear += 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... |
s552017734 | p04045 | Accepted | N,K = map(int,input().split())
D = list(map(int,input().split()))
def ok(x):
while x:
if x % 10 in D:
return False
x //= 10
return True
for i in range(N,100000):
if ok(i):
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... |
s155874646 | p04045 | Accepted | def price(N,K):
Kn = input().split()
Flag = False
for i in range(N,10*N,1):
value = str(i)
for j in range(K):
if(Kn[j] not in value):
Flag = True
elif(Kn[j] in value):
Flag = False
break
if(Flag == 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... |
s066741178 | p04045 | Accepted | import sys
# sys.setrecursionlimit(100000)
def input():
return sys.stdin.readline().strip()
def input_int():
return int(input())
def input_int_list():
return [int(i) for i in input().split()]
def main():
n, k = input_int_list()
D = input_int_list()
# N < 10000のため、嫌いな数字にかかわらず、
# 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... |
s497041617 | p04045 | Accepted | import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(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... |
s040730281 | p04045 | Accepted | n, k = map(int, input().split())
D = set(input())
for i in range(n, 10**5):
if set(str(i)) & D == set():
print(i)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s888418522 | p04045 | Accepted | n, k, *D = map(int, open(0).read().split())
D = list({0,1,2,3,4,5,6,7,8,9} - set(D))
N = list(map(int, str(n)))
d0 = D[0]
def dfs(M, i, f):
if i == len(N):
print(*M, sep='')
exit()
if f:
dfs(M+[d0], i+1, 1)
for d in D:
if d == N[i]:
dfs(M+[d], i+1, 0)
eli... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s161124892 | p04045 | Accepted | n, k, *D = map(int, open(0).read().split())
D = list({0,1,2,3,4,5,6,7,8,9} - set(D))
N = list(map(int, str(n)))
def dfs(N, M, i, f):
if i == len(N):
print(*M, sep='')
exit()
if f:
dfs(N, M + [D[0]], i+1, 1)
for d in D:
if d == N[i]:
dfs(N, M+[d], i+1, 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... |
s467731653 | p04045 | Accepted | n, k = map(int, input().split())
ds = [d for d in input().split()]
while any(c in ds for c in str(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... |
s213863925 | p04045 | Accepted | import itertools
n,k=map(int,input().split())
d=list(input())
x=[]
ans=float('inf')
for i in range(10):
if str(i) not in d:
x.append(str(i))
for i in range(1,6):
for lst in itertools.product(x,repeat=i):
if int(''.join(lst))>=n:
ans=min(ans,int(''.join(lst)))
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... |
s797110808 | p04045 | Accepted | def check(n, D):
N = []
while n != 0:
N.append(n % 10)
n //= 10
for d in D:
if d in N:
return False
return True
if __name__ == '__main__':
n, k = [int(x) for x in input().split(' ')]
D = [int(x) for x in input().split(' ')]
res = n
while 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... |
s007743357 | p04045 | Accepted | n,k = map(int,input().split())
d = list(map(str,input().split()))
while True:
sn = str(n)
l = len(sn)
flag = True
for i in range(l):
if sn[i] in d:
flag = False
break
if flag:
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... |
s741518783 | p04045 | Accepted | n, k = map(int, input().split())
d = list(input().split())
while True:
flag2 = True
for si in str(n):
if si in d:
n += 1
flag2 = False
break
if flag2:
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... |
s937323049 | p04045 | Accepted | n, k = map(int, input().split())
d = list(input().split())
#n = 1000
flag = True
while flag:
flag2 = True
for si in str(n):
if si in d:
n += 1
flag2 = False
break
if flag2:
break
else:
flag = True
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... |
s119202129 | p04045 | Accepted | N,K=map(int,input().split())
*D,=input().split()
ok=1
while ok:
ans=list(str(N))
ok=0
for a in ans:
if a in D:
ok=1
N+=1
print(''.join(ans)) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s091111788 | p04045 | Accepted | n, k = map(int, input().split())
d = list(input().split())
num = [str(i) for i in range(10)]
for i in range(k):
num.remove(d[i])
import itertools, heapq
ans = []
heapq.heapify(ans)
for i in itertools.product(num, repeat=len(str(n))):
s = int(''.join(i))
if s >= n:
heapq.heappush(ans, 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... |
s143484331 | p04045 | Accepted | n, k = map(int, input().split())
d = list(input().split())
num = [str(i) for i in range(10)]
for i in range(k):
num.remove(d[i])
import itertools
ans = []
for i in itertools.product(num, repeat=len(str(n))):
s = int(''.join(i))
if s >= n:
ans.append(s)
if len(ans) == 0:
for i in it... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s489115036 | p04045 | Accepted | import sys
from itertools import product
def input(): return sys.stdin.readline().strip()
def main():
"""
itertools.productを使うと高速なようなので写経
参考:https://atcoder.jp/contests/abc042/submissions/16188969
"""
N, K = map(int, input().split())
D = set(map(int, input().split()))
ok = [i for i in range... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s714478346 | p04045 | Accepted | import sys
from bisect import bisect_left
def input(): return sys.stdin.readline().strip()
def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
while True:
check = True
for c in str(N):
if int(c) in D:
check = False
if check:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s708039280 | p04045 | Accepted | n, k = map(int, input().split())
D = list(input().split())
ans = str(n)
while not all([c not in D for c in ans]) and int(ans) >= n:
ans = str(int(ans) + 1)
print(ans) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s079266690 | p04045 | Accepted | n,k = map(int,input().split())
d = list(input().split())
flg = True
while flg:
flg = False
m = list(str(n))
for i in m:
if i in d:
flg = True
break
if flg:
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... |
s500324674 | p04045 | Accepted | N, K = [int(x) for x in input().split()]
dislikes = [False] * 10
dislike_nums = [int(x) for x in input().split()]
for x in dislike_nums:
dislikes[x] = True
for n in range(N, N * 10):
found = False
for x in str(n):
if dislikes[int(x)]:
found = True
break
if not found:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s408803162 | p04045 | Accepted | import sys
N,K=map(int,input().split())
D=list(map(int,input().split()))
while True:
for x in [int(n) for n in str(N)]:
if x in D:
break
else:
print(N)
sys.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... |
s542008746 | p04045 | Accepted | from sys import stdin
input = stdin.readline
N, K = map(int, input().split())
D = set(map(int, input().split()))
while True:
tmp = set(str(N))
b = True
for x in tmp:
if int(x) in D:
b = False
break
if b == True:
break
else:
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... |
s501707777 | p04045 | Accepted | def minN(N:int, usable:list, restrict=True):
usable.sort()
keta = False
if restrict:
for i in usable:
if i >= N:
return str(i)
# 桁が増える
return '1'+str(usable[0])
else:
return str(usable[0])
def rote(N:list, D:set, d:set):
ans = []
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... |
s541923154 | p04045 | Accepted | def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
numset = set(range(0,10))
d = numset.difference(D)
for n in range(N, pow(10, 6) + 10):
check = set(list(str(n)))
ngflag = False
for i in check:
if int(i) in D:
ngflag ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s344354914 | p04045 | Accepted | i3=lambda : map(int,input().split())
N,K=i3()
*D,=i3()
D=set(D)
for i in range(N,10**5):
ans=1
for s in str(i):
if int(s) in D:
ans=0
break
if ans : break
print(i) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s612182410 | p04045 | Accepted | n,k=map(int,input().split());a=set(input().split())
while True:
if not set(str(n))&a: 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... |
s931404256 | p04045 | Accepted | n,k = input().split()
hate = list(input().split())
exi = True
t = True
while True:
for c in hate:
t = True
if c in list(n):
t = False
break
if t:
print(n)
break
intN = int(n) + 1
n = str(intN) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s406184881 | p04045 | Accepted | n, k = map(int, input().split())
D = set(map(int, input().split()))
from itertools import count
for ans in count(n,1):
for c in str(ans):
if int(c) in D:
break
else:
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... |
s244673703 | p04045 | Accepted | def dfs(i,num_str):
global ans_list
if i==len(str(n)):
ans_list.append(int(num_str))
if len(num_list)==1:
ans_list.append(int(num_list[0]+num_str))
else:
if num_list[0]=='0':
ans_list.append(int(num_list[1]+num_str))
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... |
s579133323 | p04045 | Accepted | N,K = map(int,input().split())
D = set(map(int,input().split()))
while True:
for i in map(int,set(str(N))):
if i in D:
break
else:
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... |
s664422588 | p04045 | Accepted | n,k=map(int,input().split())
d = list(map(int,input().split()))
#print(d)
for i in range(n,10**5):
count=0
for j in range(k):
u = str(d[j])
if(str(i).count(u)==0):
count+=1
#print("count:"+str(count))
if(count==k):
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... |
s585810458 | p04045 | Accepted | n,k=map(int,input().split())
l=list(map(int,input().split()))
for v in range(n,10**5):
for c in str(v):
if int(c) in l:
break
else:
print(v)
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... |
s432708805 | p04045 | Accepted | N,K = input().split()
D =list(map(int,input().split()))
ans = []
a = int(N[0])
x = 0
b = 0
while b in D:
b += 1
c = 2
while c in D:
c += 1
y = 0
while a == int(N[x]) and x <= len(N)-1:
while a in D and a <= 9:
a += 1
if a == 10:
y = x
if 0 in D:
a += b
if 1 i... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s073831392 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
v = n
while True:
f = True
for t in list(str(v)):
if int(t) in d:
f = False
continue
if f:
print(v)
exit(0)
v+=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... |
s477813893 | p04045 | Accepted | import sys
input = sys.stdin.readline
def find_ok( x , Oks ):
for i in Oks:
if int(i) > int(x):
break
return i
def main():
n,k = map( int , input().split() )
Nos = set(map( int , input().split() ))
while(1):
x = str(n)
set_n= set()
for digit in x:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s173131870 | p04045 | Accepted | n,k=map(int,input().split())
d=list(map(int,input().split()))
x=list(range(1,100001))
y=[0]*100000
for i in range(100000):
s=str(i)
S=len(s)
for j in range(S):
if int(s[j]) in d:
y[i-1]=1
break
for i in range(100000):
if i>=n-1:
if y[i]==0:
print(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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.