pat1121 Damn Single
题意:给出一些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相关推荐
- Single Shot Multibox Detection (SSD)实战(下)
Single Shot Multibox Detection (SSD)实战(下) Training 将逐步解释如何训练SSD模型进行目标检测. 2.1. Data Reading and Initi ...
- Single Shot Multibox Detection (SSD)实战(上)
Single Shot Multibox Detection (SSD)实战(上) 介绍了边界框.锚框.多尺度对象检测和数据集.现在,我们将利用这些背景知识构建一个目标检测模型:单次多盒检测(SSD) ...
- SSD(Single shot multibox detector)目标检测模型架构和设计细节分析
先给出论文链接:SSD: Single Shot MultiBox Detector 本文将对SSD中一些难以理解的细节做仔细分析,包括了default box和ground truth的结合,def ...
- 【LeetCode】136. Single Number 解题小结
题目: Given an array of integers, every element appears twice except for one. Find that single one. No ...
- 【错误归纳】IndexError: single positional indexer is out-of-bounds
问题说明 我使用了seaborn 画图,加载数据的时候出现了下面的这个错误提示: IndexError: single positional indexer is out-of-bounds 我先按照 ...
- pandas使用query函数查询指定日期索引对应的dataframe数据行(select rows using a single date in dataframe)
pandas使用query函数查询指定日期索引对应的dataframe数据行(select rows using a single date in dataframe) 目录 pandas使用qu
- pandas使用apply函数将dataframe多个数据列整合为元组形式并生成新的数据列(combine multiple columns as a single column of tuples)
pandas使用apply函数将dataframe多个数据列整合为元组形式并生成新的数据列(combine multiple columns as a single column of tuples ...
- Single Molecule Real-Time Sequencing
Single Molecule Real-Time Sequencing Published July 9, 2016 Recently, I have witnessed the uprising ...
- Real-Time DNA Sequencing from Single Polymerase Molecules
Real-Time DNA Sequencing from Single Polymerase Molecules 单聚合酶分子的实时DNA测序 Abstract ①We detected the ...
最新文章
- NSThread Run Loop
- 采用PHP实现”服务器推”技术的聊天室
- 1.8 欠拟合和过拟合-机器学习笔记-斯坦福吴恩达教授
- 获取另一个驱动的设备结构体_《rt-thread驱动框架分析》-i2c驱动
- Android 4.4 packageinstaller之权限获取及展现
- IEEE深度对话Facebook人工智能负责人Yann LeCun:让深度学习摆脱束缚
- 巧替换windows 7中的宋体 simsun.ttc
- Mobile开发之meta篇
- jquery版本问题
- TARA(威胁分析和风险评估方法)
- 大数据与云计算技术周报(第150期)
- 文本检测最近文章检索(1)
- Springboot Could not resolve placeholder ‘spring.data.mongodb.database’ in value “${spring.data.mong
- cad角度命令怎么输入_CAD制图软件中怎么输入相对坐标和绝对坐标?
- Nature综述:2万字带你系统入门鸟枪法宏基因组实验和分析
- discuz跳过云平台强制开启QQ互联(QQ登录)
- Windows用户的分类
- VTK笔记-CT图像获取皮肤等值面-vtkContourFilter类的使用
- 为什么maven没有3.7的版本
- 【原创】畅言实现单点登录的设计流程和技术细节(1/2)
热门文章
- “优必选“杯2021中国机器人技能大赛--赛后总结
- 【C语言】输入矩形的长和宽,计算该矩形的面积
- 383计算机毕业设计
- MT4如何添加交易品种?
- 啪!啪!给 JobIntentService 打针, Hilt 号的大针,看你爽不爽?哎呦,Espresso 看不到结果,用 UiAutomator 测。
- 计算机桌面图片唐诗,自动唐诗宋词桌面壁纸
- Flask源码分析(一)
- CrashReport(崩溃日志)分析方法
- Oracle Sequence创建与使用
- Python 3 内置函数 tuple( )