hdu 1251 统计难题
来源:互联网 发布:完美root软件 编辑:程序博客网 时间:2024/06/08 03:48
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1251
分析:字典树模板题,也可以用STL中的map(映射)。。。
代码:
///STL map#include<iostream>#include<map>#include<cstdio>#include<cstring>using namespace std;map<string,int> mp;int main(){ char str[12]; while(gets(str)){ int len=strlen(str); if(!len) break; for(int i=len;i>=0;i--){ str[i]='\0'; mp[str]++; } } while(gets(str)) cout<<mp[str]<<endl;}
阅读全文
0 0
- HDU 1251 统计难题
- HDU 1251 统计难题
- hdu 1251 统计难题
- HDU 1251:统计难题
- HDU 1251 统计难题
- Hdu-1251 统计难题
- hdu 1251 统计难题
- hdu 1251 统计难题
- hdu 1251 统计难题
- HDU-1251-统计难题
- HDU 1251 统计难题
- hdu 1251统计难题
- hdu 1251统计难题
- hdu 1251 统计难题
- HDU 1251 统计难题
- hdu 1251统计难题
- HDU 1251 统计难题
- hdu 1251 统计难题
- Android Studio Gradle
- JZOJ 5378. 【NOIP2017提高A组模拟9.19】闷声刷大题(60分)
- 前端~腾讯课堂选项卡部分代码
- maven(ssm)
- 算法学习之动态规划--最长公共子序列
- hdu 1251 统计难题
- AndroidStudio的文件的结构,so文件配置
- opencv3.1.0+contrib模块编译总结
- linux添加开机自启动脚本示例详解
- day3——利用python创立ORM
- 第二周项目三-体验复杂度
- 【PE】通过批处理脚本命令行编译VS工程
- 大话数据结构读书笔记(1)----算法
- ##Access denied for user 'root'@'localhost' (using password: YES)