submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s960770539
p04045
Accepted
def main(): price, dilike_num = map(int, input().split()) # dislike_data = list(map(int, input().split())) dislike_data = input().split() dislike_set = set(dislike_data) now_price = price while 1: now_price_set = set(list(str(now_price))) if len(now_price_set & dislike_set) == ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s920709507
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) #dcount = 0 # while True: for n in str(N): if int(n) in D: N+=1 # print(n,N,count) # #count += 1 # break else: print(N) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s715068976
p04045
Accepted
# -*- coding:utf-8 -*- def solve(): N, K = list(map(int, input().split())) D = list(map(int, input().split())) n = N while True: k = str(n) ok = True for ki in k: if int(ki) in D: ok = False if ok: print(n) return ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s618965270
p04045
Accepted
n,k = map(int, input().split()) d = input().split() while True: n_list = list(set(list(str(n)))) flag = 0 for n_data in n_list: if n_data in d: flag = 1 break if flag == 0: print(str(n)) exit(0) else: n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s217339600
p04045
Accepted
import sys def main(): input=sys.stdin.readline N,K=map(int,input().split()) D=list(map(int,input().split())) L=[] for i in range(10): if i not in D: L.append(i) for p in L: if len(str(N))==1: if p>=N: print(p) return ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s568252779
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) n = len(str(N)) C = [] for k in range(10): if not k in D: C.append(k) def num(a): if a!='' and (len(a) > n or int(a)>=N): if int(a) >= N: return a return 114514 d=1145141919 for c in C: d ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s124926951
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) n = N while True: k = str(n) ok = True for ki in k: if int(ki) in D: ok = False if ok: print(n) break n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s850527578
p04045
Accepted
def UnlikeNum(nums,price): for num in nums: if(str(num) in str(price)): return True return False N, K = map(int,input().split()) D = list(map(int,input().split())) while(UnlikeNum(D,N)): N+=1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s982778600
p04045
Accepted
# -*- coding: utf-8 -*- """ Created on Fri Jul 26 04:39:44 2019 @author: matsui """ N,K=map(int,input().split()) D=input().split() D=[int(D[i]) for i in range(K)] for n in range(N,100000): a=n//10000 b=n%10000//1000 c=n%1000//100 d=n%100//10 e=n%10 if a+b+c+d ==0: if...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s332115309
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) while True: for n in str(N): if int(n) in D: N+=1 break else: print(N) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s511072853
p04045
Accepted
n, k = map(int, input().split()) d = set(map(int, input().split())) while True: if set(map(int, list(str(n)))) & d == set(): break else: n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s886171618
p04045
Accepted
import copy import sys import math def main(): n,k = map(int,input().split()) d = list(map(str,input().split())) while True: s = str(n) flag = True for i in s: if(i in d): flag = False if flag: print(n) sys.exit() else: n += 1 def listtodict(a): b = {} for i in a: try: b[i] += 1 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s986960263
p04045
Accepted
import copy import sys import math def main(): n,k = map(int,input().split()) d = list(map(str,input().split())) while True: s = str(n) flag = True for i in s: if(i in d): flag = False if flag: print(n) sys.exit() else: n += 1 def listtodict(a): b = {} for i in a: try: b[i] += 1 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s730071166
p04045
Accepted
N, K = map(int, input().split()) lst_D = input().split() while True: for c in str(N): if c in lst_D: break else: print(N) break N += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s615463612
p04045
Accepted
N,K = map(int,input().split()) D = list(map(int,input().split())) now = N while True: flag = True for d in D: if str(d) in str(now): flag = False break if flag: print (now) break else: now += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s132754309
p04045
Accepted
n,k=map(int,input().split()) d=list(input().split()) for i in range(n,n*(10**7)): f=True l=set(str(i)) for k in d: if k in l: f=False if f: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s312663647
p04045
Accepted
n,k=map(int,input().split()) d=sorted(list(set(range(10))-set(map(int,input().split())))) for i in range(n,100000): if set(map(int,str(i)))<=set(d): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s170683130
p04045
Accepted
def check(num, dislike_list): for n in num: if n in dislike_list: return False break return True N, K = map(int, input().split()) dislike_num = input().split() while not check(str(N), dislike_num): N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s164030849
p04045
Accepted
import math inl = input().split(' ') length = len(inl[0]) n = int(inl[0]) hate = input().split(' ') def checkhate(n,hate): n_str = str(n) for c in n_str: if c in hate: return False return True while not checkhate(n,hate): n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s926694456
p04045
Accepted
n,k=map(int,input().split()) d=str(input().split()) result=n #print(len(str(n))) count=0 while True: for j in range(len(str(result))): if str(result)[j] in d: count=0 result+=1 #print(count,result) break else: count+=1 if count==len(str(result)): break print(result)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s092788160
p04045
Accepted
N, K = map(int, input().split()) L = input() def func1(N): if len(str(N)) == 5: if str(N)[0] in L or str(N)[1] in L or str(N)[2] in L or str(N)[3] in L or str(N)[4] in L: return False elif len(str(N)) == 4: if str(N)[0] in L or str(N)[1] in L or str(N)[2] in L or str(N)[3] in L: return False e...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s653417300
p04045
Accepted
#import sys #input = sys.stdin.readline from itertools import product def main(): N, K = map( int, input().split()) D = list( map( int, input().split())) NN = list( map( int, str(N))) A = [ i for i in range(10) if i not in D] ANS = [] for i in range(1,6): for p in product(A, repeat = i):...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s622523939
p04045
Accepted
#!/usr/bin/env python3 #ABC42 C n,k = map(int,input().split()) d = list(map(int,input().split())) for i in range(n,100000): s = list(map(int,list(str(i)))) for j in s: if j in d: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s994781977
p04045
Accepted
Num = [int(n) for n in input().rstrip().split()] D = [int(n) for n in input().rstrip().split()] # numbers = [ n for n in range(10) if not n in D] flag = 0 for i in range(Num[0],10*Num[0]+1): for j in str(i): if int(j) in D: flag = 1 break if flag == 0: print(i) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s393415619
p04045
Accepted
n, _ = map(int, input().split()) dislike = input().split() while True: flag = True for it in dislike: if it in str(n): flag = False break if flag: print(n) break n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s471066895
p04045
Accepted
N, K = map(int, input().split()) D = [int(i) for i in input().split()] dec = [] for i in range(10) : if not i in D : dec.append(str(i)) i = N while True : for j in str(i) : if not j in dec : break else : print(i) break i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s032833623
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) A = [i for i in range(10)] A = set(A) - set(D) A = list(A) A.sort() S = str(N) s = '' for i in range(len(S)): for j in range(len(A)): if int(S[i]) == A[j]: s += str(A[j]) break if int(S[i]) < A[j]: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s446346819
p04045
Accepted
def main(): n, k = list(map(int, input().split())) d = input().split() pay = n while True: ok = True for d_i in d: if d_i in str(pay): ok = False break if ok: break else: pay += 1 print(pay) if __nam...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s982045041
p04045
Accepted
n,k=map(int,input().split()) pay=n d=list(map(str,input().split())) for i in range(n,10*n): sp=list(str(pay)) if any(i in sp for i in d): pay=i else: break print(pay)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s031721277
p04045
Accepted
N, K = [int(i) for i in input().split()] D = [str(i) for i in input().split()] payment = N while True: count = 0 for i in D: if i in str(payment): break else: count += 1 if count == len(D): print(payment) exit() payment += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s407884046
p04045
Accepted
import bisect n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] a = [int(i) for i in range(10) if i not in d] ans = "" next_d = 0 for i in range(len(str(n))-1, -1, -1): idx = bisect.bisect_left(a, int(str(n)[i])+next_d) if idx == len(a): next_d = 1 ans = str(a[0]) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s634069962
p04045
Accepted
n,k = map(int,input().split()) d = list(map(str,input().split())) d = set([str(x) for x in range(0,10)])-set(d) while 1: can = set(list(str(n))) if all(x in d for x in can): print(n) break n+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s390970591
p04045
Accepted
n, k = list(map(int, input().split())) d = input().split() for i in range(n, 100000) : si = str(i) for j in range(len(si)) : if si[j] in d : break else : print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s381183826
p04045
Accepted
# ABC042C - こだわり者いろはちゃん / Iroha's Obsession (ARC058C) def main(): n, k = list(map(int, input().rstrip().split())) D = set(map(int, input().rstrip().split())) ans = n while any(int(i) in D for i in str(ans)): ans += 1 print(ans) if __name__ == "__main__": main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s992288356
p04045
Accepted
import sys input = sys.stdin.readline N, K = map(int, input().split()) L = [v for v in input().split()] for n in range(N, 200000): s = list(str(n)) f = False for c in s: if c in L: f = True if f: continue print("".join(s)) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s801055770
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) dislike = [] for i in range(0, 10): dislike.append(False) for i in range(0, K): dislike[D[i]] = True while True: S = str(N) flag = True for i in range(0, len(S)): if dislike[int(S[i])]: flag = False break if flag: print(N) break N +...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s660250454
p04045
Accepted
n,k=map(int,input().split()) dl=set(input().split()) ans=n while True: for a in str(ans): if a in dl: break else: print(ans) break ans+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s578472824
p04045
Accepted
def main(): n, k = input().split() d = set(input().split()) while True: if len(set(n) & d)==0: print(n) break n = str(int(n) + 1) if __name__=="__main__": main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s293653179
p04045
Accepted
N, K = map(int, input().split()) Ds = set(map(int, input().split())) nmbrs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} nDs = nmbrs - Ds payment = N while True: payment_str = set(int(i) for i in str(payment)) if payment_str.issubset(nDs) == True: print(payment) break else: payment += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s798348466
p04045
Accepted
N, K = list(map(int, input().split(' '))) D = list(map(int, input().split(' '))) #print(N, K) #print(D) obse_num = [0 for i in range(10)] for i in range(K): obse_num[D[i]] = 1 pay_money = N while 1: obse_flag = 1 S = list(str(pay_money)) for char in S: if obse_num[int(char)] == 1: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s202417397
p04045
Accepted
N, K = map(int, input().split()) d = list(map(int, input().split())) f = [] for i in range(10): f += [False] for i in range(K): f[d[i]] = True x=N-1 l=True while l: x+=1 l=False b=x while b>0: if f[b%10]: l=True break b//=10 print(x)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s756955763
p04045
Accepted
N,K=map(int,input().split()) D=set([int(i) for i in input().split()]) while any(int(j) in D for j in str(N)): N+=1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s104301598
p04045
Accepted
n,k=map(int,input().split()) d=set(input().split()) while True: if len(set(str(n))&d)>=1: n+=1 else: print(n) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s069727361
p04045
Accepted
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
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s970622332
p04045
Accepted
def good_number(D, n): if n < 10: return n % 10 not in D return n % 10 not in D and good_number(D, n // 10) N, K = input().split() digit_num = len(N) N = int(N) K = int(K) D = list(map(int, input().split())) ub = int(str(D[0]) * (digit_num + 1)) usable = [] for i in range(10): if i not in D: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s894171013
p04045
Accepted
N, K = input().split() D = input().split() E = [str(x) for x in range(10) if str(x) not in D] n = len(N) next_digit = [(str(d), 0) if str(d) not in D else None for d in range(10)] for i in range(9, -1, -1): if next_digit[i] is None: j = (i + 1) % 10 while next_digit[j] is None: j = (j +...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s637780941
p04045
Accepted
N, K = map(int, input().split()) D = input().split() for n in range(N, 10 * N): if all(map(lambda c: c not in D, str(n))): print(n) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s371849551
p04045
Accepted
n, k = map(int, input().split()) d=list(map(int, input().split())) l = [i for i in range(10) if i not in d] for i in range(n,100000): flag=True for j in str(i): if int(j) in (d): flag = False if flag: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s775428117
p04045
Accepted
N, K = map(int, input().split()) D = list(map(str, input().split())) for i in range(N, N*1000): A = list(str(i)) flag = True for a in A: if ( a in D ): flag = False if( flag == True): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s411201189
p04045
Accepted
N,K = map(int,input().split()) D = set(map(int,input().split())) A = {1,2,3,4,5,6,7,8,9,0} N_list = [int(c) for c in str(N)] use = sorted(list(A - D)) ans = [max(use) for i in range(len(N_list))] mapans = map(str,ans) x = int(''.join(mapans)) if N == x: print(x) elif N > x: if use[0]!= 0: ans = [use[...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s408213563
p04045
Accepted
n, k = map(int, input().split()) d = input().split() while True: n_str = str(n) for ch in n_str: if ch in d: n += 1 break else: print(n) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s057392195
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) d = [] for i in range(10): if i in D: pass else: d += [i] def check(i): I = str(i) n = len(I) for j in range(n): if int(I[j]) in d: pass else: return False return T...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s947545685
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) #使うことのできるリストの作成 d = [] for i in range(10): if i in D: pass else: d += [i] def check(i): #数値iがdのリストだけで書くことができるかを判定 I = str(i) #文字列に変換 # print (I) n = len(I) #桁数の取得 for j in range(n): #全桁で確認 # print (I[j...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s345445532
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) #使うことのできるリストの作成 d = [] for i in range(10): if i in D: pass else: d += [i] def check(i): #数値iがdのリストだけで書くことができるかを判定 I = str(i) #文字列に変換 # print (I) n = len(I) #桁数の取得 for j in range(n): #全桁で確認 # print (I[j...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s019459799
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) d = [] for i in range(10): if i in D: pass else: d += [i] def check(i): I = str(i) # print (I) n = len(I) for j in range(n): # print (I[j]) if int(I[j]) in d: pass else: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s993477077
p04045
Accepted
p=input().rstrip().split(' ') q=input().rstrip().split(' ') l=[0]*10 for i in range(0,len(q)): l[int(q[i])]=1; for i in range(int(p[0]),1000000000000): t=list(str(i)) G=1; for j in range(0,len(t)): if l[int(t[j])]==1: G=0; break; if G==1: print(i) brea...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s809746576
p04045
Accepted
# encoding:utf-8 import copy import random import bisect #bisect_left これで二部探索の大小検索が行える import fractions #最小公倍数などはこっち import math import sys mod = 10**9+7 sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000 def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(): return [list(map(int, l.split())) for l in...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s990294694
p04045
Accepted
n, k = map(int, input().split()) dlist = [s for s in input().split()] ans = n while True: blnOk = True for d in str(ans): if d in dlist: blnOk = False break if blnOk: print(ans) exit() else: ans += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s327177014
p04045
Accepted
n, k = map(int, input().split()) dlist = [s for s in input().split()] ans = n while True: blnOk = True for d in str(ans): if d in dlist: blnOk = False if blnOk: print(ans) exit() else: ans += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s277344034
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) for i in range(N, 100000): flag = True for j in str(i): if j in D: flag = False break if flag: print(i) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s015651275
p04045
Accepted
N,K = [int(x) for x in input().split()] D = [x for x in input().split()] ans = '' for i in range(N,N+110000): flag = True for j in str(i): if(j in D): flag = False break if(flag): print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s679316629
p04045
Accepted
N,K=map(int,input().split()) D=list(map(int,input().split())) def func(N): l=[] while(N!=0): l.append(N%10) N//=10 return l for n in range(N,10**6+1): l=func(n) T=True for i in l: if i in D: T=False break if T: print(n) quit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s640605230
p04045
Accepted
n,k=map(int,input().split()) s=set(map(int,input().split())) while len(set([int(c) for c in str(n)])&s)!=0: n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s409209937
p04045
Accepted
N,K=map(int,input().split()) D=list(input().split()) while N<100000: fr=False for j in D: if j in str(N): N+=1 fr=True break if fr: continue else: print(N) exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s653162219
p04045
Accepted
N,K=map(int,input().split()) D=list(input().split()) while sum([i in D for i in list(str(N))])>0: N+=1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s665571407
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int,input().split())) cost = N while True: for i in range(K): if str(D[i]) in str(N): break else: print(N) exit() N += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s897470257
p04045
Accepted
n, k = map(int,input().split()) d = list(map(str, input().split())) def search(x): count = 0 for i in d: if str(x).find(i) == -1: count += 1 if len(d) == count: return True while True: if search(n): break else: n += 1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s975019724
p04045
Accepted
n, k = map(int,input().split()) d = list(map(str, input().split())) d_n = [i for i in range(10) if i not in d] def search(x): count = 0 for i in d: if str(x).find(i) == -1: count += 1 if len(d) == count: return True while True: if search(n): break else: n += ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s655351272
p04045
Accepted
[n,k]=[int(_) for _ in input().split()] d=[int(_) for _ in input().split()] dt=list({_ for _ in range(10)}-set(d)) def c(n,l): for _c in str(n): if int(_c) not in l: return False return True while True: if c(n,dt): break n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s313817307
p04045
Accepted
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf=10**20 mod=10**9+7 def LI(): return list(map(int,input().split())) def I(): return int(input()) def LS(): return input().split() def S(): return input() def main(): n,k=LI() l=LS() for i i...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s885354409
p04045
Accepted
N,K = map(int,input().split()) D = set(int(x) for x in input().split()) safe = set(range(10)) - D def test(N): return set(int(x) for x in str(N)) <= safe def F(N): # 下の位から決める while N % 10: if test(N): return N N += 1 # N は 10の倍数 x = F(N//10) y = min(safe) return 10*x + y answer = F(N) pri...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s758033454
p04045
Accepted
N, K = map(int, input().split()) num_exclude = list(map(int, input().split())) dec_num = [i for i in range(0, 10)] able_use_num_lis = list(map(str, set(dec_num) - set(num_exclude))) num_len = len(str(N)) output_list = [] def dfs(cur, num, able_use_num_lis): if num != '': if int(num) >= N: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s013582688
p04045
Accepted
N, K = map(int, input().split()) D = set([str(x) for x in input().split()]) while True: if len( set(str(N)).intersection(D)) == 0: print(N) exit() else: N += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s347577853
p04045
Accepted
import itertools n, k = map(str, input().split()) ok = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} d = set(map(str, input().split())) ok.difference_update(d) ok_list = list(ok) ok_list.sort() ans = "" if ok_list[-1] * len(n) < n: ans = ok_list[0] * (len(n) + 1) if ok_list[0] != "0" else ok_list[1] + "0" * l...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s945758818
p04045
Accepted
N, K = map(int, input().split()) dislike = [] for i in range(0, 10): dislike.append(False) D = list(map(int, input().split())) for i in range(0, K): dislike[D[i]] = True Y = N while True: flag = True for i in range(0, len(str(Y))): if dislike[int(str(Y)[i])]: flag = False break if flag: print(Y) break ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s565993882
p04045
Accepted
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf=10**20 mod=10**9+7 def LI(): return list(map(int,input().split())) def I(): return int(input()) def LS(): return input().split() def S(): return input() def main(): n,k=LI() l=LS() ans=1 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s086631534
p04045
Accepted
n, m = [ int(v) for v in input().split() ] num_list = [ v for v in input().split() ] t = n while True: if all([ ( v not in num_list ) for v in list(str(t))]): print(t) break t += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s577062186
p04045
Accepted
# -*- coding: utf-8 -*- n,k = list(map(int,input().split())) d = list(input().split()) flag = True while flag: check_result = False for i in d: if i in list(str(n)): check_result =True break if check_result: n+=1 else: flag=False print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s886942275
p04045
Accepted
n, k = map(int, input().split()) dislikes = set(input().split()) price = set(str(n)) while price & dislikes: n += 1 price = set(str(n)) print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s795359754
p04045
Accepted
# N<=100000なので愚直にインクリメントしていった最初のやつでいいんじゃないかと思い始めた 繰り上がりとかの場合分けがめんどいし n, k = map(int, input().split()) nglist = list(input().split()) while True: strn = str(n) flag = True for ng in nglist: if ng in strn: flag = False break if flag: break else: n += 1 p...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s998709903
p04045
Accepted
def main(): n,k=map(int,input().split(' ')) d = input().split(' ') for i in range(n,10*n+1): if not set(list(str(i)))&set(d): print(i) break if __name__=='__main__': main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s865921072
p04045
Accepted
def equal(n, available): return n in available def less(n, available): return n < sorted(available, reverse=True)[0] def greater(n, available): return n > sorted(available, reverse=True)[0] #less(n, available) == True であること def upper_next(n, available): for v in sorted(available): if n < v: r...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s303035357
p04045
Accepted
def main(): n,k=map(int,input().split(' ')) d = list(input().split(' ')) for i in range(n,10*n+1): if not set(list(str(i)))&set(d): print(i) break main()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s866228374
p04045
Accepted
#!/usr/bin/python3 # -*- coding: utf-8 -*- Likes = set() def check(n): global Likes while n > 0: if n%10 not in Likes: return False else: n //= 10 return True def main(): global Likes N,K = map(int, input().split()) Dn = list(map(int, input().split())) Likes = set(range(10))-s...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s264938084
p04045
Accepted
N, K = map(int, input().split()) d = list(map(int, input().split())) for i in range(N, 100000): flag = True tmp = i for j in reversed(range(len(str(i)))): if (tmp // (10 ** j)) in d: flag = False break else: tmp = tmp % (10 ** j) if flag: pri...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s639696416
p04045
Accepted
n,k = map(int, input().split()) d = list(map(int, input().split())) while True: a = str(n) flag = False for i in range(len(d)): if str(d[i]) in a: flag = True n+=1 break if not flag: break print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s841107363
p04045
Accepted
n,m=map(int,input().split()) l=list(map(int,input().split())) b=True while b: b1=False l1=list(str(n)) for i in l1: if int(i) in l: b1=True if b1==False: b=False print(n) break else: n+=1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s084469659
p04045
Accepted
def dfs(i, s, l): if i == len(s): return '' for j in l: if j == int(s[i]): ans = dfs(i + 1, s, l) if ans is not None: ans += str(j) return ans elif j > int(s[i]): ans = str(l[0]) * (len(s) - i - 1) + str(j) r...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s782216005
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) ans = N while True: tmp = ans finish = True while tmp > 0: if tmp % 10 in D: finish = False break tmp //= 10 if finish: break ans += 1 print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s567937963
p04045
Accepted
ints = list(map(int, input().split())) li = list(map(int, input().split())) number = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} dislike = set(li) like = number - dislike for i in range(ints[0], 100000): flag = 0 price = [int(j) for j in str(i)] length = len(price) for k in range(length): if price[k] in lik...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s759172104
p04045
Accepted
n,k = map(int, input().split()) d = set(input().split()) while True: s = set(list(str(n))) if all([i not in d for i in s]): print(n) break n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s770910996
p04045
Accepted
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf=10**20 mod=10**9+7 def LI(): return list(map(int,input().split())) def I(): return int(input()) def LS(): return input().split() def S(): return input() def main(): n,k=LI() l=LI() a=0 ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s475183466
p04045
Accepted
nk = input().split() d = input().split() def hantei(int_siraverukazu): lst_siraverukazu = list(str(int_siraverukazu)) onazi_t_tigau_f = [] for i in range(int(nk[1])): for j in range(len(lst_siraverukazu)): if d[i] != lst_siraverukazu[j]: onazi_t_tigau_f.append(False) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s310759979
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) #lst =[] k = N """while k > 0: lst.append(k % 10) k //= 10 #lst.reverse()""" #print(lst) while 1: flg = True lst = [] N = k while k > 0: lst.append(k % 10) k //= 10 lst.reverse() #print(lst) for i...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s533181072
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) k = N """while k > 0: lst.append(k % 10) k //= 10 #lst.reverse()""" #print(lst) while 1: flg = True lst = [] N = k while k > 0: lst.append(k % 10) k //= 10 lst.reverse() # print(lst) for i in range...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s900578878
p04045
Accepted
lst_1 = input().split() N = lst_1[0] K = int(lst_1[1]) lst_N = list(N) lst_hate = input().split() flg = True while 1: for i in range(len(lst_N)): for j in range(len(lst_hate)): if lst_N[i] == lst_hate[j]: flg = False break if flg == True: bre...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s157311006
p04045
Accepted
N, K = map(int, input().split()) d = set(input().split()) for v in range(N, 10 * N): if not set(str(v)) & d: print(v) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s107596803
p04045
Accepted
from itertools import product N,K = list(map(int,input().split(" "))) Ds = list(map(int,input().split(" "))) nums = [0,1,2,3,4,5,6,7,8,9] nums = list(set(nums) - set(Ds)) cand = [] for j in range(1,6): for i in product(nums, repeat=j): i = list(map(str,i)) temp = "".join(list(i)) temp = in...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s191848255
p04045
Accepted
a,b = map(int,input().split()) c=list(map(int,input().split())) for i in range(a,99999): j = list(str(i)) n=0 for k in j: for d in c: if int(k)==d: n+=1 if n==0: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s832575276
p04045
Accepted
n,k = map(int,input().split()) d = list(input().split(' ')) def check(num): globals() s = str(n) for i in d: if i in s: return True return False while(check(n)): n+=1 print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...