s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s741518783 | p04045 | u038408819 | 1599455773 | Python | Python (3.8.2) | py | Accepted | 60 | 9152 | 241 | 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) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,817 |
s937323049 | p04045 | u038408819 | 1599455676 | Python | Python (3.8.2) | py | Accepted | 62 | 9092 | 295 | 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)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,818 |
s091111788 | p04045 | u038408819 | 1599453443 | Python | Python (3.8.2) | py | Accepted | 31 | 9248 | 553 | 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)
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,819 |
s143484331 | p04045 | u038408819 | 1599452645 | Python | Python (3.8.2) | py | Accepted | 29 | 9204 | 487 | 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... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,820 |
s489115036 | p04045 | u107639613 | 1599449443 | Python | PyPy3 (7.3.0) | py | Accepted | 67 | 73252 | 743 | 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... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,821 |
s714478346 | p04045 | u107639613 | 1599448267 | Python | PyPy3 (7.3.0) | py | Accepted | 83 | 73480 | 413 | 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:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,822 |
s079266690 | p04045 | u357751375 | 1599428000 | Python | Python (3.8.2) | py | Accepted | 76 | 9032 | 227 | 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) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,823 |
s500324674 | p04045 | u892797057 | 1599363140 | Python | PyPy3 (7.3.0) | py | Accepted | 75 | 73616 | 339 | 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:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,824 |
s542008746 | p04045 | u304612256 | 1599329332 | Python | Python (3.8.2) | py | Accepted | 95 | 9176 | 311 | 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) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,825 |
s501707777 | p04045 | u125545880 | 1599312875 | Python | Python (3.8.2) | py | Accepted | 26 | 9252 | 1,014 | 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 ... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,826 |
s541923154 | p04045 | u125545880 | 1599280204 | Python | Python (3.8.2) | py | Accepted | 86 | 9144 | 442 | 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 ... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,827 |
s344354914 | p04045 | u623814058 | 1599275396 | Python | Python (3.8.2) | py | Accepted | 64 | 8928 | 210 | 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) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,828 |
s612182410 | p04045 | u014333473 | 1599256580 | Python | Python (3.8.2) | py | Accepted | 66 | 9164 | 109 | n,k=map(int,input().split());a=set(input().split())
while True:
if not set(str(n))&a: print(n);break
n+=1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,829 |
s406184881 | p04045 | u074220993 | 1599083573 | Python | Python (3.8.2) | py | Accepted | 59 | 9112 | 226 | 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 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,830 |
s244673703 | p04045 | u589969467 | 1599069848 | Python | Python (3.8.2) | py | Accepted | 31 | 9384 | 777 | 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:
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,831 |
s579133323 | p04045 | u201928947 | 1598941221 | Python | PyPy3 (7.3.0) | py | Accepted | 96 | 73284 | 201 | 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 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,832 |
s585810458 | p04045 | u909716307 | 1598915753 | Python | Python (3.8.2) | py | Accepted | 64 | 9100 | 192 | 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()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,833 |
s432708805 | p04045 | u794448346 | 1598902229 | Python | Python (3.8.2) | py | Accepted | 28 | 9176 | 977 | 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... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,834 |
s773593542 | p04045 | u370721525 | 1598692972 | Python | Python (3.8.2) | py | Accepted | 82 | 9084 | 257 | N, K = map(int, input().split())
D = list(map(int, input().split()))
s = set(D)
for i in range(N, 10**6+1):
l = [j for j in str(i)]
flag = True
for n in l:
if int(n) in s:
flag = False
break
if flag:
ans = i
break
print(ans) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,835 |
s778118972 | p04045 | u970899068 | 1598652063 | Python | PyPy3 (7.3.0) | py | Accepted | 100 | 73752 | 315 | import sys
input = sys.stdin.readline
from collections import defaultdict
n,k= map(int, input().split())
d= list(map(int, input().split()))
d=set(d)
for i in range(n,pow(10,5)):
a=set()
v=str(i)
for j in range(len(v)):
a.add(int(v[j]))
if a.isdisjoint(d):
print(i)
exit() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,836 |
s462150082 | p04045 | u439881679 | 1598632663 | Python | Python (3.8.2) | py | Accepted | 67 | 9332 | 498 | # bsdk idhar kya dekhne ko aaya hai, khud kr!!!
# import math
# from itertools import *
# import random
# import calendar
import datetime
# import webbrowser
# f = open("input.txt", 'r')
# g = open("output.txt", 'w')
# n, m = map(int, f.readline().split())
n, k = map(int, input().split())
dislike = list(map(int, inpu... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,837 |
s583915685 | p04045 | u205042576 | 1598500400 | Python | Python (3.8.2) | py | Accepted | 77 | 9036 | 425 | import sys
def check(pay, like):
str_pay = str(pay)
like = ''.join(like)
for p in str_pay:
for lk in like:
if p == lk:
return False
return True
N, K = map(int, input().split())
D = []
D = list(map(int, input().split()))
str_D = []
for s in D:
str_D.append(st... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,838 |
s775211917 | p04045 | u164776089 | 1598495990 | Python | Python (3.8.2) | py | Accepted | 50 | 8984 | 215 | n, k = list(map(int,input().split()))
a = list(map(str,input().split()))
while True:
for j in str(n):
if j in a:
break
else:
break
n += 1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,839 |
s818713736 | p04045 | u739843002 | 1598453209 | Python | Python (3.8.2) | py | Accepted | 29 | 9656 | 471 | import itertools
def main():
N, K = [int(n) for n in input().split(" ")]
D = [1] * 10
for d in input().split(" "):
D[int(d)] = 0
L = [str(i) for i, v in enumerate(D) if v == 1]
digit = len(str(N))
cand = []
for n in list(itertools.product(L, repeat=digit)):
p = int("".join(list(n)))
if p >= N:
cand.ap... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,840 |
s328330624 | p04045 | u120651703 | 1598414970 | Python | Python (3.8.2) | py | Accepted | 75 | 9048 | 183 | N, K = [int(x) for x in input().split()]
D = input().split()
for payment in range(N, 10*N+1):
if all(char not in D for char in str(payment)):
print(payment)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,841 |
s125953278 | p04045 | u668271522 | 1598393213 | Python | Python (3.8.2) | py | Accepted | 66 | 9116 | 187 | N, K = map(int, input().split())
S = set(input().split())
while True:
L = list(str(N))
for i in L:
if i in S:
break
else:
break
N += 1
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,842 |
s864121596 | p04045 | u519339498 | 1598367422 | Python | Python (3.8.2) | py | Accepted | 58 | 9128 | 412 | '''
Created on 2020/08/25
@author: harurun
'''
def main():
import sys
pin=sys.stdin.readline
pout=sys.stdout.write
perr=sys.stderr.write
N,K=map(int,pin().split())
D=list(map(int,pin().split()))
# l=[0,1,2,3,4,5,6,7,8,9]
# for i in D:
# l.remove(i)
j=N
while True:
for k in str(j):
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,843 |
s695925969 | p04045 | u062691227 | 1598248860 | Python | PyPy3 (7.3.0) | py | Accepted | 60 | 73404 | 400 | N,K,*dd = map(int, open(0).read().split())
valid = [1] * 10
for d in dd:
valid[d] = 0
digits = [i for i,v in enumerate(valid) if v]
num_digit = len(str(N))
from itertools import product
from sys import exit
for ans_digit in [num_digit, num_digit+1]:
for x in product(digits, repeat=ans_digit):
x = int(... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,844 |
s482361067 | p04045 | u185948224 | 1598228693 | Python | Python (3.8.2) | py | Accepted | 26 | 9208 | 777 | from itertools import combinations_with_replacement
n, k = map(int, input().split())
d = [int(x) for x in input().split()]
dd = set(list(range(10))) - set(d)
x = str(n)
lst = []
dd = list(dd)
dd.sort()
sel = []
for i in dd:
if int(x[0]) <= i and len(sel) < 3: sel.append(i*10**(len(x)-1))
if len(sel) < 2:
if le... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,845 |
s464200110 | p04045 | u653837719 | 1598208695 | Python | PyPy3 (7.3.0) | py | Accepted | 81 | 73540 | 222 | n, k = map(int, input().split())
d = set(input().split())
while True:
s = str(n)
flag = True
for c in s:
if c in d:
flag = False
if flag:
print(n)
break
n += 1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,846 |
s544982661 | p04045 | u969708690 | 1598193678 | Python | Python (3.8.2) | py | Accepted | 88 | 9104 | 393 | import sys
import math
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT() : return int(input())
def MAP() : return map(int,input().split())
def LIST() : return list(MAP())
def NIJIGEN(H): return [list(input()) for i in range(H)]
N,K=MAP()
L=list(input().split())
L=set(L)
for... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,847 |
s937943882 | p04045 | u228232845 | 1598137939 | Python | Python (3.8.2) | py | Accepted | 81 | 9212 | 588 | # 24
import sys
def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input(... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,848 |
s295336532 | p04045 | u787059958 | 1598136270 | Python | Python (3.8.2) | py | Accepted | 87 | 9176 | 419 | N, K = map(int, input().split())
D = list(map(int, input().split()))
can_use = []
for i in range(10):
if (i in D):
continue
else:
can_use.append(i)
while True:
str_N = str(N)
flag = True
for i in range(len(str_N)):
if int(str_N[i]) in D:
N += 1
flag... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,849 |
s410851690 | p04045 | u955248595 | 1598084791 | Python | Python (3.8.2) | py | Accepted | 54 | 9068 | 249 | N,K = (int(T) for T in input().split())
D = input().split()
for TN in range(N,100000):
StrN = str(TN)
Flag = True
for TS in StrN:
if TS in D:
Flag = False
break
if Flag:
print(TN)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,850 |
s792411000 | p04045 | u779805689 | 1598043022 | Python | PyPy3 (7.3.0) | py | Accepted | 84 | 73348 | 91 | N,K=map(int,input().split())
D=set(input().split())
while set(str(N))&D:
N+=1
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,851 |
s233228873 | p04045 | u867826040 | 1597978589 | Python | Python (3.8.2) | py | Accepted | 49 | 9180 | 212 | n,k = map(int,input().split())
d = list(map(int,input().split()))
while(True):
x = n
while(x):
if x%10 in d:
break
x//=10
else:
print(n)
quit(0)
n += 1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,852 |
s459095189 | p04045 | u070201429 | 1597887506 | Python | PyPy3 (7.3.0) | py | Accepted | 73 | 68212 | 231 | n, k = map(int, input().split())
d = list(input().split())
flag = True
while True:
strn = str(n)
for i in d:
if i in strn:
n += 1
break
else:
flag = False
break
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,853 |
s253487204 | p04045 | u813387707 | 1597867586 | Python | Python (3.8.2) | py | Accepted | 83 | 9080 | 165 | n, k = [int(x) for x in input().split()]
d_set = set(input().split())
while True:
if len(set(str(n)).intersection(d_set)) == 0:
break
n += 1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,854 |
s963689222 | p04045 | u423966555 | 1597859374 | Python | Python (3.8.2) | py | Accepted | 68 | 9164 | 143 | N, K = map(int, input().split())
D = set(input().split())
for i in range(N, 10**5):
if not set(str(i)) & D:
print(i)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,855 |
s050836967 | p04045 | u070423038 | 1597813600 | Python | PyPy3 (7.3.0) | py | Accepted | 63 | 61964 | 534 | kingaku, n = input().split()
no_num = input().split()
ok_num = [str(i) for i in range(10) if not str(i) in no_num]
result = []
for i in kingaku:
for j in ok_num:
if i == j:
result.append(j)
break
elif i < j:
result.append(j)
print("".join(result).lju... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,856 |
s907165552 | p04045 | u070423038 | 1597813464 | Python | Python (3.8.2) | py | Accepted | 27 | 9044 | 534 | kingaku, n = input().split()
no_num = input().split()
ok_num = [str(i) for i in range(10) if not str(i) in no_num]
result = []
for i in kingaku:
for j in ok_num:
if i == j:
result.append(j)
break
elif i < j:
result.append(j)
print("".join(result).lju... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,857 |
s093168837 | p04045 | u070423038 | 1597813439 | Python | Python (3.8.2) | py | Accepted | 29 | 9160 | 534 | kingaku, n = input().split()
no_num = input().split()
ok_num = [str(i) for i in range(10) if not str(i) in no_num]
result = []
for i in kingaku:
for j in ok_num:
if i == j:
result.append(j)
break
elif i < j:
result.append(j)
print("".join(result).lju... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,858 |
s839401567 | p04045 | u070423038 | 1597811441 | Python | Python (3.8.2) | py | Accepted | 26 | 9168 | 657 | kingaku, n = input().split()
no_num = input().split()
ok_num = []
result = []
for i in range(10):
if not str(i) in no_num:
ok_num.append(str(i))
set_flg = False
for i in kingaku:
set_flg = True
for j in ok_num:
if i == j:
set_flg = False
result.append(j)
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,859 |
s109710417 | p04045 | u070423038 | 1597810892 | Python | Python (3.8.2) | py | Accepted | 29 | 9108 | 888 | kingaku, n = input().split()
no_num = input().split()
result = []
ok_num = []
kuriage_num = [-1, 0]
def kuriage(l):
for i in ok_num:
if result[l] < i:
kuriage_num = [l, i]
return
if l <= 0:
return
return kuriage(l-1)
#使える数字のリストを作成
for i in range(10):
if not str(... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,860 |
s315300178 | p04045 | u325956328 | 1597761520 | Python | Python (3.8.2) | py | Accepted | 90 | 9136 | 330 | N, K = map(int, input().split())
D = list(map(int, input().split()))
d = set()
for i in range(K):
d.add(str(D[i]))
# print(d)
for i in range(N, 100000):
flag = True
s = str(i)
li = list(s)
for nowletter in li:
if nowletter in d:
flag = False
if flag:
print(i)
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,861 |
s675452240 | p04045 | u325956328 | 1597761378 | Python | Python (3.8.2) | py | Accepted | 97 | 9184 | 258 | N, K = map(int, input().split())
D = list(map(int, input().split()))
d = set()
for i in range(K):
d.add(str(D[i]))
for i in range(N, 100000):
s = str(i)
li = list(s)
nowset = set(li)
if not nowset & d:
print(i)
exit()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,862 |
s437254142 | p04045 | u650932312 | 1597502279 | Python | Python (3.8.2) | py | Accepted | 26 | 9192 | 885 | N, K = input().split()
D = set(map(int,input().split()))
C = list({0,1,2,3,4,5,6,7,8,9}-D)
C.sort()
num = len(N)
def minimum(x,ans):
ans += str(min(C))*x
return ans
ans = ''
if C[-1]<int(N[0]):
C_0 = list(set(C)-{0})
ans += str(min(C_0))
ans = minimum(num,ans)
print(ans)
exit()
points = ... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,863 |
s094472520 | p04045 | u193264896 | 1597496836 | Python | Python (3.8.2) | py | Accepted | 60 | 9120 | 365 | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
N, K = map(int, input().split())
D = set(input().split())
for I in range(N,10**6):
if set(str(I)).isdisjoint(D):
print(I)
b... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,864 |
s800173446 | p04045 | u966695319 | 1597460651 | Python | Python (3.8.2) | py | Accepted | 80 | 11756 | 659 | from collections import deque
N, K = map(int, input().split())
nums = list(map(str, input().split()))
can_use_nums = set([str(i) for i in range(10)])
for num in nums:
can_use_nums.remove(num)
# print(can_use_nums)
queue = deque([[num] for num in can_use_nums if num != '0'])
# print(queue)
min_num = float('inf')
wh... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,865 |
s759659495 | p04045 | u289288647 | 1597377198 | Python | Python (3.8.2) | py | Accepted | 76 | 9064 | 254 | import sys
n, k = map(int, input().split())
d = set(input().split())
for i in range(n, n*10):
a = set(str(i))
for l, m in enumerate(a):
if m in d:
break
elif l == len(a)-1:
print(i)
sys.exit()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,866 |
s532066095 | p04045 | u353895424 | 1597110286 | Python | Python (3.8.2) | py | Accepted | 69 | 9168 | 260 | n, k = map(int, input().split())
D = list(map(str, input().split()))
money = n
ok = True
while True:
for d in D:
if d in str(money):
ok = False
break
if ok:
print(money)
break
money += 1
ok = True | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,867 |
s399351609 | p04045 | u353895424 | 1597110124 | Python | PyPy3 (7.3.0) | py | Accepted | 76 | 73576 | 260 | n, k = map(int, input().split())
D = list(map(str, input().split()))
money = n
ok = True
while True:
for d in D:
if d in str(money):
ok = False
break
if ok:
print(money)
break
money += 1
ok = True | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,868 |
s311021426 | p04045 | u197457087 | 1597108930 | Python | Python (3.8.2) | py | Accepted | 88 | 9188 | 380 | N,K = map(int,input().split())
A = set(map(int,input().split()))
#A = set(A)
ok = []
for i in range(10):
if i not in A:
ok.append(i)
#print(ok)
while True:
nstr = str(N)
nstr = list(nstr)
#print(nstr)
Flag = True
for x in nstr:
x = int(x)
if x in A:
Flag = False
break
#print(Flag)
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,869 |
s922438929 | p04045 | u745514010 | 1597108502 | Python | Python (3.8.2) | py | Accepted | 94 | 9112 | 217 | n, k = map(int, input().split())
dlst = list(map(int, input().split()))
ans = n
while 1:
for num in dlst:
if str(num) in str(ans):
break
else:
print(ans)
exit()
ans += 1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,870 |
s073321785 | p04045 | u453055089 | 1597105113 | Python | Python (3.8.2) | py | Accepted | 43 | 9120 | 310 | n, k = map(int, input().split())
d = set(map(int, input().split()))
ok = set(range(10))
ans = 0
for i in range(n, 100000):
ans = i
flag = False
while i != 0:
if i % 10 in d:
flag = True
break
i = i // 10
if not flag:
print(ans)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,871 |
s023089751 | p04045 | u401686269 | 1597085693 | Python | Python (3.8.2) | py | Accepted | 73 | 9088 | 143 | N,K=map(int,input().split())
D=set(input().split())
for i in range(N,N+10**6+5):
if not set(str(i)).intersection(D):
print(i)
exit() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,872 |
s533710138 | p04045 | u093041722 | 1597000181 | Python | Python (3.8.2) | py | Accepted | 30 | 9240 | 452 | N,K,*D = map(int, open(0).read().split())
Ds = set(D)
item = set([0,1,2,3,4,5,6,7,8,9]) - Ds
strs = set(str(x) for x in item)
for i in range(N,10000):
s = set(str(i))
if s.issubset(strs):
print(i)
break
else:
il = list(item)
il.sort()
if il[0] == 0:
ans = [str(il[1])] + ([str... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,873 |
s604196490 | p04045 | u074220993 | 1596996374 | Python | Python (3.8.2) | py | Accepted | 32 | 9100 | 498 | N, L = map(int, input().split())
S = {int(x) for x in input().split()}
flag = False
while 1:
if N%10 in S:
N += 1
continue
if int((N%100-N%10)/10) in S and N >= 10:
N += 1
continue
if int((N%1000-N%100)/100) in S and N >= 100:
N += 1
continue
if int((N%100... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,874 |
s400881817 | p04045 | u074220993 | 1596995338 | Python | Python (3.8.2) | py | Accepted | 38 | 9116 | 516 | N, L = map(int, input().split())
S = {int(x) for x in input().split()}
flag = False
while flag == False:
if N%10 in S:
N += 1
continue
if int((N%100-N%10)/10) in S and N >= 10:
N += 1
continue
if int((N%1000-N%100)/100) in S and N >= 100:
N += 1
continue
i... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,875 |
s984933742 | p04045 | u894623942 | 1596760636 | Python | Python (3.8.2) | py | Accepted | 70 | 8976 | 155 | n,k = map(int ,input().split())
d = set(input().split())
while True:
if not set(str(n)) & d:
print(n)
break
else:
n = n+1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,876 |
s331204546 | p04045 | u844813573 | 1596510828 | Python | Python (3.8.2) | py | Accepted | 67 | 9100 | 162 | n, k = map(int, input().split())
d = set(input().split())
while True:
if not set(str(n)) & d:
print(n)
break
else:
n += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,877 |
s784124201 | p04045 | u745514010 | 1596261881 | Python | Python (3.8.2) | py | Accepted | 78 | 9028 | 189 | n, k = map(int, input().split())
dlst = list(input().split())
while 1:
for num in dlst:
if num in str(n):
break
else:
print(n)
break
n += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,878 |
s346966338 | p04045 | u633923594 | 1596250543 | Python | Python (3.8.2) | py | Accepted | 78 | 9140 | 258 | def main():
n, k = input().split()
a=set(input().split())
while True:
n1=set(n)
if n1 & a == set():
print(n)
break
else:
n=int(n)
n+=1
n=str(n)
if __name__=="__main__":
main()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,879 |
s473576048 | p04045 | u188827677 | 1596200237 | Python | Python (3.8.2) | py | Accepted | 32 | 9064 | 332 | from itertools import product
n,k = map(int, input().split())
d = list(map(int, input().split()))
nums = []
for i in range(10):
if i not in d: nums.append(i)
m = len(str(n))
for i in range(m, m+2):
for j in product(nums, repeat=i):
ans = ""
for k in j: ans += str(k)
if int(ans) >= n:
print(ans)
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,880 |
s405731370 | p04045 | u841919141 | 1596138880 | Python | Python (3.8.2) | py | Accepted | 83 | 9076 | 242 | N, K = map(int, input().split())
D = list(map(int, input().split()))
while True:
sN = str(N)
flag = False
for ins in D:
if str(ins) in sN:
flag = True
break
if flag:
#print(out)
N += 1
else:
break
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,881 |
s372110551 | p04045 | u923270446 | 1596120556 | Python | Python (3.8.2) | py | Accepted | 68 | 9076 | 252 | n, k = map(int, input().split())
d = list(map(int, input().split()))
for i in range(n, 10 * n + 1):
flag = False
for j in str(i):
if int(j) in d:
flag = True
break
if flag:
continue
exit(print(i)) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,882 |
s147344631 | p04045 | u366886346 | 1596083339 | Python | Python (3.8.2) | py | Accepted | 93 | 9172 | 249 | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,100000):
num=list(str(i))
num1=0
for j in range(len(num)):
if num[j] in d:
num1=1
break
if num1==0:
print(i)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,883 |
s587820047 | p04045 | u519968172 | 1596082081 | Python | PyPy3 (7.3.0) | py | Accepted | 72 | 73412 | 166 | n,k=map(int,input().split())
d=list(input().split())
for i in range(n,100000):
i2=str(i)
for m in d:
if m in i2:
break
else:
print(i)
exit()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,884 |
s691850913 | p04045 | u396211450 | 1596013040 | Python | Python (3.8.2) | py | Accepted | 51 | 9068 | 327 | def check(n,s):
v=str(n)
for i in v:
if i in s:
return False
return True
def solve():
n,k=map(int,input().split())
s=input().split()
s=set(s)
while True:
if check(n,s):
print(n)
break
else:
n+=1
for _ in range(1):
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,885 |
s916632686 | p04045 | u259190728 | 1596011404 | Python | Python (3.8.2) | py | Accepted | 52 | 9228 | 1,601 | from sys import stdin,stdout
import bisect
import math
def st():
return list(stdin.readline().strip())
def inp():
return int(stdin.readline())
def li():
return list(map(int,stdin.readline().split()))
def mp():
return map(int,stdin.readline().split())
def pr(n):
stdout.write(str(n)+"\n")
def... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,886 |
s936180610 | p04045 | u648881683 | 1595983524 | Python | Python (3.8.2) | py | Accepted | 77 | 10108 | 666 | import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,887 |
s262602436 | p04045 | u727787724 | 1595970535 | Python | Python (3.8.2) | py | Accepted | 89 | 9116 | 254 | n,k=map(int,input().split())
a=list(input().split())
ans=0
for i in range(n,100001):
cnt=list(str(i))
for j in range(len(cnt)):
if cnt[j] in a:
ans=1
break
if ans==0:
print(i)
exit()
else:
ans=0
continue
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,888 |
s012168952 | p04045 | u083184913 | 1595952614 | Python | Python (3.8.2) | py | Accepted | 71 | 9012 | 178 | n,k=map(int,input().split())
D=input().split()
while True:
l=list(str(n))
for i in l:
if i in D:
break
else:
break
n+=1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,889 |
s435647470 | p04045 | u619144316 | 1595943887 | Python | Python (3.8.2) | py | Accepted | 59 | 9124 | 308 | def main():
n,k = map(int,input().split())
D = set(map(int,input().split()))
while True:
flg = 0
for i in str(n):
i = int(i)
if i in D:
flg = 1
break
if flg == 0:
break
n+=1
print(n)
main() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,890 |
s527824464 | p04045 | u036104576 | 1595823953 | Python | Python (3.8.2) | py | Accepted | 77 | 9124 | 219 | N, K = map(int, input().split())
D = set(input().split())
for n in range(N, N * 10 + 1):
ok = True
for c in str(n):
if c in D:
ok = False
if ok:
print(n)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,891 |
s158997430 | p04045 | u036104576 | 1595823847 | Python | Python (3.8.2) | py | Accepted | 95 | 9364 | 542 | import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# map(int, input().split()... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,892 |
s572934047 | p04045 | u460129720 | 1595809700 | Python | Python (3.8.2) | py | Accepted | 81 | 9192 | 242 | n,k = map(int,input().split())
d = list(map(int,input().split()))
allowed = {i for i in range(10) if i not in d}
maxn = 10**5
for k in range(1,maxn+1):
if k >= n and all(int(c) in allowed for c in str(k)):
print(k)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,893 |
s551296223 | p04045 | u894312115 | 1595789621 | Python | PyPy3 (7.3.0) | py | Accepted | 80 | 72992 | 198 | n,k=map(int,input().split())
ar=list(map(int,input().split()))
def f(n):
s=str(n)
for el in ar:
if(str(el) in s):
return 0
return 1
while(not f(n)):
n+=1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,894 |
s485044357 | p04045 | u439542873 | 1595784857 | Python | Python (3.8.2) | py | Accepted | 76 | 9116 | 304 | n, k = map(int, input().split())
d = list(map(int, input().split()))
allowed = {i for i in range(10) if i not in d}
MAXN = 10 ** 5
def answer():
for k in range(1, MAXN + 1):
if k >= n and all(int(c) in allowed for c in str(k)):
return k
answer = answer()
print(answer)
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,895 |
s601862228 | p04045 | u875113233 | 1595737884 | Python | Python (3.8.2) | py | Accepted | 87 | 9020 | 255 | def main():
n,k=input().split()
a=set(input().split())
while True:
n1=set(n)
if n1 & a == set():
print(n)
break
else:
n=int(n)
n+=1
n=str(n)
if __name__=="__main__":
main()
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,896 |
s687475566 | p04045 | u271469978 | 1595733554 | Python | Python (3.8.2) | py | Accepted | 99 | 9172 | 166 | N, K = map(int, input().split())
D = set(list(input().split()))
while N < 10 ** 6:
if len(set(list(str(N))) & D) == 0:
print(N)
exit()
N += 1
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,897 |
s569454616 | p04045 | u235210692 | 1595707712 | Python | Python (3.8.2) | py | Accepted | 71 | 9188 | 295 | n,k=[int(i) for i in input().split()]
d=[i for i in input().split()]
i=n
while True:
check=0
for number in d:
if not number in str(i):
continue
else:
check=1
break
if check==0:
print(i)
break
else:
i+=1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,898 |
s212208690 | p04045 | u212831449 | 1595629894 | Python | Python (3.8.2) | py | Accepted | 29 | 9180 | 558 | n,k = map(int,input().split())
d = list(map(int,input().split()))
n_str = str(n)
l = len(n_str)
a = [i for i in range(10) if i not in d]
#同じ桁の時
ans = ""
for i in range(l):
for j in a:
if j == int(n_str[i]):
ans += str(j)
break
elif j > int(n_str[i]):
ans += str(... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,899 |
s978488807 | p04045 | u758815106 | 1595628755 | Python | Python (3.8.2) | py | Accepted | 88 | 9100 | 252 | N, K = map(int, input().split())
D = list(map(str, input().split()))
while True:
n = str(N)
nn = str(N)
for o in nn:
if o in D:
N += 1
nn = str(N)
break
if n == nn:
break
print(N) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,900 |
s457435739 | p04045 | u986254798 | 1595536564 | Python | Python (3.8.2) | py | Accepted | 53 | 9112 | 283 | n, k = map(int, input().split())
D = list(map(int, input().split()))
def xInD(x):
while x > 0:
lsd = x % 10
if lsd in D:
return False
x //= 10
return True
while True:
if xInD(n):
print (n)
break
else:
n += 1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,901 |
s186906396 | p04045 | u926046014 | 1595533683 | Python | PyPy3 (7.3.0) | py | Accepted | 71 | 73072 | 219 | n,k=map(int,input().split())
lst=list(input())
while True:
ans=True
s=str(n)
for i in s:
if i in lst:
ans=False
break
if ans==True:
print(n)
break
n+=1 | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,902 |
s550428069 | p04045 | u704563784 | 1595531207 | Python | Python (3.8.2) | py | Accepted | 77 | 9044 | 190 | n, k = map(int, input().split())
data = list(map(int, input().split()))
ng = set(data)
for i in range(n, 10*n+1):
if all(int(c) not in ng for c in str(i)):
print(i)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,903 |
s848845333 | p04045 | u465101448 | 1595517441 | Python | Python (3.8.2) | py | Accepted | 31 | 9140 | 777 | from itertools import product
N,K = list(map(int,input().split()))
D = list(map(int,input().split()))
D_ = [_ for _ in range(10) if _ not in D]
D_.sort()
break_flag=False
for s_ in D_:
if break_flag:
break
elif s_ == 0:
continue
for p in product(D_,repeat=len(str(N))-1):
ans=int(st... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,904 |
s570788491 | p04045 | u347203174 | 1595475099 | Python | PyPy3 (7.3.0) | py | Accepted | 67 | 66772 | 349 | N, K = map(int, input().split())
num = list(map(int, input().split()))
kirai = [0]*10
for i in num:
kirai[i] = 1
MAXX = 100000
for n in range(N, MAXX):
tmp = n
good = True
while tmp > 0:
d = tmp % 10
tmp = tmp//10
if kirai[d]:
good = False
break
if go... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,905 |
s952517505 | p04045 | u065099501 | 1595385257 | Python | Python (3.8.2) | py | Accepted | 55 | 9064 | 195 | n,_ = map(int,input().split())
d = list(input().split())
flg=True
while flg:
flg=False
for i in str(n):
if i in d:
flg=True
n+=1
break
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,906 |
s218504922 | p04045 | u119148115 | 1595187576 | Python | PyPy3 (7.3.0) | py | Accepted | 62 | 62072 | 675 | import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
N,K = MI()
D = LI()
A = [] # 使ってよい数字
for i in range(10):
if not i in D:
A.append(i)
def f(x):
if x <= max(A):
for i in range(10-K):
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,907 |
s608192107 | p04045 | u841568901 | 1595185332 | Python | Python (3.8.2) | py | Accepted | 75 | 9120 | 156 | N, K = map(int, input().split())
D = input().split()
for i in range(N, N+100000):
if any(s in D for s in str(i)):
pass
else:
print(i)
break
| p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,908 |
s004932144 | p04045 | u106971015 | 1595133352 | Python | Python (3.8.2) | py | Accepted | 60 | 9148 | 223 | N,K = map(int,input().split())
D = list(map(str,input().split()))
N -=1
N_str = str(N)
while True:
N += 1
N_str = str(N)
for d in D:
if d in N_str:
break
else:
break
print(N_str) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,909 |
s626623991 | p04045 | u687574784 | 1595105915 | Python | Python (3.8.2) | py | Accepted | 68 | 9084 | 251 | N,K = list(map(int, input().split()))
D = set(input().split())
# シミュレーションでいける
for ans in range(N,100000):
if all(d not in D for d in str(ans)):
print(ans)
exit()
raise AssertionError('バグってる') | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,910 |
s330373769 | p04045 | u962985517 | 1595098260 | Python | Python (3.8.2) | py | Accepted | 71 | 9060 | 195 | n,k =map(int,input().split())
d =list(map(int,input().split()))
for i in range(n,10**n+1):
for j in str(i):
if int(j) in d:
break
else:
print(i)
exit() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,911 |
s283992221 | p04045 | u101232733 | 1595044257 | Python | Python (3.8.2) | py | Accepted | 48 | 9144 | 187 | n,k=map(int, input().split(' '))
forbid= input().split(' ')
def f(n):
for digit in str(n):
if digit in forbid:
return False
return True
while f(n)== False:
n+=1
print(n) | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,912 |
s391755201 | p04045 | u169350228 | 1595043212 | Python | PyPy3 (7.3.0) | py | Accepted | 94 | 75112 | 687 | '''
研究室PCでの解答
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
... | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,913 |
s310555816 | p04045 | u025287757 | 1595023347 | Python | Python (3.8.2) | py | Accepted | 90 | 9068 | 187 | def main():
N, K = map(int, input().split())
d = set(map(str, input().split()))
while (len(set(list(str(N))) & d) != 0):
N += 1
print(N)
if __name__ == "__main__":
main() | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,914 |
s304314989 | p04045 | u693173434 | 1594997784 | Python | Python (3.8.2) | py | Accepted | 97 | 9068 | 156 | n, k = map(int, input().split())
d=list(input().split())
for i in range(n, 10**5):
if all(str(i).count(k)<=0 for k in d):
print(i)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,915 |
s109648019 | p04045 | u271064067 | 1594921746 | Python | PyPy3 (7.3.0) | py | Accepted | 78 | 73232 | 259 | n, k =map(int, input().split())
a = list(map(str, input().split()))
for i in range(n*10):
z = 0
x = n+i
y = str(x)
for i in range(len(y)):
if y[i] in a:
z+=1
break
if z == 0:
print(x)
break | p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... | 1000 8
1 3 4 5 6 7 8 9
| 2000
| 1,215,916 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.