题目传送:BestCoder Round #41
A、ZCC loves straight flush
思路:简单题,不过刚开始没看清题,wa了好几次,然后才发现输入不连续也可以,就是说每个同一花色的牌都可以放在一块,不用在意输入顺序,感觉这里题目应该说清楚点好些
AC代码(略挫,比赛时写的都比较乱):
#include
#include
#includ...
分类:
其他好文 时间:
2015-05-17 09:24:52
阅读次数:
159
ZCC loves strings
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)
Total Submission(s): 184 Accepted Submission(s): 70
Problem Description
ZCC has g...
分类:
其他好文 时间:
2015-05-17 00:53:05
阅读次数:
169
题意:题目意思很简单就是有一个由 A C G T 组成的字符串,要求找出字符窜中出现次数不止1次的字串
思路1: 遍历字符串,用hashmap存储字串,判断即可
代码1:
public List findRepeatedDnaSequences(String s) {
List rs = new LinkedList();
Map map = new...
分类:
其他好文 时间:
2015-05-16 16:37:47
阅读次数:
179
DescriptionConsider all the sequences with length (0#include#includeusing namespace std;int dp[45][2];int main(){ int n,k; dp[1][0] = dp[1][1]= ...
分类:
其他好文 时间:
2015-05-10 22:00:04
阅读次数:
164
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4876
题意:给你N,l,k三个数,N代表N个数,从中任选k个数,然后
这k个数组成一个环,可以从这个环中选连续的1-k个数进行异或和
,把所得到的值填充到l的后面,使得有一个数r让l-r之间所有的整
整数都被这些异或和填满,求最大的r,也许表达的不太清楚,其实
就是找一个最大的r,使得给定的...
分类:
其他好文 时间:
2015-05-07 22:13:48
阅读次数:
149
Repeated DNA SequencesAll DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it i...
分类:
编程语言 时间:
2015-05-06 22:51:37
阅读次数:
348
一:leetcode 204 Count Primes
题目:
Description:
Count the number of prime numbers less than a non-negative number, n
分析:此题的算法源码可以参看这里,http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
代码:
cl...
分类:
其他好文 时间:
2015-05-06 15:06:39
阅读次数:
162
题意:给出n种化学物质,其中m对会发生化学反应,每次加入化学物质进去的时候,如果有能够和它发生反应的,危险值就乘以2,问怎样的放入顺序使得危险值最大将这m对会反应的用并查集处理,统计每个连通块里面的元素个数,再将其减去1,加起来,就是2的指数 1 #include 2 #include 3 ...
分类:
其他好文 时间:
2015-05-06 14:45:11
阅读次数:
110
A little girl loves problems on trees very much. Here's one of them.
A tree is an undirected connected graph, not containing cycles. The degree of node x in the tree is the number of nodes y of
t...
分类:
其他好文 时间:
2015-05-05 01:22:29
阅读次数:
183
题目:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful ...
分类:
其他好文 时间:
2015-05-04 08:38:25
阅读次数:
117