当前位置:网站首页>[wrong question]
[wrong question]
2022-07-28 03:39:00 【wingaso】
#include<bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
int n;
string A[N];
bool cmp(const string &a,const string &b){
return a + b < b + a;
}
int main(){
cin >> n;
for(int i = 0;i < n;i++){
cin >> A[i];
}
sort(A,A + n,cmp);
for(auto it : A)
printf("%s",it.c_str());
return 0;
}
The official solution to this problem is to establish a trie, Reduce the time complexity to O ( n ) O(n) O(n), But because of the platform environment , Can pass the card constant , use O ( l o g 2 n ) O(log_2n) O(log2n) The complexity of the code passes .
For this question , Compare the relationship between two numbers , It only needs a + b < b + a a+b < b + a a+b<b+a, That is, think from the perspective of digital integrity , You can't find local rules on every character in a number .
That is, we need to have a holistic thinking .
边栏推荐
- STM32 RT thread virtual file system mount operation
- 4-day excel practical training camp, 0.01 yuan special offer for only three days, 200 sets of learning kits
- Outlook tutorial, how to use color categories and reminders in outlook?
- 如何卸载干净zabbix服务?(超详细)
- MySQL stored procedures use cursors to synchronize data between two tables
- ASEMI整流桥GBPC3510在直流有刷电机中的妙用
- Robot development -- lead screw and guide rail
- 【5G NR】RRC Reject解析
- 动态规划——474. 一和零
- 20220727使用汇承科技的蓝牙模块HC-05配对手机进行蓝牙串口的演示
猜你喜欢

单调栈——739. 每日温度

Unity simply implements the dialog function

8000字讲透OBSA原理与应用实践

What are the fragments of MySQL

Unity backpack system

Outlook 教程,如何在 Outlook 中使用颜色类别和提醒?

STM32 RT thread virtual file system mount operation

The open source of "avoiding disease and avoiding medicine" will not go far

Integrate SSM to realize search of addition, deletion, modification and query

SQL Server备份数据库的方法
随机推荐
什么是Tor?Tor浏览器更新有什么用?
After reading MySQL database advanced practice (SQL xiaoxuzhu)
Unity背包系统
20220726汇承科技的蓝牙模块HC-05的AT命令测试
[paper notes] mobile robot autonomous navigation experimental platform based on deep learning
The latest version of pagoda installs the zip extension, and PHP -m does not display the processing method
STM32 RT-Thread虚拟文件系统挂载操作
Redis基本操作
ES6 from entry to mastery 07: Deconstruction assignment
golang gorm查询任意字段的组装方法
[5g NR] RRC reject analysis
Mouse operation and response
「运维有小邓」网络设备监控
Redis source code analysis (who says C language can't analyze it?)
【论文笔记】基于深度学习的移动机器人自主导航实验平台
【OPENVX】对象基本使用之vx_pyramid
数字经济已成为最大看点
贪心——53. 最大子数组和
CF question making record from July 25th to July 31st
Play WolframAlpha computing knowledge engine