s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s223654371 | p04045 | u577504524 | 1593355499 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9184 | 666 | #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]... |
s385224259 | p04045 | u577504524 | 1593355187 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9204 | 484 | #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]... |
s876982084 | p04045 | u577504524 | 1593355113 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9220 | 484 | #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]... |
s223359281 | p04045 | u643679148 | 1593343251 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9212 | 420 | 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... |
s184862450 | p04045 | u643679148 | 1593343121 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9212 | 406 | 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:
... |
s521491683 | p04045 | u643679148 | 1593342758 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9160 | 284 | 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)
|
s090104311 | p04045 | u896004073 | 1593311425 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9208 | 886 | 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... |
s309097272 | p04045 | u699522269 | 1593309172 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9040 | 256 | 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
|
s236534621 | p04045 | u820195841 | 1592939447 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9368 | 395 | 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... |
s820063456 | p04045 | u793430793 | 1592842801 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9036 | 230 | #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)
|
s312386682 | p04045 | u804954217 | 1592832387 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9016 | 555 | #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... |
s457009253 | p04045 | u653883313 | 1592675414 | Python | Python (3.8.2) | py | Runtime Error | 39 | 9116 | 250 | 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) |
s660408754 | p04045 | u653883313 | 1592674868 | Python | Python (3.8.2) | py | Runtime Error | 36 | 9144 | 250 | 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) |
s330242895 | p04045 | u951684192 | 1592536592 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9040 | 146 | 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) |
s542533856 | p04045 | u372102441 | 1592442434 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3700 | 736 | 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:
... |
s135017278 | p04045 | u841856382 | 1592229765 | Python | Python (3.4.3) | py | Runtime Error | 70 | 3060 | 354 | 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)
... |
s388756447 | p04045 | u811436126 | 1591508417 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 582 | 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))
... |
s558763832 | p04045 | u811436126 | 1591507719 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 435 | 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:
... |
s979033622 | p04045 | u811436126 | 1591506877 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 254 | 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)
|
s857317350 | p04045 | u757274384 | 1591333813 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 254 | # -*- 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
|
s080804357 | p04045 | u757274384 | 1591333730 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 219 | # -*- 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 |
s067811569 | p04045 | u583276018 | 1591105485 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 269 | 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)
|
s925235212 | p04045 | u581142892 | 1591054714 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 932 | 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 ... |
s303559524 | p04045 | u924845460 | 1590645231 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 117 | 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))
|
s213518475 | p04045 | u924845460 | 1590641747 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38384 | 131 | 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))
|
s927887613 | p04045 | u306950978 | 1590433608 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3924 | 236 | 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) |
s978087471 | p04045 | u822179469 | 1589947539 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 348 | 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) |
s423622729 | p04045 | u822179469 | 1589945990 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 307 | 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])) |
s208962859 | p04045 | u822179469 | 1589945873 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 339 | 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])) |
s818556852 | p04045 | u488178971 | 1589679813 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 411 | 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))... |
s411723615 | p04045 | u818308350 | 1589659209 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 680 | #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... |
s568847651 | p04045 | u729535891 | 1589653812 | Python | Python (3.4.3) | py | Runtime Error | 34 | 3316 | 950 | 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... |
s187741334 | p04045 | u285891772 | 1589498047 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 1300 | 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... |
s120190106 | p04045 | u379142263 | 1589351049 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3440 | 672 | 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 = ... |
s074580474 | p04045 | u317916383 | 1589114458 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 321 | 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... |
s831259203 | p04045 | u446451725 | 1589087375 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 454 | 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... |
s683703784 | p04045 | u446451725 | 1589087199 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 456 | 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... |
s407099380 | p04045 | u446451725 | 1589087017 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 467 | 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... |
s681043206 | p04045 | u446451725 | 1589086802 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 460 | 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... |
s060859799 | p04045 | u446451725 | 1589085336 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 401 | 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)])
... |
s656527362 | p04045 | u586206420 | 1588999597 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3444 | 1546 | 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... |
s026985626 | p04045 | u646445992 | 1588828842 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38256 | 672 | 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... |
s101671575 | p04045 | u730257868 | 1588826608 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3192 | 746 | 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:
... |
s519971500 | p04045 | u730257868 | 1588825705 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 646 | 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]:
... |
s399996043 | p04045 | u730257868 | 1588805043 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 646 | 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]:
... |
s336074556 | p04045 | u730257868 | 1588804898 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 643 | 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... |
s621917806 | p04045 | u730257868 | 1588804420 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 591 | 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... |
s154583960 | p04045 | u730257868 | 1588804340 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 571 | 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] ... |
s659250155 | p04045 | u927870520 | 1588804030 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 638 | 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[... |
s031267728 | p04045 | u230717961 | 1588529583 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3060 | 415 | 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... |
s775029378 | p04045 | u366541443 | 1588494357 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38256 | 340 | 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... |
s817785256 | p04045 | u486814557 | 1588060923 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 527 | 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]:
... |
s669673608 | p04045 | u486814557 | 1588053190 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 656 | 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.... |
s895417764 | p04045 | u486814557 | 1588049018 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 439 | 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
... |
s209511472 | p04045 | u486814557 | 1588047349 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 312 | 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)) |
s523848461 | p04045 | u306033313 | 1587916475 | Python | Python (3.4.3) | py | Runtime Error | 32 | 3700 | 1259 | 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:
... |
s771393223 | p04045 | u306033313 | 1587916385 | Python | Python (3.4.3) | py | Runtime Error | 32 | 3700 | 1241 | 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:
... |
s472313769 | p04045 | u308918401 | 1587782991 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 282 | 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) |
s305178661 | p04045 | u655622461 | 1587674249 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3408 | 190 | 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) |
s203917040 | p04045 | u492447501 | 1587331615 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3060 | 262 | 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) |
s553242666 | p04045 | u434872492 | 1587158516 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3060 | 261 | 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) |
s618811671 | p04045 | u145600939 | 1586917992 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 40556 | 304 | 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
|
s151171527 | p04045 | u145600939 | 1586917766 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 306 | 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)
|
s568916532 | p04045 | u975644365 | 1586912171 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 347 | 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(''... |
s140604602 | p04045 | u515647766 | 1586892302 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3904 | 362 | 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... |
s503285288 | p04045 | u449863068 | 1586823049 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 221 | 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 |
s980819994 | p04045 | u687135117 | 1586804452 | Python | Python (3.4.3) | py | Runtime Error | 149 | 12488 | 1218 | 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']
#'''
... |
s775708733 | p04045 | u687135117 | 1586804386 | Python | Python (3.4.3) | py | Runtime Error | 150 | 12516 | 1217 | 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']
#'''
... |
s236855492 | p04045 | u687135117 | 1586803452 | Python | Python (3.4.3) | py | Runtime Error | 152 | 12484 | 1199 | 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']
#'''
... |
s589137447 | p04045 | u870518235 | 1586406520 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 555 | 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... |
s475720564 | p04045 | u870518235 | 1586398779 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 546 | 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... |
s988366733 | p04045 | u312784236 | 1586316837 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 651 | 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(... |
s013239175 | p04045 | u684906944 | 1586229063 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 573 | 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)):... |
s675907851 | p04045 | u133936772 | 1586031380 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 77 | n,_=map(int,input().split())
s=set(input())
while s&set(str(n)): n+=1
print(n |
s774757704 | p04045 | u870297120 | 1585943626 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | N = int(input().split(' ')[0])
D = set(input())
while len(set(str(N))&D)!=0:
N += 1
print(N) |
s687729149 | p04045 | u870297120 | 1585943529 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | N = int(input().split(' ')[0])
D = set(input())
while len(set(str(N))&D)!=0:
N += 1
print(N) |
s816462613 | p04045 | u449863068 | 1585744669 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 253 | 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)
|
s333019644 | p04045 | u443872523 | 1585713567 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 612 | 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(... |
s720973416 | p04045 | u443872523 | 1585608920 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 308 | 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)) |
s405076939 | p04045 | u443872523 | 1585608816 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 363 | 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:
... |
s538710672 | p04045 | u547167033 | 1585072772 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 193 | 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() |
s663589511 | p04045 | u545368057 | 1584963680 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1003 | 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... |
s127683617 | p04045 | u545368057 | 1584963542 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 955 | 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... |
s705312520 | p04045 | u519835472 | 1584821670 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 282 | 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)) |
s923943146 | p04045 | u759518460 | 1584761393 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 508 | 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] >... |
s929763507 | p04045 | u096616343 | 1584445092 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 1 | a |
s325231315 | p04045 | u788703383 | 1584414675 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 677 | 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... |
s330217009 | p04045 | u788703383 | 1584412672 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 684 | 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... |
s415705379 | p04045 | u788703383 | 1584412574 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 643 | 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... |
s074367606 | p04045 | u934868410 | 1584065431 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 196 | 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) |
s731247956 | p04045 | u152638361 | 1584029918 | Python | Python (3.4.3) | py | Runtime Error | 36 | 3060 | 203 | 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) |
s080285038 | p04045 | u771538568 | 1583784824 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 244 | 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) |
s096594883 | p04045 | u572425901 | 1583726568 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38512 | 258 | 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 |
s256043756 | p04045 | u723583932 | 1583566205 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 398 | #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... |
s743844544 | p04045 | u723583932 | 1583564688 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 358 | #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... |
s952691506 | p04045 | u126887629 | 1583380043 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 257 | 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 |
s211528341 | p04045 | u000123984 | 1583283298 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 158 | 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)) |
s842587910 | p04045 | u000123984 | 1583283253 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 153 | 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)) |
s354621139 | p04045 | u000123984 | 1583283059 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 199 | 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)) |
s116218906 | p04045 | u000123984 | 1583283003 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 194 | 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)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.