手机那种拼音的智能输入,给出一个字典,里面有一些单词,然后给出一些按键顺序,要求是看按出的字母组合有多少是存在于字典中的,反着来看就容易多了,用一个数组来记录字典里面每个单词的按键便可以与开始的数字代表的按键顺序对应,记录次数便可以出解。

#include<cstdlib>
#include<iostream>
#include<cstring>using namespace std;int hash[1000000];
int main(){char s[200],str[10];int query[5005]; s['a']=s['b']=s['c']=2;s['d']=s['e']=s['f']=3;s['g']=s['h']=s['i']=4;s['j']=s['k']=s['l']=5;s['m']=s['n']=s['o']=6;s['p']=s['q']=s['r']=s['s']=7;s['t']=s['u']=s['v']=8;s['w']=s['x']=s['y']=s['z']=9;int n,m,t;scanf("%d",&t);while(t--){memset(hash,0,sizeof(hash));scanf("%d %d",&n,&m);for(int i=0;i<n;i++)scanf("%d",&query[i]);for(int i=0;i<m;i++){scanf("%s",str);int len=strlen(str);int num=0;for(int i=0;i<len;i++){num=num*10+s[str[i]];}hash[num]++;} for(int i=0;i<n;i++)printf("%d\n",hash[query[i]]);}return 0;
}

Intelligent IME相关推荐

  1. HDU-4287 Intelligent IME

    题目:Intelligent IME Problem Description We all use cell phone today. And we must be familiar with the ...

  2. HDU4287 Intelligent IME(Trie树,map)

    Problem Description We all use cell phone today. And we must be familiar with the intelligent Englis ...

  3. HDU -4287 Intelligent IME 字典树数组模拟

    We all use cell phone today. And we must be familiar with the intelligent English input method on th ...

  4. hdu 4287 sdnu 1119 Intelligent IME

    原题链接: hdu: http://acm.hdu.edu.cn/showproblem.php?pid=4287 sdnu: http://210.44.14.31/problem/show/111 ...

  5. wince 6中硬键盘 输入法解决

    在一个项目中,我遇到了9宫格的键盘问题:wince下的keyboard的构架是native 方式,往 系统发送的是数字按键,要在wince上实现汉字或字母,就需要一个输入法来解析! 好在T9就是这样设 ...

  6. dd实现Linux转移,linux命令-dd {拷贝并替换}

    一 命令解释: dd:用指定大小的块拷贝一个文件,并在拷贝的同时进行指定的转换. 注意:指定数字的地方若以下列字符结尾,则乘以相应的数字:b=512:c=1:k=1024:w=2 参数注释: if=文 ...

  7. 字典树,01字典树,可持续化01字典树(总结+例题)

    目录 字典树 01字典树 字典树例题: power oj 2390: 查单词 HDU 1671 Phone List HDU 1004Let the Balloon Rise HDU 1075 Wha ...

  8. 输入法(IME)实现原理

    缘起 在windows下使用的sougou输入法,除了经常弹出广告,没有什么异常行为,Linux下的中文输入法似乎没那么强大好用了.起初用的是Ibus中的pinyin,后来因为机缘巧合装了yong输入 ...

  9. ipmitool 设置网关_IPMI (Intelligent Platform Management Interface)

    4.3. ipmitool - utility for controlling IPMI-enabled devices 4.3.1. ipmitool 4.3.1.1. ubuntu 确定硬件是否支 ...

  10. The Intelligent Investor Feedback

    The Intelligent Investor Feedback 文章目录 The Intelligent Investor Feedback Intro Take away examples Wh ...

最新文章

  1. 技术图文:进一步完善自动化交易系统 - 03
  2. 风变编程python 知乎_如何看待风变编程的 Python 网课?
  3. BUUCTF(PWN)suctf_2018_stack
  4. echarts指针进度条刻度调整_指针式流量开关
  5. c# 获取方法所在的命名空间 类名 方法名
  6. 【JAVA】虚拟机指令集
  7. 跨域将.net 工程嵌入别的系统页面中发生的js、ajax的拒绝访问的错误
  8. JIT编译对比AOT编译(附图片)
  9. 固态硬盘故障检测_固态硬盘有坏道怎么办(ssd坏块检测工具)
  10. Git的安装步骤、配置(解决Git官网下载速度慢、无法下载,需要授权)
  11. 日常生活小技巧 -- Beyond Compare之PC与UNIX文件比较
  12. 卸载手机模拟大师MobileEmuMaster!!!
  13. python爬虫之糗事百科
  14. vue中的this.nextTick()
  15. Openshift API调用方法
  16. 【黑金ZYNQ7000系列原创视频教程】07.自定义IPmdash;mdash;定制RTC IP实验
  17. 架构师之路 — 部署架构 — Overview
  18. 莆田鞋,是炒鞋经济的噩梦吗?
  19. android 将图片储存到手机内存不足,如何解决手机内照片太多、空间不够用的问题呢?简单一招即可搞定...
  20. 如何运行android sdk sample中的单元测试

热门文章

  1. windows上的左斜杠和linux上的右斜杠的记忆方式
  2. java while 死循环_java while (true) 死循环
  3. Android 高通平台指南针跳变,竖起过程数据不准,Android getRotationMatrix和getOrientation使用记录
  4. html 半框添加,配眼镜全框好还是半框的好?
  5. s3c6410地址映射
  6. 基于等分线性回归方法的城乡收入差距因素比较分析——以广东省为例
  7. 往事如烟 - 老钟14
  8. LSTM(Long Short Term Memory)和RNN(Recurrent)教程收集 (知乎)
  9. @JSONField 注解详解和应用
  10. wps目录怎么加一条_WPS中如何正确插入目录_WPS怎么做目录