当前位置:网站首页>hdu4545 Magic String
hdu4545 Magic String
2022-08-05 10:58:00 【51CTO】
魔法串
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 1846 Accepted Submission(s): 692
Problem Description
Xiao Ming and his good friend Xiao Xi are playing a new game,A string consisting of lowercase letters is given by Konishi,Xiaoming gives another string that is longer than Xiaoxi,Also consists of lowercase letters,If you can make Xiaoming's string and Xiaoxi's become the same through magic conversion,那么他们两个人都会很开心.The magic here means that Xiaoming's string can arbitrarily delete a character,Or change some characters against the character change table.如:
Konishi's string is abba;
Xiao Ming's string is addba;
character change table d b (表示d能转换成b).
Then Xiao Ming can delete the firstd,然后将第二个d转换成bThe string into aabba.
Now please help to judge:Can they make the strings of two people the same through magic transformation??
Input
首先输入T,表示总共有T组测试数据(T <= 40).
接下来共T组数据,Enter the string of Xiaoxi in the first line of each set of data,Enter Xiao Ming's string on the second line(The data guarantees that the string length does not exceed1000,The length of Xiaoming's string is greater than or equal to Xiaoxi's,And all characters are in lowercase).Then enter the alphabet,先输入m,表示有mcharacter transformation(m< = 100),接着mEnter two lowercase letters per line,Indicates that the previous one can become the next one(It doesn't mean the latter can become the former).
Output
对于每组数据,先输出Case数.
If two people's strings could be made the same through magic transformation,输出“happy”,
否则输出“unhappy”.
每组数据占一行,具体输出格式参见样例.
Sample Input
2 abba addba 1 d b a dd 0
Sample Output
Case #1: happy Case #2: unhappy
Recommend
liuyiding | We have carefully selected several similar problems for you
Statistic |
Submit |
Discuss |
Note
classmates asked me.Changed according to her code.
边栏推荐
- 用户考试分数大于单科科目平均分的查询
- A small test of basic grammar, Go lang1.18 introductory refining tutorial, from Bai Ding to Hongru, basic grammar of go lang and the use of variables EP02
- 19.3 restart the Oracle environment
- API 网关简述
- 60行从零开始自己动手写FutureTask是什么体验?
- 什么是 DevOps?看这一篇就够了!
- 结合“xPlus”探讨软件架构的创新与变革
- R语言使用yardstick包的pr_curve函数评估多分类(Multiclass)模型的性能、查看模型在多分类每个分类上的ROC曲线(precision(精准率),R代表的是recall(召回率)
- Chapter 4: In the activiti process, variable transmission and acquisition process variables, setting and acquiring multiple process variables, setting and acquiring local process variables "recommende
- 【MySQL基础】-【数据处理之增删改】
猜你喜欢

用KUSTO查询语句(KQL)在Azure Data Explorer Database上查询LOG实战

Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)

脱光衣服待着就能减肥,当真有这好事?

机器学习——集成学习

使用Windbg过程中两个使用细节分享

The host computer develops C# language: simulates the STC serial port assistant to receive the data sent by the microcontroller

FPGA: Use of the development environment Vivado

结合“xPlus”探讨软件架构的创新与变革

#yyds干货盘点#【愚公系列】2022年08月 Go教学课程 001-Go语言前提简介

【综合类型第 35 篇】程序员的七夕浪漫时刻
随机推荐
Go compilation principle series 6 (type checking)
Opencv算术操作
R语言ggplot2可视化:可视化密度图(Density plot)、可视化多个分组的密度图、数据点分布在箱图中间、添加主标题、副标题、题注信息
poj2287 Tian Ji -- The Horse Racing(2016xynu暑期集训检测 -----C题)
GPU-CUDA-图形渲染分析
abc262-D(dp)
张朝阳对话俞敏洪:一边是手推物理公式,一边是古诗信手拈来
HDD杭州站•ArkUI让开发更灵活
脱光衣服待着就能减肥,当真有这好事?
MySQL 中 auto_increment 自动插入主键值
RT - Thread record (a, RT, RT Thread version - Thread Studio development environment and cooperate CubeMX quick-and-dirty)
机器学习——逻辑回归
hdu4545 魔法串
【AGC】增长服务1-远程配置示例
如何用Golang来手写一个Blog - Milu.blog 开发总结
trie树模板
gradle尚硅谷笔记
012_SSS_ Improving Diffusion Model Efficiency Through Patching
What are the standards for electrical engineering
字节一面:TCP 和 UDP 可以使用同一个端口吗?