题意:给出一些cp,给出参加派对的人,问在派对中谁是没有cp的。

思路:存储cp,用set维护参加派对的人,遍历cp对,把同时在派对的人删除。

代码


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>using namespace std;const int MAX_N = 50010;
typedef pair<string, string> P;
P input[MAX_N];
int M, Q;
char x[20];
set<string> st;
char s1[20], s2[20];int main() {// freopen("in.txt", "r", stdin);// freopen("out.txt", "w", stdout);scanf("%d", &M);for (int i = 0; i < M; i++) {scanf("%s %s", s1, s2);input[i].first = s1; input[i].second = s2;}scanf("%d", &Q);while (Q--) {scanf("%s", x);st.insert(x);}for (int i = 0; i < M; i++) {if (st.count(input[i].first) && st.count(input[i].second)) {st.erase(input[i].first);st.erase(input[i].second);}}printf("%lu\n", st.size());for (auto it = st.begin(); it != st.end(); it++) {if (it != st.begin()) printf(" ");printf("%s", it->c_str());}return 0;
}

pat1121 Damn Single相关推荐

  1. Single Shot Multibox Detection (SSD)实战(下)

    Single Shot Multibox Detection (SSD)实战(下) Training 将逐步解释如何训练SSD模型进行目标检测. 2.1. Data Reading and Initi ...

  2. Single Shot Multibox Detection (SSD)实战(上)

    Single Shot Multibox Detection (SSD)实战(上) 介绍了边界框.锚框.多尺度对象检测和数据集.现在,我们将利用这些背景知识构建一个目标检测模型:单次多盒检测(SSD) ...

  3. SSD(Single shot multibox detector)目标检测模型架构和设计细节分析

    先给出论文链接:SSD: Single Shot MultiBox Detector 本文将对SSD中一些难以理解的细节做仔细分析,包括了default box和ground truth的结合,def ...

  4. 【LeetCode】136. Single Number 解题小结

    题目: Given an array of integers, every element appears twice except for one. Find that single one. No ...

  5. 【错误归纳】IndexError: single positional indexer is out-of-bounds

    问题说明 我使用了seaborn 画图,加载数据的时候出现了下面的这个错误提示: IndexError: single positional indexer is out-of-bounds 我先按照 ...

  6. pandas使用query函数查询指定日期索引对应的dataframe数据行(select rows using a single date in dataframe)

    pandas使用query函数查询指定日期索引对应的dataframe数据行(select rows using a single date in dataframe) 目录 pandas使用qu

  7. pandas使用apply函数将dataframe多个数据列整合为元组形式并生成新的数据列(combine multiple columns as a single column of tuples)

    pandas使用apply函数将dataframe多个数据列整合为元组形式并生成新的数据列(combine multiple columns as a single column of tuples ...

  8. Single Molecule Real-Time Sequencing

    Single Molecule Real-Time Sequencing Published July 9, 2016 Recently, I have witnessed the uprising ...

  9. Real-Time DNA Sequencing from Single Polymerase Molecules

    Real-Time DNA Sequencing from Single Polymerase Molecules  单聚合酶分子的实时DNA测序 Abstract ①We detected the ...

最新文章

  1. NSThread Run Loop
  2. 采用PHP实现”服务器推”技术的聊天室
  3. 1.8 欠拟合和过拟合-机器学习笔记-斯坦福吴恩达教授
  4. 获取另一个驱动的设备结构体_《rt-thread驱动框架分析》-i2c驱动
  5. Android 4.4 packageinstaller之权限获取及展现
  6. IEEE深度对话Facebook人工智能负责人Yann LeCun:让深度学习摆脱束缚
  7. 巧替换windows 7中的宋体 simsun.ttc
  8. Mobile开发之meta篇
  9. jquery版本问题
  10. TARA(威胁分析和风险评估方法)
  11. 大数据与云计算技术周报(第150期)
  12. 文本检测最近文章检索(1)
  13. Springboot Could not resolve placeholder ‘spring.data.mongodb.database’ in value “${spring.data.mong
  14. cad角度命令怎么输入_CAD制图软件中怎么输入相对坐标和绝对坐标?
  15. Nature综述:2万字带你系统入门鸟枪法宏基因组实验和分析
  16. discuz跳过云平台强制开启QQ互联(QQ登录)
  17. Windows用户的分类
  18. VTK笔记-CT图像获取皮肤等值面-vtkContourFilter类的使用
  19. 为什么maven没有3.7的版本
  20. 【原创】畅言实现单点登录的设计流程和技术细节(1/2)

热门文章

  1. “优必选“杯2021中国机器人技能大赛--赛后总结
  2. 【C语言】输入矩形的长和宽,计算该矩形的面积
  3. 383计算机毕业设计
  4. MT4如何添加交易品种?
  5. 啪!啪!给 JobIntentService 打针, Hilt 号的大针,看你爽不爽?哎呦,Espresso 看不到结果,用 UiAutomator 测。
  6. 计算机桌面图片唐诗,自动唐诗宋词桌面壁纸
  7. Flask源码分析(一)
  8. CrashReport(崩溃日志)分析方法
  9. Oracle Sequence创建与使用
  10. Python 3 内置函数 tuple( )