submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s730201038 | p04045 | Accepted | n,k=map(int,input().split())
l=list(map(int,input().split()))
s=str(n)
flag=False
while flag==False:
flag=True
for j in l:
if s.count(str(j))!=0:
s=int(s)
s+=1
s=str(s)
flag=False
break
print(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... |
s409883657 | p04045 | Accepted | n,k=map(int,input().split())
d=list(map(int,input().split()))
suki =list({0,1,2,3,4,5,6,7,8,9} - set(d))
suki.sort()
result=[]
pay=0
def dfs(pos, pay):
if pay >= n:
result.append(pay)
return result
elif pos >= 5:
return '99999'
for i in suki:
dfs(pos+1, pay*10+i)
dfs(0, 0)
print(min(result... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s494597754 | p04045 | Accepted | def main():
n, k = list(map(int, input().split()))
D = set(input().split())
ans = n
while not set(list(str(ans))).isdisjoint(D):
ans += 1
print(ans)
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... |
s085492542 | p04045 | Accepted | n,k = map(int, input().split())
d = list(input().split())
while True:
c=0
for m in range(k):
if d[m] in str(n):
c+=1
if c==0:
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... |
s304812940 | p04045 | Accepted | n,k = map(int, input().split())
d = list(input().split())
while True:
c=0
for i in range(k):
if d[i] in str(n):
c+=1
if c==0:
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... |
s684740251 | p04045 | Accepted | def hantei(num,list):
score = 0
for i in range(len(list)):
if list[i] in str(num):
score = +1
return score
N,K = map(int,input().split())
dislike = list(map(str,input().split()))
while True:
if hantei(N,dislike) == 0:
break
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... |
s092697360 | p04045 | Accepted | from collections import Counter
def ok(n, D):
# Dに含まれる数字をnで使っていたらFalse
counter = Counter(str(n))
for d in D:
if counter[str(d)] > 0:
return False
return True
def main():
N, K = list(map(int, input().split(' ')))
D = list(map(int, input().split(' ')))
while not ok(N, D... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s268539149 | p04045 | Accepted | n, k = map(int, input().split())
d = set(input().split())
while set(list(str(n))) & d != set():
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... |
s203679398 | p04045 | Accepted | n,k=map(int,input().split())
D=set(input().split())
while set(list(str(n)))&D!=set():
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... |
s083146849 | p04045 | Accepted | import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue
import numpy as np
sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
ni = lambda: int(sys.s... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s080520147 | p04045 | Accepted | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque
def main():
n, k = map(int, readline().split())
d = {int(i) for i in readline().split()}
dq = deque()
dq.append(0)
cnd = []
while len(dq)>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... |
s749323477 | p04045 | Accepted | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque
def main():
n, k = map(int, readline().split())
d = {int(i) for i in readline().split()}
dq = deque()
cnd = []
for i in range(10):
if i in d:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s936422904 | p04045 | Accepted | n=int(input().split()[0])
a=set(input())
while a&set(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... |
s618316776 | p04045 | Accepted | n,_,*d=open(0).read().split()
n=int(n)
while 1:
if all(d not in str(n)for d in d):exit(print(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... |
s520972767 | p04045 | Accepted | n,_,*d=open(0).read().split()
n,d=int(n),set(d)
while 1:
if not d&set(str(n)):exit(print(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... |
s223695575 | p04045 | Accepted | n,k=input().split()
n=int(n)
d=set(input().split())
while 1:
if not d&set(str(n)):exit(print(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... |
s076676305 | p04045 | Accepted | n, k, *d = open(0).read().split()
n, d = int(n), set(d)
while True:
if not d & set(str(n)):
exit(print(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... |
s265472300 | p04045 | Accepted | n,k = map(int,input().split())
D = list(map(str,input().split()))
for i in range(n,10**7):
for j in str(i):
if j in D:
break
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s268825705 | p04045 | Accepted | n,k = map(int,input().split())
D = set(map(str,input().split()))
for i in range(n,10**7):
for j in str(i):
if j in D:
break
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s418437934 | p04045 | Accepted | N, K = map(int, input().split())
D = set(input().split())
tmp = set(['0','1','2','3','4','5','6','7','8','9'])
while len(D&set(str(N))) != 0:
N+=1
print(N)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s898813146 | p04045 | Accepted | N, K = map(int, input().split())
dl = list(map(str, input().split()))
curr_num = N
while True:
n_str = str(curr_num)
for d in dl:
if d in n_str:
curr_num += 1
break
else:
print(curr_num)
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... |
s242661368 | p04045 | Accepted | n,k=map(int, input().split())
d=set(input().split())
candidate_num=set(['0','1','2','3','4','5','6','7','8','9'])-d
while True:
if set(list(str(n)))<=candidate_num:
print(n)
exit()
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... |
s690488901 | p04045 | Accepted | N, K = map(int, input().split())
D = set(input().split())
tmp = set(['0','1','2','3','4','5','6','7','8','9'])
while len(D&set(str(N))) != 0:
N+=1
print(N) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s112490926 | p04045 | Accepted | def ret_num(num, val):
for i in num:
if i > val:
return i
def check(num, val):
while val > 0:
if val % 10 not in num:
return False
val//=10
return True
all_num=[0,1,2,3,4,5,6,7,8,9]
(val, dis)=[int(x) for x in input().split()]
dis_num=[int(x) for x in input().split()]
num=[]
for i in... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s052144905 | p04045 | Accepted | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s330457091 | p04045 | Accepted | n, k = map(int, input().split())
dd = list(map(int, input().split()))
frag = 1
for i in range(n, 10*n+1):
frag = 1
for d in dd:
if(str(d) in str(i)):
frag = 0
if(frag):
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... |
s554647540 | p04045 | Accepted | N,K = map(int,input().split())
D = list(input().split())
for i in range(N,10*N+1):
ans = True
for j in D:
if str(i).count(j) > 0:
ans = False
break
if ans == True:
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... |
s053126409 | p04045 | Accepted | class A:
def solve(self):
[a, b, c] = sorted([int(x) for x in input().split(" ")])
if a == 5 and b == 5 and c == 7:
print("YES")
else:
print("NO")
class B:
def solve(self):
[n, l] = [int(x) for x in input().split(" ")]
strings = []
for ... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s375629707 | p04045 | Accepted | from itertools import *
N,K = map(int,input().split())
D = list(map(int,input().split()))
num = []
for i in range(10):
if i not in D:
num.append(str(i))
ans = 10**18
for i in product(num,repeat=len(str(N))):
money = int(''.join(list(i)))
if N <= money :
ans = min(ans,money)
if ans == 10**18:
for i 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... |
s976378148 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
available = [i for i in range(10) if i not in D]
values = [0]
idx = 0
while True:
base = values[idx] * 10
for a in available:
n = base + a
if n >= N:
print(n)
quit()
values.append(n)
idx += 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... |
s947163039 | p04045 | Accepted | from itertools import product
n, k = input().split()
a = list(input().split())
l = set([str(i) for i in range(10)]).difference(a)
ni = int(n)
ans = int('99'+n)
for j in range(len(n), len(n)+2):
for i in product(l, repeat=j):
t = int(''.join(i))
if t >= ni:
ans = min(t, ans)
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... |
s436558870 | p04045 | Accepted | inf = 10**18
mod = 10**9+7
# a^n
def power(a,n,mod):
x = 1
while n:
if n & 1:
x *= a % mod
n >>= 1
a *= a % mod
return x % mod
n,k = map(int, input().split())
d = list(input().split())
ans = n
for i in range(n, n*10+1):
tmp = str(i)
ok = True
for c in tmp:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s936786148 | p04045 | Accepted | N,K = map(int,input().split())
D = set(input().split())
while len(set(str(N))&D)>0:
N+=1
print(N) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s261093003 | p04045 | Accepted | N,K = map(int,input().split())
D = list(input().split())
while True:
f = True
for s in str(N):
if s in D:
f = False
if f:
print(str(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... |
s301343254 | p04045 | Accepted | from collections import deque
n,k = map(int,input().split())
d = set(list(map(int,input().split())))
a = list({0,1,2,3,4,5,6,7,8,9} - d)
a.sort()
que = deque()
que.append(0)
while que:
ans = que.popleft()
if ans >= n:
print(ans)
exit()
for i in a:
que.append(ans*10 + i) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s917335300 | p04045 | Accepted | [n,k] = [int(i) for i in input().split()]
d = [int(i) for i in input().split()]
dic = {}
iter = 0
for i in range(10):
try:
if i != d[iter]:
dic[str(i)] = 1
else:
dic[str(i)] = 0
iter += 1
except:
dic[str(i)] = 1
pass
for i in range(n,10 ** 5):... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s911517750 | p04045 | Accepted |
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) 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... |
s680202127 | p04045 | Accepted |
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) 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... |
s953853675 | p04045 | Accepted | from itertools import*
p, _ = map(int, input().split())
nums = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - {int(i) for i in input().split()}
for i in count(p):
if {int(d) for d in str(i)} - nums == set():
print(i)
break
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s224116168 | p04045 | Accepted | N,K=map(int,input().split())
dset=set(map(int,input().split()))
def contain(n):
ns=list(str(n))
for c in ns:
if int(c) in dset:
return True
return False
for i in range(N,100000):
if not contain(i):
print(i)
break
else:
print(-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... |
s241084055 | p04045 | Accepted | n,k = map(int,input().split())
num_list = list(map(str,input().split()))
for i in range(n, 100005):
j = str(i)
flag = True
for k in range(len(j)):
if j[k] in num_list:
flag = False
if flag:
print(i)
exit()
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s115998423 | p04045 | Accepted | n,k = list(map(int, input().split()))#n = 払いたい金額 k = 嫌いな数字の個数(len(ln))
ln = list(map(int, input().split()))
pay = n
while True:
counter = 0
for i in str(pay):
if int(i) in ln:
counter +=1
if counter == 0:
print(pay)
break
else:
pay += 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... |
s234620601 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
canidates = [i for i in range(10) if i not in d]
ans = 10**9
def bfs(s):
global ans
if len(s) > len(str(n))+1:
return
if len(s) > 0:
res = int(s)
if res >= n and res < ans:
ans = res
for i in canid... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s552490231 | p04045 | Accepted | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,n*10+1):
s=str(i)
for p in d:
if p in s:
break
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s352300790 | p04045 | Accepted | fn=str
n,k=map(int, input().split())
ds=list(map(fn, input().split()))
while any(i in fn(n) for i in ds):
n+=1
print(fn(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... |
s618807335 | p04045 | Accepted | n,k=map(int, input().split())
ds=list(map(str, input().split()))
while any(i in str(n) for i in ds):
n+=1
print(str(n))
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s468633720 | p04045 | Accepted | N,K=map(int,input().split())
D=list(map(int,input().split()))
cond=True
while cond:
cond=False
for d in D:
if str(d) in str(N):
cond=True
break
N+=1
print(N-1) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s314978276 | p04045 | Accepted | N, K = map(int, input().split())
D = input().split()
i = 0
while i < 1:
i = 1
for n in str(N):
if n in D:
i = 0
N += 1
print(N - 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... |
s342777938 | p04045 | Accepted | n, k = input().split()
strN = list()
for num in n:
if num not in strN: strN.append(int(num))
sorted(strN)
N = int(n)
K = int(k)
nonFavDigits = input().split()
NonFavDigits = list()
for nFD in nonFavDigits:
NonFavDigits.append(int(nFD))
Digits = list(range(0,10))
for dig in range(0,10):
if dig in NonFavDigit... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s056751290 | p04045 | Accepted | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9+7
INF = fl... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s414138608 | p04045 | Accepted | import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s385573827 | p04045 | Accepted | N, K = map(int, input().split())
D = list(input().split())
for i in range(N, 10**18):
str_i = str(i)
flag = True
for d in D:
if d in str_i:
flag = False
break
if flag:
print(i)
break
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s708500930 | p04045 | Accepted | N,K = map(int,input().split())
D = list(input().split())
for i in range(N,100000):
flag = True
for n in str(i):
if n in D:
flag = False
break
if flag:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s932588782 | p04045 | Accepted | #!/usr/bin/env/ python3
import sys
"""
嫌いな数字がk個あり,それがd1~dk
N円のものを買うときの最低値
入力:
n k
d1-dk
"""
def contain(s, l):
for i in range(len(s)):
for j in l:
if s[i] == j:
return False
else:
return True
def main():
n, k = map(str, input().split())
kirai_num_list = 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... |
s154517394 | p04045 | Accepted | l = list(map(int, input().split()))
N = l[0]
K = l[1]
s = list(map(int, input().split()))
for value in range(100001):
result = 0
if value >= N:
flg = 1
for num in s:
if str(num) in str(value):
flg = 0
break
if flg == 1:
result = value
break
print(result) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s761791414 | p04045 | Accepted | K, N = map(int, input().split())
liked_num = [0,1,2,3,4,5,6,7,8,9]
disliked_num = list(map(int, input().split()))
for s in disliked_num:
liked_num.remove(s)
cnt = K
flag = 1
while flag:
not_n = 1
for i in str(cnt):
if not int(i) in liked_num:
not_n = 0
break
if not_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... |
s695599306 | p04045 | Accepted | n, k = map(int, input().split())
d = set(input().split())
for i in range(n, 10*n):
for c in str(i):
if c in d:
break
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s068397734 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
a = []
for i in range(10):
if i not in d:
a.append(i)
check = set(a)
for i in range(10**5):
if i >= n and set(map(int, list(str(i)))) <= set(a):
print(i)
exit()
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s959594916 | p04045 | Accepted | from collections import deque
n , k = map(int,input().split())
d = set(list(map(int,input().split())))
kouho =list({0,1,2,3,4,5,6,7,8,9} - d)
kouho.sort()
p = deque()
p.append(0)
while p:
now = p.popleft()
if now >= n:
print(now)
exit()
for i in kouho:
p.append(now*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... |
s561273728 | p04045 | Accepted | n, k = map(int,input().split())
d = set(input().split())
while True:
for c in str(n):
if c 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... |
s881413782 | p04045 | Accepted | n, k = map(int, input().split())
ds = [i for i in input().split()]
while True:
if len([n_ for n_ in str(n) if n_ in ds]) == 0:
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... |
s543148479 | p04045 | Accepted | N,K=map(int,input().split())
D=list(map(int,input().split()))
number=[i for i in range(10) if i not in D]
for i in range(N,N*10):
c=0
for j in str(i):
if int(j) not in number:
c=1
break
if c==0:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s722367128 | p04045 | Accepted | if __name__ == '__main__':
N, K = map(int, input().split())
D = list(input())
x = N
while True:
if all(y not in D for y in list(str(x))):
if x >= N:
print(x)
break
x += 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... |
s566913565 | p04045 | Accepted | N, K = map(int, input().split())
D = list(input())
y = N
while True:
if all(a not in D for a in list(str(y))):
if y >= N:
print(y)
break
y += 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... |
s642634058 | p04045 | Accepted | N, K = map(int, input().split())
D = list(input())
y = 1
while True:
if all(a not in D for a in list(str(y))):
if y >= N:
print(y)
break
y += 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... |
s713118313 | p04045 | Accepted | N,K = map(int,(input().split()))
D = list(map(int,(input().split())))
for i in range(N,100000):
for j in D:
if str(j) in str(i):
break
else:
print(i)
break | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s743614606 | p04045 | Accepted | N,K = map(int,input().split())
D = list(input().split())
for x in range(N,10**6):
x = str(x)
judge = 1
for xi in x:
if(xi in D):
judge = 0
if(judge == 1):
ans = x
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... |
s349838005 | p04045 | Accepted | import numpy as np
n, k = map(int, input().split())
hate = list(map(int, input().split()))
while True:
for c in str(n):
if int(c) in hate:
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... |
s059841239 | p04045 | Accepted | N,K=map(int,input().split())
D = list(input().split())
res = N
while(True):
if(set(str(res)).isdisjoint(set(D))):
print(res)
break
else:
int(res)
res+=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... |
s243162023 | p04045 | Accepted | n, k = map(int, input().split())
d = [i for i in range(10)]
[d.remove(int(x)) for x in input().split()]
n_len = len(str(n))
def rec_define_digit(s):
v = int(s)
# print(s)
if v >= n:
return v
ans = 999999
if len(s) >= n_len + 2:
return ans
for i in d:
ans = min(rec_define... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s876876407 | p04045 | Accepted | import itertools
n, k = map(int, input().split())
d = [i for i in range(10)]
[d.remove(int(x)) for x in input().split()]
n_len = len(str(n))
ans = -1
for x in itertools.product(d, repeat=n_len):
v = int("".join([str(i) for i in list(x)]))
# print(v)
if v >= n:
if ans < 0 or ans > v:
an... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s282924714 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
while 1:
flag = True
for i in range(K):
if str(D[i]) in str(N):
flag = False
break
if flag:
print(N)
exit()
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... |
s653635268 | p04045 | Accepted | import numpy as np
n, k = map(int, input().split())
hate = list(map(int, input().split()))
while True:
for c in str(n):
if int(c) in hate:
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... |
s206023492 | p04045 | Accepted | n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(n,10*n+1):
m =list(map(int,str(i)))
no = 0
for j in range(len(m)):
if m[j] in a:
no = 1
break
if no == 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... |
s392511263 | p04045 | Accepted | import sys
sys.setrecursionlimit(500000)
n,k = map(int,input().split())
D = list(map(int,input().split()))
ans = []
def dfs(p:str):
if int(p)>=n:
ans.append(int(p))
return
if len(p)>len(str(n))+1:
return
for i in range(10):
if not i in D:
dfs(p+str(i))
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... |
s613173070 | p04045 | Accepted | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1
def main():
N,K=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... |
s121366656 | p04045 | Accepted | n,k = map(int,input().split()) #入力
a = list(map(int,input().split())) #使用不可の数字
b = {0,1,2,3,4,5,6,7,8,9}-set(a) #使用可能な数字の集合
while set([int(i) for i in list(str(n))])-b !=set() : # 使用可能な数字のみでなければ
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... |
s292707444 | p04045 | Accepted | import copy
n,k = map(int,input().split())
d = input().split()
nd = list(map(str,range(10)))
for i in d:
nd.remove(i)
l = len(str(n))
if "0" in nd:
a1 = 1
else:
a1 = 0
alist = nd[a1:]
for _ in range(l-1):
tlist = []
for i in alist:
for j in nd:
tlist.append(i+j)
alist = copy.copy(tlist)
alist.appe... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s274321094 | p04045 | Accepted | n,k = map(int,input().split())
d = input().replace(" ","")
for i in range(n,10**9):
check = True
for j in str(i):
if j in d:
check = False
break
if check:
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... |
s741340503 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
lis = []
for i in range(10):
if not i in d:
lis.append(i)
inf = 1001001001
ans = inf
def dfs(s, n):
if len(s) >= len(str(n)) + 2:
return
if len(s) > 0 and int(s) >= n:
global ans
ans = min(ans, int(s))
e... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s051030271 | p04045 | Accepted | N, K = map(int,input().split())
D = set(map(str,input().split()))
res = N
while 1:
flg = 0
for char in str(res):
if char in D:
flg = 1
if flg == 1:
res += 1
continue
break
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... |
s993219578 | p04045 | Accepted | n,k = map(int,input().split())
d = input().split()
while True:
s = str(n)
f = 1
for i in range(len(s)):
if s[i] in d:
f = 0
else:
pass
if f:
print(s)
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... |
s208200556 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(str, input().split()))
while (1):
c = [x for x in str(n)]
ok = 1
for x in c:
if x in d:
ok = 0
break
if ok == 1:
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... |
s492254110 | p04045 | Accepted |
N,K=map(int,input().split())
D=input().split()
n=N
while 1:
flg=True
for i in range(K):
if D[i] in list(str(n)):
flg=False
if flg:
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... |
s269984181 | p04045 | Accepted | n, k = map(int, input().split())
dislike = list(map(int, input().split()))
for i in range(n,10**18):
a = str(i)
# print(a)
flag = True
for j in range(len(a)):
# print(a[j])
for k in dislike:
# print(k)
if int(a[j]) == k:
flag = False
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s331467290 | p04045 | Accepted | n,k=map(int,input().split())
d=set(input().split())
while True:
for c in str(n):
if c in d:
n+=1
break
else:
print(n)
exit() | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s849023036 | p04045 | Accepted | import collections
import numpy as np
import sys
sys.setrecursionlimit(10000000)
import copy
#N=int(input())
N,K=map(int,input().split())
D=set(input())
while len(set(str(N))&D)>0:
N+=1
print(N)
| 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s782447437 | p04045 | Accepted | def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
pay = N
while True:
if any(c in D for c in map(int, str(pay))):
pay += 1
continue
print(pay)
return
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... |
s129021065 | p04045 | Accepted | import collections
import numpy as np
import sys
sys.setrecursionlimit(10000000)
import copy
#N=int(input())
N,K=map(int,input().split())
D=list(map(int,input().split()))
for i in range(N,100000):
t=set(map(int,list(str(i))))
temp=D+list(t)
temp2=set(temp)
if len(temp)==len(temp2):
#print(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... |
s494921490 | p04045 | Accepted | def main():
import sys
sys.setrecursionlimit(10 ** 7)
N, K = map(int, input().split())
D = set(map(int, input().split()))
digits = {x for x in range(10)}
digits -= D
# print(digits)
digits = sorted(digits)
def dfs(pay):
if pay >= N:
return pay
np = pay... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s594725328 | p04045 | Accepted | n,l = map(int,input().split())
num = set(map(int,input().split()))
ans=0
for i in range(n,10*n):
for j in range(len(str(i))):
if int(str(i)[j]) in num:
if j==0:
i = (int(str(i)[0])+1)*(10**(len(str(i))-1))
break
if j ==len(str(i))-1:
ans=i
if ans!=0:
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... |
s937293538 | p04045 | Accepted | from itertools import product
n, k = list(map(int, input().split()))
dl = list(map(int, input().split()))
target = []
for i in range(10):
if i not in dl:
target.append(i)
# print(target)
ansl = []
for R in range(1, 6):
for bit in product(target, repeat=R):
t = 0
for i, b in enumerate(bit... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s776746180 | p04045 | Accepted | N, K = map(int, input().split())
D = list(map(int, input().split()))
digitlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for d in D:
digitlist.remove(d)
Keta = len(str(N))
Ans = ''
def clear(X):
if len(X) == Keta:
if int(X) >= N:
print(X)
exit()
else:
for i in digitlist:
... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s372164826 | p04045 | Accepted | #!/usr/bin/env python3
from collections import deque
N, K = map(int, input().split())
D = list(map(int, input().split()))
init = [str(i) for i in range(10) if i not in D and i != 0]
use = [str(i) for i in range(10) if i not in D]
q = deque(init)
ans = []
while q:
num = q.pop()
if int(num) >= N:
ans.app... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s163162464 | p04045 | Accepted | n, k = map(int, input().split())
d = list(map(int, input().split()))
num = n
while True:
is_match = True
for c in str(num):
if int(c) in d:
is_match = False
break
if is_match:
break
num += 1
print(num) | 1000 8
1 3 4 5 6 7 8 9
| 2000
| <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
s444940003 | p04045 | Accepted | n,k = map(int,input().split())
d = list(map(str, input().split()))
while True:
if sum([i in d for i in list(str(n))]) == 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... |
s698815043 | p04045 | Accepted | n,k=map(int,input().split())
d=list(input().split())
flag=0
m=n
while (flag==0):
str_m=list(str(m))
for j in d:
if(j in str_m):
m+=1
flag=2
break
if(flag==2):
flag=0
continue
else:
flag=1
print(int(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... |
s892758350 | p04045 | Accepted | n, k = list(map(int, input().split()))
ds = list(map(str, input().split()))
while(1):
n_str = list(str(n))
if sum([i in ds for i in n_str]) == 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... |
s966298136 | p04045 | Accepted | K, N = map(int, input().split())
D = list(map(int, input().split()))
D.sort()
flag = False
while True:
K_str = str(K)
for i in range(len(K_str)):
for j in range(len(D)):
if K_str[len(K_str)-1-i]==str(D[j]):
flag=False
break
if j==len(D)-1:
flag = True
if not 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... |
s281157479 | p04045 | Accepted | import sys
import numpy as np
input=sys.stdin.readline
n,k=map(int,input().split())
d=list(map(int,input().split()))
res=[]
for i in range(10):
if i not in d:
res.append(i)
ans=0
ansmax=0
ansmin=0
n_s=str(n)
l=len(n_s)
M=max(res)
for i in range(l):
ansmax+=M*10**(l-i-1)
if n>ansmax:
if res[0]!=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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.