P1012 [NOIP1998 提高组] 拼数
作者:互联网
// Problem: P1012 [NOIP1998 提高组] 拼数
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1012
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// User: Pannnn
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<string> info(n);
for (int i = 0; i < n; ++i) {
cin >> info[i];
}
sort(info.begin(), info.end(), [](const string &s1, const string &s2) -> bool {
return s1 + s2 > s2 + s1;
});
for (int i = 0; i < n; ++i) {
cout << info[i];
}
cout << endl;
return 0;
}
标签:info,拼数,int,s2,s1,cin,P1012,NOIP1998 来源: https://www.cnblogs.com/pannnn/p/15855187.html