hdoj-1251-统计难题【map】
统计难题
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)
Total Submission(s): 23029 Accepted Submission(s): 9640
注意:本题仅仅有一组測试数据,处理到文件结束.
banana
band
bee
absolute
acm ba
b
band
abc
2
3
1
0
pid=1075" target="_blank">
1075
pid=1247" target="_blank">
1247
#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<map>
using namespace std;
map<string,int> u;
int main(){ char s1[20],s2[20],s3[20];
while(gets(s1)){
int len=strlen(s1);
if(len==0) break;
for(int i=0;i<len;++i){
s2[i]=s1[i];
s2[i+1]='\0';
u[s2]++;
}
}
while(gets(s3)){
// printf("##%s\n",s3);
printf("%d\n",u[s3]);
//printf("null\n");
}
return 0;
}
hdoj-1251-统计难题【map】的更多相关文章
- hdoj 1251 统计难题 【字典树】
统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others) Total Subm ...
- hdoj 1251 统计难题(字典树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251 思路分析:该问题要求求出以某个字符串为前缀的单词数目,通过使用字典树,在字典树中添加count记 ...
- hdu 1251 统计难题 (map水过)
# include <stdio.h> # include <algorithm> # include <string> # include <map> ...
- hdu 1251 统计难题(字典树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251 统计难题 Time Limit: 4000/2000 MS (Java/Others) M ...
- hduoj 1251 统计难题
http://acm.hdu.edu.cn/showproblem.php?pid=1251 统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory ...
- HDU 1251 统计难题 (Trie)
pid=1251">统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/ ...
- hdu 1251:统计难题[【trie树】||【map】
<题目链接> 统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131 ...
- HDU 1251 统计难题(Trie模版题)
统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others) Total Subm ...
- hdu 1251 统计难题 (字典树入门题)
/******************************************************* 题目: 统计难题 (hdu 1251) 链接: http://acm.hdu.edu. ...
- hdoj 1251 字典树||map
统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submi ...
随机推荐
- 7407 74LS07 74LV07 74LVC07
SN7407 Convert TTL Voltage Levels to MOS LevelsHigh Sink-Current CapabilityInput Clamping Diodes Sim ...
- axure8.1可用授权码
Licensee: University of Science and Technology of China (CLASSROOM)Key: DTXRAnPn1P65Rt0xB4eTQ+4bF5IU ...
- 一个小动画,颠覆你的CSS世界观
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 用Parallel.For()和Parallel.For<TLocal>()方法实现并行运行迭代
Parallel类是.NET 4中新增的抽象线程类.如果你开发用的是VS2008或更低版本,那么就直接关闭吧,下面两个示例用了匿名委托,如果不知道匿名委托的语法,那么先去简单了解一下,不然很难理解示例 ...
- redhat/centos使用service控制启动与关闭
原文地址: http://guodong810.blog.51cto.com/4046313/1285353 有时,我们自己安装了某个软件时,想让对这个服务更加容易的控制,在redhat/centos ...
- [翻译] 5点建议,让iOS程序跑得更快
[文章原地址]http://mobile.tutsplus.com/tutorials/iphone/ios-quick-tip-5-tips-to-increase-app-performanc ...
- Android之从Browser中打开本地的应用程序&微信检测是否有对应app
在对应的应用程序的AndroidManifest.xml中配置: <activity android:name=".ui.TabHostActivity" android:w ...
- 安全开发 | 如何让Django框架中的CSRF_Token的值每次请求都不一样
前言 用过Django 进行开发的同学都知道,Django框架天然支持对CSRF攻击的防护,因为其内置了一个名为CsrfViewMiddleware的中间件,其基于Cookie方式的防护原理,相比基于 ...
- Search for a Range leetcode java
题目: Given a sorted array of integers, find the starting and ending position of a given target value. ...
- 如何在模板中引用参数类中的一个特定member
C++模板有很多特性需要我们去挖掘,很多新的设计模式也都与模板使用相关,我们知道模板的一个基本特性就是可以根据传入的类型产生新的类型.围绕这个特性,可以衍生出很多的其它特性,比如自动为不同的类生成st ...