SDUT1500 Message Flood
以前做过的用的字典树,可是貌似现在再用超内存。。。。求解释。。。
问了LYN用的map函数做的,又去小小的学了map函数。。。。
http://wenku.baidu.com/view/0b08cece05087632311212ba.html感觉这个写的挺详细的
http://wenku.baidu.com/view/d140cfcca1c7aa00b52acb46.html这个的话挺有意思,帮助理解
题目描述
输入
输出
示例输入
5 3
Inkfish
Henry
Carp
Max
Jericho
Carp
Max
Carp
0
示例输出
3
这个是代码
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std ;
int main()
{
int m ;
while(scanf("%d",&m)&&(m != ))
{
int n ;
cin>>n ;
map<string,int>mp ;
string sh ;
for(int i = ; i <= m ; i++)
{
cin>>sh ;
transform(sh.begin(),sh.end(),sh.begin(),::tolower) ;
mp[sh] = ;
}
for(int j = ; j <= n ; j++)
{
cin>>sh ;
transform(sh.begin(),sh.end(),sh.begin(),::tolower) ;
if(mp[sh])
{
m--;
mp[sh] = ;
}
}
cout<<m<<endl ;
}
return ;
}
SDUT1500 Message Flood的更多相关文章
- Message Flood
Message Flood Time Limit: 1500MS Memory limit: 65536K 题目描述 Well, how do you feel about mobile phone? ...
- Sicily 1194. Message Flood
题目地址:1194. Message Flood 思路: 不区分大小写,先全部转化为小写,用stl提供的函数做会很方便. 具体代码如下: #include <iostream> #incl ...
- STL 之map解决 Message Flood(原字典树问题)
Message Flood Time ...
- 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 ...
随机推荐
- mysql快速上手2
上一篇文章讲的是mysql的基本操作,这一篇会有一点难以理解,本节主要内容mysql视图,存储过程,函数,事务,触发器,以及动态执行sql 视图view 视图是一个虚拟表,其内容由查询定义.同真实的表 ...
- 11.find 查找并复制文件
请把系统上拥有者为ira用户的所有文件,并将其拷贝到/root/findfiles目录中 find /home/ira/ -user ira -exec cp -a {} /root/findfile ...
- 使用 Time Machine 恢复 .ssh等隐藏文件夹
重装MAC系统后,要恢复.ssh等文件夹内容,而其在“Finder”中又是默认隐藏的,这时我们可以先在“Finder”中使用“前往文件夹功能…”进入指定文件夹,然后再进入“Time Machine”进 ...
- 如何在java类中读取Properties配置文件
在com.example包下有一个test.properties文件和测试类PropertyReadTest.java. test.properties 文件内容: author=zeige tea ...
- Noesis.Javascript.dll 引用时报错“找不到指定的模块”
Could not load file or assembly 'Noesis.Javascript.dll' or one of its dependencies. 找不到指定的模块. 通过反编译发 ...
- How to add EDT relation table[AX2012]
setp 1. First create New Edit. setp 2.Create New Table First Table Name is NParentRel then drag and ...
- Infobright高性能数据仓库
1. 概述 Infobright是一款基于独特的专利知识网格技术的列式数据库.Infobright简单易用,快速安装部署,使用中无需复杂操作,能大幅度减少管理工作:在应对50TB甚至更多数据量进行多 ...
- AVG()和to_date()函数的使用
1.一道关于AVG函数和NULL值的面试题 某部门有10个员工,其中9个工资为1000,另一个为NULL,当使用AVG函数取该部门平均工资时,结果应该是多少? A.1000 B.900 我这里把题目再 ...
- linux驱动路径
1. 按键驱动 \drivers\input\keyboard\utu2440_buttons.c 2. LED驱动 \drivers\char\utu2440-led.c 3. DM9000网卡驱动 ...
- .NET操作JSON
http://www.cnblogs.com/txw1958/archive/2012/08/01/csharp-json.html JSON文件读入到内存中就是字符串,.NET操作JSON就是生成与 ...