题目链接:poj 2778 DNA Sequence
题目大意:给定一些含有疾病的DNA序列,现在给定DNA长度,问有多少种不同的DNA序列是健康的。
解题思路:对DNA片段建立AC自动机,因为最多10个串,每个串最长为10,所以最多可能有100个节点,在长度为n时
以每个节点终止的健康字符串个数形成一个状态集,通过AC自动机形成的边可以推导出n+1的状态集,走到单词节点是
...
分类:
其他好文 时间:
2014-11-09 01:10:37
阅读次数:
265
Given a string and a positive integer d. Some characters may be repeated in the given string. Rearrange characters of the given string such that the s...
分类:
其他好文 时间:
2014-11-08 16:27:57
阅读次数:
186
Some DNA sequences exist in circular forms as in the following figure, which shows a circular sequence ``CGAGTCAGCT", that is, the last symbol ``T" in...
分类:
其他好文 时间:
2014-11-06 10:46:48
阅读次数:
174
这题比较简单,重点应该在如何减少循环次数。package practice;import java.io.BufferedInputStream;import java.util.Map;import java.util.Scanner;import java.util.TreeMap;/** * ...
分类:
编程语言 时间:
2014-11-05 21:19:44
阅读次数:
193
Timer的官方描述是:A facility for threads to schedule tasks for future execution in a background thread.
Tasks may be scheduled for one-time execution, or for repeated execution at regular intervals.
意思就是...
分类:
其他好文 时间:
2014-11-01 17:52:47
阅读次数:
169
As a doll master, Alice owns a wide range of dolls, and each of them has a number tip on it's back, the tip can be treated as a positive integer. (the number can be repeated). One day,
Alice hears t...
分类:
其他好文 时间:
2014-11-01 06:19:48
阅读次数:
244
poj 4086:DNA排序
题目
描述
现在有一些长度相等的DNA串(只由ACGT四个字母组成),请将它们按照逆序对的数量多少排序。
逆序对指的是字符串A中的两个字符A[i]、A[j],具有i A[j] 的性质。如字符串”ATCG“中,T和C是一个逆序对,T和G是另一个逆序对,这个字符串的逆序对数为2。
输入
第1行:两个整数n和m,n(0
第2至m+1行...
分类:
编程语言 时间:
2014-10-30 15:17:37
阅读次数:
392
# 题目 > Given an unsorted array of integers, find the length of the longest consecutive elements sequence. > For example, > Given [100, 4, 200, 1, 3, 2], > The longest consecutive elements sequenc...
分类:
其他好文 时间:
2014-10-30 12:01:47
阅读次数:
221
Loops are an important labor-saving device commonly used in Programming Languages. When you need the same code repeated several times, typing it all o...
分类:
其他好文 时间:
2014-10-28 15:23:56
阅读次数:
199
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited numb...
分类:
其他好文 时间:
2014-10-25 11:56:08
阅读次数:
206