Intelligent IME(HDU-4287)

keil指定变量存储在外部SRAM 本文介绍在keil工程中如何将程序中的变量定义在外部SRAM,包括sct分散加载文件的配置和启动文件的设置。 阅读详情
Problem Description
  We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific, the number buttons may correspond to some English letters respectively, as shown below:
  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
  When we want to input the word “wing”, we press the button 9, 4, 6, 4, then the input method will choose from an embedded dictionary, all words matching the input number sequence, such as “wing”, “whoi”, “zhog”. Here comes our question, given a dictionary, how many words in it match some input number sequences?
 

Input
  First is an integer T, indicating the number of test cases. Then T block follows, each of which is formatted like this:
  Two integer N (1 <= N <= 5000), M (1 <= M <= 5000), indicating the number of input number sequences and the number of words in the dictionary, respectively. Then comes N lines, each line contains a number sequence, consisting of no more than 6 digits. Then comes M lines, each line contains a letter string, consisting of no more than 6 lower letters. It is guaranteed that there are neither duplicated number sequences nor duplicated words.
 

Output
  For each input block, output N integers, indicating how many words in the dictionary match the corresponding number sequence, each integer per line.
 

Sample Input
1 3 5 46 64448 74 go in night might gn
 

Sample Output
3 2 0
 
代码如下:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string letter="22233344455566677778889999";
    int n,m,t;
    map<string,int>a;
    vector<string>name;
    cin>>t;
    while(t--)
    {
        cin>>n>>m;
        for(int i=0;i<n;i++)
        {
            string z;
            cin>>z;
            name.push_back(z);
        }
        for(int i=0;i<m;i++)
        {
            string z;
            cin>>z;
            for(int j=0;z[j]!='\0';j++)
                z[j]=letter[z[j]-'a'];
            a[z]++;
        }
        for(int i=0;i<n;i++)
            cout<<a[name[i]]<<endl;
        a.clear();
        name.clear();
    }
    return 0;
}



YOLOv9分割训练自己数据和推理训练好模型,并教你使用Labelme工具标注数据(附YOLOv9分割模型结构图),全网最详细教程 YOLOv9 通过研究数据传输时的信息丢失问题,提出了可编程梯度信息(PGI)和通用高效层聚合网络(GELAN)架构,提高了参数利用率和模型性能。与 SOTA 方法相比,GELAN 仅使用传统卷积算子即可实现更好的参数利用率。PGI 适用于从轻型到大型的各种模型,使从头开始训练的模型能够获得更好的结果。YOLOv9 被评价为新的 SOTA 实时目标检测器。接下来本文手把手教你训练自己分割数据集和推理训练好的分割模型。 阅读详情

相关推荐

饥荒Mod 开发(二):Mod目录结构

饥荒中的每个Mod 都有一些固定的目录结构,各个目录的放着不同类型的文件。动画,图片,源代码等。我们最好是遵守Mod 开发中的各个目录结构,我用的是WeGame 安装的饥荒游戏,Mod 目录如下,这个目录下保存所有订阅的Mod。

小乖写代码 4638

2012 ACM/ICPC Asia Regional Tianjin Online hdu 4287 map和char[]的合作应用

Intelligent IME Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 386    Accepted Submission(s): 203 Problem Description   We all use cel

hnust_xiehonghao的专栏 1193

IoT 平台架构全景图:从设备到 AI 的完整技术体系深度解析

随着物联网设备规模进入百万级时代,IoT 平台架构已经从简单的设备接入系统演变为完整的数据平台。本文从系统架构师视角,深度解析 IoT 平台的完整技术体系,包括设备接入、MQTT 通信、消息流平台、数据平台与 AI 决策系统,并结合主流云平台实践,构建从设备到 AI 的完整 AIoT 架构认知。

moton2017的博客 860

2012 ACM/ICPC Asia Regional Tianjin Online

A very hard mathematic problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1455 Accepted Submission(s): 440 Problem Description   Haor

uva code 3095

Brim与ZUI协同安装指南:从下载到流量分析实战

