Sicily 1194. Message Flood
题目地址:1194. Message Flood
思路:
不区分大小写,先全部转化为小写,用stl提供的函数做会很方便。
具体代码如下:
#include <iostream>
#include <set>
#include <string>
using namespace std; int main() {
int n, m;
while (cin >> n && n) {
cin >> m;
set<string> v;
for (int i = ; i < n; i++) {
string temp;
cin >> temp;
for (int j = ; j < temp.size(); j++) { //全部转化为小写
temp[j] = tolower(temp[j]);
}
v.insert(temp);
}
for (int i = ; i < m; i++) {
string temp;
cin >> temp;
for (int j = ; j < temp.size(); j++) {
temp[j] = tolower(temp[j]);
}
if (v.count(temp))
v.erase(temp);
}
cout << v.size() << endl;
} return ;
}
Sicily 1194. Message Flood的更多相关文章
- Message Flood
Message Flood Time Limit: 1500MS Memory limit: 65536K 题目描述 Well, how do you feel about mobile phone? ...
- STL 之map解决 Message Flood(原字典树问题)
Message Flood Time ...
- SDUT1500 Message Flood
以前做过的用的字典树,可是貌似现在再用超内存....求解释... 问了LYN用的map函数做的,又去小小的学了map函数.... http://wenku.baidu.com/view/0b08cec ...
- sdut Message Flood(c++ map)
用字典树没过,学习了一下map; 参考博客:http://blog.csdn.net/zhengnanlee/article/details/8962432 AC代码 #include<iost ...
- Message Flood(map)
http://acm.sdut.edu.cn:8080/vjudge/contest/view.action?cid=203#problem/D 以前用字典树做过 #include <strin ...
- oj1500(Message Flood)字典树
大意:输入几个字符串,然后再输入几个字符串,看第一次输入的字符串有多少没有在后面的字符串中出现(后输入的字符串不一定出现在之前的字符串中) #include <stdio.h> #incl ...
- SDUT 1500-Message Flood(set)
Message Flood Time Limit: 1500ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 Well, how do you feel abo ...
- Eclipse 4.2 failed to start after TEE is installed
--------------- VM Arguments--------------- jvm_args: -Dosgi.requiredJavaVersion=1.6 -Dhelp.lucene ...
- 浅谈原始套接字 SOCK_RAW 的内幕及其应用(port scan, packet sniffer, syn flood, icmp flood)
一.SOCK_RAW 内幕 首先在讲SOCK_RAW 之前,先来看创建socket 的函数: int socket(int domain, int type, int protocol); domai ...
随机推荐
- Collection Views and Building Custom Layouts-备
UICollectionView的结构回顾 首先回顾一下Collection View的构成,我们能看到的有三个部分: Cells Supplementary Views 追加视图 (类似Header ...
- PHP vs Java
http://www.phpddt.com/reprint/php_font-java_end.html http://www.zhihu.com/question/20314377 http://b ...
- CA
http://www.cmca.net/index.php?option=com_content&view=article&id=55&Itemid=16
- Qt编程之右键单击QTreeWidgetItem弹出菜单
其实有这个需求很好理解,就是我有个project manager,上面的TreeWidgetItem都表示一个工程,我需要右键创建新的工程,或者删除.这个在很多普通软件中也见得多.在弹出的菜单中加入相 ...
- 计算新浪Weibo消息长度
此文为计算新浪Weibo的消息长度的方法. 就是 (发言请遵守社区公约,还可以输入119字). var getMessageLength = (function() { var byteLength ...
- HDOJ(HDU) 1587 Flowers(水、、)
Problem Description As you know, Gardon trid hard for his love-letter, and now he's spending too muc ...
- Windows 注册表操作
经常操作注册表,然后得到一份操作注册表函数实现.这里备份下. #ifndef _REGEDIT_H #define _REGEDIT_H int RegRead_S (struct HKEY__*Re ...
- JSP入门:介绍什么是JSP和Servlet(转)
转自:http://developer.51cto.com/art/200907/134506.htm JSP入门:什么是jsp? JSP(Java Server Pages)是由Sun Micros ...
- PHPSTORM实用快捷键
alt + F7 find usages 功能,可以很方便的找到函数在哪里调用了 Ctrl + E 可查看最近打开文件或项目 项目名右键选择"Local History | Show His ...
- [React Testing] JSX error diffs -- expect-jsx library
When writing React component tests, it can be hard to decipher the error diffs of broken tests, sinc ...