当前位置:网站首页>“蔚来杯“2022牛客暑期多校训练营3 C
“蔚来杯“2022牛客暑期多校训练营3 C
2022-08-04 12:23:00 【eyuhaobanga】
直接sort排序,用&加快读取速度即可
AC代码:
#include <bits/stdc++.h> #define rep(i,a,n) for(int i=a;i<n;i++) using namespace std; using LL = long long; bool cmp(string &a, string &b) { return a + b < b + a; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<string> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end(), cmp); for (int i = 0; i < n; i++) { cout << a[i]; } cout << '\n'; return 0; }
边栏推荐
猜你喜欢
考研概率论与数理统计(知识点梳理)
MySQL - Explain详解
Cool and efficient data visualization big screen, it's really not that difficult to do!丨Geek Planet
【全网首发】Redis系列5:深入分析Cluster 集群模式
动手学深度学习_LeNet
03 多线程与高并发 - ReentrantLock 源码解析
Access Huawei game anti-addiction, click the anti-addiction pop-up window, the game crashes
break与continue超详解!!!
第10章 模块和包
Based on the BiLSTM regression forecast method
随机推荐
动规(16)-并查集基础题——亲戚(Relations)
简要介绍电源效率测试
A Collection of Flutter Tutorials (2022 Edition)
Small program on how to play in the construction of e-government service platform value
Flutter 使用 json_serializable 解析 JSON 支持泛型
AI 助力双碳目标:让每一度电都是我们优化的
Access Huawei game anti-addiction, click the anti-addiction pop-up window, the game crashes
第10章 模块和包
业务中我们如何更新缓存?Redis
鲜花“刺客”收割七夕
yolo系列的head模块
WPF---Grid布局讲解
电源测试之输出动态响应(Output Dynamic Response Test)
String是引用类型
Matlab记录
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
Redis(一)安装与配置
Cache character stream
缓存中间件技术选型Memcached、MongoDB、Redis
新消费、出海、大健康......电子烟寻找“避风港”