题目链接:https://vjudge.net/problem/HDU-2896 题意:给出n个模式串(没有相同的模式串),模式串总长<=1e5。然后给出m个文本,文本总长<=1e7,求每个文本串中出现的模式串(最多3种)。 思路: 板子题。因为要输出文本串中出现的模式串编号,所以需要记录字典树中以 ...
分类:
其他好文 时间:
2020-03-14 12:43:02
阅读次数:
55
题意: 给出 $n$ 个花瓶,编号 $[0,n 1]$,一开始每个花瓶是空的。输入 $K$。$Alice$ 有两种操作,共 $m$ 个: $K=1$:输入 $A,F$。$Alice$ 将从花瓶 $A$ 开始,向空花瓶中插入花,如果没有插完,则多余的花舍弃; $K=2$:输入 $A,B$。$Alice ...
分类:
其他好文 时间:
2020-03-13 15:58:26
阅读次数:
59
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6638 There are nn pirate chests buried in Byteland, labeled by 1,2,…,n1,2,…,n. The ii-th chest's locati ...
分类:
其他好文 时间:
2020-03-12 11:25:40
阅读次数:
49
Problem Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试 ...
分类:
其他好文 时间:
2020-03-11 10:30:40
阅读次数:
41
MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors 调整一下导入顺序 import gevent from gevent import monkey monkey ...
分类:
其他好文 时间:
2020-03-11 09:11:53
阅读次数:
96
过山车 HDU - 2063 分析匈牙利算法,其实就是找得到就匹配,找不到这个点换一下看看能不能匹配; #include<bits/stdc++.h> using namespace std; #define pb push_back const int N=6e2+5; vector<int>e[ ...
分类:
其他好文 时间:
2020-03-10 19:47:59
阅读次数:
62
Problem Description 把一个字符三角形掏空,就能节省材料成本,减轻重量,但关键是为了追求另一种视觉效果。在设计的过程中,需要给出各种花纹的材料和大小尺寸的三角形样板,通过电脑临时做出来,以便看看效果。 Input 每行包含一个字符和一个整数n(0<n<41),不同的字符表示不同的花 ...
分类:
其他好文 时间:
2020-03-10 11:49:36
阅读次数:
44
贪心+树形dp 尽可能低价买入,高价卖出 设好转移规律就好了 长记性 dp[i][1] i号节点或者他的某个子孙中最低买入价格//要靠考虑路费 dp[i][0] i号节点或者他的某个子孙中最高卖出价格//要考虑路费 #include<iostream> #include<cstring> #incl ...
分类:
其他好文 时间:
2020-03-10 01:11:40
阅读次数:
64
Problem Description Give you a number on base ten,you should output it on base two.(0 < n < 1000) Input For each case there is a postive number n on b ...
分类:
其他好文 时间:
2020-03-09 20:52:34
阅读次数:
49
Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play hor ...
分类:
其他好文 时间:
2020-03-09 20:48:05
阅读次数:
56