submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s466229716
p04044
Runtime Error
list=sorted[input()] print(*list,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>
s894136102
p04044
Runtime Error
a,b=map(int,input().split()) n=list([str(input()) for i in range(b)]) p=sorted(n) q=''.join(p) print(q)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s153514539
p04044
Runtime Error
s = list(map(int, input().split())) t = [input() for i in range(s[0])] for i in range(0, s[0] - 1): if t[i] > t[i + 1]: u = t[i] t[i] = t[i + 1] t[i + 1] = u v = 0 for i in range(0, s[0]): v = v + t[i] v
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>
s445855524
p04044
Runtime Error
s = list(map(int, input().split())) t = [input() for i in range(s[0])] for i in range(0, s[0] - 1): if t[i] > t[i + 1]: u = t[i] t[i] = t[i + 1] t[i + 1] = u v = 0 for i in range(0, s[0]): v = v + t[i] t[i]
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s204262540
p04044
Runtime Error
s = list(map(int, input().split())) t = [input() for i in range(s[0])] for i in range(0, s[0] - 1): if t[i] > t[i + 1]: u = t[i] t[i] = t[i + 1] t[i + 1] = u print(t[0] + t[1] + t[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s592224582
p04044
Runtime Error
a,b = map(int,input().split()) L=[] for i in range(b): L.append(input()) K=sorted(L) 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>
s432197469
p04044
Runtime Error
a,b = map(int,input().split()) L=[list(map(input().split())) for i in range(b)] print(L.sort())
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s007134144
p04044
Runtime Error
n,m = map(int,input().split()) List = [input() for i in range(n)] 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>
s847703548
p04044
Runtime Error
n,m = map(int,input().split()) List = [input() for i in range(n)] 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>
s438930596
p04044
Runtime Error
n, l = map(int, input().split()) s = [input() for _ in range(n)] s.sort() print(s[0] + s[1] + s[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s335345182
p04044
Runtime Error
number,length=input().split() input_list=[] out='' for i in range(number): input_list.append(input()) input_list.sort() for i in input_list: out+=i print(out)
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>
s177723981
p04044
Runtime Error
l, n = map(int, input().split()) s = [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>
s631781987
p04044
Runtime Error
l, n = 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>
s101048384
p04044
Runtime Error
def sort(str_list): for i in range(len(str_list) - 1): string = str_list[i] for j in range(i + 1, len(str_list)): next_string = str_list[j] for k in range(len(string)): if ord(string[k]) > ord(next_string[k]): temp = string str_list[i] = next_string str_list[j] = temp break elif ord(string[k]) == ord(next_string[k]): continue else: break ans = "" for i in str_list: ans += i return ans line1 = input().split() n = line1[0] l = line1[1] str_list = [] for i in range(n): str_list.append(input()) print(sort(str_list)) def sort(str_list): for i in range(len(str_list) - 1): string = str_list[i] for j in range(i + 1, len(str_list)): next_string = str_list[j] for k in range(len(string)): if ord(string[k]) > ord(next_string[k]): temp = string str_list[i] = next_string str_list[j] = temp break elif ord(string[k]) == ord(next_string[k]): continue else: break ans = "" for i in str_list: ans += i return ans line1 = input().split() n = int(line1[0]) l = line1[1] str_list = [] for i in range(n): str_list.append(input()) print(sort(str_list))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s048732527
p04044
Runtime Error
def sort(str_list): for i in range(len(str_list) - 1): string = str_list[i] for j in range(i + 1, len(str_list)): next_string = str_list[j] for k in range(len(string)): if ord(string[k]) > ord(next_string[k]): temp = string str_list[i] = next_string str_list[j] = temp break elif ord(string[k]) == ord(next_string[k]): continue else: break ans = "" for i in str_list: ans += i return ans line1 = input().split() n = line1[0] l = line1[1] str_list = [] for i in range(n): str_list.append(input()) print(sort(str_list))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s730001159
p04044
Runtime Error
N, L = map(int, input().split()) l = [input() for _ in range(L)] l = sorted(l) s = "" for i in range(L): s += l[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>
s818110712
p04044
Runtime Error
N, L = map(int, input().split()) l = [input() for _ in range(L)] l.sort() s = "" for i in range(L): s += l[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>
s062784382
p04044
Runtime Error
def resolve(): n, m = map(int, input().split()) w = list() ans = "" for _ in range(m): w.append(input()) w.sort() for word in w: ans += word print(ans) resolve()
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>
s414028857
p04044
Runtime Error
def resolve(): n, m = map(int, input().split()) w = list() ans = "" for _ in range(m): w.append("".join(sorted(input()))) w.sort() for word in w: ans += word print(ans) resolve()
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>
s778578712
p04044
Runtime Error
n,l = map(int,input().split()) str1 = input() str2 = input() str3 = input() blank = [] blank.append(str1) blank.append(str2) blank.append(str3) blank.sort() new = blank[0]+blank[1]+blank[2] print(new)
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>
s051486675
p04044
Runtime Error
def resolve(): n, m = map(int, input().split()) w = list() for _ in range(m): w.append(input()) w.sort() print("".join(w)) resolve()
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>
s381744579
p04044
Runtime Error
def resolve(): n, m = map(int, input().split()) w = list() for _ in range(m): w.append(input()) w.sort() print("".join(w)) resolve()
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>
s571866826
p04044
Runtime Error
N, L = [int(i) for i in input().split(' ')] words = [input() for i in range(len(N))] words.sort(key = lambda x: x[0]) for word in words: print(word)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s440208183
p04044
Runtime Error
N, L = [int(i) for i in input().split(' ')] words = [input() for i in range(len(N))] words.sort(lambda x: x[0]) for word in words: print(word)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s292672339
p04044
Runtime Error
N, L = [int(i) for i in input().split(' ')] words = [input() for i in range(len(N))] words.sort(lambda word: word[0]) for word in words: print(word)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s189509867
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(L)] s = sorted(S) print(*s, sep='')
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s927885543
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(L)] s = sorted(S) print(*s, sep='')
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s100598092
p04044
Runtime Error
L = int(input()) print(*sorted(input() for i in range(L)), 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>
s791814278
p04044
Runtime Error
N, L = map(int, input().split()) print(*sorted(input() for i in range(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>
s969119975
p04044
Runtime Error
N, L = map(int, input().split()) print(*sorted(input() for i in range(L)), 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>
s756478444
p04044
Runtime Error
N, L = map(int, input().split()) S = [input().split() for i in range(L)] s = sorted(S) 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>
s805093843
p04044
Runtime Error
n,l=map(int,input().split()) list=[] for _ in range(n): list.append(str(input()) list.sort() ans="" for i in list: 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>
s386717686
p04044
Runtime Error
l,n=map(int,input().split()) list=[] for _ in range(n): list.append(input()) list.sort() ans="" for i in len(list): 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>
s887007339
p04044
Runtime Error
l,n=map(int,input().split()) list=[] for _ in range(n): list.append(input()) list.sort() ans="" for i in list: 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>
s591545924
p04044
Runtime Error
l,n=map(int,input().split()) list=[] for _ in range(n): list.append(str(input())) list.sort() ans="" for i in list: 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>
s306298670
p04044
Runtime Error
l,n=map(int,input().split()) D=[] for _ in range(n): D.append(str(input())) D.sort() m="" for i in S: m+=i 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>
s168410496
p04044
Runtime Error
l,n=map(int,input().split()) D=[] for _ in range(n): D.append(str(input())) S.sort(D,reverse=False) m=" " for i in S: m+=i 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>
s641331972
p04044
Runtime Error
l,n=map(int,input().split()) D=[] for _ in range(n): D.append(str(input())) S=sorted(D,reverse=False) m=" " for i in S: m+=i 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>
s807266290
p04044
Runtime Error
i = list(map(int, input().split())) s = [input() for i in range(i[1])] s.sort() newlist = sorted(s) print(''.join(newlist))
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>
s392386448
p04044
Runtime Error
N, L = map(int, input().split()) S = [input().rstrip() for i in range(L)] print(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>
s514309523
p04044
Runtime Error
N, L = map(int, input().split()) S = [input().split() for i in range(L)] P = [] s = sorted(S) for q in s: P.append(q) print(P)
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>
s282434848
p04044
Runtime Error
N, L = map(int, input().split()) P = [input().split() for i in range(L)] p = sorted(P) ppp = "".join(map(str, p)) print(ppp)
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>
s188160906
p04044
Runtime Error
N, L = map(int, input().split()) P = [input().split() for i in range(L)] p = sorted(P) print(p[0] + p[1] + p[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s148622053
p04044
Runtime Error
N, M = map(int, input().split()) word = [] for i in range(M): word.append(input()) word.sort() print(''.join(word))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s804472722
p04044
Runtime Error
n,l=map(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>
s273496161
p04044
Runtime Error
n, l = map(int, input().split(' ')) hoges = [] for _ in range(n): hoges.append(input()) a = hoges.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>
s622171149
p04044
Runtime Error
N,L = map(int,input().split()) M = [] for i in range(N): M.append(input()) M = sorted(input().split()) 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>
s878495215
p04044
Runtime Error
lis=input().split() string_list=[input() for i in range(int(lis[0]))] stringlist.sort() print(''.join(stringlist))
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>
s424789619
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(L)] SS = sorted(S) ans = "" for i in range(L): ans += SS[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>
s194717156
p04044
Runtime Error
N,L=map(int,input().split()) l=[input() for i in range(N)] a=sorted(l) b=a[0]+a[1]+a[2] print(b)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s065377368
p04044
Runtime Error
N,L=map(int,input().split()) l=[input() for i in range(N)] a=sorted(l) print(a[0]+a[1]+a[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s662988861
p04044
Runtime Error
n,l=map(int,input().split()) s=[input() for i in range(n)] s.sort() print(*a,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>
s449365534
p04044
Runtime Error
l, n = map(int, input().split()) s = sorted([str(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>
s972193852
p04044
Runtime Error
N = input().split() list = [] for i in range(1,int(N[0]),1): list.append(input()) list.sort(reverse = False) ans = "" for i in range(1,N+1,1): ans = ans + list[0] list.pop(0) 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>
s955844997
p04044
Runtime Error
N = int(input()) L_num = int(input()) list = [] for i in range(1,N+1,1): list.append(input()) list.sort(reverse = False) ans = "" for i in range(1,N+1,1): ans = ans + list[0] list.pop(0) 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>
s347858584
p04044
Runtime Error
n, l = map(int, input().split()) strs = [input().split() for i in range(n)] concat = strs[0] del strs[0] for str in strs: for i in range(len(concat) / l): if concat[i*l] < str: concat = concat[:i*l] + str + concat[i*l:] break if i == len(concat) / l -1: concat = concat + str print(concat)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s911444275
p04044
Runtime Error
N,L=map(int,input().split()) S=[] for i in range(N): s=input() S.append(s) print(sorted(S)[0]+sorted(S)[1]+sorted(S)[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s490789517
p04044
Runtime Error
a = input() b = [] for i in range(int(a[0])): b.append(input().sort()) b.sort() for j in b: print(j, 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>
s010948169
p04044
Runtime Error
#ABC042.B N,L = map(int,input().split()) s = [input()for_in range(N)] 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>
s119982213
p04044
Runtime Error
#ABC042.B N,L = map(int,input().split()) s = [input() for_in range(n)] s.sort() ans='' for i in range(N): ans =ans+ s[i] print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s619519824
p04044
Runtime Error
#ABC042.B N,L = map(int,input().split()) s = [input()for_in range(n)] 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>
s060008518
p04044
Runtime Error
#ABC042.B N,L = map(int,input().split()) s = [input()for_in range(n)] s.sort() ans='' for i in range(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>
s446846804
p04044
Runtime Error
n = input().rstirp().split() n = [int(x) for x in n] arg=[] for i in range(n[0]): data = input().rstrip() arg.append(data) sorted(arg) for j in range(n[0]): print(arg[j],end="") print("\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>
s821140410
p04044
Runtime Error
n = input().rstirp().split() n = [int(x) for x in n] arg=[] for i in range(n[0]): data = input().rstrip() arg.append(data) sorted(data) for j in range(n[0]): print(arg[j],end="") print("\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>
s558898045
p04044
Runtime Error
n,l = map(int,input().split()) s = sort([input() for i in range(n)]) print(*s,sep="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s380530922
p04044
Runtime Error
num = list(map(input().split())) word = [input() for i in range(num[0])] print(''.join(sorted(word)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s731221118
p04044
Runtime Error
num = list(map(int,input().split())) word = [input for i in range(n[0])] print(''.join(sorted(num)))
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>
s228660804
p04044
Runtime Error
a,b=map(int,(input().split())) li=[] for i in range(a): li.append(input()) li.sort a=li[0] for j in range(1,a): a+=li[j] 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>
s431378570
p04044
Runtime Error
n=int(input()) text=[input() for i in range(n)] print("".join(sorted(text)))
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>
s559717211
p04044
Runtime Error
n = list(map(int,input().split())) word = [input() for i in range(n[1])] print(''.join(sorted(word)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s790025618
p04044
Runtime Error
n = list(map(int,input().split())) word = [input() for i in range(n[1])] print(word) print(''.join(sorted(word)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s728371021
p04044
Runtime Error
N,L = map(int, input().split()) S = list((input() for i in range(N)) 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>
s188496195
p04044
Runtime Error
N = int(input()) L = int(input()) ans = {} for i in range(N): A = input() ans[A]=1 ans = sorted(ans) print("".join(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>
s461705212
p04044
Runtime Error
n,l = map(int, input().split()) Li = [] for i in range(n): li = list(input()).sort() wrd = "".join(li) Li.append(wrd) else: print("".join(Li.sort()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s439416882
p04044
Runtime Error
L, N = list(map(int, input().split())) S = [str(input()) for _ in range(N)] #print(S) S = sorted(S) #print("sorted", S) total = "".join(S) print(total)
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>
s523397768
p04044
Runtime Error
L, N = list(map(int, input().split())) S = [str(input()) for _ in range(N)] #print(S) S = sorted(S) #print("sorted", S) total = '' for i in range(len(S)): total += str(S[i]) print(total)
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>
s365355160
p04044
Runtime Error
L, N = list(map(int, input().split())) S = [input() for _ in range(N)] #print(S) S = sorted(S) #print("sorted", S) total = '' for i in range(len(S)): total += S[i] print(total)
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>
s052309127
p04044
Runtime Error
n = input().split() N = int(n[0]) L = int(n[1]) a = [] for i in range(L): b = input() a.append(b) A = sorted(a) 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>
s667194493
p04044
Runtime Error
n, l = map(int, input().split()) S = [int(input()) for i in range(n)] sorted_list = sorted(S) print(*sorted_list, 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>
s408245256
p04044
Runtime Error
N, L = map(int, input().split()) words = [] for i in range(N): words.append(input()) words.sort() for i in range(N-1): print(words[i], end="") print(words[i+1])
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>
s220622906
p04044
Runtime Error
n, l = map(int, input().split()) words = [] for i in range(n): words.append(input()) print(''.join(words.sort()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s028031639
p04044
Runtime Error
n, l = map(int, input().split()) a = sorted([input() for i in range(n)]) print(*s, sep="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s832104278
p04044
Runtime Error
n, l = map(int, input().split()) a = sort([input() for i in range(n)]) print(*s, sep="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s452334986
p04044
Runtime Error
X, L = [int(input()) for i in range(2)] li = sorted([input() for i in range(X)]) ans = '' for i in li: 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>
s788400064
p04044
Runtime Error
def getlist(): return list(map(int, input().split())) a,b = getList() lis = [] for i in range(a): lis.append(input().strip()) lis.sort() print("".join(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>
s633863231
p04044
Runtime Error
n,l = map(int,input().split()) s = [input() for i in range(n)] print(*stored(s),sep="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s190252417
p04044
Runtime Error
n,l = map(int,input().split()) s = input() for i in range(n) print(*stored(s),sep="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s931194274
p04044
Runtime Error
n = input() l = input() s = input() for i in range(n) print(*stored(s),sep="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s425284455
p04044
Runtime Error
n,l = map(int,input().split()) words = [input() for i in range(n)] words = words.sort() print("".join(words))
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>
s351233921
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for _ in range(L)] ans = sorted(S) print(''.join(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>
s554412037
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for _ in range(L)] print(''.join(sorted(S)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s076854112
p04044
Runtime Error
N, L = map(int, input().split()) S = [] for _ in range(H): S.append(input()) S1 = sorted(S) S2 ="".join(S1) print(S2)
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>
s325969090
p04044
Runtime Error
def hikaku(n1, n2): for x, y in zip(n1, n2): if ord(x) == ord(y): continue else: if ord(x) < ord(y): return False return True num, length = map(int, input().split()) wlist = [] for i in range(num): wlist.append(input()) kumi = [(x, y) for x in range(num) for y in range(x, num) if x != y] for x, y in kumi: if hikaku(wlist[x], wlist[y]): wlist[x], wlist[y] = wlist[y], wlist[x] print(wlist[0] + wlist[1] + wlist[2])
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s381146322
p04044
Runtime Error
num, size = map(int,input().split()) data =[] for x in range(num): data.apend(input()) print(data.sort().join())
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long 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>
s870241462
p04044
Runtime Error
n, l = map(int, input().split()) strs=[] for i in range(n): strs.push(input()) "".join(sorted(strs))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s373388244
p04044
Runtime Error
N,L=map(int,input().split()) S=[input() for n in range(N)] for num in range(L): ans1=S[num] for num2 in range(L): ans2=S[num2] for i in range(L): if ans1[i]>ans2[i]: break elif ans1[i]==ans2[i]: continue else : S[num],S[num2]=S[num2],S[num] break 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>
s383922115
p04044
Runtime Error
N,L=map(int,input().split()) S=[input() for n in range(N)] for num in range(L): ans1=S[num] for num2 in range(L): ans2=S[num2] for i in range(L): if ans1[i]>ans2[i]: break elif ans1[i]==ans2[i]: continue else : S[num],S[num2]=S[num2],S[num] 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>
s225387233
p04044
Runtime Error
N,L=map(int,input().split()) S=[input() for n in range(N)] for num in range(L): ans1=S[num] for num2 in range(L): ans2=S[num2] for i in range(L): if ans1[i]>ans2[i]: True else : S[num],S[num2]=S[num2],S[num] 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>
s111139172
p04044
Runtime Error
n=int(input()) l=int(input()) arr = ["" for x in range(n)] for i in range(n): arr[i]=input() arr.sort() for i in range(n): print(arr[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>
s159885410
p04044
Runtime Error
N = int(input()) L = int(input()) l=[] for _ in range(0,N): s=input() l.append(s) s="" l.sort() for i in l: s = s+i print(s)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>