当前位置:网站首页>Pat 1157: school anniversary
Pat 1157: school anniversary
2022-06-24 08:19:00 【Duange】
subject


Chinese translation

Code
#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;
}
边栏推荐
猜你喜欢

longhorn安装与使用

JDBC 在性能测试中的应用

Écouter le réseau d'extension SWIFT (source)

Part 1: building OpenGL environment

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

Swift foundation features unique to swift

2022年制冷与空调设备运行操作上岗证题库及模拟考试

LabVIEW查找n个元素数组中的质数

Swift Extension NetworkUtil(网络监听)(源码)

有关iframe锚点,锚点出现上下偏移,锚点出现页面显示问题.iframe的srcdoc问题
随机推荐
VR is destined to reappear in the Jianghu?
貸款五級分類
11--无重复字符的最长子串
[008] filter the table data row by row, jump out of the for cycle and skip this cycle VBA
dhcp、tftp基础
Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
How to use the virtual clock of FPGA?
51单片机_外部中断 与 定时/计数器中断
2022 PMP project management examination agile knowledge points (1)
Catégorie de prêt 5
LINQ 查询(2)
工控机防破解
对于flex:1的详细解释,flex:1
到底哪一首才是唐诗第一?
一文带你了解Windows操作系统安全,保护自己的电脑不受侵害
Écouter le réseau d'extension SWIFT (source)
Screenshot recommendation - snipaste
宝塔面板安装php7.2安装phalcon3.3.2
Serialization of unity
Vulnhub target: boredhackerblog: social network