记录编号 |
424217 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2010冲刺十]数字积木 |
最终得分 |
100 |
用户昵称 |
HeHe |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.053 s |
提交时间 |
2017-07-12 23:57:43 |
内存使用 |
0.32 MiB |
显示代码纯文本
- #include <iostream>
- #include <cstdio>
- #include <cstring>
- #include <string>
- #include <algorithm>
- using namespace std;
-
- inline bool cmp(const string &a, const string &b);
-
- string s[1010];
- int N;
-
- int main() {
- #ifndef LOCAL
- freopen("brick.in", "r", stdin);
- freopen("brick.out", "w", stdout);
- #endif
- scanf("%d", &N);
- for(int i = 0; i < N; ++i) cin>>s[i];
-
- sort(s, s + N, cmp);
-
- for(int i = 0; i < N; ++i) cout<<s[i];
-
- return 0;
- }
-
- inline bool cmp(const string &a, const string &b) {
- return a + b > b + a;
- }