当前位置:网站首页>[noip1998] spelling
[noip1998] spelling
2022-06-11 12:41:00 【whitewall_ nine】
// Problem: Niu Meihe 01 strand
// Contest: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/20960/1043
// Memory Limit: 524288 MB
// Time Limit: 2000 ms
// 2022-03-01 19:24:46
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,l,r) for(int i=(l);i>=(r);i--)
#define ll long long
#define pii pair<int, int>
#define mset(s,t) memset(s,t,sizeof(t))
#define mcpy(s,t) memcpy(s,t,sizeof(t))
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define mp make_pair
const ll mod = 1e9 + 7;
inline ll qmi (ll a, ll b) {
ll ans = 1;
while (b) {
if (b & 1) ans = ans * a%mod;
a = a * a %mod;
b >>= 1;
}
return ans;
}
inline int read () {
int x = 0, f = 0;
char ch = getchar();
while (!isdigit(ch)) f |= (ch=='-'),ch= getchar();
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
return f?-x:x;
}
template<typename T> void print(T x) {
if (x < 0) putchar('-'), x = -x;
if (x >= 10) print(x/10);
putchar(x % 10 + '0');
}
inline ll sub (ll a, ll b) {
return ((a - b ) %mod + mod) %mod;
}
inline ll add (ll a, ll b) {
return (a + b) %mod;
}
inline ll inv (ll a) {
return qmi(a, mod - 2);
}
int n;
vector<string> a;
bool cmp (string a, string b) {
return a + b > b + a;
}
void solve() {
cin >> n;
for (int i = 0; i < n; i ++) {
string s;
cin >> s;
a.pb(s);
}
sort(all(a), cmp);
for (auto t : a) cout << t;
}
int main () {
int t;
t =1;
//cin >> t;
while (t --) solve();
return 0;
}
For any two strings, if a + b > b + a Then put a Put it in b front . Otherwise put it in the back
边栏推荐
- 室内场馆现代化的三大要点
- How does data age in Splunk?
- imx6ul开发板移植主线u-boot之EMMC启动流程
- 2、CompletableFuture
- What scenarios can the member management system of the multi guest swimming pool achieve?
- 2020.10.27 summary of Beijing Ali cultural and entertainment
- netstat 命令详解
- Yarn switch ResourceManager (failed to connect to server:8032 retries get failed due to exceeded maximum)
- How about Lenovo Xiaoxin 520? Which is more worth buying than dangbei D3x?
- C#事件总线
猜你喜欢

Flink spark vs. Flink

How does Wireshark modify the display format of packet capturing time and date?

2022年618投影仪保值品牌榜,当贝投影闲鱼保值率排行TOP1

Venue floor efficiency is so low? The key lies in these two aspects

8. 18 arhat enhancements for atomic operations

11、Synchronized与锁升级

Oracle DatabaseLink 跨数据库连接

经营养生理疗馆要注意什么问题?

Splunk best practices - lighten the burden on Captain

8、原子操作类之18罗汉增强
随机推荐
美容院管理系统如何解决门店运营的三大难题?
13. Explanation of reentrantlock, reentrantreadwritelock and stampedlock
(recommended) how many splunks are appropriate? Search head
CMD of Jerry's AI protocol_ SET_ BLE_ Format of visibility command [chapter]
9. Parler de threadlocal
Usage of instr function in Oracle Database
Ways to double the summer performance of natatoriums
1. Thread Basics
Redis RDB和AOF
换种方式实现阖家团圆,2022旗舰投影坚果J10S被种草
In the list of 618 projector hedging brands in 2022, dangbei projection ranked top 1 in the hedging rate of idle fish
Node creates a template file with the art template template template engine
How to optimize SEO on the mobile terminal? Do you need to optimize GoogleSEO on the mobile terminal for a separate m domain name?
How about Lenovo Xiaoxin 520? Which is more worth buying than dangbei D3x?
Stone technology: R & D strength and excellent quality help upgrade the sweeping robot industry
Quel projecteur 4K est le meilleur rapport qualité - prix, quand bex3 pro met en évidence 128g Storage 618 vaut la peine de voir
Oracle 将数据导出到CSV(Excel)文件的方法
Redis data type Daily use Scenarios
Progress bar loading
2020.10.27 北京阿里大文娱一面总结