結果
| 問題 |
No.205 マージして辞書順最小
|
| コンテスト | |
| ユーザー |
E31415926
|
| 提出日時 | 2016-06-26 21:15:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 5,000 ms |
| コード長 | 440 bytes |
| コンパイル時間 | 1,104 ms |
| コンパイル使用メモリ | 81,748 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 23:26:10 |
| 合計ジャッジ時間 | 2,047 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int n;
vector<string> s;
string temp, ans = "";
cin >> n;
while (n--) {
cin >> temp;
temp.push_back('z' + 1);
s.push_back(temp);
}
while (s.size()) {
sort(s.begin(), s.end());
ans.push_back(s[0].front());
s[0].erase(s[0].begin());
if (s[0].size() == 1)s.erase(s.begin());
}
cout << ans << endl;
return 0;
}
E31415926