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 ...
随机推荐
- WordPress插件制作笔记(一)---First Plugins Demo
1->add_action HOOK简单说明: http://codex.wordpress.org/Plugin_API/Action_Reference (参考网址) //在后台页脚位置加 ...
- NT头 IMAGE_NT_HEADER
typedef struct_IMAGE_NT_HEADERS{ DWORD Signature; // 固定为 0x00004550 “PE00" IMAGE_FILE_HEADER Fi ...
- 『安全工具』Nessus多功能扫描器
0x 00 前言 写这篇博客,证明我还活着…… 0x 01 安装Nessus 直接官网 www.tenable.com/products/nessus/select-your-operating- ...
- [布局]bootstrap基本标签总结2
缩略图 <div class="container"> <div class="row"> <div class="co ...
- 通过button提交表单
通过 input button 而不是input submit提交. <!DOCTYPE html> <html lang="en"> <head&g ...
- XJOI网上同步测试DAY14 T1
思路:线段树维护最短路 #include<cstdio> #include<cmath> #include<iostream> #include<algori ...
- 为什么设计模式在C++社区没有Java社区流行?
我们发现设计模式在Java社区很流行,但是在C++社区却没有那么被关注,甚至有点被排斥,究竟是什么原因造成这个差异的呢? 昨天和同事讨论这个问题,最后得出几点原因: (1)C++内存需要 ...
- COJ 0358 xjr考考你数据结构(根号3)线段树区间修改
xjr考考你数据结构(根号3) 难度级别:C: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 请你编写一个数据结构,完成以下功能: 1)求出第 ...
- HDU_2011——求多项式的前n项和
Problem Description 多项式的描述如下:1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + ...现在请你求出该多项式的前n项的和. Input 输入数据由2行组 ...
- Misha and Changing Handles
Description Misha hacked the Codeforces site. Then he decided to let all the users change their hand ...