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 ...
随机推荐
- 《通过脚本查看哪些ip被占用》shell笔记
改脚本查看哪些ip被占用. #!/bin/bash for i in {1..10} //赋予i变量1-10 do //干什么 ping -c1 -w1 192.168.7.$i && ...
- SecureCRT远程控制ubuntu
如果你拥有两台电脑一台是ubuntu,另一台是笔记本电脑,而你又想在远程控制你的ubuntu,那么SecureCRT就可以用了. 1:首先在你的ubuntu电脑上安装SSH服务 :apt-get i ...
- yum被锁定
使用Yum的时候 提示yum被搜定了 . Another app is currently holding the yum lock; waiting for it to exit... 解决办法 ...
- 防DDOS攻击
/ip firewall filter add chain=forward connection-state=new action=jump jump-target=block-ddos add ch ...
- C#中泛型和单链表
泛型是 2.0 版 C# 语言和公共语言运行库 (CLR) 中的一个新功能.泛型将类型参数的概念引入 .NET Framework,类型参数使得设计如下类和方法成为可能:这些类和方法将一个或多个类 ...
- Operating Cisco Router
Operating Cisco Router consider the hardware on the ends of the serial link, in particular where the ...
- hive中简单介绍分区表
所介绍内容基本上是翻译官方文档,比较肤浅,如有错误,请指正! hive中创建分区表没有什么复杂的分区类型(范围分区.列表分区.hash分区.混合分区等).分区列也不是表中的一个实际的字段,而是一个或者 ...
- oracle-11g-配置dataguard
1.环境信息:系统:oracle-linux 5.7 数据库版本:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit P ...
- 虚拟机Linux下找不到/dev/cdrom
问题描述: 笔者欲更新一下VMwareTools,结果发现虚拟机Linux上找不到设备"/dev/cdrom",当然也就不能通过命令"mount /dev/cdrom / ...
- 【Ajax】脑补一下 ajax 的options
问题是因为粉红色部分引起的 ,想搞明白 put delete 的应用场景,发现ajax的一些属性也没有完全用过. 参数名 类型 描述 url String (默认: 当前页地址) 发送请求的地址. t ...