spy——[1220] SPY

2024-06-09 05:08
文章标签 spy 1220

本文主要是介绍spy——[1220] SPY,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题描述
The National Intelligence Council of X Nation receives a piece of credible information that Nation Y will send spies to steal Nation X’s confidential paper. So the commander of The National Intelligence Council take measures immediately, he will investigate people who will come into NationX. At the same time, there are two List in the Commander’s hand, one is full of spies that Nation Y will send to Nation X, and the other one is full of spies that Nation X has sent to Nation Y before. There may be some overlaps of the two list. Because the spy may act two roles at the same time, which means that he may be the one that is sent from Nation X to Nation Y, we just call 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” may bring back NationY’s confidential paper without worrying to be detention by NationY’s frontier So the commander decides to seize those that are sent by NationY, and let the ordinary people and the “dual_spy” in at the 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.
输入
There are several test cases.
Each test case contains four parts, the first part contains 3 positive integers A, B, C, and A is the number which will come into the frontier. B is the number that will be sent by Nation Y, and C is the number that NationX has sent to NationY before.
The second part contains A strings, the name list of that will come into the frontier.
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 names in a single list, if repetitive names appear in two lists, they mean the same people.
输出
Output the list that the commander should caught (in the appearance order of the lists B).if no one should be caught, then , you should output “No enemy spy”.
样例输入
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
样例输出
Qian Sun Li

No enemy spy

第一行输入要来A国的人

第二行输入B国的间谍

第三行输入A派去B的间谍

问:来的人中B国的间谍是谁

#include <iostream>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
map<string,int>Map;
int main()
{int a,b,c;while(scanf("%d%d%d",&a,&b,&c)!=EOF){string str[10000];Map.clear();for(int i=0;i<a;i++){string s;cin>>s;Map[s]=1;}for(int i=0;i<b;i++){cin>>str[i];Map[str[i]]++;}for(int i=0;i<c;i++){string s;		cin>>s;Map[s]--;}int flag=0;for(int i=0;i<b;i++){if(Map[str[i]]==2){if(flag)printf(" ");cout<<str[i];flag=1;}}if(flag==0){cout<<"No enemy spy"<<endl;}elseputs("");}return 0;
}


这篇关于spy——[1220] SPY的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1044295

相关文章

VS2022如何安装Spy+

Microsoft Spy++是一个非常好的查看Windows操作系统的窗口、消息、进程、线程信息的工具,简单易用,功能强大。 step1 安装vc++,点击下面官方链接进行下载 官方链接-VS++  下载完成后运行 点击继续 ,等待安装    等待安完成,自动启动  step2 暂时跳过此项  选择无需代码 选择工具,获取工具和功

使用py-spy解决scrapy卡死的问题

背景 在使用scrapy爬取东西的时候,使用crontab定时的启动爬虫,但是发现机器上经常产生很多卡死的scrapy进程,一段时间不管的话,会导致有10几个进程都卡死在那,并且会导致数据产出延迟。 问题定位 使用py-spy这个非常好用的python性能分析工具来进行排查,py-spy可以查看一个python进程函数调用用时,类似unix下的top命令。所以我们用这个工具看看是什么函数一直

spy——C - Time

Description Digital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “).now given the current time, please tell us how can it be expressed by the d

分析工具:Accessibility Insights、spy、Inspect

1、Accessibility Insights 官网:https://accessibilityinsights.io/ 文档:https://accessibilityinsights.io/docs/web/overview/ Github:https://github.com/microsoft/accessibility-insights-windows Windows 官方推荐的

hdu4468 Spy kmp

Spy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 227    Accepted Submission(s): 107 Problem Description “Be subtle! Be subtle! And

A Spy in the Metro UVA - 1025 (dp)

原题目不好复制,就不贴了! 题目大意: (紫书的题意)某城市的地铁是线性的,有n(2<=n<=50)个车站,从左到右编号1-n,有M1辆车从1站开始往右开,还有M2两车从第n站开始往左开,在时刻0某人从第一站出发,目的是在时刻T,会见车站n的一个间谍。在车站等车容易被抓,所以他决定尽量在开动的火车上,让在车站等待的总时间尽量的短。列车靠站停车的时间忽略。   输入第一行为n,   第二行为

Microsoft SPY++ 使用教程及实操

Spy++介绍 Spy++ (SPYXX.EXE) 是一个基于 Win32 的实用工具,提供系统进程、线程、窗口和窗口消息的图形视图。 Spy++ 有两个版本 第一个版本,名为 Spy++ (spyxx.exe),用于显示发送到在 32 位进程中运行的窗口的消息。 例如,在 32 位进程中运行的 Visual Studio。 因此,可以使用 Spy++ 来显示发送到“解决方案资源管理器” 中

杭电OJ 1220:Cube

这纯粹是一道数学题目,推理如下:给你一个正方体,切割成单位体积的小正方体,求所有公共顶点数<=2的小正方体的对数。公共点的数目只可能有:0,1,2,4.很明显我们用总的对数减掉有四个公共点的对数就可以了。总的公共点对数:n^3*(n^3-1)/2(一共有n^3块小方块,从中选出2块)(只有两个小方块之间才存在公共点,我们从所有的小方块中任意选出两个,自然就确定了这两个小方块的公共点的对数,从所

Python结合spy++

导入必要的库 import win32confrom win32 import win32guifrom win32 import win32clipboard as wimport pyautoguiimport sys 1.获取窗口全部属性 def show_window_attr(hwnd):"""显示窗口的属性:param hwnd: 窗口句柄(十进制):return: 所

@Mock @Spy @InjectMocks 注解

文章目录 1、@Mock注解2、@Spy注解3、@InjectMocks注解 1、@Mock注解 @Mock 注解往往用来创建以及注入模拟实例。当我们被测试代码依赖一个实例时,我们会用 mockito 框架创建一个模拟的实例,而不是去真的创建需要的对象。@Mock注释是Mockito.Mock(classToMock)的一种替代方法,他们都取得了相同的结果;使用@Mock通常被认