当前位置:网站首页>PAT 1157:校庆
PAT 1157:校庆
2022-06-24 06:57:00 【段舸】
题目


中文翻译

代码
#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
int main()
{
int n,m;
cin>>n;
unordered_set<string>hash;
while(n--)
{
string name;
cin>>name;
hash.insert(name);
}
cin>>m;
string a,b;
int cnt=0;
while(m--)
{
string name;
cin>>name;
if(hash.count(name))
{
cnt++;
if(a.empty() || a.substr(6,8)>name.substr(6,8)) a=name;
}
if(b.empty() || b.substr(6,8) >name.substr(6,8)) b=name;
}
cout<<cnt<<endl;
if(cnt) cout<<a<<endl;
else cout<<b<<endl;
return 0;
}
边栏推荐
- Solve the problem of notebook keyboard disabling failure
- 自动化测试的未来趋势
- Graphmae ---- quick reading of papers
- 小样本故障诊断 - 注意力机制代码 - BiGRU代码解析实现
- Introduction to software engineering - Chapter 2 - feasibility study
- For a detailed explanation of flex:1, flex:1
- Leetcode 207: course schedule (topological sorting determines whether the loop is formed)
- LINQ 查询(2)
- Chapter 1 overview of canvas
- Pagoda panel installation php7.2 installation phalcon3.3.2
猜你喜欢

一文理解同步FIFO

Svn actual measurement common operation record operation

直播回顾 | 云原生混部系统 Koordinator 架构详解(附完整PPT)

Case examples of corpus data processing (cases related to sentence retrieval)

From jsonpath and XPath to spl

JDBC 在性能测试中的应用

OC extension detects whether an app is installed on the mobile phone (source code)

Signature analysis of app x-zse-96 in a Q & a community

有关iframe锚点,锚点出现上下偏移,锚点出现页面显示问题.iframe的srcdoc问题

Swift 基础 闭包/Block的使用(源码)
随机推荐
Swift extension networkutil (network monitoring) (source code)
Leetcode exercise - jumping game, combination summation
Atguigu---16-custom instruction
How does dating software cut your leeks
搜索与推荐那些事儿
自动化测试的未来趋势
[nilm] non intrusive load decomposition module nilmtk installation tutorial
软件工程导论——第三章——需求分析
QOpenGL显示点云文件
[测试开发]初识软件测试
2022 PMP project management examination agile knowledge points (1)
小样本故障诊断 - 注意力机制代码 - BiGRU代码解析实现
Backup and restore SQL Server Databases locally
2022年流动式起重机司机特种作业证考试题库及在线模拟考试
Decltype usage introduction
JS implementation to check whether an array object contains values from another array object
Pipeline concept of graphic technology
直播回顾 | 云原生混部系统 Koordinator 架构详解(附完整PPT)
487. 最大连续1的个数 II ●●
Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020