HDU 4287 Intelligent IME
来源:互联网 发布:ar9565 linux 编辑:程序博客网 时间:2024/06/06 00:43
题意:每个数有对应的字母
2 : a, b, c
3 : d, e,f
4 : g, h, i
5 : j, k,l
6 : m, n, o
7 : p, q, r, s
8 : t, u,v
9 : w, x, y, z
给出一数字和单词 问该数字能组成下列单词中的多少个?
#include <stdio.h>
using namespace std;
int a[1000000];
int le[126];
int main()
{
int T, n, m,qt[5005];
chars[10];
le['a'] =le['b'] = le['c'] = 2;
le['d'] =le['e'] = le['f'] = 3;
le['i'] =le['h'] = le['g'] = 4;
le['j'] =le['k'] = le['l'] = 5;
le['o'] =le['n'] = le['m'] = 6;
le['p'] =le['q'] = le['r'] = le['s'] = 7;
le['v'] =le['u'] = le['t'] = 8;
le['w'] =le['x'] = le['y'] = le['z'] = 9;
scanf("%d",&T);
while(T--)
{
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++)
scanf("%d", &qt[i]);
memset(a, 0, sizeof(a));
for (int i = 0; i < m; i++)
{
scanf("%s", s);
int L = strlen(s), ans = 0;
for (int i = 0; i < L; i++)
ans = 10*ans + le[s[i]];
a[ans]++;
}
for (int i = 0; i < n; i++)
printf("%d\n", a[qt[i]]);
}
return0;
}
2 : a, b, c
3 : d, e,f
4 : g, h, i
5 : j, k,l
6 : m, n, o
7 : p, q, r, s
8 : t, u,v
9 : w, x, y, z
给出一数字和单词 问该数字能组成下列单词中的多少个?
#include <stdio.h>
using namespace std;
int a[1000000];
int le[126];
int main()
{
}
- HDU 4287 Intelligent IME
- hdu 4287 Intelligent IME
- HDU-4287-Intelligent IME
- HDU 4287 Intelligent IME
- hdu 4287 Intelligent IME
- Intelligent IME hdu 4287
- HDU 4287 Intelligent IME
- HDU 4287 Intelligent IME
- HDU 4287 Intelligent IME
- hdu-4287 Intelligent IME
- hdu 4287 Intelligent IME
- HDU 4287 - Intelligent IME
- HDU 4287 Intelligent IME
- HDU 4287 Intelligent IME
- hdu 4287 Intelligent IME
- hdu 4287 Intelligent IME
- hdu-4287 Intelligent IME
- hdu 4287 Intelligent IME
- 如何彻底卸载虚拟机
- poj 1062 昂贵的聘礼(spfa)
- poj 1274 The Perfect Stall(二分…
- poj 1847 Tram(floyd)
- HDU 4280 Island Transport(网络…
- HDU 4287 Intelligent IME
- HDU 4279 Number
- 使用 su 命令临时切换用户身份
- HDU 4289 Control(网络流)
- HDU 4292 Food(网络流)
- adb网络调试
- STL常用算法
- poj 3216 Repairing&nbs…
- 如何在自己电脑上搭建一个无线网络