牛客竞赛 1024 贪心

#include<bits/stdc++.h>
using namespace std;
vector<string> v;
bool cmp(string a,string b) {
    return a + b > b + a;
}
int main() {
    int n;
    cin>>n;
    for (int i = 1; i<= n; i++) {
        string tmp;
        cin>>tmp;
        v.push_back(tmp);
    }
    sort(v.begin(),v.end(),cmp);
    for (int i = 0; i< v.size(); i++) {
        cout<<v[i];
    }
    return 0;
}
posted @ 2025-06-19 22:54  Guaninf  阅读(3)  评论(0)    收藏  举报