submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s384504964
p04044
Accepted
a = list(map(int,input().split())) b = [input() for i in range(a[0])] c = [] for i in range(a[0]): c.append(b[i]) d = sorted(c) print("".join(d))
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>
s452947974
p04044
Accepted
N, L = list(map(int, input().strip().split(' '))) S = [] for i in range(N): s = input() S.append(s) S.sort() c="" for i in S: c = c+i 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>
s301228551
p04044
Accepted
n,l = (int(_) for _ in input().split()) s = [input() for i in range(n)] s.sort() print(''.join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s773310621
p04044
Accepted
# coding: utf-8 N, L = map(int, input().split()) print("".join(sorted([input() for _ in range(N)])))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s839220135
p04044
Accepted
N,L = map(int,input().split()) S = [] for i in range(N): S.append(input()) S.sort() for i in range(N): print(S[i], end="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s377386699
p04044
Accepted
n, l = map(int,input().split()) list = [] for i in range(n): a = input() list.append(a) 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>
s878378340
p04044
Accepted
n, l = map(int, input().split()) print(''.join(sorted([input() for _ in range(n)])))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s613668114
p04044
Accepted
N, L = map(int, input().split()) s = [] for S in range(N): S = str(input()) s.append(S) l = sorted(s) m = "".join(l) print(m)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s679159889
p04044
Accepted
data = list(map(int, input().split())) strings = [input() for _ in range(data[0])] strings.sort() s = '' for x in strings: s += x 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>
s098546468
p04044
Accepted
N,L=map(int,input().split()) moji=[] for i in range(0,N): moji.append(input()) moji=sorted(moji) answer="" for i in range(0,N): answer+=moji[i] 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>
s058591668
p04044
Accepted
N, L = map(int, input().split()) s = [0 for i in range(N)] for i in range(N): s[i] = input() s.sort() output = "" for i in range(N): output += s[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>
s590374050
p04044
Accepted
N,L=map(int,input().split()) S=[] for _ in range(N): S.append(input()) S.sort() for s in S: print(s,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>
s457881514
p04044
Accepted
N,L=map(int,input().split()) l=[] for i in range(N): l.append(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>
s186160981
p04044
Accepted
N, L = map(int, input().split()) S = sorted([input() for _ in range(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>
s232358995
p04044
Accepted
#!/usr/bin/env python3 # -*- coding: utf-8 -*- n,l = map(int, input().split()) a=[] for i in range(0,n): a.append(input()) a.sort() print(''.join(a))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s518707615
p04044
Accepted
n, l = map(int, input().split()) L = [input() for i 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>
s459706316
p04044
Accepted
n,l = map(int,input().split()) s = [input() for i in range(n)] s.sort() ans = "" for i in s: ans += i print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s861835752
p04044
Accepted
n,l = map(int,input().split(' ')) li = [] for i in range(n): li.append(input()) li.sort() print(''.join(li))
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>
s965540317
p04044
Accepted
N, L = map(int, input().split()) s = [] for i in range(N): s.append(input()) s = sorted(s) ans = "".join(s) 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>
s355621732
p04044
Accepted
# -*- coding: utf-8 -*- N, L = map(int, input().split()) words = [] answer = '' for i in range(N): words.append(input()) for i in range(len(words)): word = min(words) answer += word words.remove(word) 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>
s125975039
p04044
Accepted
# -*- coding: utf-8 -*- # スペース区切りの整数の入力 N, L = map(int, input().split()) # 複数行に複数の入力値を取得し、出力する S = [input() for i in range(N)] S = sorted(S) # 出力 # リストSの各要素に対してlen()を取得したリストの各要素がすべてLと一致するか否かの判定 len_list = [s_length == L for s_length in list(map(lambda s: len(s), S))] S_concat = "" if all(len_list): for i in range(len(S)): S_concat+=S[i] print(S_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>
s159115937
p04044
Accepted
def main(): N, L = map(int, input().split()) S = [input() for _ in range(N)] S.sort() ans = ''.join(S) print(ans) 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>
s372670539
p04044
Accepted
n,l = map(int, input().split()) s_list = [input() for i in range(n)] s_list.sort() s = '' for item in s_list: s += item 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>
s959435982
p04044
Accepted
from sys import stdin def main(): n = next_int() l = next_int() s = [input() for _ in range(n)] s.sort() print("".join(s)) def next_int(): return int(next_str()) def next_str(): result = "" while True: tmp = stdin.read(1) if tmp.strip() != "": result += tmp elif tmp != '\r': break return result 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>
s588537263
p04044
Accepted
n,l = map(int, input().split()) s_li = [input() for i in range(n)] s_li.sort() s = '' for item in s_li: s += item 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>
s297309118
p04044
Accepted
N, L = [int(i) for i in input().split()] list = sorted([input() for i in range(N)]) ans = '' #print(list) for i in range(N): ans += list[i] print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s323708114
p04044
Accepted
N,L=map(int,input().split()) list1=[] for i in range(N): S=input() list1.append(S) list1.sort() ans="" for j in range(N): ans=ans+list1[j] print("".join(list1))
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>
s684164308
p04044
Accepted
a = input().split(" ") ar = [] for j in range(int(a[0])): l = input() ar.append(l) b = sorted(ar) print("".join(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>
s645431583
p04044
Accepted
def main(): N, L = map(int, input().split()) S = [] answer = "" for i in range(N): S.append(input()) for s in sorted(S): answer += s print(answer) 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>
s882887902
p04044
Accepted
#! /usr/bin/python3 # 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) """ 1≦N,L≦100 全ての i(1≦i≦N) に対し、Si の長さは L に等しい。 各 i について, Si は全て半角英小文字のみから成る文字列である。 """ test_mode = False N, L = map(int, input().split()) S = [] for i in range(N): S.append(input()) if test_mode: print(S) S.sort() if test_mode: print(S) for i in range(N): print(S[i], end='')
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s431903489
p04044
Accepted
N, L = map(int, input().split()) S = [] for i in range(N): S.append(input()) S_sorted = sorted(S) print("".join(S_sorted))
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>
s711008805
p04044
Accepted
n,l = map(int,input().split()) s = [] for i in range(n): s.append(input()) s = sorted(s) print(''.join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s686870046
p04044
Accepted
# -*- coding: utf-8 -*- from sys import stdin N, L = [int(x) for x in stdin.readline().rstrip().split()] dic = [] for i in range(N): dic.append(stdin.readline().rstrip()) dic_sort = sorted(dic) ans = "".join(dic_sort) 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>
s032694779
p04044
Accepted
N, L=map(int, input().split()) Slist=list(sorted([input() for _ in range(N)])) S='' for i in range(N): S+=Slist[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>
s143509641
p04044
Accepted
N, L = [int(x) for x in input().split()] S = [input() for i in range(N)] print(''.join(sorted(S)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s690918840
p04044
Accepted
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right from string import ascii_lowercase from functools import lru_cache import sys sys.setrecursionlimit(10000) INF = float("inf") YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no" dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0] dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1] def inside(y, x, H, W): return 0 <= y < H and 0 <= x < W def ceil(a, b): return (a + b - 1) // b def main(): N, L = map(int, input().split()) T = [] for _ in range(N): T.append(input()) print("".join(sorted(T))) 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>
s118775143
p04044
Accepted
n,l = map(int, input().split()) s = [] for i in range(n): s.append(input()) s.sort() ans = "" for i in range(len(s)): 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>
s095349969
p04044
Accepted
N, L = 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>
s071963443
p04044
Accepted
input_list = list(map(int, input().split())) n = input_list[0] l = input_list[1] str_list = [] for i in range(n): str_list.append(input()) str_list = sorted(str_list) ans_str = ''.join(str_list) print(ans_str)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s261350798
p04044
Accepted
n, l = map(int, input().split()) sl = sorted([input() for i in range(1, n + 1)]) print("".join(sl))
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>
s453447685
p04044
Accepted
n, l = map(int, input().split()) sl = sorted([input() for i in range(1, n + 1)]) r = "" for i in sl: r += i print(r)
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>
s262583082
p04044
Accepted
n,l = map(int,input().split()) a = [] for _ in [0]*n: a += [input()] a.sort() print("".join(a))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s152554761
p04044
Accepted
num, length = map(int, input().split(" ")) li = [input() for x in range(num)] li_sort = [] def q_sort(li): left = [] right = [] if len(li) <= 1: return li ref = li[0] ref_count = 0 for ele in li: if ele < ref: left.append(ele) elif ele > ref: right.append(ele) else: ref_count += 1 left = q_sort(left) right = q_sort(right) return left + [ref] * ref_count + right print("".join(q_sort(li)))
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>
s384602016
p04044
Accepted
N, L = map(int,input().split()) log = [ input() for i in range(N) ] log.sort() result = '' for i in log: 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>
s177270560
p04044
Accepted
n, l = map(int, input().split()) s = [] for i in range(n): s.append(input()) s.sort() ans = "" for i in range(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>
s807045654
p04044
Accepted
n, l = map(int, input().split()) list_count = 0 list = [] while list_count < n: list.append(str(input())) list_count += 1 list.sort() ans = "" for letter in list: ans += letter 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>
s644030717
p04044
Accepted
n,l=map(int,input().split()) s=list(input()for _ 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>
s205520960
p04044
Accepted
n,l = map(int,input().split()) c = [0]*n for i in range(n): c[i] = input() c.sort() print(*c,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>
s357169057
p04044
Accepted
N, L = map(int, input().split()) x = [] for i in range(N): x.append(input()) x.sort() print("".join(x))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s165978540
p04044
Accepted
N,L = map(int,input().split()) D = [] for i in range(N) : D.append(input()) D = sorted(D) print("".join(D))
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>
s866754298
p04044
Accepted
N,L=map(int,input().split()) l=[] for i in range(N): l.append(input()) l.sort() print(''.join(l))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s313359639
p04044
Accepted
n, l = map(int, input().split()) s = [] for i in range(n): s.append(input()) s.sort() ans = '' for i in s: ans += i print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s265922483
p04044
Accepted
N,L = map(int, input().split()) S = [input() for _ in range(N)] S = sorted(S) ans = '' for i in range(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>
s864091559
p04044
Accepted
import sys input() print(''.join( sorted([x.rstrip() for x in sys.stdin.readlines()])))
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>
s209999042
p04044
Accepted
N, L = map(int, input().split()) s = [input() for i in range(N)] s.sort() print(''.join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s336705102
p04044
Accepted
n,l=map(int,input().split()) s=[ input() for i in range(n)] s.sort() print(''.join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s285028230
p04044
Accepted
#!/usr/bin/python3 # -*- coding: utf-8 -*- n, L = [int(i) for i in input().split()] s = [input() for i in range(n)] s.sort() print(''.join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s958385350
p04044
Accepted
N, L = map(int, input().split()) S = [input() for _ in range(N)] S.sort() output = "" for i in range(N): output += S[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>
s239555796
p04044
Accepted
N, L = map(int, input().split()) inputs = [input() for _ in range(N)] orderd_inputs = sorted(inputs) print(''.join(orderd_inputs))
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>
s601829445
p04044
Accepted
N, L = map(int, input().split()) S = [] for i in range(N): S.append(input()) S.sort() for i in S: print(i, end = "") print()
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>
s358951840
p04044
Accepted
n, l = list(map(int, input().split())) li = [input() for i in range(n)] print(''.join(sorted(li)))
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>
s422941128
p04044
Accepted
n,l=map(int,input().split()) a=[input() for x in range(n)] a.sort() print(''.join(a))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s181016250
p04044
Accepted
N, L = map(int,input().split()) AAA = [] for i in range(N): AAA.append(input()) AAA.sort() ans = "" for i in range(N): ans += AAA[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>
s163685197
p04044
Accepted
N, L = map(int, input().split()) nums = [] for i in range(N): nums.append(input()) nums.sort() print(''.join(nums))
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>
s449174064
p04044
Accepted
n,l = map(int,input().split()) s_list = [] for i in range(n): s_list.append(input()) s_list.sort() for st in s_list: print(st,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>
s093851433
p04044
Accepted
N, L = map(int, input().split()) S = ['']*N for i in range(N): S[i] = 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>
s146672183
p04044
Accepted
n, l = map(int, input().split()) s = [input() for i in range(n)] s.sort() ans = '' for i in range(n): print(s[i], end = '') print()
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>
s994203559
p04044
Accepted
n = int(raw_input().split()[0]) a = [] for i in range(n): a.append(raw_input()) a.sort() ans = '' for i in a: 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>
s424148601
p04044
Accepted
n,L=map(int,input().split()) l=[] for i in range(n): l.append(input()) l.sort() ans='' for i in l: 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>
s133591937
p04044
Accepted
def solve(): n, l = map(int, input().split()) lists = [input() for _ in range(n)] # for _ in range(l): # lists.append(input()) lists = sorted(lists) for s in lists: print(s, end="") solve()
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>
s656530535
p04044
Accepted
n, l = map(int, input().split()) s = [] for i in range(n): S = input() s.append(S) import string ALPHABETS = string.ascii_uppercase def chars_to_int(chars): chars = chars.upper() size = len(chars) result = 0 for pos, c in enumerate(chars): i = ALPHABETS.index(c) + 1 exp = size - pos - 1 result += i * 26 ** exp return result a = [] for i in range(n): b = chars_to_int(s[i]) a.append([b, s[i]]) a.sort(key=lambda x: x[0]) ans = "" for i in range(n): ans += a[i][1] 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>
s935684445
p04044
Accepted
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>
s016536457
p04044
Accepted
N,L=[int(i) for i in input().split()] S=[input() for i in range(N)] S.sort() for m in S: print(m,end="") print()
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>
s358576034
p04044
Accepted
N,L = map(int,input().split()) src = [input() for i in range(N)] src.sort() print(''.join(src))
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>
s367549110
p04044
Accepted
#-*-coding:utf-8-*- def main(): n, l = map(int, input().split()) arry = [input() for _ in range(n)] arry.sort() print(''.join(arry)) 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>
s931026868
p04044
Accepted
n, l = map(int, input().split()) lst = [input() for _ in range(n)] lst.sort() print("".join(lst))
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>
s007761650
p04044
Accepted
num,lengh = map(int,input().split()) lis = [input() for i in range(num)] print("".join(sorted(lis)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s066645672
p04044
Accepted
N, L = map(int, input().split()) S = [input() for i in range(N)] S.sort() print(''.join(S))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s640999075
p04044
Accepted
#42b 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>
s161427702
p04044
Accepted
N,L = map(int,input().split()) strList = [] for i in range(N): strList.append(input()) strList.sort() for str in strList: print(str,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>
s596440556
p04044
Accepted
n,l=map(int,input().split()) m=sorted([input() for _ in range(n)]) print("".join(m))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s587977920
p04044
Accepted
N, L = map(int, input().split()) S = [input() for i in range(N)] for i in range(N): print(sorted(S)[i], end="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s868659688
p04044
Accepted
def main(): t = input().split(" ") N, L = int(t[0]), int(t[1]) s = [] for i in range(N): s.append(input()) s.sort() print("".join(s)) 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>
s966495106
p04044
Accepted
n, l = map(int, input().split()) s = list([input() for i in range(n)]) print("".join(sorted(s)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s772086903
p04044
Accepted
N, L = map(int, input().split());print(''.join(sorted([input() for i in range(N)])))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s124876404
p04044
Accepted
def main(): n, l = map(int,input().split()) s =[] for i in range(n): s.append(input()) print("".join(sorted(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>
s005811077
p04044
Accepted
N, L = map(int, input().split()) S = sorted(input() for _ in range(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>
s375151040
p04044
Accepted
N, L = 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>
s220263801
p04044
Accepted
n,m=map(int,input().split()) k=[] for i in range(n): s=input() k.append(s) k.sort() print(''.join(k))
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>
s638205188
p04044
Accepted
n,l=map(int,input().split()) a=[] for i in range(n): a+=list(input().split()) a.sort() a=''.join(a) 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>
s177047117
p04044
Accepted
n, l = map(int, input().split(" ")) s = [input() for i in range(n)] print("".join(sorted(s)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s392485251
p04044
Accepted
n,l=map(int,input().split()) s=[] for i in range(n): s.append(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>
s425076476
p04044
Accepted
n = list(map(int, input().split())) a = [] for i in range(n[0]): a.append(input()) a.sort() for i in range(n[0]): print(a[i], end="") print()
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>
s847577420
p04044
Accepted
N, L = [int(i) for i in input().split()] sList = sorted([input() for _ in range(N)], key=lambda s: s) s = ''.join(sList) 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>
s748658068
p04044
Accepted
N, L = map(int,input().split()) L = [] for i in range(N): S = input() L.append(S) sorted_L = sorted(L) 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>
s887130706
p04044
Accepted
n , l = map(int, input().split()) s = [] for i in range(n): s.append(input()) s.sort() for i in range(n): print(s[i],end = "") print("")
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>
s764694721
p04044
Accepted
N, L = map(int, input().split()) S = [input() for _ in range(N)] S.sort() ans = "" for i in range(len(S)): 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>
s199542065
p04044
Accepted
N,L=map(int,input().split()) S=[] for i in range(N): S.append(input()) S.sort() for i in range(N): print(S[i],end="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s228142363
p04044
Accepted
n,l=map(int,input().split()) ss=[input() for _ in range(n)] ss=sorted(ss) 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>
s170447531
p04044
Accepted
n, l = list(map(int, input().split())) s = [input().strip() for i in range(n)] # print(s) ans = '' for ss in sorted(s): ans += ss 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>