HDU 2895 编辑距离】的更多相关文章

#include<stdio.h> #include<iostream> #include<string.h> #include<algorithm> using namespace std; ],str2[]; ]; int main(){ while(scanf("%s",str1)!=EOF){ getchar(); memset(str2,,sizeof(str2)); memset(vis,false,sizeof(vis));…
DESCRIPTION:大意是给你两个字符串.编辑距离只有add和delete会产生.所以.编辑距离最短一定是两个字符串的长度差.然后...呵呵呵呵.... 猜题意就可以了...但是...我觉得这个题很不专业...题面上给的是删除时不输出字符...raner...还是要输出...还有就是...如果恰好当前对应的两个位置刚好相同..还是要modify...逗我玩呢.... 总而言之..已无力吐槽... 附代码: #include<stdio.h>#include<string.h>#…
Robberies Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24462    Accepted Submission(s): 9037 Problem Description The aspiring Roy the Robber has seen a lot of American movies, and knows that…
http://acm.hdu.edu.cn/showproblem.php?pid=4323 题意: 给出n个串和m次询问,每个询问给出一个串和改变次数上限,在不超过这个上限的情况下,n个串中有多少个串可以转化为询问中给的串. 思路: 明显的编辑距离DP,直接暴力过了,网上有用bk树的,可惜我不会. #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n, m; ]…
Magic Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1867    Accepted Submission(s): 763 Problem Description There are many magic numbers whose lengths are less than 10. Given some queri…
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, counterclockwise in a circle, in label 1,2,3...n. The firs…
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029. 1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092.1093. 1094.1095.1096.1097.1098.1106.1108.1157.116…
为迎接9月14号hdu命题的长春网络赛 ACM弱校的弱菜,苦逼的在机房(感谢有你)呻吟几声: 1.对于本次网络赛,本校一共6名正式队员,训练靠的是完全的自主学习意识 2.对于网络赛的群殴模式,想竞争现场赛名额,只有泪奔%>_<% 3.至于带队教练的请师兄帮帮忙,如果可以的活,他们能在训练过程中指导,岂不更好,个人对此表示不乐观 虽然形式很不乐观,但我们还是努力着,尽人事,然后…… 至于最终结果拭目以待吧 o(╯□╰)o 杭电上的题目 4267 A Simple Problem with Int…
Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7194    Accepted Submission(s): 3345 Problem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了.显然,作为多年拼搏的商人,XHD不会坐以待毙的.  一天,当他正在苦思冥想解困良策的…
Given two strings S and T, determine if they are both one edit distance apart. 这道题是之前那道Edit Distance的拓展,然而这道题并没有那道题难,这道题只让我们判断两个字符串的编辑距离是否为1,那么我们只需分下列三种情况来考虑就行了: 1. 两个字符串的长度之差大于1,那么直接返回False 2. 两个字符串的长度之差等于1,那么长的那个字符串去掉一个字符,剩下的应该和短的字符串相同 3. 两个字符串的长度之…