submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s857317350
p04045
Runtime Error
# -*- coding : utf-8 -*- n,k = map(int, input().split()) D = list(map(str, input().split())) curr_num = N while True : n_str = str(curr_num) for d in D: if d in n_str: curr_num += 1 break else: print(curr_num) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s080804357
p04045
Runtime Error
# -*- coding : utf-8 -*- n,k = map(int, input().split()) D = list(map(str, input().split())) while True : n_str = str(N) for d in D: if d in n_str: 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...
s067811569
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) other = [i for i in range(10)] - d m = 0 def dfs(m, now): m = int(m) if(m >= n): print(int(now)) else: if(m == 0): m = "" m = str(m) for(o in other): dfs(m, m + o)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s925235212
p04045
Runtime Error
class A: def solve(self): [a, b, c] = sorted([int(x) for x in input().split(" ")]) if a == 5 and b == 5 and c == 7: print("YES") else: print("NO") class B: def solve(self): [n, l] = [int(x) for x in input().split(" ")] strings = [] for ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s303559524
p04045
Runtime Error
n,k=map(int, input().split()) ds=list(map(str, input().split())) while i in str(n) for i in ds: n+=1 print(str(n))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s213518475
p04045
Runtime Error
n,k=map(int, input().split()) ds=[] for i in range(len(k)): ds.append(input()) ans=n while ds in ans: ans+=1 print(str(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...
s927887613
p04045
Runtime Error
n , k = map(int,input().split()) d = set(list(map(int,input().split()))) kouho =list({0,1,2,3,4,5,6,7,8,9} - d) kouho.sort() def f(now): if now >= n: print(now) exit() for i in kouho: f(now*10 + i) f(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...
s978087471
p04045
Runtime Error
n,k = map(int,input().split()) #入力 a = list(map(int,input().split())) #使用不可の数字 b = {0,1,2,3,4,5,6,7,8,9}-set(a) #使用可能な数字の集合 n = [int(i) for i in list(str(n))] #価格(int)をリストに分解 while set([int(i) for i in list(str(n))])-b !={} : # 使用可能な数字のみでなければ 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...
s423622729
p04045
Runtime Error
n,k = map(int,input().split()) #入力 a = list(map(int,input().split())) #使用不可の数字 n2 = [int(i) for i in list(str(n))] #価格を分解 for i in n2: while n2[i] in a :#使用不可ならば n2[i] += 1 if n2[i]>=10: n2[i] =1 print("".join([str(i) for i in n2]))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s208962859
p04045
Runtime Error
n,k = map(int,input().split()) #入力 a = list(map(int,input().split())) #使用不可の数字 b = list({0,1,2,3,4,5,6,7,8,9}-set(a)) #使用可能な数字のリスト n2 = [int(i) for i in list(str(n))] #価格を分解 for i in n2: while n2[i] in a :#使用不可ならば n2[i] += 1 print("".join([str(i) for i in n2]))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s818556852
p04045
Runtime Error
N,K= map(int,input().split()) D = [int(j) for j in input().split()] D2 = list(set([i for i in range(0,10)])-set(D)) D1 = list(set([i for i in range(1,10)])-set(D)) ans ='' for i in reversed(range(-len(str(N)),0)): if int(str(N)[i]) not in D: ans+=str(N)[i] elif i==-len(str(N)): ans+=str(min(D1))...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s411723615
p04045
Runtime Error
#input #n=3519,k=5,d=0,2,5,7,9 d0=[0,1,2,3,4,5,6,7,8,9] n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(k):d0.remove(d[i]) n=str(n) n=n[::-1] ans0=0 for i in range(len(n)): for j in range(len(d0)): if int(n[i])==9 and i<(len(n)-1) and d0[len(d0)-1]!=9: ans=10**i * d0...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s568847651
p04045
Runtime Error
from collections import deque n, k = map(int, input().split()) D = list(map(int, input().split())) # 1. 初期化 ok_lst = [x for x in range(0, 10) if x not in D] ok_lst.sort(reverse = True) stack = deque([x for x in ok_lst if x != 0]) while len(stack) > 0: # 2. 現在の情報の取得 # 今回は現在の数字 now_num = stack.pop() # 3...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s187741334
p04045
Runtime Error
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s120190106
p04045
Runtime Error
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections MOD = 10**9+7 MAX = 10**18 MIN = -10**18 n,k= map(int,input().split()) d = list(map(int,input().split())) able = [True]*10 for i in range(k): able[d[i]] = False 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...
s074580474
p04045
Runtime Error
inputNK = input() N = int(inputNK[0]) K = int(inputNK[1]) dislike = input.split(" ") judge = true answer = 0 for i in range(N,INF): for number in dislike: if str(i).count(number) != 0 judge = false break if judge == true: answer = i break else: judge = true 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...
s831259203
p04045
Runtime Error
import itertools NK = input().split() N = NK[0] K = int(NK[1]) d = input().split() D = [int[s] for s in d] Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in D: Da.remove(i) Da_str = [str(j) for j in Da] a_1 = [''.join(j) for j in itertools.product(Da_str, repeat=len(N))] a_2 = [''.join(j) for j in itertools.prod...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s683703784
p04045
Runtime Error
import itertools NK = input().split() N = NK[0] K = int(NK[1]) d = input().split() D = [int[s] for s in d] Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in D: Da.remove(i) Da_str = [str(j) for j in Da] a_1 = [''.join(j) for j in itertools.product(Da_str, repeat=len(N))] a_2 = [''.join(j) for j in itertools.prod...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s407099380
p04045
Runtime Error
import itertools NK = input().split() N = NK[0] K = int(NK[1]) d = input().split() D = [int[s] for s in d] Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in range(len(D)): Da.remove(D[i]) Da_str = [str(j) for j in Da] a_1 = [''.join(j) for j in itertools.product(b_st, repeat=len(N))] a_2 = [''.join(j) for j in 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...
s681043206
p04045
Runtime Error
import itertools NK = input().split() N = NK[0] K = int(NK[1]) d = input().split() D = [int[s] for s in d] Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in range(len(D)): Da.remove(D[i]) Da_str = [str(j) for j in Da] a_1 = [''.join(j) for j in itertools.product(b_st, repeat=len(N))] a_2 = [''.join(j) for j in it...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s060859799
p04045
Runtime Error
import itertools NK = input().split() N = NK[0] K = int(NK[1]) d = input().split() D = [int[s] for s in d] Da = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for i in range(len(D)): Da.remove(D[i]) nu = [] for j in itertools.combinations_with_replacement(Da, len(N)+1): b = ''.join([str(j[i]) for i in range(len(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...
s656527362
p04045
Runtime Error
import copy def make1d(n, m): return [copy.deepcopy(m) for i in range(0,n)] s = list(map(int, input().split())) t = list(map(int, input().split())) #支払う金額s[0]を桁ごとに分解する #支払う金額の桁数:n n = 0 while (s[0] // (10 ** n)) >= 10: n = n + 1 l = make1d(n + 1, 1) m = s[0] for i in range(0, n + 1): l[n - i] = m % 10 m...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s026985626
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(int, input().split())) OK = list({1, 2, 3, 4, 5, 6, 7, 8, 9} - set(D)) S = str(N) ans = [] def find_next(x): while True: x += 1 if x in OK: return str(x) for i in range(len(S)): if int(S[i]) in OK: ans += S[i] elif max(OK...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s101671575
p04045
Runtime Error
n, k = map(int,input().split()) d = list(map(int,input().split())) s = 0 while s == d[s]: s += 1 x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 t = 0 while i <= y + t: j = 0 while j < k: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s519971500
p04045
Runtime Error
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 t = 0 while i <= y + t: j = 0 while j < k: if a[y-i+1] == d[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...
s399996043
p04045
Runtime Error
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 t = 0 while i <= y + t: j = 0 while j < k: if a[y-i+1] == d[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...
s336074556
p04045
Runtime Error
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 t = 0 while i <= y: j = 0 while j < k: if a[y-i+1] == d[j]: a[y...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s621917806
p04045
Runtime Error
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 t = 0 while i <= y: j = 0 while j < k: if a[y-i+1] == d[j]: a[y...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s154583960
p04045
Runtime Error
n, k = map(int,input().split()) d = list(map(int,input().split())) x = 0 y = 0 while x <4: if n // (10**x) >0: y = x x += 1 i = 0 a = [0] m = 0 while i <= y: a.append(((n//(10**(y-i)))%10)) i +=1 i = 0 while i <= y: j = 0 while j < k: if a[y-i+1] == d[j]: a[y-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...
s659250155
p04045
Runtime Error
n,k=list(map(int,input().split())) D=list(map(int,input().split())) like=[] for i in range(10): if not i in D: like.append(i) N=str(n) ans=[] for i in range(len(N)): for j in range(len(like)): if like[j]>=int(N[i]): ans.append(like[j]) break else: if not like[...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s031267728
p04045
Runtime Error
import itertools def solve(n, k, xs): tmp = [str(i) for i in range(10) if i not in xs] str_len = len(str(n)) hoge = [i for i in map(lambda x: int("".join(x)), itertools.product(tmp, repeat=str_len)) if i >= n] return hoge[0] if __name__ == "__main__": n, k = [int(i) 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...
s775029378
p04045
Runtime Error
import math n,k = list(map(int, input().split())) a = list(map(int, input().split())) for ii in range(n*10): i = ii+1 ar = ValueToArray10(i, int(1+(math.log(i)+0.00001)/math.log(10))) ok=1 for j in ar: for k in a: if(j==k): ok=0 if(ok==1 and i>=n): print...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s817785256
p04045
Runtime Error
l=list(map(int,input().split())) d=list(map(int,input().split())) d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() n=[int(k) for k in str(l[0]) for i in range(len(n)) dig1=0 dig2=0 for j in range(l[1]): p=dig1+d_bar[j]*10**(range(l[0])-i) if p>l[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...
s669673608
p04045
Runtime Error
l=list(map(int,input().split())) d=list(map(int,input().split())) d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() a=[] p=0 n_int=[int(k) for k in str(l[0])] for i in range(len(n_int)): a.append(10) for j in range(len(d_bar)): if n_int[-i-1]==d_bar[j]: a....
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s895417764
p04045
Runtime Error
l=list(map(int,input().split())) d=list(map(int,input().split())) d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() a=[] n_str=str(l[0]) n_int=[int(k) for k in n_str] for i in n_int: a.append('na') for j in d_bar: if i<=j: a[i-1]=j 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...
s209511472
p04045
Runtime Error
l=list(map(int,input().split())) d=list(map(int,input().split())) d_bar=[] for m in range(10): if m not in d: d_bar.append(m) d_bar.sort() a='' for i in str(l[0]): for j in d_bar: if int(i)<=j: k=str(j) break else: pass a=a+k print(int(a))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s523848461
p04045
Runtime Error
n, k = map( int, input().split()) hate = set( input().split()) usable = sorted( list( {str(i) for i in range(10)} - hate)) l = len(str(n)) def check(l): num = [] if l == 1: for i in usable: num.append(i) if l == 2: for ii in usable: for i in usable: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s771393223
p04045
Runtime Error
n, k = map( int, input().split()) hate = set( input().split()) usable = sorted( list( {str(i) for i in range(10)} - hate)) l = len(str(n)) def check(l): num = [] if l == 1: for i in usable: num.append(i) if l == 2: for ii in usable: for i in usable: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s472313769
p04045
Runtime Error
a,n=map(int,input()) b=[] for i in range(n): b.append(int(input()) flag="F" which flag=="F": k=a fflag="T" which k>=1 and fflag=="T": l=int(k%10) for i in range(n): if a[i]==l: fflag="F" break if fflag=="T": flag="T" else: a+=1 print(a)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s305178661
p04045
Runtime Error
N, L = map(int, input().split()) hates = [input() for _ in range(N)] for i in range(N, 9999): nums = list(str(i)) com = set(nums) & set(hates) if len(com) == 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...
s203917040
p04045
Runtime Error
import sys N,K = map(int, input().split()) *D, = input().split() for n in range(N, 10000, 1): L = list(str(n)) flg = 0 for l in L: if (l in D) or n<N: flg = 1 break if flg==0: print(n) sys.exit(9)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s553242666
p04045
Runtime Error
N,K=map(int,input().split()) D=list(map(int,input().split())) for price in range(N,10**4+1): s=str(price) flag=True for i in range(len(s)): if int(s[i]) in D: flag=False if flag: ans=price 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...
s618811671
p04045
Runtime Error
n,k = map(int,input().split()) d = list(input().split()) ans = n while True: flag = False for i in d: if flag :break if i in str(ans): x = len(str(n)) - str(n).index(i) - 1 ans += 10**x flag = True if flag:continue print(ans) 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...
s151171527
p04045
Runtime Error
n,k = map(int,input().split()) d = list(input().split()) ans = n while True: flag = False for i in d: if flag :break if i in str(ans): x = len(str(n)) - str(n).index(i) - 1 ans += 10**x flag = True if flag:continue print(ans) exit(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...
s568916532
p04045
Runtime Error
N, K = map(str, input().split()) N = ''.join(list(reversed(N))) num_ls = [i for i in range(10)] ls = map(int, input().split()) dif = list(set(num_ls) - set(ls)) dif.sort() ans = '' for i in N: tmp = min(filter(lambda x: int(i) <= x, dif)) if tmp == None: tmp=min(dif) ans = ans + str(tmp) print(''...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s140604602
p04045
Runtime Error
def function(m, set1): set2 = set(str(m)) if len(set1 & set2) > 0: return False else: return True def function(n, set1): m = n while not function(m, set1): m += 1 return m line1 = input().split() n = int(line1[0]) k = int(line1[1]) list1 = [] for i in range(k): list1.append(int(input())) set1...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s503285288
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(int, input(split()))) i = N while True: flg = True for j in str(i): if int(j) in D: flg = False break if flg == True: print(i) exit() i += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s980819994
p04045
Runtime Error
import numpy as np import sys import math readline = sys.stdin.buffer.readline #N,K = map(int, readline().split()) N = list(input()) #print(N) K=int(N[len(N)-1]) N.remove(' ') N.remove(N[len(N)-1]) #print(N) A = list(input().split()) #print(N,K) #print(A) Number=['1','2' ,'3', '4', '5', '6', '7', '8', '9','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...
s775708733
p04045
Runtime Error
import numpy as np import sys import math readline = sys.stdin.buffer.readline #N,K = map(int, readline().split()) N = list(input()) #print(N) K=int(N[len(N)-1]) N.remove(' ') N.remove(N[len(N)-1]) #print(N) A = list(input().split()) #print(N,K) #print(A) Number=['1','2' ,'3', '4', '5', '6', '7', '8', '9','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...
s236855492
p04045
Runtime Error
import numpy as np import sys import math readline = sys.stdin.buffer.readline #N,K = map(int, readline().split()) N = list(input()) #print(N) K=int(N[len(N)-1]) N.remove(' ') N.remove(N[len(N)-1]) #print(N) A = list(input().split()) #print(N,K) #print(A) Number=['1','2' ,'3', '4', '5', '6', '7', '8', '9','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...
s589137447
p04045
Runtime Error
N, K = map(int, input().split()) num = ["0","1","2","3","4","5","6","7","8","9"] dis = input().split() can_use = sorted(list(set(num)-set(dis))) sN = str(N) L = len(sN) ans = "" for i in range(1,L): if sN[i] in can_use: ans += sN[i] else: ans += min(can_use) if sN[0] in can_use: ans += sN...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s475720564
p04045
Runtime Error
N, K = map(int, input().split()) num = ["0","1","2","3","4","5","6","7","8","9"] dis = input().split() can_use = sorted(list(set(num)-set(dis))) sN = str(N) L = len(sN) ans = "" if sN[0] in can_use: ans += sN[0] else: if can_use[0] == "0": ans += can_use[1] else: ans += can_use[0] 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...
s988366733
p04045
Runtime Error
n,k=map(int, input().split()) d=list(map(int, input().split())) l=list() for i in range(10): l.append(i) l=list(set(d) ^ set(l)) lFirst=list(set(l) ^ set([0])) nList=list(map(int, list(str(n)))) answer=list() flag=False for i in lFirst: if nList[0]<i: answer.append(i) for i in range(1,len(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s013239175
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) n_str = str(n) # print(n_str) l = list(({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(d))) # print(l) ans_list = [] for i in range(len(n_str)): if int(n_str[i]) in l: ans_list.append(n_str[i]) elif int(n_str[i]) < l[-1]: for j in range(len(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...
s675907851
p04045
Runtime Error
n,_=map(int,input().split()) s=set(input()) while s&set(str(n)): n+=1 print(n
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s774757704
p04045
Runtime Error
N = int(input().split(' ')[0]) D = set(input()) while len(set(str(N))&D)!=0: N += 1 print(N)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s816462613
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(int, input().split())) for ans = "" for n in str(N): a = 0 while True: if int(n) in D: n = int(n) + 1 a = int(n)+1 else: a = int(n) ans += str(a) 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...
s333019644
p04045
Runtime Error
N, K = map(int, input().split()) L = set(map(int, input().split())) A = set(i for i in range(10)) B = sorted(list(A - L)) N_digit = len(str(N)) pay = "" for i in str(N): for b in B: if b >= int(i): pay += str(b) break else: continue if int(pay): print(int(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s720973416
p04045
Runtime Error
N, K = map(int, input().split()) L = set(map(int, input().split())) A = set(i for i in range(10)) B = sorted(list(A - L)) N_digit = len(str(N)) pay = "" for i in str(N): for b in B: if b >= int(i): pay += str(b) break else: continue print(int(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...
s405076939
p04045
Runtime Error
N, K = map(int, input().split()) # L = set(input() for i in range(K)) L = set(map(int, input().split())) # 差集合→list A = set(i for i in range(10)) B = sorted(list(A - L)) N_digit = len(str(N)) pay = "" for i in str(N): for b in B: if b >= int(i): pay += str(b) 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...
s538710672
p04045
Runtime Error
n,k=map(int,input().split()) d=list(map(int,input().split())) N=list(str(n)) for i in range(len(N)): N[i]=int(N[i]) for i in range(n,n*10+1): if not N.isdisjoint(d): 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...
s663589511
p04045
Runtime Error
N,K = map(int, input().split()) Ds = list(map(int, input().split())) able = [] for i in range(10): if i in Ds:continue able.append(i) # print(able) sN = str(N) n = len(sN) m = able[0] #最小 if int(sN[0]) > max(able): if m == 0: ans = str(able[1]) + str(able[0]) * n else: ans = str(able...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s127683617
p04045
Runtime Error
N,K = map(int, input().split()) Ds = list(map(int, input().split())) able = [] for i in range(10): if i in Ds:continue able.append(i) # print(able) sN = str(N) n = len(sN) m = able[0] #最小 if int(sN[0]) > max(able): if m == 0: ans = str(able[1]) + str(able[0]) * n else: ans = str(able...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s705312520
p04045
Runtime Error
N,K = list(map(str, input().split())) D = sorted(input().split()) W = [] P = "" for i in range(10): if str(i) not in D: W.append(str(i)) for i in range(len(N)): for j in range(len(W)): if N[i] <= W[j]: P += W[j] break print(int(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...
s923943146
p04045
Runtime Error
n, k = input().split() d = input().split() valid = [i for i in range(10) if str(i) not in d] ans = '' if valid[-1] < int(n[0]): if valid[0] == 0: ans += str(valid[1]) else: ans += str(valid[0]) ans += str(valid[0]) * len(n) else: for i, s in enumerate(n): if i > 0 and ans[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...
s929763507
p04045
Runtime Error
a
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s325231315
p04045
Runtime Error
import sys sys.setrecursionlimit(10**6) n_price,k = map(str,input().split()) k = int(k) n_length = len(n_price) d_ng_list = list(input()) restrict = True answer = "" for s in range(10): if str(s) not in d_ng_list: min_number = str(s) break def find_number(i): global restrict if not restrict: return min_numbe...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s330217009
p04045
Runtime Error
import sys sys.setrecursionlimit(10**6) n_price,k = map(str,input().split()) k = int(k) n_length = len(n_price) d_ng_list = list(map(str,input().split())) restricted = True answer = "" for s in range(10): if str(s) not in d_ng_list: min_number = str(s) break def find_number(i,restricted): if not restricted: 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...
s415705379
p04045
Runtime Error
n_price,k = map(str,input().split()) k = int(k) n_length = len(n_price) d_ng_list = list(map(str,input().split())) restricted = True answer = "" for s in range(10): if str(s) not in d_ng_list: min_number = str(s) break def find_number(i,restricted): if not restricted: return min_number for s in range(10): i...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s074367606
p04045
Runtime Error
n,k = map(int,input().split()) D = list(map(int,input().split())) while True: dis = False for d in D: if d in str(n): dis = True break if not dis: 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...
s731247956
p04045
Runtime Error
N, K = map(int,input().split()) D = list(input()) for i in range(N, 10000): M = list(str(i)) if all([M[j] not in D for j in range(len(M))]): ans = int("".join(M)) 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...
s080285038
p04045
Runtime Error
N,K=map(int,(input().split())) li=[] for i in range(K): li.append(int(input())) for j in range(N,10000): k=0 for t in str(j): if int(t) in li: k=1 break else: if k==0: print(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...
s096594883
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(str, input().split())) for i in range(n, 100000): s = list(str(i)) flg = 0 for j in s: if j in d: flg = 1 break if flg == 0: print("".join(s)) 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...
s256043756
p04045
Runtime Error
#abc 042 c def dfs(i,s): if i==n_keta: if s>=n: kouho.append(s) return 0 for j in range(len(like)): dfs(i+1,s+like[j]) return 0 n,k=input().split() d=list(map(int,input().split())) like=[] for i in range(10): if i not in d: like.append(str(i)) kouho=[] n_keta...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s743844544
p04045
Runtime Error
#abc 042 c def dfs(i,s): if i==n_keta: if s>=n: kouho.append(s) return 0 for j in range(len(like)): dfs(i+1,s+like[j]) return 0 n,k=input().split() d=list(map(int,input().split())) like=[] for i in range(10): if i not in d: like.append(str(i)) kouho=[] n_k...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s952691506
p04045
Runtime Error
n,k = map(int, input().strip().split()) d = list(input().split()) n,k = map(int,input().strip().split()) d = list(input().split()) for x in range(n,100000): for y in d: if y in str(x): break else: 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...
s211528341
p04045
Runtime Error
n,k = map(int, input().split()) li = list(map(int, input().split())) Li = list(n) while len(set(Li)&set(li)): n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s842587910
p04045
Runtime Error
n,k = map(int, input().split()) li = list(map(int, input().split())) Li = list(n) while set(Li)&set(li): n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s354621139
p04045
Runtime Error
n,k = map(int, input().split()) li = [] for i in range(k): li.append(int(input())) else: Li = list(n) while not len(set(li)&set(Li)) == 0: n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s116218906
p04045
Runtime Error
n,k = map(int, input().split()) li = [] for i in range(k): li.append(int(input())) else: Li = list(n) while not len(set(li)&set(Li)): n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s433527446
p04045
Runtime Error
n,k = map(int, input().split()) li = [] i = 0 for i<k: li.append(int(input())) i += 1 else: Li = list(n) while not len(set(li)&set(Li)): n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s587931355
p04045
Runtime Error
n,k = map(int, input().split()) li = [] i = 0 for i<k: li.append(int(input())) i += 1 else: Li = list(n) while not set(li)&set(Li) == set(): n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s795267920
p04045
Runtime Error
n,k = map(int, input().split()) li = [] i = 0 for i<k: li.append(int(input())) i += 1 else: Li = list(n) while not set(li)&set(Li) == {}: n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s244751703
p04045
Runtime Error
n,k = map(int, input().split()) li = [] i = 0 for i<k: li.append(int(input())) i += 1 else: Li = list(n) while li&Li: n += 1 Li = list(n) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s078372369
p04045
Runtime Error
n,k = map(int, input().split()) li = [] i = 0 for i<k: li.append(int(input())) i += 1 else: Li = list(str(n)) while li&Li: n += 1 Li = list(str(n)) else: print("".join(Li))
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s511104597
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) digit = [str(i) for i in range(10) if not i in d] ans = [] stack = [i for i in digit] while stack: s = stack.pop() if int(s) >= n: ans.append(s) else: for i in digit: if len(i+s) <= len(str(n)+1): stack.append(i+s) print(m...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s348035345
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) digit = [str(i) for i in range(10) if not i in d] ans = [] stack = [i for i in digit] while stack: s = stack.pop() if int(s) >= n: ans.append(s) else: for i in digit: if len(i+s) <= len(str(n)): stack.append(i+s) print(min(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s332442476
p04045
Runtime Error
N,K=input().split() D=input().split() while True: for s in D: if N.count(s)!=0: frag=1 else: pass if frag==1: a=int(N)+1 N=str(a) frag=0 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...
s984903932
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(int, input().split())) N_str = str(N) nl = list(N_str) D_str = [] for i in D: D_str.append(str(i)) d_in_n = False for i in nl: if not i in D_str: continue else: d_in_n = True break if d_in_n == False: print(N) else: while len(nl) < 4: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s881618628
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(int, input().split())) N_str = str(N) nl = list(N_str) D_str = [] for i in D: D_str.append(str(i)) d_in_n = False for i in nl: if not i in D_str: continue else: d_in_n = True break if d_in_n == False: print(N) else: L = [] for i in...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s132125779
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(int, input().split())) N_str = str(N) nl = list(N_str) D_str = [] for i in D: D_str.append(str(i)) d_in_n = False for i in nl: if not i in D_str: continue else: d_in_n = True break if d_in_n == False: print(N) else: L = [] 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...
s666851219
p04045
Runtime Error
N,K=input().split() dis=list() dis=input().split() while True: for c in dis: if N.count(c)!=0: frag=1 else: pass if frag==1: N=int(N)+1 N=str(N) frag=0 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...
s816482826
p04045
Runtime Error
N,K=input().split() dis=list(K) dis=input().split() while True: for c in dis: if N.count(c)!=0: frag=1 else: pass if frag==1: N=int(N)+1 N=str(N) frag=0 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...
s854761401
p04045
Runtime Error
N,K=input().split() dis=list(K) dis=input().split() while True: for c in dis: if N.count(c)!=0: frag=1 else: pass if frag==1: N=int(N)+1 N=str(N) frag=0 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...
s910077611
p04045
Runtime Error
N, K = map(int, input().split()) D = list(map(str, input().split())) num_set = set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']) N_list = list(str(N)) diff_list = sorted(list(num_set.difference(set(D)))) if (list(set(D)&set(N_list)) == []): print(N) else: if '0' in diff_list: n_list = [diff_list...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s519747783
p04045
Runtime Error
n, k = map(int, input().split()) d = list(map(int, input().split())) a = 0 for i in range(n, 10000): if checknum(i, d): a = i break print(a) def checknum(n, d): for s in str(n): if d.count(int(s)) > 0: return False return True 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...
s372765487
p04045
Runtime Error
#!/use/bin/env python3 (n, k) = [int(s) for s in input().split()] a = [int(s) for s in input().split()] like = [] ans = n while (1): c = True for ii in range(0, 4): b = b // 10 d = b % 10 if b == 0: break if d in a: c = False 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...
s851141967
p04045
Runtime Error
n, k = map(int, input().split()) list_num = [input() for i in range(k)] price = n while True : i = 0 for i in range(len(str(price))) : if str(price)[i] in list_num : price += 1 break else : print(price) 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...
s942944719
p04045
Runtime Error
from functools import lru_cache N, K = map(int, input().split()) D = input().split() O = [] for c in "0123456789": if c not in D: O.append(c) # N = 523 # D = 2 3 @lru_cache() def func(s, i, over): if i == len(s): return "" # d < N[0] if over: return O[0] + func(s, i+1, over=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...
s553321790
p04045
Runtime Error
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): N, K = map(int, input().split()) D = set(list(map(int, input().split()))) F = set(list(range(10))) - D result = '' for n in str(N): if int(n) in F: result += n else: result += str(min([f for f in F 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...