万恶之源 翻译 题意就是给出N个DNA序列,要求出一个包含这n个序列的最短序列是多长 这是一道搜索题,为什么呢?从样例可以感受到,我们应该从左往右"扫描",从n个DNA序列中取出某个特定的字母,直到n个序列都被取空.题目便是要求这个"取出"次数的最小值.而我们每次都选择A,T,C,G中的其中一个取出,这样便形成了一个不断以4个叶子延申的搜索树了.(请自行脑补)(当然实际必须要剪掉) IDA* 这题很适合用IDA*,随着深度不断增加,第一个访问到的答案一定是最优解.而…
DNA sequence Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4217    Accepted Submission(s): 2020 Problem Description The twenty-first century is a biology-technology developing century. We kno…
题目大意:有n个DNA序列,构造一个新的序列,使得这n个DNA序列都是它的子序列,然后输出最小长度. 题解:第一次接触IDA*算法,感觉~~好暴力!!思路:维护一个数组pos[i],表示第i个串该匹配第pos[i]个元素.一共有四种可能,A,C,G,T,依次枚举,如果说A和n个串中的第j个串匹配,就直接就pos[j]++就行了,然后进入下一层,如果说最终没有成功构造,还有进行回溯,所以每一层我们都要维护一个数组来记录pos的值方便回溯. 具体实现和注释都在code中了,应该不难理解. code:…
题目链接: https://vjudge.net/contest/254151#problem/G AC代码: #include<iostream> #include<cstring> #include<string> #include<algorithm> using namespace std; # define inf 0x3f3f3f3f # define maxn 10 int len[maxn]; char a[maxn][maxn]; int…
DNA sequence Time Limit : 15000/5000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 15   Accepted Submission(s) : 7 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description The twenty-first century…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1560 DNA sequence Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2999    Accepted Submission(s): 1462 Problem Description The twenty-first centu…
DNA sequence Time Limit : 15000/5000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 15   Accepted Submission(s) : 7 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description The twenty-first century…
DNA sequence Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3503    Accepted Submission(s): 1681 Problem Description The twenty-first century is a biology-technology developing century. We kn…
http://acm.hdu.edu.cn/showproblem.php?pid=1560 DNA sequence Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 732    Accepted Submission(s): 356 Problem Description The twenty-first century is a…
HDU 1560 DNA sequence(DNA序列) Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)   Problem Description - 题目描述 The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. Th…
DNA sequence 直接中文了 题目描述 21世纪是生物科技飞速发展的时代.我们都知道基因是由DNA组成的,而DNA的基本组成单位是A,C,G,T.在现代生物分子计算中,如何找到DNA之间的最长公共子序列是一个基础性问题. 但是我们的问题不是那么简单:现在我们给定了数个DNA序列,请你构造出一个最短的DNA序列,使得所有我们给定的DNA序列都是它的子序列. 例如,给定"ACGT","ATGC","CGTT","CAGT"…
DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9899   Accepted: 3717 Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For exa…
DNA Sequence 题意:DNA的序列由ACTG四个字母组成,如今给定m个不可行的序列.问随机构成的长度为n的序列中.有多少种序列是可行的(仅仅要包括一个不可行序列便不可行).个数非常大.对100000取模. 思路:推荐一个博客,讲的很清楚. 这样的题目.n非常大,首先想到的就是用矩阵来优化.那么怎样构造转移方程呢:首先建立一棵Trie,然后依照AC自己主动机的方式构造fail指针,然后会发现.当一个状态分别加入ACTG之后,会得到还有一个状态. (详细解释见代码) 代码: /* ID:…
DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11860   Accepted: 4527 Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For ex…
DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11860   Accepted: 4527 Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For ex…
DNA Sequence   Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment ATC then it may mean that the a…
DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19991   Accepted: 7603 Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For ex…
DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9889   Accepted: 3712 Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For exa…
题目链接:https://vjudge.net/problem/POJ-2778 DNA Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18479   Accepted: 7112 Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to…
DNA Sequence Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment ATC then it may mean that the ani…
Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment ATC then it may mean that the animal may have…
It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment ATC then it may mean that the animal may have a genetic di…
Q - Play With Sequence HDU - 3971 这个题目是一个线段树,比较特别的线段树,就是c询问一定次数之后重新排序建树来优化减低复杂度. 第一次碰到这种题目有点迷. 这个题目写还是很好写的,就是重新排序建树的位置不太好找. 不过可以知道的是,这是更新花费时间和排序花费时间的一个平衡,这个是一个二次函数,这个二次函数的最低点可以自己测出来. 现在可能有点听不懂,写完代码就很好理解了, 我测的每隔2000次C的操作就重新建树排序是最优的. 800,1000,2200,3000…
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1560 BFS题解:http://www.cnblogs.com/crazyapple/p/3218107.html 构造一个串,使得它包含所有的给定DNA序列,并且要求长度最短.采用dfs策略,对于每个串定义1个指针,当全部指针为串尾时判断构造的长度,由于状态空间过大,但是又存在冗余搜索,可以用迭代加深将状态减少.最长待构造长度 + 当前长度 < 迭代的最大深度则直接return,大大减少了状态数.…
题意:给定一些DNA序列,求一个最短序列能够包含所有序列. 思路:记录第i个序列已经被匹配的长度p[i],以及第i序列的原始长度len[i].则有两个剪枝: 剪枝1:直接取最长待匹配长度.1900ms int h = 0; for(int i = 0; i < n; ++i) { h = max(len[i] - p[i], h); //最大待匹配长度 } 剪枝二:统计每个序列里面四种序列值,并求得每种序列值的最长长度.将四种序列值加起来就是最长待匹配长度.180ms int cal() { /…
The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T(thymine). Finding the longest common subsequence betw…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1560 题目大意:给出n个字符串,让你找一个字符串使得这n个字符串都是它的子串,求最小长度. 解题思路:迭代加深搜索,迭代加深搜索,就是限制DFS的深度deep,若搜不到答案,则加深深度,重新搜索,这样就防止了随着深度不断加深而进行的盲目搜索.这题的迭代深度deep以这n个子串中的最长长度作为起点,不断+1,知道找到符合条件的字符串.每次DFS的时候,都要判断一下,当前的深度+最少还有加深的深度是否大…
L3-015. 球队“食物链” 某国的足球联赛中有N支参赛球队,编号从1至N.联赛采用主客场双循环赛制,参赛球队两两之间在双方主场各赛一场. 联赛战罢,结果已经尘埃落定.此时,联赛主席突发奇想,希望从中找出一条包含所有球队的“食物链”,来说明联赛的精彩程度.“食物链”为一个1至N的排列{ T1 T2 ... TN },满足:球队T1战胜过球队T2,球队T2战胜过球队T3,……,球队T(N-1)战胜过球队TN,球队TN战胜过球队T1.[像是构成了一个遍历了所有节点一次的回路或者可以形成了一个环:那…
题目: The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T(thymine). Finding the longest common subsequence…
Problem Description The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T(thymine). Finding the longest com…