結果
| 問題 | No.205 マージして辞書順最小 |
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2015-05-09 01:03:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 469 bytes |
| 記録 | |
| コンパイル時間 | 673 ms |
| コンパイル使用メモリ | 73,396 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 20:56:49 |
| 合計ジャッジ時間 | 1,541 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
ソースコード
#include<iostream>
#include<string>
#include<queue>
#include<functional>
using namespace std;
int main(void){
int N;cin >> N;
priority_queue<string, vector<string>, greater<string>> que;
string s;
for (int i = 0; i < N; i++){
cin >> s;
s += '{';
que.push(s);
}
s = "";
while (que.empty()==false){
auto t = que.top(); que.pop();
auto p = t[0];
if (p == '{')break;
s += p;
que.push(t.substr(1, t.size() - 1));
}
cout << s << endl;
return(0);
}
btk