Sicily 1194. Message Flood
来源:互联网 发布:linux怎么选中命令复制 编辑:程序博客网 时间:2024/05/22 15:09
注意: 不区分大小写, 所以需要转换成统一小写, 方便比较
另A为联系人集合, B为发送人集合
题意就是求: A - B
// Problem#: 1194// Author#: Reid Chan#include <iostream>#include <cctype>#include <set>using namespace std;void to_low(string &a, string b, int l) { for (int i = 0; i < l; i++) { a += tolower(b[i]); }}int main() { int n, m; while (cin >> n >> m && n != 0) { set<string> contacts, senders; string name; string ins; int len; for (int i = 0; i < n; ++i) { cin >> name; ins = ""; len = name.length(); to_low(ins, name, len); contacts.insert(ins); } for (int i = 0; i < m; ++i) { cin >> name; ins = ""; len = name.length(); to_low(ins, name, len); senders.insert(ins); } int num = contacts.size(); set<string>::iterator it; for (it = senders.begin(); it != senders.end(); ++it) { if (contacts.find(*it) != contacts.end()) { contacts.erase((*it)); } } cout << contacts.size() << endl; } return 0;}
0 0
- Sicily 1194. Message Flood
- sicily--1194. Message Flood
- Sicily 1194. Message Flood
- [sicily]1194. Message Flood
- sicily 1194. Message Flood
- sicily-1194. Message Flood
- [sicily online]1194. Message Flood
- Sicily 1194 Message Flood
- sicily message flood
- Sicily 1194 Message Flood
- Sicily 1938. Message Flood
- Sicily Message Flood
- 1194. Message Flood
- 1194. Message Flood
- 1194. Message Flood
- 1194. Message Flood
- sicily Message Flood STL中set和map的应用
- Message Flood
- ISP简介(ISP--Interface Segregation Principle)接口隔离原则
- iOS开发UI篇—手写控件,frame,center和bounds属性
- 目标管理是项目管理的核心思想之
- 不要垃圾时间
- MySQL基本语法命令
- Sicily 1194. Message Flood
- ant文件筛选
- Github
- Android Studio开发基础之启动Service,并通过从Activity向Service传递数据
- bash shell函数的定义及变量的简单说明
- 最近在用codeigniter 备注下数据库操作方法
- 尝试使用Volley
- html canvas 截图
- 免费生成MP3外链