0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

#9. 【UTR #1】vfk的数据

https://uoj.ac/submission/593085
This commit is contained in:
Baoshuo Ren 2022-11-21 16:09:41 +08:00
parent 15193a9938
commit dda252595e
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

29
UniversalOJ/9/9.cpp Normal file
View File

@ -0,0 +1,29 @@
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using std::cin;
using std::cout;
const char endl = '\n';
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
std::vector<std::string> v(n);
for (auto& s : v) cin >> s;
std::sort(v.begin(), v.end(), [&](const std::string& lhs, const std::string& rhs) -> bool {
return lhs.size() == rhs.size() ? lhs < rhs : lhs.size() < rhs.size();
});
for (auto& s : v) cout << s << endl;
return 0;
}