当前位置:网站首页>1006 sign in and sign out (25 points)
1006 sign in and sign out (25 points)
2022-06-21 07:53:00 【Crer_ lu】
1006 Sign In and Sign Out (25 branch )
Topic link
Algorithm analysis
Open two structure arrays , use sort Sorting can be
Code implementation
#include<bits/stdc++.h>
using namespace std;
#define N 10005
typedef struct{
string name;
string in;
string out;
}ind;
ind tma[N], tmb[N];
bool cmp1(const ind a, const ind b){
return a.in < b.in;
}
bool cmp2(const ind a, const ind b){
return a.out > b.out;
}
int main(){
int m;
string s;
scanf("%d", &m);
for(int i = 1; i <= m; ++ i){
cin>> tma[i].name >> tma[i].in>> tmb[i].out;
tmb[i].name = tma[i].name;
}
sort(tma + 1, tma + m + 1, cmp1);
sort(tmb + 1, tmb + m + 1, cmp2);
cout<< tma[1].name<< ' '<< tmb[1].name;
return 0;
}
边栏推荐
- 华三IPsec
- (对于换行符)gets和fgets的区别,puts和fputs的区别
- One year experience interview byte Tiktok e-commerce, share the following experience!
- General business plan
- 22 parameter estimation - maximum likelihood estimation method
- ANSA二次开发 - 外部程序采用socket与ANSA实现通信
- 32单片机——pwm波输出
- Interview duck interview brush question website system source code
- stm32中定义和声明问题
- 2021-07-28 STM32F103 I2C Hardware Transfer Include previous IO Clock EXIT USB use firmware library
猜你喜欢

Wechat official account docking: push article information to official account with one click

2021-06-16 STM32F103 exti interrupt identification using firmware library

Arduino about software uninstallation and library uninstallation

古风排版 (20 分)(测试点4)

Deploy ZABBIX enterprise level distributed monitoring

One year experience interview byte Tiktok e-commerce, share the following experience!

How to modify system language in win7

微信公众号对接 : 一键推送文章信息至公众号

Blank screen of virtual machine browser

mysql分页查询如何优化
随机推荐
mysql分页查询如何优化
虚拟机浏览器花屏空白问题
How MySQL closes a transaction
Leetcode topic [array] -40- combined sum II
Qunhui dsm7 add kit source
应用程序卡死,如何快速退出?
mysql存储过程中的循环语句怎么写
Send using queue mailbox
One year experience interview byte Tiktok e-commerce, share the following experience!
Flutter returns to the black screen of the previous page
Sword finger offer 34 A path with a value in a binary tree
Rdkit | fragment decomposition of drug molecules
(对于换行符)gets和fgets的区别,puts和fputs的区别
The reality camera in unity operates the mirror and lookat to the front of the object based on dotween
Traversal of binary tree
升级Jenkins步骤和遇到的问题
Cobaltstrike office macro virus utilization
19 statistics and its sampling distribution -- distribution of sample mean and central limit theorem
Software download method
2021-06-17 STM32F103 USART serial port code using firmware library