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 ...
随机推荐
- 为Linux服务器伪装上Windows系统假象
网络上的计算机很容易被黑客利用工具或其它手段进行扫描,以寻找系统中的漏洞,然后再针对漏洞进行攻击. 通过伪装Linux系统,给黑客设置系统假象,可以加大黑客对系统的分析难度,引诱他们步入歧途,从而进一 ...
- IL2CPP的前世今生
在2014年年中的时候,Unity3D官方博客上却发了一篇"The future of scripting in unity"的文章,引出了IL2CPP的概念,感觉有取代Mono之 ...
- c++ string类型转换为char *类型
string 是c++标准库里面其中一个,封装了对字符串的操作 把string转换为char* 有3中方法: 1.data 如: string str="abc"; char *p ...
- 一个坑:java.sql.ResultSet.getInt==》the column value; if the value is SQL NULL, the value returned is 0
Retrieves the value of the designated column in the current row of this ResultSet object as a String ...
- oschina BI商业智能开源软件
54款 BI商业智能开源软件 MySQL数据仓库解决方案 Infobright OLAP 分析引擎 Apache Kylin 数据处理和分发系统 Apache NiFi OLAP 数据查询引擎 Dru ...
- Android中ListView通过BaseAdapter实现数据的绑定
1. public class ListFiles extends Activity { ListView Listview=null; protected void onCreate(Bundle ...
- zabbix discovery
preface(见面礼): 仅扫tcp端口: netstat -tnlp|egrep -i "$1"
- Nmon 监控 Linux 的系统性能
Nmon(得名于 Nigel 的监控器)是IBM的员工 Nigel Griffiths 为 AIX 和 Linux 系统开发的一款计算机性能系统监控工具.Nmon 可以把操作系统的统计数据展示在屏幕上 ...
- JS-事件处理
1.一个简单的单击事件: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- css样式:列表
css code: /*系统自带的*/ ul li{ list-style-style: disc; } /*自定义图标*/ ul li{ list-style-image: url("im ...