本文提供Brim与ZUI协同安装与实战指南,详细讲解从下载、环境变量配置到流量分析的全流程。通过将PCAP文件转换为ZNG格式,结合直观的Zed查询语言,这套组合能极大提升大型网络数据包的分析效率,是网络安全与运维人员进行高效流量分析的利器。

metal的博客 462

西门子PLC1200 1214C DC/DC/DC 驱动步进电机

控制电机旋转的指令在“指令”中的“工艺”下的“Motion Control”(若出现程序块无法调用情况,则看备注3的第4条),本篇只介绍常用指令(若想学习详细与更多指令,请参考指令手册)。

2301_79553921的博客 1万+

2012 ACM/ICPC Asia Regional Tianjin Online ——A very hard mathematic problem解题报告

http://acm.hdu.edu.cn/showproblem.php?pid=4282 裸搜索题,因为2^31开三次方后大概是1000多,所以搜索的规模很小,枚举Z枚举Y看X是否满足条件即可,判断X是否满足条件可以二分。

sunny606的专栏 1470

风光储并网对电力系统稳定性影响的仿真研究

本文研究了风光储并网对电力系统稳定性的影响,基于MATLAB/Simulink平台搭建了IEEE 9节点测试系统的风光储并网模型。研究对比了光储、风储和风光储三种并网配置在多种干扰下的稳定性表现。结果表明:光储系统对频率变化最敏感,风储系统具有更强的功率波动适应能力,而风光储联合系统通过互补效应展现出最佳综合稳定性。储能系统在所有配置中均显著改善了频率恢复性能,验证了其在新能源并网中的关键支撑作用。研究为高比例可再生能源电力系统的稳定运行提供了仿真依据和技术参考。

huanghm88的专栏 156

2012 ACM/ICPC Asia Regional Tianjin Online [赛后解题报告]

请原谅我是个弱逼。 Pro.ID Title 4278 Faulty Odometer 4279 Number 4280 Island Transport 4281 Judges' response 4282 A very hard mathematic problem 4283 You Are the O

tclh123 - 悲剧的泳裤王子 1074

使用Simulink对氢燃料电池与锂电池的混合储能系统进行建模

本文介绍了基于Simulink的氢燃料电池与锂电池混合储能系统建模与协同控制方法。系统通过氢燃料电池提供稳定能源,锂电池实现快速响应,结合DC-DC变换器和负载管理器实现动态调控。详细阐述了从模型创建、关键模块配置到控制器设计的完整流程,重点说明了功率分配算法和充放电控制策略的实现。通过仿真分析验证了系统在不同负载条件下的性能表现,包括响应速度、工作效率和稳定性等指标。该方案为新能源混合储能系统的设计与优化提供了实用指导,有助于提升系统可靠性和延长电池寿命。

amy_mhd的博客 315

化工设备设计软件:PVELITE二次开发_(12).数据导入导出与兼容性

在数据导入之前,需要定义数据在PVELITE中的结构。可以通过编程接口定义字段名称和数据类型。# 导入必要的库 import pvelite # 创建PVELITE实例 pve = pvelite . PVELITE() # 定义CSV数据结构 csv_structure = {

kkchenjj的博客 1216

HDOJ---4287 Intelligent IME[字典树---水题]

Intelligent IME Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 145    Accepted Submission(s): 80 Problem Description   We all use cell phone...

weixin_34348805的博客 179

【PCIe硬件】PCIe引脚PRSNT与热插拔

热插拔的基本目的是要让PCIe设备按照规定的顺序、原则,从系统中移除或插入到系统中来,并能正常的工作,且不影响系统的正常运行。事实上,PCIe“热插拔”的关键目的就是为前面面所提到的系统RAS服务的,是提升系统RAS能力的非常重要的手段!注意,这里有两个相关概念,前面我们讲的热插拔,其实是广义的“热插拔”。这里的Hot-Plug,为了方便,我们叫做PCIe热插拔,也就是我们现在及后面将要讨论的内容。

smartvxworks的博客 2813

HDU-4287-Intelligent IME

