文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) (优先队列)

Time limit : 2sec / Memory limit : 256MB

Score : 200 points

Problem Statement

Iroha has a sequence of N strings S1,S2,…,SN. The length of each string is L.

She will concatenate all of the strings in some order, to produce a long string.

Among all strings that she can produce in this way, find the lexicographically smallest one.

Here, a string s=s1s2s3...sn is lexicographically smaller than another string t=t1t2t3...tm if and only if one of the following holds:

There exists an index i(1≦i≦min(n,m)), such that sj=tj for all indices j(1≦j<i), and si<ti.

si=ti for all integers i(1≦i≦min(n,m)), and n<m.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwwjgz.html