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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s314073054 | p04044 | u318363730 | 1544918452 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 335 | d = input().rstrip()
d_list = d.split(" ")
t_list = []
for i in range(int(d_list[1])):
t_list.append(str(input().rstrip()))
def solution(t_list):
t_list.sort()
ans_str = ""
for i in t_list:
ans_str += i
return ans_str
def main():
print(solution(t_list))
if __name__ == '__main... |
s015340973 | p04044 | u318363730 | 1544917864 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 330 | d = input().rstrip()
d_list = d.split(" ")
t_list = []
for i in range(int(d_list[1])):
t_list.append(input().rstrip())
def solution(t_list):
t_list.sort()
ans_str = ""
for i in t_list:
ans_str += i
return ans_str
def main():
print(solution(t_list))
if __name__ == '__main__':
... |
s452909288 | p04044 | u140251125 | 1544040181 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 139 | # input
n, l = map(int, input().split())
S = sorted([input() for _ in range(N)])
ans = ''
for i in range(N):
ans += S[i]
print(ans)
|
s835242518 | p04044 | u705617253 | 1543607531 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3060 | 140 | n, l = map(int, input().split())
s = [input() for _ in range(n)]
result = ""
s.sort()
for i in range(l):
result += s[i]
print(result)
|
s612718274 | p04044 | u869728296 | 1542816381 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 218 | N,L=map(int,input().strip().split(" "))
a=[]
for i in range(L):
a.append(input())
a.sort()
b=str(a)
b=b.replace(",","")
b=b.replace("[","")
b=b.replace("]","")
b=b.replace("'","")
b=b.replace(" ","")
print(b)
|
s130866074 | p04044 | u018679195 | 1542228356 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 103 | N,L=map(int,input().split())
S = [input() for i in range(N)]
S.sort()
for s in S:
print(s,end=“”) |
s867858165 | p04044 | u863370423 | 1542228273 | Python | PyPy3 (2.4.0) | py | Runtime Error | 187 | 38384 | 103 | N,L=map(int,input().split())
S = [input() for i in range(N)]
S.sort()
for s in S:
print(s,end=“”) |
s163353188 | p04044 | u863370423 | 1542221092 | Python | Python (3.4.3) | py | Runtime Error | 20 | 2940 | 106 | n,l=map(int, input())
s=[list(input()) for i in range(n)]
s.sort()
for i in s:
print(i,end="")
print() |
s305629880 | p04044 | u208052792 | 1541171294 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 171 | N, L = map(int, input().split())
s = [0 for i in range(N)]
for i in range(N):
s[i] = input()
s.sort()
output = ""
for i in range(L):
output += s[i]
print(output)
|
s159014492 | p04044 | u438786370 | 1541171144 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 155 | data = list(map(lambda x: int(x), input().split()))
strings = [input() for _ in range(data[1])]
strings.sort()
s = ''
for x in strings:
s += x
print(s) |
s355672682 | p04044 | u363407238 | 1540687968 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 91 | n, l = map(int, input().sprit())
s = [input() for _ in range(n)]
s.sort()
print("".join(s)) |
s676024136 | p04044 | u079543046 | 1540652053 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 141 | N, L = map(int, input().split())
s = []
ans = []
dj = list(arange(N))
for i in range(N):
s.append(input())
s = sorted(s)
ans = "".join(s) |
s186242362 | p04044 | u466478199 | 1537494864 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 103 | L,N=map(int,input().split())
l=[]
for i in range(N):
l.append(input())
l.sort()
print(''.join(l))
|
s742288298 | p04044 | u466478199 | 1537494721 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 141 | L,N=map(int,input().split())
l=[]
for i in range(N):
s=list(input())
s.sort()
a=''.join(s)
l.append(a)
l.sort()
print(''.join(l))
|
s543182404 | p04044 | u787562674 | 1536651342 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 331 | N, L = map(int, input().split())
inputs = [input() for _ in range(N)]
ans = [
inputs[0] + inputs[1] + inputs[2],
inputs[0] + inputs[2] + inputs[1],
inputs[1] + inputs[0] + inputs[2],
inputs[1] + inputs[2] + inputs[0],
inputs[2] + inputs[0] + inputs[1],
inputs[2] + inputs[1] + inputs[0],
]
prin... |
s625960720 | p04044 | u787562674 | 1536651148 | Python | Python (3.4.3) | py | Runtime Error | 781 | 367152 | 262 | N, L = map(int, input().split())
inputs = [input() for _ in range(N)]
ans = []
for i in range(L):
for j in range(L):
for k in range(L):
if i != j and j != k:
ans.append(inputs[i] + inputs[j] + inputs[k])
print(min(ans)) |
s031334713 | p04044 | u005260772 | 1535082975 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 126 | n = int(raw_input())
s = ''
for i in range(n):
s += raw_input()
s = sorted(s)
ans = ''
for i in s:
ans += i
print ans
|
s971247476 | p04044 | u052347048 | 1534096626 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 100 | lengh,num = map(int,input().split())
lis = [input() for i in range(num)]
print("".join(sorted(lis))) |
s207586369 | p04044 | u690536347 | 1533357564 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 85 | s,l=map(int,input().split())
m=sorted([input() for _ in range(l)])
print("".join(m))
|
s170391482 | p04044 | u278864208 | 1533326926 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 115 | N, L = map(int, input().split())
S = [input() for i in range(N)]
for i in range(3):
print(sorted(S)[i], end="") |
s582461042 | p04044 | u278864208 | 1533325910 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 130 | N, L = map(int, input().split())
S = [input() for i in range(N)]
print("{0}{1}{2}".format(sorted(S)[0],sorted(S)[1],sorted(S)[2])) |
s760580659 | p04044 | u050428930 | 1531173818 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 84 | n,m=map(int,input().split())
s=sorted([input() for i in range(m)])
print("".join(s)) |
s214732425 | p04044 | u588341295 | 1530633458 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 177 | # -*- coding: utf-8 -*-
N, L = map(int, input().split())
str_list = [input() for i in range(L)]
str_list.sort()
ans = ""
for i in range(L):
ans += str_list[i]
print(ans) |
s421462981 | p04044 | u894440853 | 1528364594 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 67 | print("".join(sorted([input() for _ in range(input().split()[0])))) |
s840296008 | p04044 | u136090046 | 1528250800 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 128 | n, l = map(int, input().split())
array = sorted([input() for x in range(l)])
res = ""
for i in array:
res += i
print(res)
|
s493065812 | p04044 | u314057689 | 1527900114 | Python | PyPy3 (2.4.0) | py | Runtime Error | 396 | 81388 | 1613 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys# {{{
import os
import time
import re
from pydoc import help
import string
import math
import numpy as np
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from... |
s602666687 | p04044 | u226108478 | 1523982706 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 212 | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == '__main__':
n, length = list(map(int, input().split()))
s = sorted([input() for _ in range(length)])
print(''.join(s))
|
s170412342 | p04044 | u259752752 | 1523149522 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 507 | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
int N, L;
cin >> N >> L;
vector<string> v;
string ret;
string s;
for(int i=0; i<N; i++){
cin >> s;
v.push_back(s);
}
sort(v.begin(), v.end(), less<string>() );
for(vector<s... |
s544070355 | p04044 | u684084063 | 1523148034 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3316 | 183 | # -*- coding: utf-8 -*-
N,L = map(int,input().split())
ANS=[]
ans=""
for hoge in range(L):
S=input()
ANS.append(S)
ANS=sorted(ANS)
for fuga in ANS:
ans=ans+fuga
print(ans) |
s253322812 | p04044 | u978494963 | 1523135360 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 112 | n,l = list(map(int, input().split(" ")))
s = []
for i in range(n):
s.append(input())
sort(s)
print("".join(s)) |
s938073830 | p04044 | u657541767 | 1523035556 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 116 | n, l = map(int, input().split())
str_list = [input() for i in range(l)]
str_list.sort()
print("".join(str_list))
|
s618891314 | p04044 | u657541767 | 1523035455 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | n, l = map(int, input().split())
str_list = [input() for i in range(3)]
str_list.sort()
print("".join(str_list))
|
s574114986 | p04044 | u667949809 | 1522545768 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 112 | n,l = input().split()
n = int(n)
s = []
for i in range(n):
s.append(input())
s.sort()
print(s[0]+s[1]+s[2])
|
s274838556 | p04044 | u667949809 | 1522545561 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | n,l = map(int,input().split())
s = []
for i in range(n):
s.append(input())
s.sort()
print(s[0]+s[1]+s[2]) |
s854903642 | p04044 | u976256337 | 1521346230 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 15 | 3 3
dxx
axx
cxx |
s031201613 | p04044 | u103539599 | 1518237146 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3956 | 214 | N,L=map(int,input().split())
S=[input() for i in range(N)]
Ts=""
T=[]
for j in range(L):
t=j
for i in range(N):
if t==L: t=0
Ts+=S[t]
t+=1
T.append(Ts)
Ts=""
print(min(T)) |
s287575071 | p04044 | u952708174 | 1517084267 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 116 | N,L = [int(i) for i in input().split()]
S=[[i for i in input().strip()] for j in range(N)]
print(''.join(sorted(S))) |
s294011735 | p04044 | u667084803 | 1510047693 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 459 | def power_func(a,b,p):
"""a^b mod p を求める"""
if b==0: return 1
if b%2==0:
d=power_func(a,b//2,p)
return d*d %p
if b%2==1:
return (a*power_func(a,b-1,p ))%p
from math import factorial
H,W,A,B=map(int, input().split())
p=10**9+7
ans=0
X=[1]
Y=[1]
for i in range(H+W-2):
fact=factorial(i+1)%p
X+=[fa... |
s411602408 | p04044 | u255555420 | 1502826355 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 93 | L, N = map(int,input().split())
S = [input() for i in range(N)]
S.sort()
print("".join(S)) |
s663938167 | p04044 | u255555420 | 1502820985 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 105 | L, N = map(int,input().split())
S = [input() for i in range(N)]
B=sorted(S)
A=''.join(B)
print(str(A)) |
s500720939 | p04044 | u255555420 | 1502820720 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 105 | L, N = map(int,input().split())
S = [input() for i in range(N)]
S=sorted(S)
A=''.join(S)
print(str(A)) |
s176621176 | p04044 | u255555420 | 1502820635 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 102 | L, N = map(int,input().split())
S = [input() for i in range(N)]
S.sort()
A=''.join(S)
print(str(A)) |
s348097574 | p04044 | u255555420 | 1502820430 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 97 | L, N = map(int,input().split())
S = [input() for i in range(N)]
S.sort()
A=''.join(S)
print(A) |
s217837058 | p04044 | u255555420 | 1502820234 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 97 | L, N = map(int,input().split())
S = [input() for i in range(N)]
S.sort()
A=''.join(S)
print(A) |
s740244698 | p04044 | u993069079 | 1498294892 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 107 | n, l = map(int, raw_input().split())
for i in xrange(n):
a.append(raw_input())
a.sort()
print "".join(a) |
s734545290 | p04044 | u993069079 | 1498294821 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 108 | n, l = map(int, raw_input().split())
for i in xrange(n):
a.append(raw_input())
a.sort()
print " ".join(a) |
s949202935 | p04044 | u319818166 | 1490220702 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 178 | import sys
L, N = map(int, raw_input().split())
input = []
for i in range(0, N):
sentence = raw_input()
input.append(sentence)
for x in sorted(input):
sys.stdout.write(x) |
s288822451 | p04044 | u788681441 | 1484255352 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 164 | #pythonだとsortでそのまま何文字でもソートしてくれる
n, l = map(int, input().split())
s = [input() for _ in range(n)]]
print(''.join(sorted(s))) |
s447909598 | p04044 | u580920947 | 1483236619 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 171 | # -*- coding: utf-8 -*-
# problem B
N, L = map(int, input().split())
ls = []
for _ in N:
input_data = input()
ls.append(input_data)
ls.sort()
print(''.join(ls)) |
s297337832 | p04044 | u317493066 | 1483046880 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3060 | 192 | N, L = map(int, input().split())
data = []
for _ in range(N):
input_data = input()
data.append(input_data)
print(data)
data.sort()
print(''.join(data))
|
s844234676 | p04044 | u582243208 | 1480112163 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 78 | n,l=map(int,input().split())
print("".join(sorted[input() for i in range(n)])) |
s814716947 | p04044 | u493916575 | 1480050174 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3188 | 141 | N,L = map(int, input().split())
S = 26*[""]
for i in range(N):
S[i] = input()
S.sort()
str = ""
for s in S:
str += s
print(str)
|
s460675917 | p04044 | u117095520 | 1477683531 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 189 | import heapq
N, L = map(int, raw_input().split())
hq = []
for _ in xrange(N:
s = raw_input()
heapq.heappush(hq, s)
ans = ''
while len(hq) > 0:
ans += heapq.heappop(hq)
print ans |
s905483219 | p04044 | u612721349 | 1472788509 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 71 | print("".join(sorted([input() for i in range(int(input().split[0]))]))) |
s481440393 | p04044 | u289882742 | 1470434095 | Python | Python (2.7.6) | py | Runtime Error | 33 | 2820 | 141 | import sys
def main(lines):
print(''.join(sorted(lines.split())))
next(sys.stdin)
for line in sys.stdin:
lines += line
main(lines)
|
s583679897 | p04044 | u112002050 | 1469398308 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 92 | N = int(input().split()[0])
words = [input() for i in range(N)]
print("".join(words.sort())) |
s136690770 | p04044 | u112002050 | 1469398266 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3064 | 87 | N = input().split()[0]
words = [input() for i in range(N)]
print("".join(words.sort())) |
s848410609 | p04044 | u153147777 | 1469324950 | Python | Python (2.7.6) | py | Runtime Error | 321 | 2820 | 752 | import sys
sys.setrecursionlimit(10000000)
n, l = map(int, raw_input().split())
s = [raw_input() for _ in xrange(n)]
gtable = [[] for _ in xrange(26)]
result = []
def searchPrint(e, n):
table = [[] for _ in xrange(26)]
for i in e:
table[ord(s[i][n]) - 97].append(i)
for el in table:
... |
s234130821 | p04044 | u153147777 | 1469324902 | Python | Python (2.7.6) | py | Runtime Error | 28 | 2820 | 709 | n, l = map(int, raw_input().split())
s = [raw_input() for _ in xrange(n)]
gtable = [[] for _ in xrange(26)]
result = []
def searchPrint(e, n):
table = [[] for _ in xrange(26)]
for i in e:
table[ord(s[i][n]) - 97].append(i)
for el in table:
if len(el) == 0:
continue
... |
s724696645 | p04044 | u435698658 | 1469322278 | Python | Python (2.7.6) | py | Runtime Error | 991 | 3080 | 111 | N, L = raw_input().split()
l = []
for _ in range(N):
l.append(raw_input().strip())
print "".join(sorted(l)) |
s018621055 | p04044 | u798181098 | 1469322174 | Python | Python (3.4.3) | py | Runtime Error | 1699 | 8536 | 116 | n, l = map(int, input().split())
s = []
for i in range(n):
t = input()
s.append(t)
s.sort()
print(s.join('')) |
s763511986 | p04045 | u149249972 | 1601366762 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9384 | 567 | import math
total = list(map(lambda x: int(x), input().split()))
possible = list({0,1,2,3,4,5,6,7,8,9} - set(list(map(lambda x: int(x), input().split()))))
yen = total[0]
digits = math.log10(yen) + 1
final = []
while digits:
if yen % (10**digits) in possible:
final.append(int(yen % (10**digits)))
else... |
s955286458 | p04045 | u149249972 | 1601366674 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9404 | 567 | import math
total = list(map(lambda x: int(x), input().split()))
possible = list({0,1,2,3,4,5,6,7,8,9} - set(list(map(lambda x: int(x), input().split()))))
yen = total[0]
digits = math.log10(yen) + 1
final = []
while digits:
if yen % (10**digits) in possible:
final.append(int(yen % (10**digits)))
else... |
s688055985 | p04045 | u697690147 | 1600916235 | Python | PyPy2 (7.3.0) | py | Runtime Error | 300 | 85152 | 733 | n, k = input().split()
d = list(map(int, input().split()))
a = []
for i in range(10):
if i not in d:
a.append(i)
n = list(map(int, list(n)))
for i in range(len(n)):
if n[i] in d:
ind = i
done = False
while not done:
for j in range(n[ind]+1, 10):
i... |
s411831596 | p04045 | u035885928 | 1600392238 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8904 | 521 | n, k= input().split()
l = list(map(int,input().split()))
checkNum=[i for i in range(11)]
def find(x):
while x!=checkNum[x]:
checkNum[x]=checkNum[checkNum[x]]
x=checkNum[x]
return x
for i in l:
checkNum[find(i)]=checkNum[find(i+1)]
fin=""
for i in range(len(n)):
first=int(n[i])
k=f... |
s508719814 | p04045 | u035885928 | 1600389823 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9240 | 515 | n, k= map(int,input().split())
l = list(map(int,input().split()))
checkNum=[i for i in range(11)]
for i in l:
checkNum[find(i)]=checkNum[find(i+1)]
def find(x):
while x!=checkNum[x]:
checkNum[x]=checkNum[checkNum[x]]
x=checkNum[x]
return x
fin=""
remain=0
if n==0:
fin=str(find(0))
whil... |
s064020163 | p04045 | u644907318 | 1600259444 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9088 | 936 | N,K = map(int,input().split())
D = list(map(int,input().split()))
E = []
for i in range(10):
if i not in D:
E.append(i)
E = sorted(E)
N = str(N)
ind = len(N)
for i in range(len(N)):
if int(N[i]) not in E:
ind = i
break
if ind==len(N):
print(N)
else:
flag = 0
x = ""
for i ... |
s553626963 | p04045 | u113835532 | 1599791955 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9140 | 432 | def answer(n: int, k: int, d: []) -> int:
numbers = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ^ set(d))
payment = ''
for i in str(n):
for num in numbers:
if int(i) <= num:
payment += str(num)
break
return int(payment)
def main():
n, k = map(int, input(... |
s960022775 | p04045 | u107639613 | 1599446094 | Python | PyPy3 (7.3.0) | py | Runtime Error | 80 | 74680 | 581 | import sys
from bisect import bisect_left
def input(): return sys.stdin.readline().strip()
def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
ok = [i for i in range(10) if i not in D]
N = str(N)
l = len(N)
if {i for i in range(int(N[0]), 10)} <= D:
if ok[0] ... |
s645549174 | p04045 | u892797057 | 1599362082 | Python | PyPy3 (7.3.0) | py | Runtime Error | 103 | 74432 | 1218 | N, L = [int(x) for x in input().split()]
S = []
for s in range(N):
S.append(input())
print("".join(sorted(S)))
# %% [markdown]
#
# C
#
# %%
N, K = [int(x) for x in input().split()]
dislikes = [False] * 10
dislike_nums = [int(x) for x in input().split()]
for n in dislike_nums:
dislikes[n] = True
# Add '0' in ... |
s558305478 | p04045 | u125545880 | 1599278861 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9160 | 713 | def minN(N:int, usable:list, restrict=True):
usable.sort()
if restrict:
for i in usable:
if i >= N:
return str(i)
else:
return str(usable[0])
def main():
N, K = map(int, input().split())
D = set(map(int, input().split()))
numset = set(range(0,10))
... |
s261205067 | p04045 | u139614630 | 1598967486 | Python | Python (3.8.2) | py | Runtime Error | 33 | 8944 | 969 | #!/usr/bin/env python3
import sys
from itertools import chain
from bisect import bisect_left
# from collections import Counter
# import numpy as np
def solve(N: int, K: int, D: "List[int]"):
nr = list(map(int, reversed(str(N))))
over = False
answer = []
useable = sorted(set(range(10)) - set(D))
i... |
s451474947 | p04045 | u869790980 | 1598486741 | Python | PyPy2 (7.3.0) | py | Runtime Error | 343 | 85056 | 241 |
n,k = map(int, raw_input().split())
letters = [u for u in range(10) if u not in set(map(int, raw_input().split()))]
def dfs(u,n,letters):return min([dfs(u*10 +l,n,letters) for l in letters if u or l]) if u < n else u
print dfs(0,n,letters) |
s211898451 | p04045 | u869790980 | 1598486547 | Python | PyPy2 (7.3.0) | py | Runtime Error | 348 | 85672 | 272 | #1000 8
#1 3 4 5 6 7 8 9
n,k = map(int, raw_input().split())
s = set(map(int, raw_input()))
letters = [u for u in range(10) if u not in s]
def dfs(u,n,letters):
if u >= n:
return u
return min([dfs(u*10 +l,n,letters) for l in letters if u or l])
print dfs(0,n,letters) |
s096590089 | p04045 | u997134361 | 1598216207 | Python | Python (3.8.2) | py | Runtime Error | 36 | 9108 | 307 | total, k = map(int, input().split())
d = input().split()
def find_lowest_denomination(total, d):
for i in range(total, 10001):
if not set(str(i)) & set(d):
print(i)
return
raise ValueError('Should never reach this code block')
find_lowest_denomination(total, d)
|
s768587080 | p04045 | u185948224 | 1598154819 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9152 | 683 | from itertools import combinations_with_replacement, product
n, k = map(int, input().split())
d = [int(x) for x in input().split()]
dd = set(list(range(10))) - set(d)
x = str(n)
lst = []
dd = list(dd)
dd.sort()
sel = []
for i in dd:
if int(x[0]) <= i and len(sel) < 3: sel.append(i*10**(len(x)-1))
if len(sel) < 2:
... |
s292449210 | p04045 | u423966555 | 1597858935 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9060 | 361 | import itertools
N, K = map(int, input().split())
D = list(map(int, input().split()))
dic = [0,1,2,3,4,5,6,7,8,9]
for i in D:
dic.remove(i)
dict = map(str, dic)
n = len(str(N)) #何桁か
ans = []
for i in range(2):
for v in itertools.permutations(dict, n+i):
if int(''.join(v)) >= N:
ans.appe... |
s069531103 | p04045 | u070423038 | 1597810379 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9068 | 847 | kingaku, n = input().split()
no_num = input().split()
result = []
ok_num = []
kuriage_num = [-1, 0]
def kuriage(l):
for i in ok_num:
if result[l] < i:
kuriage_num = [l, i]
return
if l <= 0:
return
return kuriage(l-1)
#使える数字のリストを作成
for i in range(10):
if not str(... |
s604122979 | p04045 | u573512968 | 1597736309 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9160 | 579 | N,k=map(int,input().split())
lst=list(map(int,input().split()))
x=[]
for i in range(10):
x.append(i)
for char in lst:
if char in x:
x.remove(char)
# print(x)
# x.sort(
s=str(N)
c=len(s)
x.sort(reverse=True)
ans=""
flag=0
for j in range(10000000000):
if len(ans)>=len(s):
break
else:
... |
s290015299 | p04045 | u070423038 | 1597726070 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9160 | 578 | price, hate = input().split()
no_num = set([x for x in input().split()])
ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num))
result = []
f = True
exe = True
for i in price:
f = True
for j in ok_num:
if i <= j:
result.append(j)
f = False
... |
s239185871 | p04045 | u070423038 | 1597725994 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9160 | 599 | price, hate = input().split()
no_num = set([x for x in input().split()])
ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num))
result = []
f = True
exe = True
for i in price:
f = True
for j in ok_num:
if i <= j:
print(j)
result.append(j)
... |
s410079526 | p04045 | u070423038 | 1597725908 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9140 | 604 | price, hate = input().split()
no_num = set([x for x in input().split()])
ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num))
result = []
f = True
exe = True
for i in price:
f = True
for j in ok_num:
if i <= j:
print(j)
result.append(j)
... |
s821486022 | p04045 | u166012301 | 1597192825 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9076 | 602 | n, k = map(int, input().split())
n = str(n)
d = [int(i) for i in input().split()]
av_d = [str(i) for i in range(0, 10) if i not in d]
number = ''
for i in range(len(n)):
managed = False
for j in av_d:
if i == 0 and j == '0':
continue
if j >= n[i]:
number += j
... |
s286768655 | p04045 | u166012301 | 1597192706 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9084 | 606 | n, k = map(int, input().split())
n = str(n)
d = [int(i) for i in input().split()]
av_d = [str(i) for i in range(0, 10) if i not in d]
number = ''
for i in range(len(n)):
managed = False
for j in av_d:
if i == 0 and j == '0':
continue
if j >= n[i]:
number += j
... |
s494013104 | p04045 | u166012301 | 1597192630 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9132 | 602 | n, k = map(int, input().split())
n = str(n)
d = [int(i) for i in input().split()]
av_d = [str(i) for i in range(0, 10) if i not in d]
number = ''
print(av_d)
for i in range(len(n)):
managed = False
for j in av_d:
if i == 0 and j == '0':
continue
if j >= n[i]:
number += j... |
s849591694 | p04045 | u267718666 | 1596593175 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9032 | 405 | N, K = map(int, input().split())
D = set(map(int, input().split()))
digits = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - D)
N = str(N)
res = ''
for c in N:
n_digit = int(c)
if n_digit == digits[0]:
res += str(digits[0])
continue
for i in range(1, 10-K):
if n_digit <= digits[i] and n_digi... |
s998426956 | p04045 | u396211450 | 1596012975 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9056 | 308 | def check(n,s):
v=str(n)
for i in v:
if i in s:
return False
return True
def solve():
n,k=mp()
s=input().split()
s=set(s)
while True:
if check(n,s):
print(n)
break
else:
n+=1
for _ in range(1):
solve() |
s810730093 | p04045 | u212831449 | 1595629637 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9084 | 529 | n,k = map(int,input().split())
d = list(map(int,input().split()))
n_str = str(n)
l = len(n_str)
a = [i for i in range(10) if i not in d]
#同じ桁の時
ans = ""
for i in range(l):
for j in a:
if j == int(n_str[i]):
ans += str(j)
break
elif j > int(n_str[i]):
ans += str(... |
s707628707 | p04045 | u254871849 | 1595539447 | Python | Python (3.8.2) | py | Runtime Error | 120 | 27644 | 18552 | import sys
import numpy as np
from heapq import heappush, heappop
from bisect import bisect_left as bi_l, bisect_right as bi_r
from collections import deque, Counter, defaultdict
from itertools import combinations, product
import string
inf = float('inf')
MOD = 10**9+7
# MOD = 998244353
class NumberTheory():
def ... |
s063927303 | p04045 | u465101448 | 1595516832 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9152 | 416 | N,K = list(map(int,input().split()))
D = list(map(int,input().split()))
D_ = [_ for _ in range(10) if _ not in D]
D_.sort()
N_=N+1
break_flag=False
for s_ in D_:
if break_flag:
break
elif s_ == 0:
continue
for p in product(D_,repeat=len(str(N_))-1):
ans=int(str(s_)+''.join(map(str,... |
s104652535 | p04045 | u112065131 | 1595452984 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9156 | 534 | # -*- coding: utf-8 -*-
# C - こだわり者いろはちゃん
N, K = map(int, input().split())
D = list(map(int, input().split()))
numList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
listAns = []
num = []
listN = [int(x) for x in list(str(N))]
# print(listN)
for i in numList:
if i not in D:
num.append(i)
# print(num)
for i in listN... |
s685528682 | p04045 | u687574784 | 1595105814 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9084 | 250 | N,K = list(map(int, input().split()))
D = set(input().split())
# シミュレーションでいける
for ans in range(N,10000):
if all(d not in D for d in str(ans)):
print(ans)
exit()
raise AssertionError('バグってる') |
s123932140 | p04045 | u706414019 | 1594943656 | Python | Python (3.8.2) | py | Runtime Error | 63 | 17344 | 382 | import sys,math,collections,itertools,bisect
input = sys.stdin.readline
N,K=list(map(int,input().split()))
D = list(map(int,input().split()))
Ds = set([0,1,2,3,4,5,6,7,8,9])-set(D)
can = list(itertools.product(Ds,repeat = 5))
candi = []
for c in can:
candi.append(1**4*c[0]+10**3*c[1]+10**2*c[2]+10**1*c[3]+c[4])
ca... |
s543903491 | p04045 | u543373102 | 1594870113 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9160 | 136 | N , K = input().split()
Dk = list(map(int, input().split()))
for i in range(N,10*N+1):
if set(i)&set(Dk) == set():
print(i) |
s178243476 | p04045 | u543373102 | 1594869476 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9172 | 147 | N , K = map(int, input().split())
Dk = list(map(int, input().split()))
for i in range(N,10*N+1):
if set(i)&set(Dk) == set():
print(i)
|
s345758312 | p04045 | u081149041 | 1594256187 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8940 | 313 | def digit():
N, K = [int(n) for n in input().split()]
digit = [int(n) for n in input().split()]
for i in range(N, N*10):
b = i
while b != 0:
if (b % 10) in digit:
break
b /= 10
if b == 0:
print(i)
break:
digit() |
s186357659 | p04045 | u081149041 | 1594256061 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9024 | 313 | def digit():
N, K = [int(n) for n in input().split()]
digit = [int(n) for n in input().split()]
for i in range(N, N*10):
b = i
while b != 0:
if (b % 10) in digit:
break
b /= 10
if b == 0:
print(i)
break:
digit() |
s991773600 | p04045 | u819135704 | 1593529626 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9172 | 452 | N, K = map(int, input().split())
l = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
for _ in range(K):
l.remove(int(input()))
n = [int(x) for x in str(N)]
c = len(n)
max = l[0]
min = l[-1]
if N > 1111 * max:
b = 10000*min([i for i in l if i>0]) + 1111*min
else:
a = [max] * c
for j in range(c):
if a[j] > n[j]:
... |
s303233451 | p04045 | u867848444 | 1593454377 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8924 | 366 | from bisect import *
n, k = map(int,input().split())
d = list(map(int,input().split()))
use_num = []
for i in range(10):
if i in d:continue
use_num.append(i)
str_n = str(n)
res = 0
for i in str_n:
temp = bisect_left(use_num, int(i))
add = use_num[temp]
if temp == len(use_num):
add = use_nu... |
s499065609 | p04045 | u867848444 | 1593454257 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9192 | 292 | from bisect import *
n, k = map(int,input().split())
d = list(map(int,input().split()))
use_num = []
for i in range(10):
if i in d:continue
use_num.append(i)
str_n = str(n)
res = 0
for i in str_n:
temp = bisect_left(use_num, int(i))
res = res * 10 + use_num[temp]
print(res) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.