PAT (Advanced Level) 1006. Sign In and Sign Out (25)
简单题。
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std; struct X
{
string name;
int a,b;
}s[];
int n,hh,mm,ss; bool cmp1(const X&a,const X&b)
{
return a.a<b.a;
} bool cmp2(const X&a,const X&b)
{
return a.b>b.b;
} int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
{
cin>>s[i].name;
scanf("%d:%d:%d",&hh,&mm,&ss);
s[i].a=hh**+mm*+ss;
scanf("%d:%d:%d",&hh,&mm,&ss);
s[i].b=hh**+mm*+ss;
}
sort(s+,s++n,cmp1); cout<<s[].name<<" ";
sort(s+,s++n,cmp2); cout<<s[].name<<"\n";
return ;
}
PAT (Advanced Level) 1006. Sign In and Sign Out (25)的更多相关文章
- PAT (Advanced Level) Practice 1002 A+B for Polynomials (25 分) 凌宸1642
PAT (Advanced Level) Practice 1002 A+B for Polynomials (25 分) 凌宸1642 题目描述: This time, you are suppos ...
- PAT (Advanced Level) 1106. Lowest Price in Supply Chain (25)
简单dfs #include<cstdio> #include<cstring> #include<cmath> #include<vector> #i ...
- PAT (Advanced Level) 1097. Deduplication on a Linked List (25)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
- PAT (Advanced Level) 1090. Highest Price in Supply Chain (25)
简单dfs. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> ...
- PAT (Advanced Level) 1079. Total Sales of Supply Chain (25)
树的遍历. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #i ...
- PAT (Advanced Level) Practise - 1098. Insertion or Heap Sort (25)
http://www.patest.cn/contests/pat-a-practise/1098 According to Wikipedia: Insertion sort iterates, c ...
- PAT (Advanced Level) Practice 1055 The World's Richest (25 分) (结构体排序)
Forbes magazine publishes every year its list of billionaires based on the annual ranking of the wor ...
- PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642
PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642 题目描述: At the beginning of ever ...
- PAT (Advanced Level) Practice(更新中)
Source: PAT (Advanced Level) Practice Reference: [1]胡凡,曾磊.算法笔记[M].机械工业出版社.2016.7 Outline: 基础数据结构: 线性 ...
随机推荐
- Tomcat 7优化
1.在bin/catalina.bat文件中加入下面参数,对JVM进行优化,至于这一大驼参数的作用及说明,大家到网上找找,应该有很多的,如:http://www.mzone.cc/article/32 ...
- 桥接 NAT HOST-ONLY
无论是vmware,virtual box,virtual pc等虚拟机软件,一般来说,虚拟机有三种网络模式: 1.桥接 2.NAT 3.Host-Only 桥接 桥接网络是指本地物理网卡和虚拟网卡通 ...
- [转]php 在各种web服务器的运行模式
一.php在apache中运行模式 php在apache中一共有三种工作方式:CGI模式.FastCGI模式.Apache 模块DLL) 以下分别比较: 1. CGI模式与模块模式比较: php在ap ...
- centos 6.5常见lib库安装
在CentOS安装软件的时候,可能缺少一部分支持库,而报错.这里首先安装系统常用的支持库.那么在安装的时候就会减少很多的错误的出现. # yum install -y gcc gdb strace g ...
- Update Case的用法与execute执行字符串
摘自于网路:http://www.cnblogs.com/joinger/articles/1297160.html update h_crm_SafetyAccessUser set ...
- 获取表空间的语句 以及 建表和索引的ddl
alter session set container=PHD1; SET SERVEROUTPUT ON SET LINESIZE SET FEEDBACK OFF SET PAGESIZE sel ...
- shell注意事项
以下基于bash 1.shell只有变量和数组?,数组() 2.( (表达式1,表达式2…) ) 3.[ expr ] 实际上是bash 中 test 命令的简写.即所有的 [ expr ] 等于 t ...
- linux视频学习4(crontab和进程)
1 . crontab定时任务: 任务调度: 系统在某个时间执行的特定的命令. 分类: 1.系统工作.2.个别的用户工作. 设置任务调度文件: /etc/crontab 1.crontab -e : ...
- svn删除用户
如果安装有svn客户端,右键打开svn settings 然后就可以重新登录svn用户了 或者删除此文件
- db2导入表结构和表数据
http://www.cnblogs.com/kfarvid/archive/2010/12/15/1906776.html db2的博文 -bash-3.2$ db2 connect to ca ...