- 博客(9)
- 收藏
- 关注
原创 HDU5340 回文自动机
题意:判断能否将字符串S分解为3个回文串。思路:利用回文自动机的性质,add完字符ch时,last所对应的节点代表了以ch结尾的最长回文子串,设一个to数组,to[i]表示以第i个字符结尾的最长回文子串节点。第一部分满足的条件显然是:T[to[i]].len==i+1再考虑第三部分,可以利用fail指针,找出所有以最后一个字符结尾的所有回文子串。同样,第二部分也是如此。(此思路...
2019-04-23 12:40:35
374
2
原创 HDU6300------多校2018-1C
Triangle Partition Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 1686 Accepted Submission(s): 848Special Judge Pro...
2018-08-02 17:17:55
190
原创 HDU6298------多校2018-1A
Maximum Multiple Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2429 Accepted Submission(s): 1021 Problem Description ...
2018-08-02 17:12:36
157
原创 HDU1022
Train Problem I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 46085 Accepted Submission(s): 17266 Problem Description ...
2018-07-30 21:54:27
651
原创 HDU1018
Big Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 42899 Accepted Submission(s): 20961 Problem Description In ...
2018-07-29 12:17:42
202
原创 HDU2104
hide handkerchief Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7277 Accepted Submission(s): 3275 Problem Description...
2018-07-28 20:47:25
320
原创 HDU1011
Problem Description You, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a huge cavern, which consists of many rooms conn...
2018-07-28 20:39:04
459
原创 ZOJ 1003
显然易见,该问题应该使用DFS解决。分析:(假定A>B)如果A要赢,要么A真,要么双假。如果B要赢,只能B真A假。 故判断结果输出,应判断B能否赢,而不是A能否赢。 其次,气球是唯一的,所以可以从2~100(1不用考虑)正序踩气球。 即dfs(k)->dfs(k+1) k 一个气球,要么A踩,要么B踩,要么都不踩,
2017-09-06 15:29:11
410
1
原创 ZOJ 1002
题目很简单,就是类似八皇后的dfs问题,但是有着限制条件。所以要在dfs过程中check 是否符合条件代码如下:#include #include#include#include#include#includeusing namespace std;int MAX;int a;int now;char str[4][4];//判断能不能放int canPut(int
2017-09-06 09:37:58
271
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人