結果
| 問題 |
No.205 マージして辞書順最小
|
| コンテスト | |
| ユーザー |
hirokazu1020
|
| 提出日時 | 2015-05-08 23:11:10 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 772 bytes |
| コンパイル時間 | 845 ms |
| コンパイル使用メモリ | 90,176 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-05 20:07:12 |
| 合計ジャッジ時間 | 1,555 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 7 WA * 8 |
ソースコード
#include<sstream>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())
#define indexOf(v,x) (find(all(v),x)-v.begin())
int main(){
int n;
cin>>n;
priority_queue<string,vector<string>,greater<string> > pq;
rep(i,n){
string s;
cin>>s;
pq.push(s);
}
string ans;
while(!pq.empty()){
string s=pq.top();pq.pop();
if(s.empty())continue;
ans+=s[0];
s.erase(s.begin());
pq.push(s);
}
cout<<ans<<endl;
return 0;
}
hirokazu1020