HDU-4287-Intelligent IME http://acm.hdu.edu.cn/showproblem.php?pid=4287 开始用字典树+深搜,超时。。。。后来发现题目最多6位数,可将字符串转化成对应的数字,然后hash即可 TLE的代码 #include #include #include #include using namespace std;

菜鸟的程序人生 2523

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

HDU 4287 Intelligent IME

http://acm.hdu.edu.cn/showproblem.php?pid=4287 MAP 无压力. View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <map> 4 #include <string.h> 5 using n...

dicuanjiang7084的博客 99

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

【STL】 hdu4287 Intelligent IME

Intelligent IME 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4287 题意:对应于手机九宫格按键,给你n个数字串和m个字母串,问对于每个数字串,在m个字母串中有几个字母串是由这个按这个数字串的按键生成的。 题解:把字母哈希到手机数字按键上,对于每个字母串转化为对应的数字串,再通过map查找之前是否有这个字母串,最后计数输出。 代

Ted's 游乐园 2686

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

hdu 4287 Intelligent IME

题目大意:手机键盘中与数字2相对应的字母有a,b,c;3相对应的字母有d,e,f。给出一些数字串如34,和一些小写字母串。求小写字母对应的数字串出现的次数。字符串abc对应的数字串是111,dh对应的数字串是34。则小写字符串中111出现一次,34出现一次。 题解:可以直接字典树,或者暴力做,毕竟数据比较弱。。。一开始理解错题意,便把数字按照所有转化一遍,再去用字典树,结果超时。。。直接将数

Ezereal的博客 672

HDU 4287 Intelligent IME 水题

HDU 4287 Intelligent IME 水题 主要其他博客写的太麻烦,所以决定写一写这个题的题解: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4287 题意: 第一行:T:几组测试样例 第二行:n,m 接下来n行每行一个数字 接下来m行每行一个字符串(长度不超过6) 要求: 按照手机九宫格字母和数字的...

winnermoce的博客 195

HDU 4287 Intelligent IME hash

Intelligent IME题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4287DescriptionWe all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be spe...

sortmin的博客 311

HDU 4287 Intelligent IME [模拟]

这题就很傻逼,因为按出来的字母 对应 唯一的 数字按键。 代码: #include #include #include #include #include #include #include #include using namespace std; inline int Rint() { int x; scanf("%d", &x); return x; } inline int m

tclh123 - 悲剧的泳裤王子 1070

HDU-4287 Intelligent IME

题目:Intelligent IME Problem Description   We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific, the number button...

码农-Vax天道的时间宝藏 367

HDU - 4287 Intelligent IME 字典树

HDU - 4287 Intelligent IME Time Limit: 1000MS   Memory Limit: 32768KB   64bit IO Format: %I64d & %I64u Submit Status Description   We all use cell phone today. And we

qq_18661257的专栏 1586

HDU - 4287 Intelligent IME

传送门 问题描述: We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific, the number buttons may correspond to some English letters respectively, as shown below:   2 : a, b, c 3 : d, e,

m0_51727949的博客 197

Intelligent IME hdu 4287

字典树,练习模版。 #include #include using namespace std; struct Trie { int sum; Trie *next[8]; Trie() { int i; for(i=0;i<8;i++) next[i]=NULL; sum=0; } }*root=new Trie,*temp; void DealTrie(cha

1030

hdu 4287 Intelligent IME

点击打开链接hdu 4287 解题思路: 1思路:暴力+map 2分析:建立一个char 数组用来存储每一个字母对应的数值。然后求出每一个单词的序列,然后利用map查找。最后输出 3注意:如果是采取每一次都去搜索那么肯定TLE 代码: #include &lt;algorithm&gt; #include &lt;iostream&gt; #include &lt;cstr...

我是传奇 141

hdu-4287 Intelligent IME

http://acm.hdu.edu.cn/showproblem.php?pid=4287 题目蛮简单的,开始没想到,

有一种力量叫乐观 678
上一篇: sort(HDU-3293)
下一篇: Windows Message Queue(HDU-1509)
绿蚁.r
博客等级 码龄10年 4粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值