submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s448201023
p04044
Runtime Error
str_list = [] n_number,l_length = map(int,input().split()) w_1=input() str_list.append(w_1) w_2=input() str_list.append(w_2) w_3=input() str_list.append(w_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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s608600078
p04044
Runtime Error
N,L = map(int, input().split()) S = sorted(input() for _ in range(L)) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s549683307
p04044
Runtime Error
Firstline = input() Firstline = Firstline.split() List = [] for i in int(Firstline[0]): List.append(input()) List.sort() s = "" for i in List: s += i print(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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s013250153
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for s in range(N)] S.sort() output = "" for i in S: output+=i prunt(output)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s376965894
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for s in range(L)] S.sort() output = "" for i in S: output+=i prunt(output)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s503451665
p04044
Runtime Error
N,L=map(int,input().split()) List = [] for i in range (N): List.append(int(input())) List.sort() res = "" for i in range(N): res+=List[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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s383095740
p04044
Runtime Error
N,L=map(int, input().split()) ls = [] for i in range(N): ls.append(split()) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s871747659
p04044
Runtime Error
n,l=map(int,input().split()) s=[] for i in range(n): s.append(str(input())) a="".join(sorted(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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s743720192
p04044
Runtime Error
# 入力 N,L = list(map(int, input().split())) S = [] for _ in range(N): S.add(str(input())) # 出力 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s329607102
p04044
Runtime Error
#!/usr/bin/python # -*- coding: UTF-8 -*- import sys def input(): return sys.stdin.readline().strip() def _main(): input() s = sorted(list(input().split())) print("".join(s)) if __name__ == "__main__": _main()
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s392224385
p04044
Runtime Error
def lexi(): n, l = [int(i) for i in input().split()] arr = [] for i in range(n): arr.append(input(i)) a = arr.sorted() ans = ''.join(a) print(ans) lexi()
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s221175131
p04044
Runtime Error
N, L = map(int, input().split()) str_list = [input() for _ in range(N)] str_list.sort() a = str_list[0] b = str_list[1] c = str_list[2] print(a+b+c)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s291195702
p04044
Runtime Error
N, L = map(int, input().split()) str_list = [input() for _ in range(N)] str_list.sort() a = str_list[0] b = str_list[1] c = str_list[2] print(a+b+c)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s632008943
p04044
Runtime Error
n, l = map(int, input().split()) s = [int(input()) for i in range(n)] s.sort() S = "" for i in s: S += i print(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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s020057962
p04044
Runtime Error
n, l = (map(int, input().split())) ss = [] for i in range(n): ss.append(input()) ss.sort() print(str.join(ss))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s938641411
p04044
Runtime Error
N, L = map(int, input().split()) S = [] for l in range(L): S.append(str(input())) S.sort() sum_ = '' for s in S: sum_ += s print(sum_)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s965656015
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(L)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s872737461
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(L)] print("axxcxxdxx")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s820178607
p04044
Runtime Error
record = sorted([input() for i in range(int(input().split()[1]))]) print("".join(record))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s565513629
p04044
Runtime Error
#ABC042B n,l=map(int,input().split()) a=[] for i in range(n) a.append(input()) a.sort() print(''.join(mylist))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s032143236
p04044
Runtime Error
n,l=(int(x) for x in input().split()) sente1=input() sente2=input() sente3=input() mylist=[sente1,sente2,sente3] mylist.sort() a=''.join(mylist) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s604563552
p04044
Runtime Error
l,n=(int(x) for x in input().split()) sente1=input() sente2=input() sente3=input() mylist=[sente1,sente2,sente3] mylist.sort() print(''.join(mylist))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s468945322
p04044
Runtime Error
n,l=(int(x) for x in input().split()) sente1=input() sente2=input() sente3=input() mylist=[sente1,sente2,sente3] mylist.sort() print(''.join(mylist))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s062576758
p04044
Runtime Error
#ABC042B l,n=(int(x) for x in input().split()) sente1=input() sente2=input() sente3=input() mylist=[sente1,sente2,sente3] mylist.sort() print(''.join(mylist))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s075564224
p04044
Runtime Error
a,b=map(int,input().split()) s=sorted([input() for i in range(n)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s639014337
p04044
Runtime Error
a,b=map(int,input().split()) s=sorted([input() for i in range(N)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s544024221
p04044
Runtime Error
a,b=map(int,input().split()) s=sorted([input() for i in range(n)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s013299862
p04044
Runtime Error
a,b=map(int,input().split()) s=[] for i in range(n): s.append(input()) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s624565557
p04044
Runtime Error
a,b=map(int,input().split()) c=input() s=[] for i in range(N): s.append(input()) s.sort() print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s171227061
p04044
Runtime Error
a,b=map(int,input().split()) c=input() s=[] for i in range(N): s.append(input()) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s763317872
p04044
Runtime Error
n,l=map(int,input().split) s=sorted([input() for i in range(n)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s769494888
p04044
Runtime Error
n,l = map(int,input(),split()) s = [input() for _ in range(n)] s.sort() for k in s: print(k, 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s145486748
p04044
Runtime Error
n,l = map(int,input().split()) s = [input() for _ in range(l)] s.sort() ss = "" for i in range(n): ss += s[i] print(ss)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s706745479
p04044
Runtime Error
n,l = map(int,input().split()) s = [list(int(input())) for i in range(l)] s.sort() ss = "" for i in range(n): ss += s[i] print(ss)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s510759996
p04044
Runtime Error
N,L = map(int,input().split()) S = [input() for i in range(L)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s777863496
p04044
Runtime Error
N,L = map(int,input().split()) S = [input() for i in range(L)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s229806763
p04044
Runtime Error
N,L = map(int,input().split()) S = [input() for i in range(L)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s364533164
p04044
Runtime Error
n, l = map(int, input().split()) strs = [] for i in range(l): strs.append(input()) strs.sort() print(''.join(strs))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s999232806
p04044
Runtime Error
n, l = map(int, input().split()) strs = [] for i in range(l): strs.append(input()) strs.sort() print(''.join(strs[: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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s340711417
p04044
Runtime Error
n,l=map(int,input().split) s=[input() for _ in range (n)] s.sort() ans=s[0] for i in range (1,n): ans+=s[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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s452810498
p04044
Runtime Error
N,L = map(int,input().split()) S = [input() for i in range(N)] print("".join(S.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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s206789049
p04044
Runtime Error
# -*- coding : utf-8 -*- n,l = map(int, input().split()) L = list([input() for i in range(n)]) L.sort() word = "" for i in len(L): word = word + L[i] print(word)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s959215913
p04044
Runtime Error
# -*- coding : utf-8 -*- n,l = map(int, input().split()) L = list(map(int, [input() for i in range(n)])) L.sort() word = "" for i in len(L): word = word + L[i] print(word)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s170862419
p04044
Runtime Error
# -*- coding : utf-8 -*- n,l = map(int, input().split()) L = map(int, [input() for i in range(n)]) L.sort() word = "" for i in len(L): word = word + L[i] print(word)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s603633149
p04044
Runtime Error
# -*- coding : utf-8 -*- n,l = map(int, input().split()) L = map(int, [input() for i in range(n)]) word = "" for i in len(L): L.sort() word = word + L[0] L = L.remove(L[0]) print(word)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s685040288
p04044
Runtime Error
N,L=map (str(), input().split()) a=[str(i) for i in input().split()] b=a.sort(a) c=b.join() print(c)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s230441844
p04044
Runtime Error
n,l=map(int,input().split()) s=[[]] for i in range(n): dumy=inout() s.append(dumy) n_s=sorted(s) b='' for i in range(n): b+=n_s[i] print(b)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s618498018
p04044
Runtime Error
n,l = map(int,input().ssplit()) s = sorted([input() for i in range(n)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s491085015
p04044
Runtime Error
n,l = map(int,input().ssplit()) s = sorted([int(input()) for i in range(n)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s133487824
p04044
Runtime Error
N,L = map(int,input().split()) s = sorted([int(innput()) for i in range(N)]) print(*s,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s218371266
p04044
Runtime Error
L,N=map(int,input().split()) l=list() for i in range(N): S=input() l.append(S) ll=sorted(l) print(''.join(ll))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s504449498
p04044
Runtime Error
N = list(map(int, input().split())) string = [input() for s in range(N[1])] string.sort() print(''.join(string))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s709230966
p04044
Runtime Error
N = list(map(int, input().split())) string = [input() for s in range(N[1])] string.sort() print(string)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s370792099
p04044
Runtime Error
n,l = list(map(int, input().split())) ln = [] for n in range(l): ln.append(input()) output = '' for i in sorted(ln): output += i print(output)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s275506202
p04044
Runtime Error
n,l=map(int, input().split()) ss=[input() for i in range(n)] ss=ss.sort() print(''.join(ss))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s868754618
p04044
Runtime Error
n,l=map(int, input().split()) ss=[input() for i in range(n)] print(''.join(ss.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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s565040167
p04044
Runtime Error
n,l=map(int, input().split()) ss=[] for i in range(len(n)): ss.append(input()) a=sorted(list(ss)) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s993547719
p04044
Runtime Error
#文字列大好き n,l = map(int, input().split()) s=[input() for _ in range(n)] s=s.sort() print(''.join(s)) #ans='' #for i in s: # ans=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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s790471990
p04044
Runtime Error
#!/usr/bin/env python3 """ Lの文字列N個(s1-sN) N個の文字列を辞書順にしたあと,くっつけて出力する """ def main(): l, n = map(int, input().split()) input_list = [] for i in range(n): input_list.append(input()) result_list = sorted(input_list) print("".join(result_list)) if __name__ == "__main__": main()
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s102371120
p04044
Runtime Error
#!/usr/bin/env python3 """ Lの文字列N個(s1-sN) N個の文字列を辞書順にしたあと,くっつけて出力する """ def main(): l, n = map(int, input().split()) input_list = [] for i in range(n): input_list.append(input().strip()) result_list = sorted(input_list) print("".join(result_list)) if __name__ == "__main__": main()
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s113463939
p04044
Runtime Error
a=input().split(" ") list1=[] for i in range(int(a[0])): b=input() list1.append(b) list2=sorted(list1) for j in range(int(a[0])+1): c=c+list2[j] print(c)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s127376608
p04044
Runtime Error
L, N = input().strip().split() s = [input() for i in range(int(N))] result = "" for i in sorted(s): result = result + i print(result)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s943196780
p04044
Runtime Error
if __name__ == '__main__': numbers = input().split(' ') N = int(numbers[0]) L = int(numbers[1]) # print(N, L) words = [input()] for i in range(N - 1): # word2 = input() length = len(words) new_word = input() for j in range(length): # (1) word = words[j] for l in range(L): if ord(new_word[l]) < ord(word[l]): if j == 0: words.insert(0, new_word) # スペースをつけておく else: words.insert(j, new_word) flag = False break elif ord(new_word[l]) > ord(word[l]): flag = True break else: continue if flag: if j == length - 1: words.append(new_word) continue # (1)のcontinue else: break # (1)のbreak concat = '' for i in range(len(words)): concat += words[i] print(concat)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s104539358
p04044
Runtime Error
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect from collections import defaultdict from collections import deque from functools import lru_cache ############# # Constants # ############# MOD = 10**9+7 INF = float('inf') ############# # Functions # ############# ######INPUT###### def I(): return int(input().strip()) def S(): return input().strip() def IL(): return list(map(int,input().split())) def SL(): return list(map(str,input().split())) def ILs(n): return list(int(input()) for _ in range(n)) def SLs(n): return list(input().strip() for _ in range(n)) def ILL(n): return [list(map(int, input().split())) for _ in range(n)] def SLL(n): return [list(map(str, input().split())) for _ in range(n)] ######OUTPUT###### def P(arg): return print(arg) def Y(): print("Yes"); return def N(): print("No"); return #####Inverse##### def inv(n): return pow(n, MOD-2, MOD) ######Combination###### kaijo_memo = [] def kaijo(n): if(len(kaijo_memo) > n): return kaijo_memo[n] if(len(kaijo_memo) == 0): kaijo_memo.append(1) while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD) return kaijo_memo[n] gyaku_kaijo_memo = [] def gyaku_kaijo(n): if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n] if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1) while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD) return gyaku_kaijo_memo[n] def nCr(n,r): if(n == r): return 1 if(n < r or r < 0): return 0 ret = 1 ret = ret * kaijo(n) % MOD ret = ret * gyaku_kaijo(r) % MOD ret = ret * gyaku_kaijo(n-r) % MOD return ret ######Factorization###### def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([n, 1]) return arr #####MakeDivisors###### def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) return divisors #####LCM##### def lcm(a, b): return a * b // gcd (a, b) #####BitCount##### def count_bit(n): count = 0 while n: n &= n -1 count += 1 return count #####ChangeBase##### def base_10_to_n(X, n): if X//n: return base_10_to_n(X//n, n)+[X%n] return [X%n] def base_n_to_10(X, n): return sum(int(str(X)[-i])*n**i for i in range(len(str(X)))) #####IntLog##### def int_log(n, a): count = 0 while n>=a: n //= a count += 1 return count ############# # Main Code # ############# N,L = IL() S = SLs(N) S.sort() P(*S,sep="")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s404581683
p04044
Runtime Error
NL = input() N, L = NL.split(" ") N, L = int(N), int(L) word_dict = {} for i in range(N): word_dict.[i](input()) def hikaku(a, b): for i,j in zip(a,b): if a < b: return a, b if b < a: return b, a for i in range(1, N-1): for j in range(N-j): a,b = word_dict[j], word_dict[j+1] a,b = hikaku(a, b) word_dict[j], word_dict[j] = a, b return_word = "" for i in word_dict: return_word += word_dict[i] print(return_word)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s812185343
p04044
Runtime Error
L, N = map(int, input().split()) lists = [] for i in range(N): lists.append(input()) print(''.join(sorted(lists)))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s293614244
p04044
Runtime Error
L,N = map(int, input().split()) list=[] for i in range(N): list.append(input()) print(''.join(sorted(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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s049183517
p04044
Runtime Error
n, l= map(int, input().split()) s = [input() for _ in range[n]] s.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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s092985240
p04044
Runtime Error
n, l= map(int, input().split()) s=sorted([input () for i in ranage(n)]) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s359438342
p04044
Runtime Error
n.l = map(int,input().split()) L = [input() for_ in range(n)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s077638356
p04044
Runtime Error
L,N=map(int,input().split()) l=[] for i in range(N): S=input() l.append(S) #print(l) l2=sorted(l) #print(l2) ans="".join(l2) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s889008445
p04044
Runtime Error
N, L = map(int, input().split()) S = [] for _ in range(N): S.append(input()) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s105893888
p04044
Runtime Error
strs = [] for i in range(N): n = input() strs.append(n) strs = sorted(strs) strs = ''.join(strs) print(strs)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s382549495
p04044
Runtime Error
input = input().split(" ") N = input[0] L = input[1] inputs = list() for n in range(N): list.append(input()) inputs.sort() answer = "".join(inputs) print(answer)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s830409642
p04044
Runtime Error
input = input().split(" ") N = (int)input[0] L = (int)input[1] inputs = [] for n in range(N): inputs.append(input()) inputs.sort() answer = "".join(inputs) print(answer)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s026579771
p04044
Runtime Error
NL = input().split() N = int(NL[0]) L = int(NL[1]) aba = ["axx", "fxx", "dxx"] st = [] for i in range(N): a = aba[i] st.append(a) s_st = sorted(st) dic = "" for j in range(len(s_st)): dic += s_st[j] print(dic)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s262245605
p04044
Runtime Error
NL = ["3", "3"] N = int(NL[0]) L = int(NL[1]) st = [] for i in range(N): a = input() st.append(a) s_st = sorted(st) dic = "" for j in range(len(s_st)): dic += s_st[j] print(dic)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s240141953
p04044
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; vector<string> s(n); for(int i = 0; i < n; i++){ cin >> s[i]; } sort(s.begin(), s.end()); for(int i = 0; i < n; i++){ cout << s[i]; } cout << endl; }
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s428833008
p04044
Runtime Error
N, M = map(int, input().split()) Mylist = [] for i in range(M): S = input() Mylist.append(S) ANSlist = sorted(Mylist) ANS = ''.join(ANSlist) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s417285288
p04044
Runtime Error
N, M = map(int(), input().split()) Mylist = [] for i in range(M): S = input() Mylist.append(S) ANSlist = sorted(Mylist) ANS = ''.join(ANSlist) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s464890149
p04044
Runtime Error
n,l=map(int, input().split()) #a1 a2 a3 s = [i 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s324265365
p04044
Runtime Error
n,l=map(int, input().split()) #a1 a2 a3 s = [i for i in range(q)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s599683279
p04044
Runtime Error
n, l = map(int,input().split()) s = [input() for _ in range(n)] i = sorted(s) print(''.join(i)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s296712651
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for _ in range(N)] print(''.join(S.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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s707430840
p04044
Runtime Error
n, l = map(int, input().split()) s = soated([input() for i in range(n)]) print(*s, sep = "")
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s268159388
p04044
Runtime Error
x = [int(x) for x in input().split(' ')][1] l = [] for i in range(x): l += [input()] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s228173451
p04044
Runtime Error
x = [int(x) for x in input().split()][1] l = [] for i in range(x): l += [input()] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s487706256
p04044
Runtime Error
x = [int(x) for x in input().split()][1] l = [] for i in range(x+1): l += [input()] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s799202887
p04044
Runtime Error
l = [x for x in input().split(' ')] l = sorted(l) 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s719934860
p04044
Runtime Error
N,K = list(map(int,input().split())) listA = [] for i in range(K):listA.append(input()) listA.sort() print("".join(listA))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s710990783
p04044
Runtime Error
N,L = map(int, input().split()) S = [] for i in range(N): S.append(input()) S.sort() ans = '' for i in range(N): ans += ans + S[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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s886741311
p04044
Runtime Error
N,L = map(int, input().split()) S = [list(map(str, input().split())) for i in range(N)] S.sort() ans = '' for i in range(N): ans += ans + S[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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s122764440
p04044
Runtime Error
H, W = map(int, input().split()) S = [] for _ in range(H): S.append(input()) S.sort() str1='' for i in range (H): str1=str1+S[i] print(str1)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s268174611
p04044
Runtime Error
H, W = map(int, input().split()) S = [] for _ in range(H): S.append(input()) S.sort() str1='' str1.append(S[i] for i in range (H)) print(str1)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s249319379
p04044
Runtime Error
H, W = map(int, input().split()) S = [] for _ in range(H): S.append(input()) S.sort() str1='' str1.append(S[i] for i in range (H))
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s354566897
p04044
Runtime Error
n,b=list(input().split()) a=[input() for i in range(n)] 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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s078973364
p04044
Runtime Error
a,b=map(int,input().split()) n=sorted([input() for i in range(a)]) print(*s,sep='')
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s000304754
p04044
Runtime Error
a,b=map(int,input().split()) n=sorted([input() for i in range(b)]) print(*s,sep='')
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s987973572
p04044
Runtime Error
a,b=map(int,input().split()) n=list([input() for i in range(b)]) for i in n: p=sorted(n) q=''.join(p) print(q)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s318878223
p04044
Runtime Error
a,b=map(int,input().split()) n=list([str(input()) for i in range(b)]) for i in n: p=sorted(n) q=''.join(p) print(q)
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 string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>