結果

問題 No.205 マージして辞書順最小
ユーザー latte0119
提出日時 2015-05-16 19:31:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 1,534 ms
コンパイル使用メモリ 167,724 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 04:56:48
合計ジャッジ時間 2,003 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 7 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;


int main(){
    int N;
    priority_queue<string,vector<string>,greater<string> >Q;
    cin>>N;
    for(int i=0;i<N;i++){
        string str;cin>>str;
        Q.push(str);
    }

    string T;

    while(!Q.empty()){
        string s=Q.top();Q.pop();
        T+=s[0];
        if(s.size()==1)continue;
        else Q.push(s.substr(1,s.size()-1));
    }

    cout<<T<<endl;
    return 0;
}
0