submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s676024136
p04044
Runtime Error
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)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s186242362
p04044
Runtime Error
L,N=map(int,input().split()) l=[] for i in range(N): l.append(input()) l.sort() print(''.join(l))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s742288298
p04044
Runtime Error
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))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s543182404
p04044
Runtime Error
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...
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s625960720
p04044
Runtime Error
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))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s031334713
p04044
Runtime Error
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
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s971247476
p04044
Runtime Error
lengh,num = map(int,input().split()) lis = [input() for i in range(num)] print("".join(sorted(lis)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s207586369
p04044
Runtime Error
s,l=map(int,input().split()) m=sorted([input() for _ in range(l)]) print("".join(m))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s170391482
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(N)] for i in range(3): print(sorted(S)[i], end="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s582461042
p04044
Runtime Error
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]))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s760580659
p04044
Runtime Error
n,m=map(int,input().split()) s=sorted([input() for i in range(m)]) print("".join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s214732425
p04044
Runtime Error
# -*- 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)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s421462981
p04044
Runtime Error
print("".join(sorted([input() for _ in range(input().split()[0]))))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s840296008
p04044
Runtime Error
n, l = map(int, input().split()) array = sorted([input() for x in range(l)]) res = "" for i in array: res += i print(res)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s602666687
p04044
Runtime Error
# -*- 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))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s170412342
p04044
Runtime Error
#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...
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s544070355
p04044
Runtime Error
# -*- 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)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s253322812
p04044
Runtime Error
n,l = list(map(int, input().split(" "))) s = [] for i in range(n): s.append(input()) sort(s) print("".join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s938073830
p04044
Runtime Error
n, l = map(int, input().split()) str_list = [input() for i in range(l)] str_list.sort() print("".join(str_list))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s618891314
p04044
Runtime Error
n, l = map(int, input().split()) str_list = [input() for i in range(3)] str_list.sort() print("".join(str_list))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s574114986
p04044
Runtime Error
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])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s274838556
p04044
Runtime Error
n,l = map(int,input().split()) s = [] for i in range(n): s.append(input()) s.sort() print(s[0]+s[1]+s[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s854903642
p04044
Runtime Error
3 3 dxx axx cxx
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s031201613
p04044
Runtime Error
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))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s287575071
p04044
Runtime Error
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)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s294011735
p04044
Runtime Error
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...
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s411602408
p04044
Runtime Error
L, N = map(int,input().split()) S = [input() for i in range(N)] S.sort() print("".join(S))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s663938167
p04044
Runtime Error
L, N = map(int,input().split()) S = [input() for i in range(N)] B=sorted(S) A=''.join(B) print(str(A))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s500720939
p04044
Runtime Error
L, N = map(int,input().split()) S = [input() for i in range(N)] S=sorted(S) A=''.join(S) print(str(A))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s176621176
p04044
Runtime Error
L, N = map(int,input().split()) S = [input() for i in range(N)] S.sort() A=''.join(S) print(str(A))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s348097574
p04044
Runtime Error
L, N = map(int,input().split()) S = [input() for i in range(N)] S.sort() A=''.join(S) print(A)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s740244698
p04044
Runtime Error
n, l = map(int, raw_input().split()) for i in xrange(n): a.append(raw_input()) a.sort() print "".join(a)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s734545290
p04044
Runtime Error
n, l = map(int, raw_input().split()) for i in xrange(n): a.append(raw_input()) a.sort() print " ".join(a)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s949202935
p04044
Runtime Error
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)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s288822451
p04044
Runtime Error
#pythonだとsortでそのまま何文字でもソートしてくれる n, l = map(int, input().split()) s = [input() for _ in range(n)]] print(''.join(sorted(s)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s447909598
p04044
Runtime Error
# -*- 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))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s297337832
p04044
Runtime Error
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))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s844234676
p04044
Runtime Error
n,l=map(int,input().split()) print("".join(sorted[input() for i in range(n)]))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s814716947
p04044
Runtime Error
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)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s460675917
p04044
Runtime Error
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
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s905483219
p04044
Runtime Error
print("".join(sorted([input() for i in range(int(input().split[0]))])))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s481440393
p04044
Runtime Error
import sys def main(lines): print(''.join(sorted(lines.split()))) next(sys.stdin) for line in sys.stdin: lines += line main(lines)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s583679897
p04044
Runtime Error
N = int(input().split()[0]) words = [input() for i in range(N)] print("".join(words.sort()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s136690770
p04044
Runtime Error
N = input().split()[0] words = [input() for i in range(N)] print("".join(words.sort()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s848410609
p04044
Runtime Error
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: ...
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s234130821
p04044
Runtime Error
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 ...
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s724696645
p04044
Runtime Error
N, L = raw_input().split() l = [] for _ in range(N): l.append(raw_input().strip()) print "".join(sorted(l))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s018621055
p04044
Runtime Error
n, l = map(int, input().split()) s = [] for i in range(n): t = input() s.append(t) s.sort() print(s.join(''))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long str...
s693222529
p04045
Wrong Answer
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 = [int(d) for d in str(total[0])] i = 0 if yen[0] == 9 and 9 not in possible: zeros = [0] * len(yen) yen = [1] + zeros print(int(''.join(map(str, ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s183304908
p04045
Wrong Answer
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 = [int(d) for d in str(total[0])] for index, i in enumerate(yen): if i not in possible: for j in possible: if j > 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...
s784174888
p04045
Wrong Answer
n = list(map(int, input().split())) a = list(map(int, input().split())) c = [1,2,3,4,5,6,7,8,9] b = list(set(a) ^ set(c)) print(b[0] * n[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...
s818542899
p04045
Wrong Answer
n,thevailladadu = [int(x) for x in input().split()] d = [int(x) for x in input().split()] m = n while(n>=10): n=n//10 check = n while check in d: check=(check+1)%10 if check>n: a = 0 while a in d: a+=1 while check<m: check=(check*10)+a print(check) elif check<n: a=1 whi...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s990109675
p04045
Wrong Answer
n,thevailladadu = [int(x) for x in input().split()] d = [int(x) for x in input().split()] m = n while(n>0): n=n//10 check = n while check in d: check+=1 if check>n: a = 0 while a in d: a+=1 while check<m: check=(check*10)+a print(check) else: a=1 while a in d: 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...
s985851436
p04045
Wrong Answer
n,thevailladadu = [int(x) for x in input().split()] d = [int(x) for x in input().split()] m = n while(n>0): n=n//10 check = n while check in d: check+=1 if check>n: a = 0 while a in d: a+=1 while n<m: n=(n*10)+a print(n) else: a=1 while a in d: a+=1 b = 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...
s717404441
p04045
Wrong Answer
n,thevailladadu = [int(x) for x in input().split()] d = [int(x) for x in input().split()] m = n i=0 ans=0 while (n>0): a = n%10 #print(a) while a in d: a=(a+1)%10 ans+=(a*(10**i)) n//=10 i+=1 if ans<m: j=1 while j in d: j+=1 ans+=(j*(10**i)) 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...
s199433730
p04045
Wrong Answer
import re N, K = map(int, input().split()) unlike_list = set(map(str, input().split())) unlike_nums = ''.join(unlike_list) ans = False while not ans: if re.match(r'([' + unlike_nums + ']+)', str(N)): N += 1 else: ans = True 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...
s221938174
p04045
Wrong Answer
import re N, K = map(int, input().split()) unlike_list = list(map(str, input().split())) unlike_nums = ''.join(unlike_list) ans = False while not ans: if re.match(r'([' + unlike_nums + ']+)', str(N)): N += 1 else: ans = True 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...
s423903445
p04045
Wrong Answer
def check(n,l): r=str(n) for i in range(len(r)): if int(r[i]) not in l: return 0 return 1 n,k=map(int,input().split()) c=set(map(int,input().split())) d=set(range(0,10)) l=list(d-c) index=1 while check(n,l)==0: n+=n print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s132072223
p04045
Wrong Answer
import sys import logging logging.basicConfig(level=logging.DEBUG) N,K=list(map(int,input().split())) num=list(input().split()) i=0 while True: for j in str(N+i): #logging.debug('j={}'.format(j)) if j in num: i+=1 break else: print(N+i) sys.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...
s874431632
p04045
Wrong Answer
# N, Kの入力受付 N, K = map(int, input().split()) # Dの入力受付 D = set(input().split()) # 0-9とDの差集合作成、リスト化してEに代入 E = list({"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - D) # Eの要素の組み合わせのリストF作成、整数化 F = list((i+j+k+l+n) for i in E for j in E for k in E for l in E for n in E) F = list(map(int, F)) # Fの要素でN以上の最小値を出力 result = 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...
s931999846
p04045
Wrong Answer
# N, Kの入力受付 N, K = map(int, input().split()) # Dの入力受付 D = set(input().split()) # 0-9とDの差集合作成、リスト化してEに代入 E = list({"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - D) # Eの要素の組み合わせのリストF作成、整数化 F = list((i+j+k+l) for i in E for j in E for k in E for l in E) F = list(map(int, F)) # Fの最大値10000追加 F.append(10000) # Fの要素で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...
s087394025
p04045
Wrong Answer
n, k= input().split() l = list(map(int,input().split())) checkNum=[i for i in range(11)] def find(x): while x!=checkNum[x]: checkNum[x]=checkNum[checkNum[x]] x=checkNum[x] return x for i in l: checkNum[find(i)]=checkNum[find(i+1)] fin="" for i in range(len(n)): first=int(n[i]) k=f...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s062688471
p04045
Wrong Answer
n, k= input().split() l = list(map(int,input().split())) checkNum=[i for i in range(11)] def find(x): while x!=checkNum[x]: checkNum[x]=checkNum[checkNum[x]] x=checkNum[x] return x for i in l: checkNum[find(i)]=checkNum[find(i+1)] fin="" for i in range(len(n)): first=int(n[i]) k=f...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s720194157
p04045
Wrong Answer
n, k= map(int,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="" remain=0 if n==0: fin=str(find(0)) w...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s234909620
p04045
Wrong Answer
n, k= map(int,input().split()) l = list(map(int,input().split())) checkNum=[i for i in range(11)] for i in l: checkNum[i]=checkNum[i+1] def find(x): while x!=checkNum[x]: checkNum[x]=checkNum[checkNum[x]] x=checkNum[x] return x fin="" remain=0 while n>0 or remain>0: last=n%10 k=find(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s655488894
p04045
Wrong Answer
n, k= map(int,input().split()) l = list(map(int,input().split())) checkNum=[i for i in range(11)] for i in l: checkNum[i]=checkNum[i+1] def find(x): while x!=checkNum[x]: checkNum[x]=checkNum[checkNum[x]] x=checkNum[x] return x fin="" remain=0 while n>0 or remain>0: last=n%10 k=find(...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s964174645
p04045
Wrong Answer
n, k = map(int, input().split()) dl = list(map(int, input().split())) for i in range(n, 10001): money = list(map(int, str(i))) for m in money: if dl.count(m) != 0: break else: print(i) break
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s831205852
p04045
Wrong Answer
#from statistics import median #import collections #aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] from math import gcd from itertools import combinations,permutations,accumulate, product # (string,3) 3回 #from collections import deque from collections import deque,defaultdict,Counter ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s088494854
p04045
Wrong Answer
from collections import deque,defaultdict,Counter from heapq import heapify,heappop,heappush,heappushpop from copy import copy,deepcopy from itertools import product,permutations,combinations,combinations_with_replacement from bisect import bisect_left,bisect_right from math import sqrt,gcd,ceil,floor,factorial # from ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s541625448
p04045
Wrong Answer
import sys input = sys.stdin.readline import math def INT(): return int(input()) def MAPINT(): return map(int, input().split()) def LMAPINT(): return list(map(int, input().split())) def STR(): return input() def MAPSTR(): return map(str, input().split()) def LMAPSTR(): return list(map(str, input().split())) f_inf = 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...
s098860158
p04045
Wrong Answer
import sys input = sys.stdin.readline import math def INT(): return int(input()) def MAPINT(): return map(int, input().split()) def LMAPINT(): return list(map(int, input().split())) def STR(): return input() def MAPSTR(): return map(str, input().split()) def LMAPSTR(): return list(map(str, input().split())) f_inf = 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...
s501167089
p04045
Wrong Answer
# coding:UTF-8 import sys def resultSur97(x): return x % (10 ** 9 + 7) if __name__ == '__main__': # ------ 入力 ------# nk = list(map(int, input().split())) # スペース区切り連続数字 x = nk[1] dList = list(map(int, input().split())) # スペース区切り連続数字 # ------ 処理 ------# f = 0 n = nk[0] wh...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s461584495
p04045
Wrong Answer
N, K = map(int, input().split()) D = list(map(int, input().split())) def f(n, x): if n==0: if x >= N: print(x) exit() return for i in range(10): if i in D: continue f(n-1, x*10+i) f(len(str(N)), 0) ans = "" for i in range(1, 10): if...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s401485137
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) def validate(strNum): for i in range(0, len(strNum)): if strNum[i] in d: return False return True for i in range(0, 10001): tf = validate(str(n)) # print(tf) if tf: print(n) exit() n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s682315422
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) def validate(strNum): for i in range(0, len(strNum)): if strNum[i] in d: return False return True for i in range(0, 1001): tf = validate(str(n)) # print(tf) if tf: print(n) exit() n += 1
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s115385419
p04045
Wrong Answer
n,k = map(int,input().split()) if k == 0: print(n) exit() dislike = list(map(int,input().split())) ref = [0,1,2,3,4,5,6,7,8,9,0] for i in range(10): while ref[i] in dislike: ref[i] = (ref[i]+1)%10 ans = '' for i in str(n): ans += str(ref[int(i)]) if int(ans)<n: ans = str(ref[1])+str(ref[0])*len(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...
s359306644
p04045
Wrong Answer
n,k = map(int,input().split()) if k == 0: print(n) exit() dislike = list(map(int,input().split())) ref = [0,1,2,3,4,5,6,7,8,9,0] for i in range(10): while ref[i] in dislike: ref[i] = (ref[i]+1)%10 ans = '' for i in str(n): ans += str(ref[int(i)]) if int(ans)<n: ans = str(ref[1])+ans print(ans)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s632994702
p04045
Wrong Answer
n,k = map(int,input().split()) if k == 0: print(n) exit() dislike = list(map(int,input().split())) usable = [] for i in range(10): if i not in dislike: usable.append(i) print(usable) ans = '' for i in str(n): while int(i) not in usable: i = str((int(i)+1)%10) ans+=i 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...
s359279438
p04045
Wrong Answer
n,k = [int(x) for x in input().split()] ds = {int(x) for x in input().split()} ns = {0,1,2,3,4,5,6,7,8,9} -ds #print(ds) #print(ns-ds) temp=0 d ={} a=1 b = {} m = len(str(n)) +1 over=False while(a<=m and not over ): c = [] d = 10**(a-1) for v in ns: if a>1: for bv in b[a-1]: t = v*d + bv ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s240432792
p04045
Wrong Answer
n,k = [int(x) for x in input().split()] ds = {int(x) for x in input().split()} ns = {0,1,2,3,4,5,6,7,8,9} -ds #print(ds) #print(ns-ds) temp=0 d ={} a=1 b = {} m = len(str(n)) +1 over=False while(a<m and not over ): c = [] d = 10**(a-1) for v in ns: if a>1: for bv in b[a-1]: t = v*d + bv ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s031365592
p04045
Wrong Answer
N,K=map(int,input().split()) D=list(map(int,input().split())) while True: S=str(N) flag=True for x in S: if x in D: flag=False if flag==True: 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...
s864500787
p04045
Wrong Answer
def answer(n: str, k: str, d: []) -> int: numbers = list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ^ set(d)) payment = '' if int(str(numbers[-1]) * len(n)) < int(n): if numbers[0] == 0: payment = str(numbers[1]) + str('0' * len(n)) else: payment = str(numbers[0]) * (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...
s589471485
p04045
Wrong Answer
from sys import stdin, stdout from time import perf_counter import sys sys.setrecursionlimit(10**9) mod = 10**9+7 n,k = map(int,input().split()) d= list(map(int,input().split())) test = [1,2,3,4,5,6,7,8,9] for item in range(k): if d[item]==0: print(n) exit() result =[] for item in test: ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s918752508
p04045
Wrong Answer
def price(N,K): Kn = input().split() Flag = False for i in range(N,10001,1): value = str(i) for j in range(K): if(Kn[j] not in value): Flag = True elif(Kn[j] in value): Flag = False break if(Flag == True): ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s388577234
p04045
Wrong Answer
import sys N , K = map(int,input().split()) D = list(map(int,input().split())) L = [i for i in range(10)] for i in D: L.remove(i) c = [] for i1 in L: for i2 in L: for i3 in L: for i4 in L: k = i1*1000 + i2*100 + i3*10 + i4 c.append(k) c.sort() for i in range(len(c)): if c[i] >= N: pr...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s435241807
p04045
Wrong Answer
N, K = map(int, input().split()) Ds = list(map(int, input().split())) N2 = '' for d in str(N): intd = int(d) for i in range(intd, 10): if not i in Ds: N2 += str(i) break print(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...
s500363690
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) n = 1000 flag = True while flag: flag2 = True for si in str(n): if si in d: n += 1 flag2 = False break if flag2: break else: flag = True 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...
s568531030
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) #n = 1000 flag1 = True while flag1: for si in str(n): if si in d: n += 1 break flag1 = False print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s742625047
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) #n = 1000 flag1 = True while flag1: for si in str(n): if si in d: n += 1 break flag1 = False print(n)
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s508332621
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) num = [str(i) for i in range(10)] for i in range(k): num.remove(d[i]) import itertools, heapq ans = [] heapq.heapify(ans) for i in itertools.product(num, repeat=len(str(n))): s = int(''.join(i)) if s >= n: heapq.heappush(ans, -s) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s117534367
p04045
Wrong Answer
n, k = map(int, input().split()) d = list(input().split()) num = [str(i) for i in range(10)] for i in range(k): num.remove(d[i]) import itertools, heapq ans = [] heapq.heapify(ans) for i in itertools.product(num, repeat=len(str(n))): s = int(''.join(i)) if s >= n: heapq.heappush(ans, -s) ...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s411257000
p04045
Wrong Answer
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 int(str(ok[-1]) * l) < int(N): if ok[0] == 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...
s445735805
p04045
Wrong Answer
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 int(str(ok[-1]) * l) < int(N): if ok[0] == 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...
s348119307
p04045
Wrong Answer
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 int(str(ok[-1]) * l) < int(N): if ok[0] == 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...
s552752155
p04045
Wrong Answer
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 the beginning of N for carrying up N = "0" + str(N) # Create a list of numbers consists N n_list = [] for n in N: n_list.append(int(n)) # Cre...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s573768164
p04045
Wrong Answer
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 the beginning of N for carrying up N = "0" + str(N) # Create a list of numbers consists N n_list = [] for n in N: n_list.append(int(n)) # Cre...
1000 8 1 3 4 5 6 7 8 9
2000
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p> <p>She is shopping, and now paying at the cashier. Her total is <var>N</var> y...
s639377712
p04045
Wrong Answer
def minN(N:int, usable:list, restrict=True): usable.sort() if restrict: for i in usable: if i >= N: return str(i) # 桁が増えるとき if usable[0] != 0: return str(usable[0]) + str(usable[0]) else: return str(usable[1]) + str(usable[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...
s621358068
p04045
Wrong Answer
n, k = map(int, input().split()) D = set(map(int, input().split())) if k == 9: print(n+1) exit(0) for ans in range(n,10000): for c in str(ans): if int(c) in D: break else: 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...
s383450057
p04045
Wrong Answer
n, k = map(int, input().split()) D = set(map(int, input().split())) if k == 9: print(n) exit(0) for ans in range(n,10000): for c in str(ans): if int(c) in D: break else: 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...
s752563022
p04045
Wrong Answer
n, k = map(int, input().split()) D = set(map(int, input().split())) if k == 0 or 9: print(n) exit(0) for ans in range(n,10000): for c in str(ans): if int(c) in D: break else: 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...