submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s468579931
p04045
Accepted
N, K = map(int, input().split()) S = input().split() flag = False for i in range(N, 10*N): for k in range(len(str(i))): if str(i)[k] in S: flag = False break else: flag = True continue 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...
s127761575
p04045
Accepted
N, K = raw_input().split() D = raw_input().split() candi = [str(i) for i in xrange(10)] for d in D: candi.remove(d) def decide(i): if i >= len(N): return '' for c in candi: if N[i] == c: return c + decide(i+1) elif N[i] < c: return c + candi[0] * (len(N) - 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...
s645418368
p04045
Accepted
# B N, L = [int(i) for i in input().split()] D = sorted([i for i in input().split()]) for i in range(N, 100000): if all([s not in D for s in list(str(i))]): 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...
s401028585
p04045
Accepted
# -*- coding: utf-8 -*- import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll N, K = map(int, raw_input().split()) D = set(raw_input().split()) for i in xrange(100000): for x in str(N): if x in 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...
s924565819
p04045
Accepted
N, K = map(int,input().split()) D_set = set(list(map(int,input().split()))) while True: if set(map(int,list(str(N)))) & D_set: N += 1 else: break print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s492188572
p04045
Accepted
N,K = map(int,raw_input().split(" ")) A = map(int,raw_input().split(" ")) n = [int(c) for c in str(N)] len_n = len(n) digits = [] for i in range(10): if not(i in A): digits.append(i) def need_big_keta(): if n[0] < digits[-1]: return False i=0 while i < len_n and n[i] == digits[-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...
s185192121
p04045
Accepted
N, K = map(int, input().split()) d = input().split() def check(c): for i in d: if str(c).count(i): return False return True count = N while True: if check(count): break count += 1 print(count)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s655308016
p04045
Accepted
class IrohasObsession: def getMinimumValue(self,n,k,d): nums=list(set(d)^set([0,1,2,3,4,5,6,7,8,9])) for i in range(100000): digits=[int(str(n)[i]) for i in range(len(str(n)))] flag=1 for j in range(len(digits)): if not digits[j] in nums: flag=0 if flag: print n; return n+=1 print -1 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...
s679207238
p04045
Accepted
N, K = map(int, input().split()) D = list(map(int, input().split())) dp = [True]*10 for e in D: dp[e] = False def calc(s): res = True for c in s: if not dp[int(c)]: res = False break return res while True: if calc(str(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...
s953591807
p04045
Accepted
N,K=map(int,input().split()) Ds=list(input().split()) Di=list(map(int,Ds)) nex=[1]*10 for i in reversed(Di): nex[i-1]=nex[i]+1 def check(n): ns = str(N) for nss in ns: if nss in Ds: return False return True def next(i): global N ns='{0:0>5}'.format(N) t=nex[int(ns[i])] ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s076004289
p04045
Accepted
def solve(): n, k = map(int, input().split()) d = set(input().split()) while True: s = str(n) for x in d: if x in s: break else: print(s) break n += 1 def main(): solve() 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...
s406992619
p04045
Accepted
N,K = input().split() D = list(map(int,input().split())) def check(num,D): numStr = str(num) for i in range(len(numStr)): if int(numStr[i]) in D: return False return True n = int(N) for i in range(n,100000): if check(i,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...
s947772098
p04045
Accepted
import re class IO_for_Contest(object): @staticmethod def my_input(): # return raw_input() return input() @staticmethod def read_from_input(): n, k = IO_for_Contest.read_n_int(2) return n, IO_for_Contest.read_n_int(k) @staticmethod def read_line(): ret...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s933053727
p04045
Accepted
N, K = map(int, input().split()) D = list(input().split()) for i in range(N, N*10): if all(d not in str(i) for d in 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...
s952289103
p04045
Accepted
def check_number(ans): ans = map(int,list(str(ans))) for i in range(len(ans)): for j in range(K): if ans[i]==number[j]: return 0 return 1 if __name__ == '__main__': N,K = map(int,raw_input().split()) number = map(int,raw_input().split()) ans = N count =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s891365185
p04045
Accepted
N, K = list(map(int, input().split())) D = list(input().split()) for x in range(N, N * 10): if all(d not in str(x) for d in D): print(x) 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...
s295154055
p04045
Accepted
N, K = map(int, raw_input().split()) D = map(str, raw_input().split()) while True: if any(l in D for l in str(N)): 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...
s728151806
p04045
Accepted
#coding: utf-8 #ABC042C n,k=map(int,raw_input().split()) d=raw_input().split() while True: if all(x not in str(n) for x in d): res=n break n+=1 print res
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s033741232
p04045
Accepted
N, K = map(int, input().split()) oknums = set(range(10)) - set(map(int, input().split())) def can(ans): digits = map(int, list(str(ans))) for d in digits: if not d in oknums: return False return True ans = N while True: if can(ans): 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...
s431487299
p04045
Accepted
import sys S, K = input().split() Bad = list(map(int, input().split())) OK = sorted(set(range(10)) - set(Bad)) NotZero = sorted(set(OK) - set([0])) if any(d > str(OK[-1]) for d in S): print(str(NotZero[0]) + str(OK[0]) * len(S)) sys.exit() count = [0] * 10 for c in str(S): count[ord(c) - ord('0')] += 1 gr...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s538235128
p04045
Accepted
S, K = map(int, input().split()) Bad = list(input().split()) while 1: if all(d not in str(S) for d in Bad): print(S) break S += 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...
s537530506
p04045
Accepted
import itertools ini = int(input().split(" ")[0]) try: negaset = [int(x) for x in input().split(" ")] except : print (ini) exit() okset = sorted([str(i) for i in range (10) if i not in negaset]) #print(ini,okset) for p in [int("".join(j)) for j in itertools.chain.from_iterable (itertools.product(okset,rep...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s358845352
p04045
Accepted
N, K = map(int, raw_input().split()) D = map(int, raw_input().split()) n = N while True: s = str(n) if all(str(d) not in s for d in D): 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...
s999323014
p04045
Accepted
n,k=map(int,input().split()) drr=map(int,input().split()) digits = set(map(str,set([0,1,2,3,4,5,6,7,8,9])-set(drr))) #print(digits) for i in range(n,100000): # print(i,set(str(i))) if set(str(i)).issubset(digits): 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...
s685990771
p04045
Accepted
n, k = map(int, input().split()) dislike = input().split() i = 0 while True: money = str(n + i) if len(set(money).intersection(dislike)) == 0: print(money) 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...
s752523023
p04045
Accepted
N, K = map(int, raw_input().split()) D = raw_input().split() while any(s in D for s 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...
s488572887
p04045
Accepted
#!/usr/bin/env python3 # -*- coding:utf-8 -*- def main(): N, K = map(int, input().split()) D = input().split() i = N while True: if len(set(str(i)).intersection(D)) == 0: print(i) break i += 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...
s296792712
p04045
Accepted
N, K = map(int, input().split()) Ds = input().split() for v in range(N, N*10 + 1): strv = str(v) for d in Ds: if d in strv: break else: 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...
s395023390
p04045
Accepted
def no_dislike_number(num, D): for digit in num: if digit in D: return False return True # for dislike in D: # if dislike in num: # return False # return True MAX = 10000 N, K = map(int, input().split()) D = input().split() num = N while(True): if no_dislike_...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s085766481
p04045
Accepted
#coding=UTF-8 mojir=input() hyo=mojir.split(' ') N=int(hyo[0]) K=int(hyo[1]) mojir=input() hyo=mojir.split(' ') D=[int(mono) for mono in hyo] kouho=N def usecheck(gaku): gakustr=str(gaku) keta=len(gakustr) dame=None for idx in range(0,keta,1): if gakustr[idx] in hyo: dame=idx ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s943790076
p04045
Accepted
import itertools N, K = map(int, raw_input().split()) d = map(int, raw_input().split()) d = set(d) ok = set(range(10)) - d ok = sorted(list(ok)) ok = [str(i) for i in ok] i = 1 while True: for ele in itertools.product(ok, repeat=i): if int("".join(list(ele))) >= N: print "".join(list(ele)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s570069348
p04045
Accepted
#!/usr/bin/env python2 #encoding: UTF-8 # To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. import math line=raw_input().rstrip().split(' ') N=int(line[0]) K=int(line[1]) Disto=raw_input().rstrip(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s684958329
p04045
Accepted
N, K = map(int, raw_input().split()) D = map(int, raw_input().split()) for i in range(N, 1000000): flag = 0 for j in D: if str(j) in str(i): flag = 1 break if flag == 0: print i exit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s203740960
p04045
Accepted
import itertools,math,bisect,pprint,sys n, k = map(int, raw_input().split()) d = map(int, raw_input().split()) def use_d(n): for i in list(str(n)): if int(i) in d: return True else: return False while n < 100000: if use_d(n): n += 1 else: print n sys....
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s595569004
p04045
Accepted
cond = [int(n) for n in input().split(" ")] exclude = {n for n in range(10)} answer = "" mo = {str(n) for n in input().split(" ")} exclude = exclude - mo for n in range(cond[0],100000): for m in [n for n in str(n)]: if m in mo: 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...
s128207314
p04045
Accepted
def no_dislike_number(num, D): for dislike in D: if dislike in num: return False return True MAX = 10000 N, K = map(int, input().split()) D = input().split() num = N while(True): if no_dislike_number(str(num), D): print(num) break num += 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...
s610019340
p04045
Accepted
n, k = map(int, raw_input().split()) l = map(int, raw_input().split()) flag = False while flag == False: flag = True t = n while t > 0: m = t % 10 if m in l: flag = False break t = t / 10 n += 1 print n - 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s348039054
p04045
Accepted
def read(): return map(int, input().split()) n, k = read() d = set(read()) nset = set(map(int, str(n))) while nset.intersection(d): n += 1 nset = set(map(int, 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...
s082225202
p04045
Accepted
n,k=map(int,input().split()) d=list(map(str,input().split())) d=set(d) for i in range(n,10**7): ans=set(str(i)) for j in ans: if j in d: break else: 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...
s693023678
p04045
Accepted
import sys l = raw_input().split() N = int(l[0]) K = int(l[1]) a = raw_input().split() like={} for i in range(10): if str(i) in a: like.setdefault(i,False) else: like.setdefault(i,True) while(True): ok = True num_str = str(N) for s in num_str: if like[int(s)] is Fal...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s732160759
p04045
Accepted
N, _ = [int(x) for x in input().split()] D = set(range(10)) - set([int(x) for x in input().split()]) n = [int(x) for x in list(str(N))] i = 0 while i < len(n): if n[i] not in D: cand = {x for x in D if x > n[i]} if len(cand) > 0: n[i] = min(cand) for j in range(i + 1, len(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...
s667261902
p04045
Accepted
n, k = map(int,input().split()) d = list(map(str,input().split())) ans = n f = 0 while True: ansstr = list(str(ans)) l = len(ansstr) cnt = 0 for i in range(l): if ansstr[i] in d: break else: cnt += 1 if cnt == l: f = 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...
s125089078
p04045
Accepted
n, k = map(int, input().split()) d = set(input().split()) while True: current_digits = set(str(n)) if current_digits & d: n += 1 else: break print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s770507522
p04045
Accepted
N, K = map(int, raw_input().split()) D = "".join(raw_input().strip().split()) i = N while True: flag = True for c in str(i): if c in D: flag = False if flag: 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...
s099377486
p04045
Accepted
#coding :utf-8 N, K = map(int, raw_input().split()) D = map(int, raw_input().split()) while True: flag = True for x in D: if str(x) in str(N): flag =...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s532313812
p04045
Accepted
N, K = map(int,input().split()) D = list(map(str, input().split())) while True: S = str(N) t = 0 for x in S: if x not in D: t += 1 if t == len(S): print(S) break else: N += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s763511986
p04045
Runtime Error
import math total = list(map(lambda x: int(x), input().split())) possible = list({0,1,2,3,4,5,6,7,8,9} - set(list(map(lambda x: int(x), input().split())))) yen = total[0] digits = math.log10(yen) + 1 final = [] while digits: if yen % (10**digits) in possible: final.append(int(yen % (10**digits))) 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...
s411831596
p04045
Runtime Error
n, k= input().split() l = list(map(int,input().split())) checkNum=[i for i in range(11)] def find(x): while x!=checkNum[x]: checkNum[x]=checkNum[checkNum[x]] x=checkNum[x] return x for i in l: checkNum[find(i)]=checkNum[find(i+1)] fin="" for i in range(len(n)): first=int(n[i]) k=f...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s508719814
p04045
Runtime Error
n, k= map(int,input().split()) l = list(map(int,input().split())) checkNum=[i for i in range(11)] for i in l: checkNum[find(i)]=checkNum[find(i+1)] def find(x): while x!=checkNum[x]: checkNum[x]=checkNum[checkNum[x]] x=checkNum[x] return x fin="" remain=0 if n==0: fin=str(find(0)) whil...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s064020163
p04045
Runtime Error
N,K = map(int,input().split()) D = list(map(int,input().split())) E = [] for i in range(10): if i not in D: E.append(i) E = sorted(E) N = str(N) ind = len(N) for i in range(len(N)): if int(N[i]) not in E: ind = i break if ind==len(N): print(N) else: flag = 0 x = "" for i ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s553626963
p04045
Runtime Error
def answer(n: int, k: int, d: []) -> int: numbers = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ^ set(d)) payment = '' for i in str(n): for num in numbers: if int(i) <= num: payment += str(num) break return int(payment) def main(): n, k = map(int, input(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s960022775
p04045
Runtime Error
import sys from bisect import bisect_left def input(): return sys.stdin.readline().strip() def main(): N, K = map(int, input().split()) D = set(map(int, input().split())) ok = [i for i in range(10) if i not in D] N = str(N) l = len(N) if {i for i in range(int(N[0]), 10)} <= D: if ok[0] ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s645549174
p04045
Runtime Error
N, L = [int(x) for x in input().split()] S = [] for s in range(N): S.append(input()) print("".join(sorted(S))) # %% [markdown] # # C # # %% N, K = [int(x) for x in input().split()] dislikes = [False] * 10 dislike_nums = [int(x) for x in input().split()] for n in dislike_nums: dislikes[n] = True # Add '0' 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...
s558305478
p04045
Runtime Error
def minN(N:int, usable:list, restrict=True): usable.sort() if restrict: for i in usable: if i >= N: return str(i) else: return str(usable[0]) def main(): N, K = map(int, input().split()) D = set(map(int, input().split())) numset = set(range(0,10)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s261205067
p04045
Runtime Error
#!/usr/bin/env python3 import sys from itertools import chain from bisect import bisect_left # from collections import Counter # import numpy as np def solve(N: int, K: int, D: "List[int]"): nr = list(map(int, reversed(str(N)))) over = False answer = [] useable = sorted(set(range(10)) - set(D)) 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...
s451474947
p04045
Runtime Error
n,k = map(int, raw_input().split()) letters = [u for u in range(10) if u not in set(map(int, raw_input().split()))] def dfs(u,n,letters):return min([dfs(u*10 +l,n,letters) for l in letters if u or l]) if u < n else u print dfs(0,n,letters)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s211898451
p04045
Runtime Error
#1000 8 #1 3 4 5 6 7 8 9 n,k = map(int, raw_input().split()) s = set(map(int, raw_input())) letters = [u for u in range(10) if u not in s] def dfs(u,n,letters): if u >= n: return u return min([dfs(u*10 +l,n,letters) for l in letters if u or l]) print dfs(0,n,letters)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s096590089
p04045
Runtime Error
total, k = map(int, input().split()) d = input().split() def find_lowest_denomination(total, d): for i in range(total, 10001): if not set(str(i)) & set(d): print(i) return raise ValueError('Should never reach this code block') find_lowest_denomination(total, 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...
s768587080
p04045
Runtime Error
from itertools import combinations_with_replacement, product n, k = map(int, input().split()) d = [int(x) for x in input().split()] dd = set(list(range(10))) - set(d) x = str(n) lst = [] dd = list(dd) dd.sort() sel = [] for i in dd: if int(x[0]) <= i and len(sel) < 3: sel.append(i*10**(len(x)-1)) if len(sel) < 2: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s292449210
p04045
Runtime Error
import itertools N, K = map(int, input().split()) D = list(map(int, input().split())) dic = [0,1,2,3,4,5,6,7,8,9] for i in D: dic.remove(i) dict = map(str, dic) n = len(str(N)) #何桁か ans = [] for i in range(2): for v in itertools.permutations(dict, n+i): if int(''.join(v)) >= N: ans.appe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s069531103
p04045
Runtime Error
kingaku, n = input().split() no_num = input().split() result = [] ok_num = [] kuriage_num = [-1, 0] def kuriage(l): for i in ok_num: if result[l] < i: kuriage_num = [l, i] return if l <= 0: return return kuriage(l-1) #使える数字のリストを作成 for i in range(10): if not str(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s604122979
p04045
Runtime Error
N,k=map(int,input().split()) lst=list(map(int,input().split())) x=[] for i in range(10): x.append(i) for char in lst: if char in x: x.remove(char) # print(x) # x.sort( s=str(N) c=len(s) x.sort(reverse=True) ans="" flag=0 for j in range(10000000000): if len(ans)>=len(s): break 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...
s290015299
p04045
Runtime Error
price, hate = input().split() no_num = set([x for x in input().split()]) ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num)) result = [] f = True exe = True for i in price: f = True for j in ok_num: if i <= j: result.append(j) f = 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...
s239185871
p04045
Runtime Error
price, hate = input().split() no_num = set([x for x in input().split()]) ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num)) result = [] f = True exe = True for i in price: f = True for j in ok_num: if i <= j: print(j) result.append(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...
s410079526
p04045
Runtime Error
price, hate = input().split() no_num = set([x for x in input().split()]) ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num)) result = [] f = True exe = True for i in price: f = True for j in ok_num: if i <= j: print(j) result.append(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...
s821486022
p04045
Runtime Error
n, k = map(int, input().split()) n = str(n) d = [int(i) for i in input().split()] av_d = [str(i) for i in range(0, 10) if i not in d] number = '' for i in range(len(n)): managed = False for j in av_d: if i == 0 and j == '0': continue if j >= n[i]: number += 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...
s286768655
p04045
Runtime Error
n, k = map(int, input().split()) n = str(n) d = [int(i) for i in input().split()] av_d = [str(i) for i in range(0, 10) if i not in d] number = '' for i in range(len(n)): managed = False for j in av_d: if i == 0 and j == '0': continue if j >= n[i]: number += 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...
s494013104
p04045
Runtime Error
n, k = map(int, input().split()) n = str(n) d = [int(i) for i in input().split()] av_d = [str(i) for i in range(0, 10) if i not in d] number = '' print(av_d) for i in range(len(n)): managed = False for j in av_d: if i == 0 and j == '0': continue if j >= n[i]: number += 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...
s849591694
p04045
Runtime Error
N, K = map(int, input().split()) D = set(map(int, input().split())) digits = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - D) N = str(N) res = '' for c in N: n_digit = int(c) if n_digit == digits[0]: res += str(digits[0]) continue for i in range(1, 10-K): if n_digit <= digits[i] and n_digi...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s998426956
p04045
Runtime Error
def check(n,s): v=str(n) for i in v: if i in s: return False return True def solve(): n,k=mp() s=input().split() s=set(s) while True: if check(n,s): print(n) break else: n+=1 for _ in range(1): solve()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s810730093
p04045
Runtime Error
n,k = map(int,input().split()) d = list(map(int,input().split())) n_str = str(n) l = len(n_str) a = [i for i in range(10) if i not in d] #同じ桁の時 ans = "" for i in range(l): for j in a: if j == int(n_str[i]): ans += str(j) break elif j > int(n_str[i]): ans += str(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s707628707
p04045
Runtime Error
import sys import numpy as np from heapq import heappush, heappop from bisect import bisect_left as bi_l, bisect_right as bi_r from collections import deque, Counter, defaultdict from itertools import combinations, product import string inf = float('inf') MOD = 10**9+7 # MOD = 998244353 class NumberTheory(): def ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s063927303
p04045
Runtime Error
N,K = list(map(int,input().split())) D = list(map(int,input().split())) D_ = [_ for _ in range(10) if _ not in D] D_.sort() N_=N+1 break_flag=False for s_ in D_: if break_flag: break elif s_ == 0: continue for p in product(D_,repeat=len(str(N_))-1): ans=int(str(s_)+''.join(map(str,...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s104652535
p04045
Runtime Error
# -*- coding: utf-8 -*- # C - こだわり者いろはちゃん N, K = map(int, input().split()) D = list(map(int, input().split())) numList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] listAns = [] num = [] listN = [int(x) for x in list(str(N))] # print(listN) for i in numList: if i not in D: num.append(i) # print(num) for i in listN...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s685528682
p04045
Runtime Error
N,K = list(map(int, input().split())) D = set(input().split()) # シミュレーションでいける for ans in range(N,10000): if all(d not in D for d in str(ans)): print(ans) exit() raise AssertionError('バグってる')
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s123932140
p04045
Runtime Error
import sys,math,collections,itertools,bisect input = sys.stdin.readline N,K=list(map(int,input().split())) D = list(map(int,input().split())) Ds = set([0,1,2,3,4,5,6,7,8,9])-set(D) can = list(itertools.product(Ds,repeat = 5)) candi = [] for c in can: candi.append(1**4*c[0]+10**3*c[1]+10**2*c[2]+10**1*c[3]+c[4]) ca...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s543903491
p04045
Runtime Error
N , K = input().split() Dk = list(map(int, input().split())) for i in range(N,10*N+1): if set(i)&set(Dk) == set(): 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...
s178243476
p04045
Runtime Error
N , K = map(int, input().split()) Dk = list(map(int, input().split())) for i in range(N,10*N+1): if set(i)&set(Dk) == set(): 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...
s345758312
p04045
Runtime Error
def digit(): N, K = [int(n) for n in input().split()] digit = [int(n) for n in input().split()] for i in range(N, N*10): b = i while b != 0: if (b % 10) in digit: break b /= 10 if b == 0: print(i) break: digit()
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s991773600
p04045
Runtime Error
N, K = map(int, input().split()) l = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] for _ in range(K): l.remove(int(input())) n = [int(x) for x in str(N)] c = len(n) max = l[0] min = l[-1] if N > 1111 * max: b = 10000*min([i for i in l if i>0]) + 1111*min else: a = [max] * c for j in range(c): if a[j] > n[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...
s303233451
p04045
Runtime Error
from bisect import * n, k = map(int,input().split()) d = list(map(int,input().split())) use_num = [] for i in range(10): if i in d:continue use_num.append(i) str_n = str(n) res = 0 for i in str_n: temp = bisect_left(use_num, int(i)) add = use_num[temp] if temp == len(use_num): add = use_nu...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s499065609
p04045
Runtime Error
from bisect import * n, k = map(int,input().split()) d = list(map(int,input().split())) use_num = [] for i in range(10): if i in d:continue use_num.append(i) str_n = str(n) res = 0 for i in str_n: temp = bisect_left(use_num, int(i)) res = res * 10 + use_num[temp] print(res)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s223654371
p04045
Runtime Error
#C n,k = map(int,input().split()) d = list(map(int,input().split())) x = [i for i in range(10)] num = list(set(x)-set(d)) price = str(n) w = [] for i in range(len(price)): for j in range(len(num)): if num[j]>= int(price[i]): w.append(j) break if num[len(num)-1] < int(price[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...
s385224259
p04045
Runtime Error
#C n,k = map(int,input().split()) d = list(map(int,input().split())) x = [i for i in range(10)] num = list(set(x)-set(d)) price = str(n) w = [] for i in range(len(price)): for j in range(len(num)): if num[j]>= int(price[i]): w.append(j) break if num[len(num)-1] < int(price[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...
s223359281
p04045
Runtime Error
n, k = input().split() ds = list(map(int, input().split())) p_num = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(ds)) p_num.sort() ans = [] if max(p_num) < int(n[0]): n = n[1:] if (min(p_num) != 0): ans.append(p_num[0]) else: ans.append(p_num[1]) for s in n: for p in p_num: 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...
s184862450
p04045
Runtime Error
n, k = input().split() ds = list(map(int, input().split())) p_num = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(ds)) p_num.sort() ans = [] if max(p_num) < int(n[0]): if (min(p_num) != 0): ans.append(p_num[0]) else: ans.append(p_num[1]) for s in n: for p in p_num: if int(s) <= 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...
s521491683
p04045
Runtime Error
n, k = input().split() ds = list(map(int, input().split())) p_num = list(set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - set(ds)) p_num.sort() ans = [] for s in n: for p in p_num: if int(s) <= p: ans.append(str(p)) break ans = int(''.join(ans)) print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s090104311
p04045
Runtime Error
N, K = input().split() dislike = set(list(map(int, input().split()))) next_map = {} for i in range(10): for j in range(i,10): if j not in dislike: if i == 0: min_digit = j next_map.update({ i : j }) break next_map.update({ i : min_digit }) max_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...
s309097272
p04045
Runtime Error
a = input().split() tg = a[0] ok_nums = set("1","2","3","4","5","6","7","8","9","0") ng_nums = set(input().split()) ok_nums = ok_nums - ng_nums rt = 0 i = int(tg) while True: if ok_nums >= set(d for d in str(i)): print(i) break else: 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...
s236534621
p04045
Runtime Error
N, K = map(int, input().split()) P = list(map(int, input().split())) numbers = [0,1,2,3,4,5,6,7,8,9] use = [] for i in numbers: if not i in P: use.append(i) ul = [] for u5 in [0, use[1]]: for u4 in use: for u3 in use: for u2 in use: for u1 in use: ul.append(u5*10000 + u4*1000 + u3*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...
s820063456
p04045
Runtime Error
#ABC042C N,K=map(int,input().split()) N=str(N) N_len=len(N) a=[] out=N for i in range(K): a.append(input()) for i2 in range(N_len): for i3 in range(K): if N[i2]==a[i3]: out += 1 print(out)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s312386682
p04045
Runtime Error
#include <iostream> using namespace std; int main(void) { int n, k; cin >> n >> k; bool dislikes[10] = {false}; for (int i = 0, x; i < k; i++) { cin >> x; dislikes[x] = true; } auto valid = [&](int x) { while (x) { int d = x % 10; if...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s457009253
p04045
Runtime Error
n, k = map(int, input().split()) d = set(map(int, input().split())) l = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} a = d ^ l for i in range(n, 10000): g = set(str(i)) i_int ={int(m) for m in g} if i_int<=a: ans = i break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s660408754
p04045
Runtime Error
n, k = map(int, input().split()) d = set(map(int, input().split())) l = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} a = d ^ l for i in range(n, 10000): g = set(str(i)) i_int ={int(m) for m in g} if i_int==a: ans = i break print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s330242895
p04045
Runtime Error
N,K = map(int, input().split()) D = set(map(int, input().split())) D2 = {1,2,3,4,5,6,7,8,9} if 0 in D: print(N) else: print(int(*D2-D)*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...
s542533856
p04045
Runtime Error
import sys input = sys.stdin.readline #n = int(input()) #l = list(map(int, input().split())) ''' a=[] b=[] for i in range(): A, B = map(int, input().split()) a.append(A) b.append(B)''' a=list(map(str, [0,1,2,3,4,5,6,7,8,9])) n,k=map(int, input().split()) d=list(map(str, input().split())) for item 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...
s135017278
p04045
Runtime Error
N, K = map(int, input().split()) d = list(map(str, input().split())) ans = N while True: sra = str(ans) if sra[0] not in d and sra[1] not in d and sra[2] not in d and sra[3] not in d: if len(sra) == 5: if sra[4] not in d: print(sra) break print(sra) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s388756447
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) keta = int(len(str(n))) ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0})) ans = '' for i in reversed(range(keta)): val = int(str(n)[i]) candidate = [j for j in ok if j >= val] if candidate: ans += str(min(candidate)) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s558763832
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0})) ans = '' for i in range(len(str(n))): flag = False num = int(str(n)[i]) candidate = [j for j in ok if j >= num] if candidate: ans += str(min(candidate)) 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...
s979033622
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0})) ans = '' for i in range(len(str(n))): num = int(str(n)[i]) ans += str(min([j for j in ok if j >= num])) 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...