比赛 |
2016-10-11 4 syz |
评测结果 |
AAAAAAAAAA |
题目名称 |
数字积木 |
最终得分 |
100 |
用户昵称 |
森林 |
运行时间 |
0.039 s |
代码语言 |
C++ |
内存使用 |
0.32 MiB |
提交时间 |
2016-10-11 18:55:33 |
显示代码纯文本
- #include<iostream>
- #include<cstdio>
- #include<cstring>
- #include<algorithm>
- #include<string>
- #include<iomanip>
- using namespace std;
- template<typename T>inline void QR(T& x){
- char ch;bool f=0;
- while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
- if(ch=='-'){f=1;ch=getchar();}x=ch-48;
- while(ch=getchar(),ch>='0'&&ch<='9')x=x*10+ch-48;
- if(f)x=-x;
- }
- template<typename T>inline void QW(T x){
- char str[30];short cnt=0;
- if(x<0){putchar('-');x=-x;}
- while(str[+cnt]=x%10+48,x/=10);
- while(putchar(str[cnt]),--cnt);
- }
- const int maxn=1100;
- inline bool com(const string& a,const string& b){
- return a+b>b+a;
- }
- string str[maxn];
- int main(){
- #define submit
- #ifdef submit
- freopen("brick.in","r",stdin);
- freopen("brick.out","w",stdout);
- #endif
- int n;
- scanf("%d",&n);
- for(int i=1;i<=n;i++)cin>>str[i];
- sort(str+1,str+1+n,com);
- for(int i=1;i<=n;++i){
- cout<<str[i];
- }putchar(10);
- #ifdef submit
- fclose(stdin);
- fclose(stdout);
- #else
- system("pause");
- #endif
- return 0;
- }