submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s935428097
p04044
Runtime Error
N = int(input()) L = int(input()) l=[] for _ in range(0,N): l.append(input()) 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>
s770770162
p04044
Runtime Error
# cook your dish here s=input() m=s.split() n=int(s[0]); l=int(s[2]); list=[] for i in range(n): st=input() list.append(st) list.sort() for i in list: print(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>
s465676771
p04044
Runtime Error
N, L = map(int, input().split()) result = [] for i in range(N): result.append(i) print("".join(sorted(result)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s009584036
p04044
Runtime Error
a = list(map(int, input().split())) b = [] for i in sys.stdin: b.append(i) b.sort() c = "" for j in b: c += j print(c)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s111247871
p04044
Runtime Error
s=input() a=[] for i in s: if i == 'B': if x: a.pop() else: a.append(i) 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>
s886841667
p04044
Runtime Error
n,l = map(int,input().split()) s=[] for i in range(n): i=input() s.append(i) s.sort() result=''.join(s) print(reault)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s125840151
p04044
Runtime Error
l, n = map(int, input().split()) st = [] for _ in range(n): st.append(str(input())) st.sort() print("".join(st))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s679256001
p04044
Runtime Error
l, n = map(int, input().split()) st = [] for _ in range(n): st.append(str(input())) st.sort() print("".join(st))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s594174696
p04044
Runtime Error
l, n = map(int, input().split()) st = [] for _ in range(n): st.append(str(input())) st.sort() print(''.join(st))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s456333249
p04044
Runtime Error
l, n = map(int, input().split()) st = [] for _ in range(n): st.append(str(input())) st.sort() ans = '' for s in st: ans += s print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s871567861
p04044
Runtime Error
l, n = map(int, input().split()) st = [] for _ in range(n): st.append(input()) st.sort() ans = '' for s in st: ans += s print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s970146447
p04044
Runtime Error
N, L = map(int, input().split()) list=[] for i in range(N): list.append(str(input())) print("".join(sorted.list()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s551568415
p04044
Runtime Error
n,l = map(int,input().split()) l = sorted([str(input()) for _ in range(l)]) print(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>
s558584054
p04044
Runtime Error
N,K = map(int, input().split()) lst = [] for z in range(K): lst.append(input()) lst.sort() print("".join(lst))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s118009604
p04044
Runtime Error
n, l = map (int, input().split()) s = sorted([input() for i in ratnge(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>
s952218315
p04044
Runtime Error
n, l = map (int, input().split()) s = sorted(input() for i in ratnge(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>
s873770106
p04044
Runtime Error
N = int(input().splice()[0]) L = int(input().splice()[1]) Ss = [] for i in range(N): Ss[i] = input() for i, a in enumerate(Ss): key = a j = i - 1 while j >= 0 and Ss[j] > a: Ss[j + 1] = Ss[j] j = j - 1 Ss[j + 1] = key print(' '.join(Ss))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s024347633
p04044
Runtime Error
l, n = map(int, input().split()) s = [] sort = [] for i in range(n): s.append(input()) s.sort() print(''.join(s))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s955275542
p04044
Runtime Error
a = input().split() l = a[0] n = a[1] s = [] for i in range(int(n)): s.append(input()) s.sort() ret = "" for i in range(int(n)): ret = ret + s[i] print(ret)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s936646284
p04044
Runtime Error
N,L=map(int,input().split()) s=[list(input()) for i in range(N)] p=sorted(s) print("".joint(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>
s311762432
p04044
Runtime Error
n, l = list(map(int, input().split())) t = [] for i in range(l): t.append(input()) t.sort() print(("").join(t))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s752295747
p04044
Runtime Error
print(''.join(sorted(input() for _ in range(int(input())))))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s966633366
p04044
Runtime Error
a , b = map(int,input().split()) c_list = [input() for i in range(a)] c.sort() print("".join(c))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s207175073
p04044
Runtime Error
a , b = map(int,input().split()) list = [] papa = "" for i in range(b): list.append(input()) c = sorted(list) for x in c: papa += x print(papa)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s053240032
p04044
Runtime Error
a , b = map(int,input().split()) list = [] papa = "" for i in range(b): list.append(input()) list.sort() for x in list: papa += x print(papa)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s855064086
p04044
Runtime Error
a , b = map(int,input().split()) list = [] for i in range(b): list.append(input()) list.sort() print(join(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>
s887537091
p04044
Runtime Error
n,l = map(int, input().split()) s = [input() for i in range(N)] print("".join(s.sort()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s646434565
p04044
Runtime Error
L, N = map(int, input().split()) s = [input() for i in range(N)] print("".join(sorted(s)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s344762185
p04044
Runtime Error
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>
s498475365
p04044
Runtime Error
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>
s928735811
p04044
Runtime Error
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>
s256606791
p04044
Runtime Error
L, N = map(int,input().split()) words = [] for i in range(N): words.append(input()) 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>
s420207343
p04044
Runtime Error
num = int(input().split()) str = input() strc = '' for i in range(num[0]-1): strc = input() if str > strc: str = strc + str else: str = str + strc print(str)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s050403625
p04044
Runtime Error
num = int(input().split()) str = '' strc = '' for i in range(num[0]-1): strc = input() if str > strc: str = strc + str else: str = str + strc print(str)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s143646801
p04044
Runtime Error
num = int(input().split()) str = '' strc = '' for i in range(num[0]): strc = input() if str > strc: str = strc + str else: str = str + strc print(str)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s135491377
p04044
Runtime Error
N,L=map(int, input().split()) str_lists = [] for i in ange(N): str_lists.append(input()) print(''.join(sorted(str_lists)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s482377001
p04044
Runtime Error
N,L=map(int, input().split()) str_lists = [] for i in xrange(N): str_lists.append(input()) print(''.join(sorted(str_lists)))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s846716818
p04044
Runtime Error
N, L = map(int, input().split()) S = [input() for i in range(N)] print((''.join(S.sorted())))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s331282411
p04044
Runtime Error
N,L = input().split() L=int(L) S=[] for i in range (L): S.append(input()) S.sort() for j in S : 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>
s177033155
p04044
Runtime Error
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>
s873119169
p04044
Runtime Error
n, l = map(int, input().split()) S = [] for i in range(n): S[i] = input() ans = ''.jion(sorted(S)) print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s044363994
p04044
Runtime Error
n, l = map(int, input().split()) S = [] for i in n: S[i] = input() ans = ''.jion(sorted(S)) print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s875488742
p04044
Runtime Error
n,k=map(int,input().split()) ln=map(str(input()) for _ in range(n)) ln.sort() print("".join(ln))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s016616472
p04044
Runtime Error
n,l = map(int,input().split()) s = sorted([input() for i in range(n)]) print(*s,seq="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s690306068
p04044
Runtime Error
n,k=map(int,input().split()) ln=map(str(input())for _ in range(n)) ln.sort() print("".join(ln))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s910923958
p04044
Runtime Error
n,k=map(int,input().split()) ln=map(int(input())for _ in range(n)) ln.sort() print("".join(ln))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s585788449
p04044
Runtime Error
n,k=map(int,input().split()) ln=map(int(input())for _ in range(n)) ln.sort() for l in ln: ans="".join(l) 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>
s821024177
p04044
Runtime Error
N, _ = [int(i) for i in input().split()] S = [input() for _ in range(N)] ans = "".join(sorted(s)) print(ans)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s211311864
p04044
Runtime Error
n, l = map(int, input().split()) a = sorted([input() for i 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>
s887362562
p04044
Runtime Error
a, b = map(int, input().split()) lists = [] for i in range(a): lists.add(input()) print(lists.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>
s118150913
p04044
Runtime Error
ip1 = input().split() N = int(ip1[0]) L = int(ip1[1]) strings = [] for i in range(N): strings.append(input()) strings.sort() ans = "" for i in range(len(strings)): ans += string[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>
s752812548
p04044
Runtime Error
N, L = gets.split.map(&:to_i) arr = [] N.times do arr.push(gets.chomp) end arr.sort! print arr.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>
s881422409
p04044
Runtime Error
N, x = list(map(int, input().split())) li = sorted(list(map(int, input().split()))) res = 0 for i in li: x -= i if x < 0: break else: res += 1 if x > 0: res -= 1 print(res)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s369667233
p04044
Runtime Error
N, x = list(map(int, input().split())) li = sorted(list(map(int, input().split()))) print(li) res = 0 for i in li: x -= i if x < 0: break else: res += 1 if x > 0: res -= 1 print(res)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s441215734
p04044
Runtime Error
N, L = map(int, input().split()) lix = sorted(input() for i in range(L)) res = "".join(lix) print(res)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s264663583
p04044
Runtime Error
N, L = map(int, input().split()) lix = sorted(input() for i in range(L)) print("".join(lix))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s830498248
p04044
Runtime Error
n,l=map(int,input()) 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>
s666487581
p04044
Runtime Error
n,l=map(int,input()) s=[] for i in range(n): s.append(i) 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>
s558328512
p04044
Runtime Error
n, l = map(int(input().split())) l = [for i in range(n)] s = sorted(l) 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>
s271345731
p04044
Runtime Error
n, l = map(int(input())) l = [for i in range(n)] s = sorted(l) 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>
s574086758
p04044
Runtime Error
a=input().split() b=int(a[0]) data = [input() for i in range(+1)] sort(data) for j in data: c=c+j print(c)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s297040134
p04044
Runtime Error
a=input().split() b=int(a[0]) data = [input() for i in range(b)] sort(data) for j in data: c=c+j print(c)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s013661235
p04044
Runtime Error
[print("".join(sorted(input() for _ in range(l)))) for n, l in [map(int, input().split())]]
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s559552108
p04044
Runtime Error
a = input().rstrip().split() N=int(a[0]) L=int(a[1]) l=[] for i in range(N): b=input() l.append() l.sort() ans="" for i in range(N): ans+=l[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>
s839668386
p04044
Runtime Error
n, l = (int(x) for x in input().split()) s = list(str(x) for x in input().split()) s.sort() ans = 0 while range(n + 1): ans += s[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>
s802220687
p04044
Runtime Error
n, l = (int(x) for x in input().split()) while range(n + 1): s = list(x for x in input.split()) s.sort() ans = 0 while range(n + 1): ans += s[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>
s897098632
p04044
Runtime Error
n, l= (int(x) for x in input().split()) s = list(x for x in input.split()) s.sort() ans = 0 while range(n + 1): ans += s[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>
s361986804
p04044
Runtime Error
N , L = map(int,input().sqlit()) S.list() for i in range(N): S.append(input()) S.sort() for i in range(S): print(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>
s739677770
p04044
Runtime Error
a, b = map(int, input().split()) c =[] for i in range(b-1): c.append(str(input())) c = sorted(c) mojiretu = '' for x in c: mojiretu += x print(mojiretu)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s998811262
p04044
Runtime Error
a, b = map(int, input().split()) c =[] for i in range(b): c.append(str(input())) c = sorted(c) mojiretu = '' for x in c: mojiretu += x print(mojiretu)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s264631493
p04044
Runtime Error
N, L = map(int, input().split()) A = sorted([input for _ in range(N)]) 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>
s109914626
p04044
Runtime Error
x = list(map(int,input().split())) for i in 0 to X[0] A.append(input()) result = ''.join(A) print(result)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s791951912
p04044
Runtime Error
a = input().split(" ") s = [input() for i in range(a)] 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>
s712227679
p04044
Runtime Error
N,L=map(int,input().split()) S=[input() for i in range(N)] print(''.join(S.sort()))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s153326839
p04044
Runtime Error
N,L=map(int,input().split()) S=[input() for i in range(N)] print(''.join(S.sort))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s256219763
p04044
Runtime Error
n,l=map(int,input().split(" ")) words=[input() for i in range(0,l)] words.sort() words="".join(words) print(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>
s826759521
p04044
Runtime Error
arr_len_int = int(input().split(' ')[1]) if (arr_len_int==1): print(input()) else: a = [input() for i in range(arr_len_int)] a.sort() print(''.join(a))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s466621461
p04044
Runtime Error
arr_len_int = int(input().split(' ')[1]) a = [input() for i in range(arr_len_int)] a.sort() print(''.join(a ))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s030799048
p04044
Runtime Error
arr_len_int = int(input().split(' ')[1]) a = [input() for i in range(arr_len_int)] a.sort() b = set(a) print(''.join(b ))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s203940000
p04044
Runtime Error
L,N = map(int, input().split()) s = sorted([input() for i 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>
s949515040
p04044
Runtime Error
L,N = (int, input().split()) s = sorted([input() for i 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>
s193459856
p04044
Runtime Error
L,N = (int, input().split()) s = sorted([input() for i in range(N)]) print(s,end="")
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s711510567
p04044
Runtime Error
n, l = map(int, input().split()) s = sorted([input() for i in 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>
s091335046
p04044
Runtime Error
n,l=map(int,input().split()) s=[] for i range(n): s.append(input()) s.sort() ans='' for x in s: ans+=x 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>
s891938576
p04044
Runtime Error
n,l=map(int,input().split()) for i range(n): s=input() s=s.sort() print(*s,sep='')
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s716165116
p04044
Runtime Error
N, L = map(int, input().split()) s=[] for i in range(N): s.append(i) s.sort() ans = '' for x in s: ans += x 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>
s357342507
p04044
Runtime Error
n, l = map(int, input().split()) s = [] for i in range(l) : s.append(input()) s.sort() print(*s, sep='')
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s499110495
p04044
Runtime Error
n,m=map(int,input().split()) mat=[] for i in range(n): mat.append(list(input())) mat.sort(key=lambda x:x) ans='' for i in mat: 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>
s310509484
p04044
Runtime Error
n = int(input()) l = int(input()) ln = [] for i in range n: ln.append(input()) ln.sort() s = "" for word in ln: s += word 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>
s272670764
p04044
Runtime Error
# -*- coding: utf-8 -*- length, count = list(map(int, input().split())) words = [] for i in range(count): s = input() if len(s) != length: continue words.append(s) words = sorted(words) r = ''.join(words) print(r)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s227269250
p04044
Runtime Error
# -*- coding: utf-8 -*- length, count = list(map(int, input().split())) words = [] for i in range(count): words.append(input()) words = sorted(words) r = ''.join(words) print(r)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s357945869
p04044
Runtime Error
print("".join(sorted([input() for i in range(int("{}".format(input().split().pop(-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>
s655428559
p04044
Runtime Error
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) def main(): N, L, A = map(int, open(0).read().split()) A.sort() print("".join(A)) if __name__ == "__main__": main()
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s026116412
p04044
Runtime Error
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) def main(): N, L, A = map(int, open(0).read().split()) A.sort() print("".join(map(str, A))) if __name__ == "__main__": main()
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s490834471
p04044
Runtime Error
input_line = input().split() list_str = [] ans_str = '' for i in range(int(input_line[1])): list_str.append(input()) list_str.sort() for i in list_str: ans_str += i print(ans_str)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s296443712
p04044
Runtime Error
#! /usr/bin/env python # -*- coding: utf-8 -*- import pdb import sys F = sys.stdin N, L = int(F.readline().rstrip().split()) a = [F.readline() for x in range(N)] a.sort() answer = ''.join(a) print(answer)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s112375439
p04044
Runtime Error
# At Beginner Contest 042 B (200) n, l = map(int, input().split()) S = [] for _ in range(n): S.append(input()) out = [] min_ = float("inf") min_idxs = list(range(len(S))) pos = 0 while S: new_min = [] for i in min_idxs: s = S[i] ch = ord(s[pos]) if ch < min_: min_ = ord(s[pos]) new_min = [ i ] elif ch == min_: new_min.append(i) if len(new_min) == 1: out.append(S[new_min[0]]) del S[new_min[0]] min_idxs = list(range(len(S))) pos = 0 else: pos += 1 min_idxs = new_min min_ = float("inf") r = "".join(out) print(r)
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>
s363950527
p04044
Runtime Error
N, L = input().split() string_list = [input() for i in range(int(N))] string_list.soted() ans = '' for i in string_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>
s161725160
p04044
Runtime Error
N, L = input().split() string_list = [input() for i in range(int(L))] string_list.soted() ans='' for i in string_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>
s623760398
p04044
Runtime Error
N,L = map(int, input().strip().splip(' ')) print(''.join(sorted([input().strip() for _ in range(N)])))
3 3 dxx axx cxx
axxcxxdxx
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>S_1, S_2, ..., S_N</var>. The length of each string is <var>L</var>.</p> <p>She will concatenate all of the strings in some order, to produce a long string.</p> <p>Among all strings that she can produce in this way, find the lexicographically smallest one.</p> <p>Here, a string <var>s=s_1s_2s_3</var>...<var>s_n</var> is <em>lexicographically smaller</em> than another string <var>t=t_1t_2t_3</var>...<var>t_m</var> if and only if one of the following holds: <ul> <li>There exists an index <var>i(1≦i≦min(n,m))</var>, such that <var>s_j = t_j</var> for all indices <var>j(1≦j&lt;i)</var>, and <var>s_i&lt;t_i</var>.</li> <li><var>s_i = t_i</var> for all integers <var>i(1≦i≦min(n,m))</var>, and <var>n&lt;m</var>.</li> </ul></p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>1 ≦ N, L ≦ 100</var></li> <li>For each <var>i</var>, the length of <var>S_i</var> equals <var>L</var>.</li> <li>For each <var>i</var>, <var>S_i</var> consists of lowercase letters.</li> </ul> </section> </div> <hr/> <div class="io-style"> <div class="part"> <section> <h3>Input</h3><p>The input is given from Standard Input in the following format:</p> <pre><var>N</var> <var>L</var> <var>S_1</var> <var>S_2</var> : <var>S_N</var> </pre> </section> </div> <div class="part"> <section> <h3>Output</h3><p>Print the lexicographically smallest string that Iroha can produce.</p> </section> </div> </div> <hr/> <div class="part"> <section> <h3>Sample Input 1</h3><pre>3 3 dxx axx cxx </pre> </section> </div> <div class="part"> <section> <h3>Sample Output 1</h3><pre>axxcxxdxx </pre> <p>The following order should be used: <code>axx</code>, <code>cxx</code>, <code>dxx</code>.</p></section> </div> </span>