自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Canopus

Canopus

  • 博客(14)
  • 收藏
  • 关注

原创 BZOJ 3998 [TJOI2015]弦论

Description对于一个给定长度为N的字符串,求它的第K小子串是什么。Input第一行是一个仅由小写英文字母构成的字符串S 第二行为两个整数T和K,T为0则表示不同位置的相同子串算作一个。T=1则表示不同位置的相同子串算作多个。K的意义如题所述。Output输出仅一行,为一个数字串,为第K小的子串。如果子串数目不足K个,则输出-1Sample Input...

2018-02-28 10:03:33 146

原创 SPOJ LCS2 Longest Common Substring II + BZOJ 2946 [Poi2000]公共串

A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, also called factor, is a consecutive sequence of characters oc...

2018-02-24 11:40:23 108

原创 SPOJ LCS Longest Common Substring

A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, also called factor, is a consecutive sequence of characters oc...

2018-02-23 10:56:20 169

原创 算法详解——后缀自动机

由于最近CSDN对Markdown的支持不好,因此贴出Markdown代码:https://paste.ubuntu.com/p/Wd8PJnnxTf/DFA////////////////////////////////////////////////////////////////////////// DFA,即确定性有限状态自动机,由一个五元组M=(Σ,Q,qs,F,tr)M=(Σ...

2018-02-22 17:39:28 247

原创 POJ 1509 Glass Beads

Once upon a time there was a famous actress. As you may expect, she played mostly Antique Comedies most of all. All the people loved her. But she was not interested in the crowds. Her big hobby were b...

2018-02-22 15:03:35 187

原创 Codeforces Round #462 (Div. 2)

由于太菜只能做出前两题……A. A Compatible Pair思路:暴力枚举。 代码:#include <cstdio>#include <algorithm>const int maxn=100;const long long inf=0x3f3f3f3f3f3f3f3f;int read(){ int x=0,f=1; cha...

2018-02-15 09:51:37 190

原创 BZOJ 1565 [NOI2009]植物大战僵尸

DescriptionInputOutput仅包含一个整数,表示可以获得的最大能源收入。注意,你也可以选择不进行任何攻击,这样能源收入为0。Sample Input3 2 10 0 20 0 -10 0 -5 1 0 0 100 1 2 1 100 0Sample Output25HINT在样例中, 植物P1,1P1,1P_{1,...

2018-02-13 16:43:51 168

原创 BZOJ 2127 happiness

Description高一一班的座位表是个n*m的矩阵,经过一个学期的相处,每个同学和前后左右相邻的同学互相成为了好朋友。这学期要分文理科了,每个同学对于选择文科与理科有着自己的喜悦值,而一对好朋友如果能同时选文科或者理科,那么他们又将收获一些喜悦值。作为计算机竞赛教练的scp大老板,想知道如何分配可以使得全班的喜悦值总和最大。Input第一行两个正整数n,m。接下来是六个矩阵第一...

2018-02-11 16:07:10 156

转载 浅谈算法——博弈论

转载自https://www.cnblogs.com/Wolfycz/p/8430991.html网上的博弈博客和论文有很多,但是有些没有详细的证明,仅仅是给出了结论。今天作者将一些常见的博弈论模板集中起来,给大家介绍一下博弈论中一些单一游戏的决策和常见的Nim模板与证明。注:下列游戏都建立在双方都有最优策略的情况下,若未加以说明,则每人每次至少取一个石子。例1:取石子游戏之一...

2018-02-10 11:10:21 13917 2

原创 POJ 2975 Nim

DescriptionNim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removing one or more stones from any single pile. Play

2018-02-06 16:23:31 169

原创 POJ 2154 Color

DescriptionBeads of N colors are connected together into a circular necklace of N beads (NYou only need to output the answer module a given number P.InputThe first line of the input is an int

2018-02-06 15:13:24 114

原创 BZOJ 2938 [Poi2000]病毒

题目链接权限题不放题目描述了思路建好AC自动机,用DFS判环。代码#include #include const int maxn=30000;struct ac_automaton{ int son[maxn+10][2],cnt,fail[maxn+10],danger[maxn+10],q[maxn+10],head,tail,vis[maxn

2018-02-02 12:04:42 199

原创 二分图知识点总结

最大匹配:在二分图中,最多的没有公共顶点的边的数量。(用匈牙利算法) 最小点覆盖:在二分图中,所有边至少有一个顶点在一个点集S" role="presentation">SSS中,这样的点集S" role="presentation">SSS的最少元素个数。(最小点覆盖=最大匹配) 最大独立点集:在二分图中,选择一些点,使得这些点两两没有边直接相连。(最大独立点集=总点数-最大匹配) DAG

2018-02-01 17:40:27 270

原创 POJ 2503 Babelfish

DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.

2018-02-01 11:55:59 198

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除