- 博客(18)
- 收藏
- 关注
原创 HDU_3518 Boring counting(后缀自动机)
Boring countingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description035 now faced a tough problem,his english teacher gives him a string,which cons...
2020-04-29 16:43:35 160
原创 洛谷_3975 [TJOI2015]弦论(后缀自动机)
[TJOI2015]弦论题目链接:https://www.luogu.com.cn/problem/P3975题解:对于T==0,只需要构造自动机,将每个状态节点的cnt设为1,然后DFS即可。对于T==1,则需要额外求出每个点出现的次数,即cnt=出现次数。若状态节点不是克隆节点,则初始设cnt=1,否则cnt=0。然后按节点len降序访问每个节点,cnt[st[i].link]+=cn...
2020-04-28 20:57:50 185
原创 HDU_6240 Server(分数规划+树状数组)
ServerTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionAlice and Bob are working on a new assignment. In this project, they need to access ...
2020-04-26 23:40:56 176
原创 CodeForces_1340B Nastya and Scoreboard(动态规划)
Nastya and Scoreboardtime limit per test:1 secondsmemory limit per test:256 megabytesProblem DescriptionDenis, who managed to buy flowers and sweets (you will learn about this story in the next ta...
2020-04-24 17:44:05 234
原创 SGU_142 Keyword(hash)
KeywordTime limit per test: 0.5 sec. Memory limit: 16384 KBProblem DescriptionKevin has invented a new algorithm to crypt and decrypt messages, which he thinks is unbeatable. The algorithm uses a ...
2020-04-24 10:15:51 173
原创 ZOJ_2283 Challenge of Wisdom(动态规划)
Challenge of WisdomTime Limit: 2000 msMemory Limit: 32768 KBProblem Description“I have a great deal of lands. They’re divided into N*M grids (N, M <= 1,000,000,000). When you are in (x, y), you...
2020-04-23 12:27:55 225
原创 POJ_3522 Slim Span(最小生成树)
Slim SpanTime Limit: 5000MS Memory Limit: 65536KProblem DescriptionGiven an undirected weighted graph G, you should find one of spanning trees specified as follows.The graph G is an ordered pair...
2020-04-22 10:53:01 162
原创 洛谷_2495 [SDOI2011]消耗战(虚树)
消耗战题目链接:https://www.luogu.com.cn/problem/P2495题解:对于单样例,可以考虑树形DP。但此题是多实例,所以需要对树进行处理,每次询问有k+1(加上一号点)个关键点。对每个询问构造出虚树。边权:虚树的边上的权值,为原树中两点路径上的边权最小值,可以利用倍增的思想求权值。DP:对于虚树,设dpidp_idpi为以iii为根的子树都与i号节点断开连...
2020-04-21 17:49:13 157
原创 CodeForces_613D Kingdom and its Cities(虚树)
Kingdom and its Citiestime limit per test:2 secondsmemory limit per test:256 megabytesProblem DescriptionMeanwhile, the kingdom of K is getting ready for the marriage of the King’s daughter. Howev...
2020-04-21 14:33:45 169
原创 51nod_2983 数字配对(费用流)
数字配对Problem Description有 n 种数字,第 i 种数字是 ai、有 bi 个,权值是 ci。若两个数字 ai、aj 满足,ai 是 aj 的倍数,且 ai/aj 是一个质数,那么这两个数字可以配对,并获得 ci×cj 的价值。一个数字只能参与一次配对,可以不参与配对。在获得的价值总和不小于 0 的前提下,求最多进行多少次配对。Input第一行一个整数 n。第...
2020-04-20 20:36:34 194
原创 51nod_2361 XYK的音游(动态规划)
XYK的音游Problem Descriptionxyk最近入坑了一个新音游。游戏界面上有 nnn 个并排的按键,当前这首歌有 mmm 个鼓点。游戏的玩法是在鼓点的时刻移动鼠标到对应的按键上并点击来获取分数。对于第 i 个鼓点,我们用tit_iti,wiw_iwi,xix_ixi 来描述,表示在tit_iti 时刻点击第 xix_ixi 个按键会获得 wiw_iwi 的分数。...
2020-04-16 21:07:01 248
原创 UVA_10748 Knights Roaming(搜索)
题意有n个棋子,棋子在(x,y)(x,y)(x,y)时可以移动至(x±2,y±1)(x\pm2,y\pm1)(x±2,y±1)或(x±1,y±2)(x\pm1,y\pm2)(x±1,y±2)。棋盘无限大,每个棋子允许移动的步数不同,第i个棋子允许移动ki步,棋盘上共有多少个不同的位置能被棋子到达。题解:n≤30,ki≤50n\le30,k_i\le50n≤30,ki≤50,每个棋子允许移动...
2020-04-14 12:44:11 84
原创 CodeForces_1338C Perfect Triples(数论)
Perfect Triplestime limit per test:2 secondsmemory limit per test:256 megabytesProblem DescriptionConsider the infinite sequence s of positive integers, created by repeating the following steps:...
2020-04-13 14:25:03 247
原创 ZOJ_3780 Paint the Grid Again(拓扑排序)
Paint the Grid AgainTime Limit: 2000 msMemory Limit: 65536 KBProblem DescriptionLeo has a grid with N × N cells. He wants to paint each cell with a specific color (either black or white).Leo has ...
2020-04-13 09:17:00 110
原创 ZOJ_3777 Problem Arrangement(动态规划)
Problem Arrangement Time Limit: 2000 msMemory Limit: 65536 KBProblem DescriptionThe 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arran...
2020-04-12 20:34:22 142
原创 CodeForces_1201D Treasure Hunting(贪心)
Treasure Huntingtime limit per test:3 secondsmemory limit per test:256 megabytesProblem DescriptionYou are on the island which can be represented as a n×mn×mn×m table. The rows are numbered from 1...
2020-04-11 10:45:12 144
原创 51nod_2369 奈芙莲的序列(动态规划)
奈芙莲的序列Problem Description有一天可爱的Nephren得到了一个序列,一开始,她取出序列的第一个数,形成一个新的序列B,然后取出序列A的第二个数,放在序列B的最左边或最右边,序列B此时有两个数,下一步,再取出序列A的第三个数放在序列B的最左边或最右边,……现在的问题是,通过上面的步骤,可以得到B的最长上升子序列的长度是多少Input第一行,一个整数N.第二行,N个...
2020-04-09 09:29:43 196
原创 ZOJ_3224 Mathematics(数论)
MathematicsTime Limit: 1000 msMemory Limit: 32768 KBProblem DescriptionMathematics is always attractive. For example, Fourier Transform can split a normal function into parts with Sin function and...
2020-04-04 20:18:42 187
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人