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: 基础数据结构: 线性 ...
随机推荐
- A*搜寻算法(A星算法)
A*搜寻算法[编辑] 维基百科,自由的百科全书 本条目需要补充更多来源.(2015年6月30日) 请协助添加多方面可靠来源以改善这篇条目,无法查证的内容可能会被提出异议而移除. A*搜索算法,俗称A星 ...
- JSP基本语法--Page指令 <%@page 属性=”内容“%>
page指令语法:<%@page 属性=”内容“%> 常用:contentType,import,pageEncoding 例子,设置MIME属性,如果使用一些高版本的tomcat,可能自 ...
- sql server 的约束的作用 于 理解 [转]
SQL Server中的约束用来确保系统的完整性.一般约束可以分为:主键约束外键约束检查约束默认约束唯一约束非空约束 但是一般我们需要特别注意前三种约束:主键约束,一就是说跟你系统的实体有很大的关系, ...
- 转 awk 使用方法
Shell编程-awk 简介 awk 是一种对立的编程语言,集成于所有UNIX/Linux中,这个名字是它创建者的名字首字母组成的 Alfred Aho,Peter Weinberger, and B ...
- C++调用C#之C++DLL调用C# COM控件
1. 新建项目 这里我们使用ATL,来接受C# COM控件向外发送的事件. 2. 初始化ATL #include "stdafx.h" CComModule _module; BO ...
- java复用类
java复用类英文名叫reusing classes ,重新使用的类,复用的意思就是重复使用的类,其实现方法就是我们平常使用的组合和继承: 1.组合: has-a 的关系 (自我理解:组合就是我们 ...
- js滚动条
/*滚动条在Y轴上的滚动距离*/function ScrollTop(){ var scrollTop = 0, bodyScrollTop = 0, documentScrollTop = 0; i ...
- 17232 伪Acmer的推理(传递闭包)
17232 伪Acmer的推理 时间限制:1000MS 内存限制:65535K提交次数:0 通过次数:0 收入:0 题型: 编程题 语言: G++;GCC Description 现在正是期末, ...
- android 5.0新特性学习--视图阴影
android 5.0的视图阴影主要是体验出层次性,就是在一个物体上面叠加上一层的设计,而这种设计就是除了传统的,x,y的纸面层,还有就是透过纸面的z轴的层次设计. elevation: 高度,静态属 ...
- Windows API 之 CreateThread、GetExitCodeThread(未完)
GetExitCode Retrieves the termination status of the specified thread. BOOL WINAPI GetExitCodeThread( ...