結果
問題 |
No.205 マージして辞書順最小
|
ユーザー |
|
提出日時 | 2020-02-27 20:32:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 321 bytes |
コンパイル時間 | 899 ms |
コンパイル使用メモリ | 80,456 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 16:00:43 |
合計ジャッジ時間 | 1,808 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> #include<queue> using namespace std; int N; main() { cin>>N; priority_queue<string,vector<string>,greater<string> >P; for(;N--;) { string s;cin>>s;P.push(s+'~'); } while(!P.empty()) { string s=P.top();P.pop(); if(s[0]!='~') { cout<<s[0]; P.push(s.substr(1)); } } cout<<endl; }