hdu4545 魔法串
来源:互联网 发布:龙卷风翻墙软件下载 编辑:程序博客网 时间:2024/04/30 10:27
没有使用LCS,画蛇添足了一步导致找了一晚上错误,难道我的RP又欠费了?
#include<iostream>#include<cstring>#include<cstdio>using namespace std;int main(){char s1[1005],s2[1005];bool map[30][30];int t,m;int len1,len2;char t1[3],t2[3];int i,j,icase=1;scanf("%d",&t);while(icase<=t){memset(map,0,sizeof(map));scanf("%s%s",s1,s2);len1=strlen(s1);len2=strlen(s2);scanf("%d",&m);while(m--){scanf("%s%s",t1,t2);map[t1[0]-'a'][t2[0]-'a']=1; //这是hash?刚学会用}i=0;j=0;while(i<len1&&j<len2){if(s1[i]==s2[j]){i++;j++;continue;}else{if(map[s2[j]-'a'][s1[i]-'a']){i++;j++;continue;}}j++;}if(i==len1) printf("Case #%d: happy\n",icase++);else printf("Case #%d: unhappy\n",icase++);}return 0;}
- hdu4545(魔法串)
- HDU4545:魔法串
- hdu4545 魔法串
- HDU4545:魔法串
- hdu4545魔法串
- hdu4545 魔法串
- hdu4545魔法串
- hdu4545魔法串
- 魔法串(hdu4545(LCS|贪心)
- hdu4545——魔法串
- HDU4545 魔法串(DP)
- HDU4545 魔法串 字符串处理
- HDU4545
- HDU4545
- HDU4545+LCS
- 魔法串
- HDU4545+计算日期
- hdu 4545 魔法串
- Android入门进阶教程(18)- Looper、MessageQueue、Handler 与消息循环
- PostgreSQL
- Android入门进阶教程(19)-PowerManager 与电源管理
- 非常好的国外技术网站
- HDU ACM 1003 Max Sum(简单DP)
- hdu4545 魔法串
- Fedora 14 下关于ns-allinone-2.34中的的xgraph软件包的安装问题
- 一个程序员应该知道东西
- LightOJ 1418 - Trees on My Island (Pick`s theorem)
- 多通道语音合成
- .net中如何在服务器端获取客户端的html标签控件。
- KeServiceDescriptorTable 与 KeServiceDescriptorTableShadow
- 淘宝移动设备测试框架TMTS
- WSGI Webob Routes 实例