結果

問題 No.205 マージして辞書順最小
ユーザー IJMP320
提出日時 2015-05-08 23:44:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 2,691 ms
コンパイル使用メモリ 166,660 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 20:44:59
合計ジャッジ時間 2,233 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 7 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define F first
#define S second
const int INF = 2000000000;
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
struct P{int x;int y;P(int X=0,int Y=0){x=X;y=Y;}};

int main() {
    int N;
    cin >> N;
    vector<string> s(N);
    REP(i,N) {
        cin >> s[i];
    }
    string T = "";
    while(true) {
        if(s[0][0]=='|') break;
        T += s[0][0];
        s[0].erase(s[0].begin());
        s[0]+='|';
        sort(ALL(s));
    }
    cout <<  T << endl;
    return 0;
}
0