当前位置:网站首页>Hdu3527 (Hangdian) spy problem
Hdu3527 (Hangdian) spy problem
2022-06-11 19:33:00 【*c.】
Need to know :vector See the following blog for basic details
STL application ( unfinished _m0_62044244 The blog of -CSDN Blog
Title Description
The NationalIntelligence( Intelligence work ) Council( The committee ) of X Nation receives a piece ofcredible( reliable ) informationthat Nation Y will send spies( The spy ) to stealNation X’s confidential( Confidential ) paper. So thecommander( The commander ) of TheNational Intelligence Council take measures immediately, he will investigate( survey ) people who will come into Nation X. Atthe same time, there are two List in the Commander’s hand, one is full of spiesthat Nation Y will send to Nation X, and the other one is full of spies thatNation X has sent to Nation Y before. There may be some overlaps( repeat ) of the two list. Because the spy( The spy ) may act two roles at the same time, whichmeans that he may be the one that is sent from Nation X to Nation Y, we justcall this type a “dual-spy”. So Nation Y may send “dual_spy” back to Nation X,and it is obvious now that it is good for Nation X, because “dual_spy” maybring back NationY’s confidential paper without worrying to be detention( Detainment ) by NationY’s frontier( The border ) So the commander decides to seize thosethat are sent by NationY, and let the ordinary people and the “dual_spy” in atthe same time .So can you decide a list that should be caught by the Commander?
A:the list contains that will come to the NationX’s frontier.
B:the list contains spies that will be sent by Nation Y.
C:the list contains spies that were sent to NationY before.
input
There areseveral test cases.
Each test case contains four parts, the first part contains 3 positive integersA, B, C, and A is the number which will come into the frontier. B is the numberthat will be sent by Nation Y, and C is the number that NationX has sent toNationY before.
The second part contains A strings, the name list of that will come into thefrontier.
The second part contains B strings, the name list of that are sent by NationY.
The second part contains C strings, the name list of the “dual_spy”.
There will be a blank line after each test case.
There won’t be any repetitive( Repetitive ) names in asingle list, if repetitive names appear in two lists, they mean the samepeople.
output
Output the listthat the commander should caught (in the appearance order of the lists B).if noone should be caught, then , you should output “No enemy spy”
sample input
8 4 3
Zhao Qian Sun Li Zhou Wu Zheng Wang
Zhao Qian Sun Li
Zhao Zhou Zheng
2 2 2
Zhao Qian
Zhao Qian
Zhao Qian
sample output
Qian Sun Li
No enemy spy
ans
#include<bits/stdc++.h>
using namespace std;
const int N=1e7+10;
vector<string> x,y,z,ans;// Deposit in the three line list And a list of arrests
int main()
{
int a,b,c,i;string s;
while(cin>>a>>b>>c)
{
x.clear(),y.clear(),z.clear(),ans.clear();
for(i=0;i<a;i++)
{
cin>>s;x.push_back(s);
}
for(i=0;i<b;i++)
{
cin>>s;y.push_back(s);
}
for(i=0;i<c;i++)
{
cin>>s;z.push_back(s);
}// The above step is to deposit in the three line list
for(i=0;i<b;i++)
{// From the second line, find out what the first line has but the third line does not have, that is, the spy to be captured
if(find(x.begin(),x.end(),y[i])!=x.end())
if(find(z.begin(),z.end(),y[i])==z.end())
{
ans.push_back(y[i]);
}
}
if(!ans.size())
{
cout<<"NO enemy spy";
}else{
for(i=0;i<ans.size();i++)
{
cout<<ans[i]<<" ";
}
}
cout<<endl;
}
return 0;
}边栏推荐
- Introduction to go language (VI) -- loop statement
- [image denoising] image denoising based on Markov random field with matlab code
- [solution] codeforces round 798 (Div. 2)
- 谷歌提出超强预训练模型CoCa,在ImageNet上微调Top-1准确率达91%!在多个下游任务上SOTA!...
- Software requirements engineering review
- 我不太想在网上开户,网上股票开户安全吗?
- Go语言入门(五)——分支语句
- 2022各大厂最新总结的软件测试宝典,看完不怕拿不到offer
- 【信号去噪】基于非线性滤波器实现语音自适应去噪附matlab代码
- 激活函数公式、导数、图像笔记
猜你喜欢

SLAM APP
![[Multisim Simulation] using operational amplifier to generate sawtooth wave](/img/98/27086746dc552ada25fd36a82cb52b.png)
[Multisim Simulation] using operational amplifier to generate sawtooth wave

30讲 线性代数第二讲 矩阵

Replace the backbone of target detection (take the fast RCNN as an example)
![[untitled]](/img/02/49d333ba80bc6a3e699047c0c07632.png)
[untitled]

Go语言入门(六)——循环语句
![[video denoising] video denoising based on salt with matlab code](/img/79/e1f8255061a342e02232ac1e393217.png)
[video denoising] video denoising based on salt with matlab code
![Leetcode: sword finger offer 59 - ii Maximum value of queue [deque + sortedlist]](/img/6b/f2e04cd1f3aaa9fe057c292301894a.png)
Leetcode: sword finger offer 59 - ii Maximum value of queue [deque + sortedlist]

LDPC 7 - simple example of decoding

Practice of Flink CDC in Dajian cloud warehouse
随机推荐
[image segmentation] image segmentation based on Markov random field with matlab code
计算926的9260次方里的字符串里有多少个926
PyMySQL利用游标操作数据库方法封装!!!
CMU 15-445 數據庫課程第五課文字版 - 緩沖池
On Workflow selection
mysql 联合索引和BTree
collect. stream(). Use of the collect() method
Picture bed: picgo+ Tencent cloud +typera
YOLOv3 Pytorch代码及原理分析(一):跑通代码
Introduction to ieda bottom menu
Qubicle notes: Hello voxel
2022 the latest software testing classic summarized by major manufacturers. After reading it, I'm not afraid I won't get an offer
Database design graduation information management
[assembly] analysis of Experiment 7 of the fourth edition of assembly language
Tensorflow---TFRecord文件的创建与读取
干货!基于序列超图神经网络的信息扩散预测
【Laravel系列7.5】事件系统
[Multisim Simulation] using operational amplifier to generate sawtooth wave
Raki's notes on reading paper: memory replace with data compression for continuous learning
Crop disease detection using image processing technology and convolutional neural network (CNN)