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
s423556133
p04045
u268318377
1553059611
Python
Python (3.4.3)
py
Accepted
87
3188
392
n,k = map(int,input().split()) D = set([int(d) for d in input().split()]) num = set([0,1,2,3,4,5,6,7,8,9]) D = list(num - D) D.sort(reverse=True) _ = 10**7 def abcC(x, ans): if len(x) == len(str(n))+3: return ans if n <= int(x) < ans: ans = int(x) elif n > int(x): for i in D: ...
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,216,517
s258537835
p04045
u824237520
1552943586
Python
Python (3.4.3)
py
Accepted
94
2940
294
n, k = map(int, input().split()) #d = list(map(int, input().split())) d = input().split() while 1: temp = list(str(n)) for c in d: #print(c, temp) if c in temp: #print('a') break else: print(n) exit() n += 1 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,216,518
s688569923
p04045
u593005350
1552768823
Python
Python (3.4.3)
py
Accepted
69
3064
233
#ABC042C N,K=map(int,input().split()) D=list(map(int,input().split())) E=[0]*10 for d in D: E[d]=1 while(1): for n in str(N): if E[int(n)]==1: N+=1 break 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,216,519
s799480785
p04045
u381626581
1552639168
Python
Python (3.4.3)
py
Accepted
42
2940
259
n, k = map(int, input().split()) list = list(map(int, input().split())) def valid(x): while x: if (x % 10) in list: return 0 x //= 10 return 1 cur = n while True: if valid(cur): break cur += 1 print(cur)
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,216,520
s413219879
p04045
u348898379
1552638070
Python
Python (3.4.3)
py
Accepted
77
3064
339
n,k=input().split() n=int(n) k = int(k) bl=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] L = [int(x) for x in input().split()] for i in L: x = int(i) bl[x]=1 while True: s = str(n) flag=0 for i in s: if bl[int(i)]==1: n = n + 1 flag = 1 break if flag == 0: ...
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,216,521
s408150628
p04045
u729133443
1552359211
Python
Python (3.4.3)
py
Accepted
81
2940
74
n=int(input().split()[0]);a=set(input()) while a&set(str(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,216,522
s301029019
p04045
u634208461
1552339081
Python
Python (3.4.3)
py
Accepted
75
2940
195
import sys N, K = map(int, input().split()) D = list(input().split()) D = set(D) for i in range(N, 100 * N): if D & set(str(i)): continue else: 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,216,523
s468859311
p04045
u845333844
1552083045
Python
Python (3.4.3)
py
Accepted
88
2940
99
n,k=map(int,input().split()) d=set(input().split()) while len(d&set(str(n)))!=0: 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,216,524
s633192269
p04045
u357050210
1551934031
Python
Python (3.4.3)
py
Accepted
71
3060
286
n,l = map(int,input().split()) x = [ int(i) for i in input().split() ] a = [ 0 for i in range(10) ] for i in x: a[i] = 1 def check(n): s = str(n) for i in s: if a[int(i)] == 1: return False return True while check(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,216,525
s217336624
p04045
u977389981
1551821151
Python
Python (3.4.3)
py
Accepted
90
3064
269
n, k = map(int, input().split()) A = set([int(i) for i in input().split()]) num = set([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) - A for i in range(n, n * 10 + 1): for j in list(str(i)): if int(j) not in num: break 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,216,526
s582380423
p04045
u529909658
1551772615
Python
Python (3.4.3)
py
Accepted
75
3060
420
price, n = [int(i) for i in input().split(' ')] exclude_nums = [int(i) for i in input().split(' ')] nums = set([i for i in range(0,10)]) for num in exclude_nums: nums.discard(num) while True: safe = True for num in str(price): if int(num) in nums: pass else: price ...
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,216,527
s887898893
p04045
u174394352
1551674164
Python
Python (3.4.3)
py
Accepted
85
2940
99
N,K=map(int,input().split()) D=set(input().split()) while len(D&set(str(N)))!=0: 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,216,528
s668781958
p04045
u185034753
1551242546
Python
Python (3.4.3)
py
Accepted
33
3064
539
def validate(n, d: set) -> bool: while n > 0: # print(n) r = n%10 if r in d: return False n //= 10 return True def solve(n, d): d = set(d) for i in range(n, 10**6): if validate(i, d): return i return -1 def main(): n, k = map(in...
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,216,529
s194813515
p04045
u964763428
1551046958
Python
Python (3.4.3)
py
Accepted
79
3060
186
N, _ = map(int, input().split()) D = list(map(int, input().split())) E = [str(i) for i in [0,1,2,3,4,5,6,7,8,9] if i not in D] E while not all(n in E for n in str(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,216,530
s677333387
p04045
u190086340
1551043902
Python
Python (3.4.3)
py
Accepted
72
2940
368
BASE, N = map(int, input().split()) NGs = input().split() def solve(): def is_valid(num): s_num = str(num) for ng in NGs: if s_num.count(ng): return False return True # print(BASE, N) # print(NGs) num = BASE while not is_valid(num): num...
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,216,531
s495217072
p04045
u518064858
1551043628
Python
Python (3.4.3)
py
Accepted
96
2940
203
n,k=map(int,input().split()) d=list(input().split()) x=0 p=n while x==0: q=list(str(p)) x=1 for y in q: if y in d: p+=1 x=0 break print(p)
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,216,532
s578816511
p04045
u887207211
1550983799
Python
Python (3.4.3)
py
Accepted
51
2940
147
N, K = map(int,input().split()) D = input().split() while True: for n in str(N): if(n 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,216,533
s070826995
p04045
u393512980
1550981279
Python
Python (3.4.3)
py
Accepted
84
3060
265
N, K = map(int, input().split()) D = list(map(int, input().split())) M = N while 1: flag = False for x in str(M): if int(x) in D: flag = True break if flag == True: M += 1 else: print(M) 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,216,534
s999004719
p04045
u371763408
1550679978
Python
Python (3.4.3)
py
Accepted
67
3060
312
n,k=map(int,input().split()) D=list(map(int,input().split())) nums=[i for i in range(10) if i not in D] def str_check(string): string=str(string) for i in string: if int(i) not in nums: return False return True for i in range(1,100000): if str_check(i)==True and n<=i: 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,216,535
s996997851
p04045
u226108478
1550282902
Python
Python (3.4.3)
py
Accepted
29
3316
746
# -*- coding: utf-8 -*- def main(): n, k = map(int, input().split()) d = list(map(int, input().split())) like_numbers = [i for i in range(10) if i not in d] digit_count = len(list(map(str, list(str(n))))) digit = [0] * digit_count ans = list() def dfs(count): if count == digit_cou...
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,216,536
s933234914
p04045
u090225501
1550205024
Python
Python (3.4.3)
py
Accepted
34
3060
417
import itertools def main(): n, _ = map(int, input().split()) d = [int(s) for s in input().split()] p = [i not in d for i in range(10)] print(solve(n, p)) def solve(n, p): def check(i): if i == 0: return True if not p[i % 10]: return False return ch...
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,216,537
s373107406
p04045
u771876084
1550195473
Python
Python (2.7.6)
py
Accepted
10
2696
607
#coding:utf-8 # O(Dlogn)解法? N,K=map(int, raw_input().split(" ")) D=map(int, raw_input().split(" ")) keta=len(str(N)) strN=str(N) ans1="" for x in range(keta-1): p=int(strN[keta-x-1]) d=0 for dd in range(10): if dd not in D: d=dd break ans1=str(d)+ans1 candidate=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,216,538
s193983926
p04045
u762955009
1550108106
Python
Python (3.4.3)
py
Accepted
63
3060
304
def contains_digit(n: int, d: set): flag = False while n > 0: flag = flag or (n % 10 in d) n //= 10 return flag N, K = map(int, input().split()) D = set(list(map(int, input().split()))) for i in range(N, N*10): if not contains_digit(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,216,539
s471250343
p04045
u729133443
1549720277
Python
Python (3.4.3)
py
Accepted
18
3064
391
n=input()[:-2] s=sorted(set(range(10))-set(map(int,input().split()))) s=[str(i)for i in s] if all(i in s for i in n): print(n) exit() f=0 t='' for i in n: if f: t+=s[0] elif i in s: t+=i else: for j in s: if int(j)>int(i): t+=str(j) f=1 break else: break els...
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,216,540
s484812280
p04045
u644778646
1549648266
Python
Python (3.4.3)
py
Accepted
82
2940
252
N,K = map(int,input().split()) D = list(map(int,input().split())) i = N while True: flg = True for j in str(i): if int(j) in D: flg = False break if flg == True: print(i) exit() 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,216,541
s371577606
p04045
u689562091
1549316227
Python
Python (3.4.3)
py
Accepted
79
2940
114
D, K = map(int, input().split()) S = set(input().split()) while any((c in S) for c in str(D)): D += 1 print(D)
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,216,542
s558390075
p04045
u689562091
1549315542
Python
Python (3.4.3)
py
Accepted
72
2940
169
def foo(D, S): while any((c in S) for c in str(D)): D += 1 return D D, K = map(int, input().split()) S = set(map(str, input().split())) print(foo(D, 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,216,543
s515355254
p04045
u977389981
1549301650
Python
Python (3.4.3)
py
Accepted
54
2940
190
n, k = map(int, input().split()) A = list(input().split()) for i in range(n * 10): for j in str(n + i): if j in A: break else: print(n + 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,216,544
s772362142
p04045
u219607170
1549232758
Python
Python (3.4.3)
py
Accepted
57
2940
262
N, K = map(int, input().split()) D = input().split() def isok(yen, D): flag = True for y in yen: if y in D: flag = False break return flag while True: if isok(str(N), D): 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,216,545
s538721266
p04045
u977389981
1549229933
Python
Python (3.4.3)
py
Accepted
74
2940
203
n, k = map(int, input().split()) A = list(input().split()) for i in range(10 * n): for a in A: if a in str(n + i): break else: ans = n + 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,216,546
s106784413
p04045
u483645888
1548869628
Python
Python (3.4.3)
py
Accepted
89
8256
1,100
N, K = map(int, input().split()) de_num = list(map(int, input().split())) ok_num = [] cand_num = [] ans_num = [] #print(de_num) for i in range(10): if i not in de_num: ok_num.append(i) #print(ok_num) for i in ok_num: for j in ok_num: for k in ok_num: for l in ok_num: for m in ok_num: ...
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,216,547
s079848467
p04045
u950708010
1548778730
Python
Python (3.4.3)
py
Accepted
48
2940
355
n,k = (int(i) for i in input().split()) d = list(int(i) for i in input().split()) def ketajudge(x): while x != 0: if x%10 in d: return False break else: if x//10 == 0: return True break x = x//10 for i in range(10*n): judge = n+i if ketajudge(judge) == 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,216,548
s841130144
p04045
u651663683
1547696300
Python
Python (3.4.3)
py
Accepted
60
3188
194
n=int(input().split()[0]) d=input().split() while True: v=True for i in str(n): if i in d: v=False break if v: 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,216,549
s736358032
p04045
u882209234
1547346493
Python
Python (3.4.3)
py
Accepted
67
2940
217
N, K = map(int, input().split()) D = list(input()) flag = True while flag: flag = False tmp = str(N) for d in D: if d in tmp: N += 1 flag = True 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,216,550
s498013804
p04045
u272557899
1546721895
Python
Python (3.4.3)
py
Accepted
17
3064
340
n, k = map(int, input().split()) a = input().split() d = [int(m) for m in a] aset = set(a) i = n while True: k = list(str(i)) klen = len(k) for j in range(klen): if k[j] in aset: i += 10 ** (klen - j - 1) i -= i % (10 ** (klen - j - 1)) break else: pri...
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,216,551
s346004348
p04045
u813916554
1546532045
Python
Python (3.4.3)
py
Accepted
53
3064
319
n,k=input().split() n=int(n) k=int(k) d=input().split() d=list(map(int,d)) a=[0]*10 flag=True for i in d: a[i]+=1 while 1: flag=True tmp=n while tmp!=0: if(a[tmp%10]!=0): flag=False n+=1 break tmp//=10 if flag==True: 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,216,552
s436177929
p04045
u586149955
1546386364
Python
Python (3.4.3)
py
Accepted
85
3060
128
n, k = [int(x) for x in input().split()] d = set([x for x in input().split()]) while len(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,216,553
s044260342
p04045
u281303342
1546367910
Python
Python (3.4.3)
py
Accepted
73
2940
192
N,K = map(int,input().split()) D = set(input().split()) for i in range(N,100000): # 禁止文字との共通集合がなければ良い if not D & set(str(i)): 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,216,554
s225873593
p04045
u138486156
1545955264
Python
Python (3.4.3)
py
Accepted
58
2940
261
n, k = map(int, input().split()) d = input().split() for r in range(n, n*10): s = "{}".format(r) for x in d: if x in s: break #for else構文 for 文が全て終わった時に実行される else: print(r) 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,216,555
s372948149
p04045
u138486156
1545954626
Python
Python (3.4.3)
py
Accepted
28
3064
608
from itertools import product n, k = map(int, input().split()) d = list(map(int, input().split())) a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(d) a = sorted(list(a)) l = len(str(n)) c = "" for i in range(l): c += str(a[-1]) if int(c) < n: if a[0] == 0: ans = str(a[1]) else: a...
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,216,556
s457967544
p04045
u023515228
1545774110
Python
Python (3.4.3)
py
Accepted
57
2940
198
N, K = map(int, input().split()) D = input().split() for R in range(N, N * 10): S = '{}'.format(R) for d in D: if d in S: break else: print(R) 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,216,557
s542570946
p04045
u886274153
1545774016
Python
Python (3.4.3)
py
Accepted
61
2940
323
def fukumu(D, kazu): for i in str(kazu): if D.count(i) == 0: continue else: return True return False def keisan(N, D): kazu = N while fukumu(D, kazu): kazu += 1 return kazu N, K = [int(i) for i in input().split()] D = input().split() print(keisan(N,D...
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,216,558
s735973512
p04045
u052332717
1545666672
Python
Python (3.4.3)
py
Accepted
61
3060
268
n,k = map(int,input().split()) B = list(map(int,input().split())) A = [i for i in range(0,10)] for number in B: A.remove(number) for i in range(n,10*n+1): for j in str(i): if not int(j) in A: 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,216,559
s954921802
p04045
u017810624
1545649417
Python
Python (3.4.3)
py
Accepted
55
5744
828
n,k=map(int,input().split()) d=list(map(int,input().split())) l=[0,1,2,3,4,5,6,7,8,9] for i in range(k): l.remove(d[i]) L=[] for j1 in range(len(l)): for j2 in range(len(l)): for j3 in range(len(l)): for j4 in range(len(l)): for j5 in range(len(l)): L.append(l[j1]*10000+l[j2]*1000+l[j3]*...
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,216,560
s301908590
p04045
u643840641
1545576937
Python
Python (3.4.3)
py
Accepted
69
9112
312
n, k = map(int, input().split()) d = list(map(int, input().split())) ok = [i for i in range(10) if i not in d] ans = [] def solve(pay): if pay == "00000": return if pay != "" and int(pay) >= n: ans.append(pay) return for c in ok: solve(pay + str(c)) return solve("") print(min(list(map(int, 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,216,561
s571937624
p04045
u147310836
1545539772
Python
Python (2.7.6)
py
Accepted
10
2696
665
N,K=map(int,raw_input().split()) D=map(int,raw_input().split()) U=[i for i in range(10) if i not in D] Keta=1 while True: if N>U[-1]*(sum(10**(i) for i in range(Keta))): Keta+=1 else: break N_copy=N Result=[] for k in range(Keta): for u in U: if u*(10**(Keta-k-1))+U[-1]*(sum(10*...
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,216,562
s194269054
p04045
u924895886
1545340703
Python
Python (3.4.3)
py
Accepted
84
3060
257
n, k = map(int, input().split()) a = [int(x) for x in input().split()] while True: s = str(n) poss = False for i in s: if int(i) in a: poss = True break if not poss: print(n) exit(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,216,563
s089631802
p04045
u318363730
1545332901
Python
Python (3.4.3)
py
Accepted
29
3188
1,382
import sys line = [] for i in sys.stdin.readlines(): line.append(i.rstrip()) data = line.pop(0).split(" ") num_list = line.pop().split(" ") def pick_up(num_list): use_list = ['0','1','2','3','4','5','6','7','8','9'] for i in num_list: use_list.remove(i) return use_list def advance(n_list, num)...
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,216,564
s360881959
p04045
u278670845
1545253420
Python
Python (3.4.3)
py
Accepted
71
3060
402
import itertools import sys def main(): n,k = map(int, input().split()) ds = list(map(int, input().split())) for i in range(n, 10**6): s = str(i) for d in ds: if str(d) in s: f = False break else: f = True if f:...
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,216,565
s901167823
p04045
u278670845
1545253386
Python
Python (3.4.3)
py
Accepted
69
3060
402
import itertools import sys def main(): n,k = map(int, input().split()) ds = list(map(int, input().split())) for i in range(n, 10**6): s = str(i) for d in ds: if str(d) in s: f = False break else: f = True if f:...
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,216,566
s156021457
p04045
u726615467
1545195623
Python
Python (3.4.3)
py
Accepted
54
3064
794
# encoding: utf-8 N, K = map(int, input().split()) D = list(map(int, input().split())) Db = [] for Di in range(10): if Di not in D: Db.append(Di) # print("#", Db) for level in range(6): if N // (10 ** level) < 1: break # print("#", level) # memo = [None] * ((level + 1) * 10000) def pay(pos, tmp): ...
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,216,567
s186654048
p04045
u726615467
1545195588
Python
Python (3.4.3)
py
Accepted
60
3648
788
# encoding: utf-8 N, K = map(int, input().split()) D = list(map(int, input().split())) Db = [] for Di in range(10): if Di not in D: Db.append(Di) # print("#", Db) for level in range(6): if N // (10 ** level) < 1: break # print("#", level) memo = [None] * ((level + 1) * 10000) def pay(pos, tmp): ...
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,216,568
s274273426
p04045
u589726284
1545194300
Python
Python (3.4.3)
py
Accepted
92
2940
180
N, K = map(int, input().split()) D = set(input().split()) for i in range(N, 10000 * 10): if len(set(str(N)) & D) >= 1: N += 1 else: 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,216,569
s212455262
p04045
u880373275
1545166702
Python
Python (3.4.3)
py
Accepted
77
3060
195
def main(): n, _ = map(int, input().split()) ds = set(input().split()) while any(c in ds for c in iter(str(n))): 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,216,570
s398717305
p04045
u323680411
1545103748
Python
Python (3.4.3)
py
Accepted
24
3060
347
import sys n, k = map(int, input().split()) D = [int(x) for x in input().split()] def dfs(s: str, m: int) -> None: if s != "" and int(s) >= n: print(s) sys.exit() if len(s) == m: return for i in range(10): if i not in D: dfs(str(i) + s, m) for i in range(sy...
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,216,571
s477308134
p04045
u513081876
1544756275
Python
Python (3.4.3)
py
Accepted
87
2940
171
N, K = map(int, input().split()) D = set(input().split()) for i in range(10**6): if len(set(str(N)) & D) >= 1: N += 1 else: 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,216,572
s656757457
p04045
u983918956
1544472466
Python
Python (3.4.3)
py
Accepted
34
3064
539
import itertools N,K = input().split() D = list(map(int,input().split())) int_list = set(range(10)) like = list(int_list - set(D)) like.sort() min_cost = 10**6 for e in itertools.product(like,repeat = len(N)): result = 0 for i in range(len(N)): result += e[i] * pow(10,i) if int(N) <= result < min_co...
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,216,573
s845881929
p04045
u695811449
1544361305
Python
Python (3.4.3)
py
Accepted
84
3060
140
N,K=map(int,input().split()) D=set(input().split()) for i in range(N,10**10): if set(str(i)) & D==set(): 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,216,574
s695200099
p04045
u140251125
1544114223
Python
Python (3.4.3)
py
Accepted
91
3060
182
n, k = map(int, input().split()) D = input().split() D_inv = set([str(i) for i in range(10)]) - set(D) ans = n while not set(list(str(ans))).issubset(D_inv): ans += 1 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,216,575
s183246245
p04045
u140251125
1544112977
Python
Python (3.4.3)
py
Accepted
20
3188
1,023
# input n, k = map(int, input().split()) D = list(map(int, input().split())) N = [int(x) for x in list(str(n))] D_inv = sorted(list(set(range(10)) - set(D))) m = len(N) + 1 # 置換する桁 for i in range(len(N)): if N[i] in D: m = i break if m == len(N) + 1: print(n) exit() n = len(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,216,576
s910040309
p04045
u761529120
1543890329
Python
Python (3.4.3)
py
Accepted
74
9596
522
N, K = map(int, input().split(" ")) list_num = ["0","1","2","3","4","5","6","7","8","9"] D = input().split(" ") use_num = list(set(list_num) - set(D)) ok = [] for a in use_num: ok.append(a) for b in use_num: ok.append(a+b) for c in use_num: ok.append(a+b+c) for d in us...
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,216,577
s114183825
p04045
u513081876
1543186962
Python
Python (3.4.3)
py
Accepted
85
3060
257
import sys N, K = map(int, input().split()) D = [str(i) for i in input().split()] ans = 0 now = N for j in range(10**6): for i in list(str(now)): if i in D: now += 1 break else: print(now) 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,216,578
s391899976
p04045
u001024152
1542510624
Python
Python (3.4.3)
py
Accepted
87
3060
223
N,K = map(int, input().split()) D = input().split() usable = set([str(i) for i in range(10)]) - set(D) # print(usable) for i in range(N, 10000*10): if set(list(str(i))).issubset(usable): 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,216,579
s480802868
p04045
u255280439
1542325318
Python
Python (3.4.3)
py
Accepted
85
4692
3,307
import sys import math import collections import itertools import array import inspect # Set max recursion limit sys.setrecursionlimit(1000000) # Debug output def chkprint(*args): names = { id(v): k for k, v in inspect.currentframe().f_back.f_locals.items() } print(', '.join( name...
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,216,580
s678678785
p04045
u782098901
1541047852
Python
Python (3.4.3)
py
Accepted
71
3060
248
N, K = map(int, input().split()) D = list(map(int, input().split())) def hate_num(n): for s in str(n): if int(s) in D: return False return True while True: if hate_num(N): 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,216,581
s447893086
p04045
u681150536
1540267983
Python
Python (3.4.3)
py
Accepted
97
2940
245
def main(): N, K = map(int, input().split()) input_d = set(input().split()) while True: n = set(list(str(N))) if not input_d & n: break 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,216,582
s796667941
p04045
u255280439
1540248760
Python
Python (3.4.3)
py
Accepted
94
4688
3,327
import sys import math import collections import itertools import array import inspect # Set max recursion limit sys.setrecursionlimit(1000000) # Debug output def chkprint(*args): names = { id(v): k for k, v in inspect.currentframe().f_back.f_locals.items() } print(', '.join( name...
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,216,583
s935025249
p04045
u459697504
1539927656
Python
Python (3.4.3)
py
Accepted
97
3064
960
#! /usr/bin/python3 # こだわり者いろはちゃん / Iroha's Obsession # 参考 : https://abc042.contest.atcoder.jp/submissions/3419872 """ 1≦N<10000 1≦K<10 0≦D1<D2<…<DK≦9 {D1,D2,…,DK}≠{1,2,3,4,5,6,7,8,9} """ N, K = map(int, input().split()) D = set(list(input().split())) test_mode = False def check_num(x, d): """ ...
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,216,584
s783177935
p04045
u513081876
1539313118
Python
Python (3.4.3)
py
Accepted
91
3060
227
N, K = map(int, input().split()) D = set(input().split()) frag = True ans = 0 N = N-1 for i in range(0, 1000000): N += 1 if len(set(str(N)) & D) == 0: ans = N frag = 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,216,585
s247637518
p04045
u832039789
1539303202
Python
Python (3.4.3)
py
Accepted
51
2940
153
n,k=map(int,input().split());d=input().split() while 1: for c in str(n): if c 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,216,586
s271735358
p04045
u635931083
1539297834
Python
Python (2.7.6)
py
Accepted
85
2568
333
import sys def exists_allow(string, not_list): for i in not_list: if string.count(str(i)) > 0: return True return False n, k = raw_input().split() n = int(n) d = map(int, raw_input().split()) while True: if exists_allow(str(n), d): n = n + 1 else: 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,216,587
s093464212
p04045
u832039789
1539297022
Python
Python (3.4.3)
py
Accepted
71
2940
191
n,k = map(int,input().split()) d = list(map(int,input().split())) while 1: for c in str(n): if int(c) 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,216,588
s789117502
p04045
u724892495
1539200555
Python
Python (3.4.3)
py
Accepted
71
3064
242
N,K = map(int,input().split()) D=input().split() for i in range(N,100001): dame=False for d in D: if d in str(i): dame=True break if dame: continue 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,216,589
s291304493
p04045
u233152254
1538877343
Python
Python (3.4.3)
py
Accepted
79
2940
189
N, K = [int(x) for x in input().split()] D = input().split() while True: for i in set(str(N)): if i in D: 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,216,590
s063034572
p04045
u596276291
1538763046
Python
Python (3.4.3)
py
Accepted
55
4072
951
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right from string import ascii_lowercase from functools import lru_cache import sys sys.setrecursi...
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,216,591
s502075684
p04045
u099918199
1538712828
Python
Python (3.4.3)
py
Accepted
87
2940
289
n,k = map(int, input().split()) list_d = list(map(str, input().split())) ans = n ans_list = list(str(ans)) while True: ans_list = list(str(ans)) for number in ans_list: if number in list_d: ans += 1 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,216,592
s073578615
p04045
u056677140
1538256757
Python
Python (3.4.3)
py
Accepted
55
3060
267
N, K = map(int,input().split()) hate = input().split() sw = False while True: N_str = str(N) for i in N_str: if i in hate: break else: sw = True if sw: 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,216,593
s672508665
p04045
u853900545
1537682321
Python
Python (3.4.3)
py
Accepted
81
2940
77
n=int(input().split()[0]) d=set(input()) 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,216,594
s156248500
p04045
u457901067
1537591881
Python
Python (3.4.3)
py
Accepted
48
2940
260
N, K = map(int, input().split()) D = list(map(int, input().split())) i = N while i >= N: work = i while work > 0: if work % 10 in D: break else: work = work // 10 if work > 0: i += 1 continue else: 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,216,595
s932002790
p04045
u832039789
1537497267
Python
Python (3.4.3)
py
Accepted
53
2940
241
n,k = map(int,input().split()) d = input().split() def isValid(num): s = str(num) for c in s: if c in d: return False return True for i in range(n,10*n+1): if isValid(i): 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,216,596
s771373898
p04045
u883048396
1537483607
Python
Python (3.4.3)
py
Accepted
19
3188
1,722
iN,iK = [int(x) for x in input().split()] aD = [int(x) for x in input().split()] aUnList = sorted([x for x in range(10) if x not in aD]) aUnList.sort() sN = str(iN) iF = int(sN[0]) def fCheckDigit(sTarget,iL,iPoint,aUnList,aRet,bRev): iF = int(sTarget[iPoint]) aUpper = [x for x in aUnList if x >= iF] aUpp...
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,216,597
s162459914
p04045
u883048396
1537483073
Python
Python (3.4.3)
py
Accepted
18
3064
1,709
iN,iK = [int(x) for x in input().split()] aD = [int(x) for x in input().split()] aUnList = sorted([x for x in range(10) if x not in aD]) aUnList.sort() sN = str(iN) iF = int(sN[0]) def fCheckDigit(sTarget,iPoint,aUnList,aRet,bRev): iL = len(sTarget) iF = int(sTarget[iPoint]) aUpper = [x for x in aUnList 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,216,598
s738116493
p04045
u608088992
1537465253
Python
Python (3.4.3)
py
Accepted
84
3444
215
N, K = map(int, input().split()) D = [str(_) for _ in input().split()] Unable = set(D) Fin = False Ans = N while not Fin: if not set(str(Ans)) & Unable: Fin = True else: Ans += 1 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,216,599
s824371394
p04045
u505420467
1537295730
Python
Python (3.4.3)
py
Accepted
51
3060
226
N, K = map(int, input().split()) D = list(map(int, input().split())) n = N while True: i = n while i != 0: if i % 10 in D: break i = i // 10 if i == 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,216,600
s220441574
p04045
u787562674
1536649355
Python
Python (3.4.3)
py
Accepted
63
3060
271
N, K = map(int, input().split()) inputs_set = set([i for i in input().split()]) all_set = set({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}) rest_set = all_set - inputs_set for i in range(N, N*10 + 1): if set(str(i)) <= rest_set: 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,216,601
s122857837
p04045
u394853232
1536180719
Python
Python (3.4.3)
py
Accepted
55
2940
203
N , K = map(int,input().split()) lst = input().split() start = N while True: for num in str(start): if num in lst: break else: break start += 1 print(str(start))
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,216,602
s313719974
p04045
u323680411
1536035664
Python
Python (3.4.3)
py
Accepted
44
2940
180
N, K = map(int, input().split()) D = set(input().split()) n = N while True: for c in str(n): if c 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,216,603
s618553523
p04045
u323680411
1536035594
Python
Python (3.4.3)
py
Accepted
52
2940
175
N, K = map(int, input().split()) D = input().split() n = N while True: for c in str(n): if c 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,216,604
s673998066
p04045
u323680411
1536022600
Python
Python (3.4.3)
py
Accepted
44
3316
233
N, K = map(int, input().split()) D = list(map(int, input().split())) n = N while True: i = n while i != 0: if i % 10 in D: break i = int(i / 10) if i == 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,216,605
s788603791
p04045
u323680411
1536022575
Python
Python (3.4.3)
py
Accepted
45
2940
228
N, K = map(int, input().split()) D = list(map(int, input().split())) n = N while True: i = n while i != 0: if i % 10 in D: break i = i // 10 if i == 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,216,606
s238845076
p04045
u439396449
1535682800
Python
Python (3.4.3)
py
Accepted
65
3060
281
from itertools import product N, K = map(int, input().split()) D = [int(x) for x in input().split()] def check(x): for s in str(x): if int(s) in D: return False return True for i in range(N, 10 * N): if check(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,216,607
s554966006
p04045
u006657459
1535681364
Python
Python (3.4.3)
py
Accepted
58
3060
255
N, K = map(int, input().split()) D = [Di for Di in input().split()] for n in range(N, 1000000000): n = str(n) flag = True for ni in n: if ni in D: flag = False break if flag: print(n) 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,216,608
s978230473
p04045
u966695411
1535430064
Python
Python (3.4.3)
py
Accepted
74
3060
273
def main(): N, L = map(int, input().split()) D = input().split() ans = N while 1: s = str(ans) f = 1 for i in D: if i in s : f = 0 if f : break ans += 1 print(ans) 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,216,609
s195578349
p04045
u966695411
1535429929
Python
Python (3.4.3)
py
Accepted
94
2940
236
def main(): N, L = map(int, input().split()) D = input().split() ans = N while 1: s = str(ans) if not [1 for i in D if i in s] : break ans += 1 print(ans) 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,216,610
s023060383
p04045
u761989513
1534565849
Python
Python (3.4.3)
py
Accepted
85
2940
82
n=int(input().split()[0]) d=set(input()) while len(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,216,611
s576371435
p04045
u631277801
1534329484
Python
Python (3.4.3)
py
Accepted
39
3060
314
N,K = map(int, input().split()) D = set(list(map(int, input().split()))) ans = 0 for i in range(N, 10*N+1): res = i while res > 0: digit = res % 10 if digit in D: break res //= 10 if res <= 0: 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,216,612
s816547342
p04045
u692632484
1534329199
Python
Python (3.4.3)
py
Accepted
98
2940
195
N,K=[int(i) for i in input().split()] D=[int(i) for i in input().split()] INF = 99999999 for i in range(N,INF): for d in D: if str(d) in str(i): break else: print(i) 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,216,613
s651879505
p04045
u761320129
1534329005
Python
Python (3.4.3)
py
Accepted
44
3060
188
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 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,216,614
s299147467
p04045
u759651152
1534266341
Python
Python (3.4.3)
py
Accepted
27
3064
654
#-*-coding:utf-8-*- import itertools def solve(like_list, n, rp, ans): for i in itertools.product(like_list, repeat=rp): if i[0] != 0: num = int(''.join(map(str, i))) if num >= int(n): ans = min(ans, num) return ans def main(): n, k = input().split() d_...
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,216,615
s305997477
p04045
u756569003
1534213341
Python
Python (3.4.3)
py
Accepted
72
2940
211
N, K = map(int, input().split()) D = list(map(int, input().split())) def check(a): s = str(a) for i in s: if int(i) in D: return True return False n = N while check(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,216,616