Zhejiang University is about to celebrate her 122th anniversary in 2019. To prepare for the celebration, the alumni association (校友会) has gathered the ID’s of all her alumni. Now your job is to write a program to count the number of alumni among all the people who come to the celebration.

Input Specification:

Each input file contains one test case. For each case, the first part is about the information of all the alumni. Given in the first line is a positive integer  . Then N lines follow, each contains an ID number of an alumnus. An ID number is a string of 18 digits or the letter X. It is guaranteed that all the ID’s are distinct.

The next part gives the information of all the people who come to the celebration. Again given in the first line is a positive integer  . Then M lines follow, each contains an ID number of a guest. It is guaranteed that all the ID’s are distinct.

Output Specification:

First print in a line the number of alumni among all the people who come to the celebration. Then in the second line, print the ID of the oldest alumnus – notice that the 7th - 14th digits of the ID gives one’s birth date. If no alumnus comes, output the ID of the oldest guest instead. It is guaranteed that such an alumnus or guest is unique.

Sample Input:

5
372928196906118710
610481197806202213
440684198612150417
13072819571002001X
150702193604190912
6
530125197901260019
150702193604190912
220221196701020034
610481197806202213
440684198612150417
370205198709275042

Sample Output:

3
150702193604190912

Ω

给出校友身份ID,然后统计参加校庆人群中的校友个数,并输出最年长的校友ID。如果没有校友参加,则输出所有宾客中最年长的ID。

最年长ID具有明显的优先级,与pair比较的思想类似,我们可以用pair对 的比较来判断是否需要替换最年长ID。比如说一个校友{false,"19991229"}和一个非校友{true,"18900101"},由于前者的pair较小( ),选择前者为最年长ID。


『1157』Anniversary相关推荐

  1. 『转载』Debussy快速上手(Verdi相似)

    『转载』Debussy快速上手(Verdi相似) Debussy 是NOVAS Software, Inc(思源科技)发展的HDL Debug & Analysis tool,这套软体主要不是 ...

  2. 『参考』.net CF组件编程(4)——为自定义组件添加工具箱图标!

    前言: 在前三篇的文章中,和大家一起创建了一个用于TCP连接检测的小组件,如果你记不得了,可以通过以下链接去回顾一下: 『参考』.net CF组件编程(1)--基础之后 『参考』.net CF组件编程 ...

  3. 『TensorFlow』命令行参数解析

    argparse很强大,但是我们未必需要使用这么繁杂的东西,TensorFlow自己封装了一个简化版本的解析方式,实际上是对argparse的封装 脚本化调用tensorflow的标准范式: impo ...

  4. 『Numpy』常用方法记录

    numpy教程 防止输出省略号 import numpy as np np.set_printoptions(threshold=np.inf) 广播机制 numpy计算函数返回默认是一维行向量: i ...

  5. 2018年『web』开发者不得不知的技术趋势

    作为一个『web』开发者,无论是做前端还是后端,都应该时刻保持着对技术的敏感性.技术的流行需要一定时间的沉淀,有哪些web相关的技术会可能会在2018年成为web开发的新宠呢?下面列举业界经过实践并且 ...

  6. 『TensorFlow』函数查询列表_张量属性调整

    博客园 首页 新随笔 新文章 联系 订阅 管理 『TensorFlow』函数查询列表_张量属性调整 数据类型转换Casting 操作 描述 tf.string_to_number (string_te ...

  7. 『TensorFlow』专题汇总

    TensorFlow函数查询 『TensorFlow』0.x_&_1.x版本框架改动汇总 『TensorFlow』函数查询列表_数值计算 『TensorFlow』函数查询列表_张量属性调整 『 ...

  8. 两个构件的重合点_初三物理易错点:你被眼睛欺骗了,那些『平面镜成像』中的困惑...

    时光飞逝,一晃初三的伙伴们已经返校复课一个多月了,想必有很多感慨和困惑吧? 还有的地方初三的伙伴们还没有复课,在家乖乖地学习网课,想必也是有诸多的困惑和不解吧? 今天木木老西跟大家解开物理当中的一个困 ...

  9. 『Numpy』内存分析_高级切片和内存数据解析

    在计算机中,没有任何数据类型是固定的,完全取决于如何看待这片数据的内存区域. 在numpy.ndarray.view中,提供对内存区域不同的切割方式,来完成数据类型的转换,而无须要对数据进行额外的co ...

最新文章

  1. 【转】 ASP.NET 3.5中使用新的ListView控件
  2. 云消防大数据_消防云大数据app下载-消防云大数据下载v1.1.5 安卓版-西西软件下载...
  3. ubuntu下txt文件编码转换、查询(gbk/ISO-8859-utf-8)
  4. 运行shell脚本时怎么知道jdk路径_Shell写脚本关于ssh执行jar包,需要刷新JDK路径的问题...
  5. OSO.EXE病毒专杀工具
  6. Python Dict笔记
  7. 计算机与科学 研究生考试内容,计算机科学与技术考研考哪些科目 备考技巧有哪些...
  8. user32.dll 函数说明
  9. 天空盒 Skybox
  10. 20个PCB快捷键操作,提升绘图效率
  11. python批量将word转换成pdf_python批量实现Word文件转换为PDF文件
  12. 华为无线网卡无服务器,联通华为无线上网卡连接时连接被终止解决方法 - 小众知识...
  13. TypeError: list indices must be integers or slices, not float
  14. HugePages 大内存页
  15. 区块链、密码和银行之间的衍生关系
  16. 机器学习(Machine Learning)深度学习(Deep Learning)资料(Chapter 2)
  17. 京东图书架构设计有感
  18. 2018年高德地图POI全国数据下载
  19. 合伙人制度是梦想、价值观和利益的捆绑
  20. 什么是阻抗匹配以及为什么要阻抗匹配

热门文章

  1. linux下文件的属性 r, w, x 分别代表什么意思?
  2. chain模型音素对齐
  3. 放下流量思维,回归用户思维
  4. 【C语言】无符号大数的加减问题
  5. Redis环境搭建以及常见问题详解
  6. 网络基础(二)之TCP/UDP协议
  7. go语言time用法总结
  8. 简单的启发式搜索---算法爬山算法
  9. 180303 逆向-抵御静态分析(2)
  10. git合并分支(一看就懂)