<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[吧唧吧唧]]></title><description><![CDATA[遇 见 最 美 的 自 己 。]]></description><link>https://blog.csdn.net/L__emon</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; L__emon]]></copyright><item><title><![CDATA[UVA 548 —— 二叉树的递归遍历]]></title><link>https://blog.csdn.net/L__emon/article/details/60751911</link><guid>https://blog.csdn.net/L__emon/article/details/60751911</guid><author>L__emon</author><pubDate>Tue, 07 Mar 2017 10:10:16 +0800</pubDate><description><![CDATA[已知二叉树的中序遍历和后序遍历，构建二叉树，求叶子到根的最小路径权值和；
后序遍历的最后一个字符即为二叉树的根结点，然后在中序遍历中找到这个根结点的位置，根结点的左边序列即为该根的左子树，右边序列即为右子树，然后再在后序遍历中找左右子树的根结点，以此类推，用递归遍历。


#include
#define INF 0x3f3f3f3f
using namespace std;
const ]]></description><category></category></item><item><title><![CDATA[UVA 122 树的层次遍历]]></title><link>https://blog.csdn.net/L__emon/article/details/60466974</link><guid>https://blog.csdn.net/L__emon/article/details/60466974</guid><author>L__emon</author><pubDate>Sun, 05 Mar 2017 14:29:31 +0800</pubDate><description><![CDATA[紫书P150


#include
using namespace std;
const int maxn = 300;
bool failed;

struct Node{
    bool have_value;                                      //是否被赋值过
    int v;                                ]]></description><category></category></item><item><title><![CDATA[Codeforces Beta Round #17 D. Notepad]]></title><link>https://blog.csdn.net/L__emon/article/details/53312867</link><guid>https://blog.csdn.net/L__emon/article/details/53312867</guid><author>L__emon</author><pubDate>Wed, 23 Nov 2016 22:15:48 +0800</pubDate><description><![CDATA[原题：http://codeforces.com/contest/17/problem/D
题意：求[ ( b - 1 ) * b^( n - 1 ) ] % c，如果ans = 0, 则ans = c；
思路：指数循环节 —— ，（其中Φ
 为欧拉函数）；


#include
#define ll __int64
using namespace std;
const int max]]></description><category></category></item><item><title><![CDATA[Codeforces Beta Round #13 D —— Triangles 计算几何]]></title><link>https://blog.csdn.net/L__emon/article/details/52987276</link><guid>https://blog.csdn.net/L__emon/article/details/52987276</guid><author>L__emon</author><pubDate>Mon, 31 Oct 2016 22:04:31 +0800</pubDate><description><![CDATA[原题：http://codeforces.com/contest/13/problem/D
题意：有n个红点，m个蓝点，在所有红点中选择三个点组成三角形，使得任意蓝点都不在该三角形内，问这样的三角形有多少个；
思路：首先，如何判断一个点是否在该三角形内 —— 我们假定三角形ABC以及所要判断的点P，如果P在ABC内，那么对边AB来说，点P和点C在边AB的同侧；对边BC来说，点P和点A在边BC的]]></description><category></category></item><item><title><![CDATA[HDU 1058 —— Humble Numbers]]></title><link>https://blog.csdn.net/L__emon/article/details/52842382</link><guid>https://blog.csdn.net/L__emon/article/details/52842382</guid><author>L__emon</author><pubDate>Mon, 17 Oct 2016 21:50:38 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1058
思路：每次保留最小的数，注意输出格式；


#include
#include
#include
#define Min(a, b, c, d) min(min(a, b), min(c, d))
using namespace std;
const int maxn = 6000;
int]]></description><category></category></item><item><title><![CDATA[HDU 2152 —— Fruit]]></title><link>https://blog.csdn.net/L__emon/article/details/52825021</link><guid>https://blog.csdn.net/L__emon/article/details/52825021</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 20:24:31 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=2152
修改一下左右的边界范围


#include 
#include 
#include 
using namespace std;
const int maxn = 110;
int a[110][2];
int dp[maxn*maxn], tmp[maxn*maxn];
int n, m;]]></description><category></category></item><item><title><![CDATA[HDU 2069 —— Coin Change]]></title><link>https://blog.csdn.net/L__emon/article/details/52823954</link><guid>https://blog.csdn.net/L__emon/article/details/52823954</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 16:50:03 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=2069
思路：需要注意一个条件，组合的硬币数不能超过100。把数组开成二维的，dp[i][j] 表示用 j 个硬币组成 i 的方式有多少种。


#include 
#include 
#include 
const int maxn = 300;
using namespace std;
int ]]></description><category></category></item><item><title><![CDATA[HDU 1171 —— Big Event in HDU]]></title><link>https://blog.csdn.net/L__emon/article/details/52822583</link><guid>https://blog.csdn.net/L__emon/article/details/52822583</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 13:56:27 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1171


#include
#include
#include
using namespace std;
const int maxn = 100;
const int maxm = 5e5;
int dp[maxm], tmp[maxm];
int val[maxn], num[maxn];
in]]></description><category></category></item><item><title><![CDATA[HDU 1085 —— Holding Bin-Laden Captive!]]></title><link>https://blog.csdn.net/L__emon/article/details/52822569</link><guid>https://blog.csdn.net/L__emon/article/details/52822569</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 13:55:05 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1085


#include
#include
#include
using namespace std;
const int maxn = 1e4;
int dp[maxn], tmp[maxn];
int a, b, c;
int main(){
    while(cin>>a>>b>>c){
]]></description><category></category></item><item><title><![CDATA[HDU 1398 —— Square Coins]]></title><link>https://blog.csdn.net/L__emon/article/details/52822564</link><guid>https://blog.csdn.net/L__emon/article/details/52822564</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 13:53:31 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1398


#include
using namespace std;
const int maxn = 1000;
int arr[maxn], tmp[maxn];
int n;
int main(){
    while(cin>>n){
        if(n == 0)  break;
 ]]></description><category></category></item><item><title><![CDATA[HDU 1028 —— Ignatius and the Princess III]]></title><link>https://blog.csdn.net/L__emon/article/details/52822558</link><guid>https://blog.csdn.net/L__emon/article/details/52822558</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 13:51:31 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1028


#include
using namespace std;
const int maxn = 250;
int arr[maxn], tmp[maxn];
int n;
int main(){
    while(cin>>n){
        for(int i = 0;i<=n;i+]]></description><category></category></item><item><title><![CDATA[母函数讲解篇]]></title><link>https://blog.csdn.net/L__emon/article/details/52822552</link><guid>https://blog.csdn.net/L__emon/article/details/52822552</guid><author>L__emon</author><pubDate>Sat, 15 Oct 2016 13:49:27 +0800</pubDate><description><![CDATA[在数学中，某个序列的母函数(Generating function，又称生成函数)是一种形式幂级数，其每一项的系数可以提供关于这个序列的信息。使用母函数解决问题的方法称为母函数方法。

母函数可分为很多种，包括普通母函数、指数母函数、L级数、贝尔级数和狄利克雷级数。对每个序列都可以写出以上每个类型的一个母函数。构造母函数的目的一般是为了解决某个特定的问题，因此选用何种母函数视乎序列本身的特性和]]></description><category></category></item><item><title><![CDATA[HDU 1005 —— Number Sequence]]></title><link>https://blog.csdn.net/L__emon/article/details/52513907</link><guid>https://blog.csdn.net/L__emon/article/details/52513907</guid><author>L__emon</author><pubDate>Mon, 12 Sep 2016 15:28:09 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1005
思路：找循环节；f[n] = (f[n-1]*A+f[n-2]*B)%7，所以f[n-1]和f[n-2]都只有7种可能：0、1、2、3、4、5、6，且A和B都是固定的，所以循环节最大就是7*7=49；


#include
int res[100];
int main(){
	int a, ]]></description><category></category></item><item><title><![CDATA[HDU 2222 — Keywords Search]]></title><link>https://blog.csdn.net/L__emon/article/details/47983205</link><guid>https://blog.csdn.net/L__emon/article/details/47983205</guid><author>L__emon</author><pubDate>Tue, 25 Aug 2015 20:53:42 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=2222
题意：
给出n个模板以及文本，问文本中出现了多少个模板；


思路：
要注意有重复的模板，也是要算数的；
用val数组来计算每种模板的个数；用vis数组来表示单词的节点；




#include
#include
#include
#include

using names]]></description><category></category></item><item><title><![CDATA[HDU 2594 — Simpsons’ Hidden Talents]]></title><link>https://blog.csdn.net/L__emon/article/details/47782501</link><guid>https://blog.csdn.net/L__emon/article/details/47782501</guid><author>L__emon</author><pubDate>Wed, 19 Aug 2015 16:29:20 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=2594
题意：
给出两个字符串S1， S2，找出S1中最长的可以和S2的后缀匹配的前缀；


思路：
将S1作为模式串，S2作为目标串，用KMP就好，看到S2的最后一个字符时能匹配S1中的第几个字符；




#include  
#include  
  
const int max]]></description><category></category></item><item><title><![CDATA[HDU 1867 — A + B for you again]]></title><link>https://blog.csdn.net/L__emon/article/details/47732871</link><guid>https://blog.csdn.net/L__emon/article/details/47732871</guid><author>L__emon</author><pubDate>Mon, 17 Aug 2015 21:40:26 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1867
题意：
给你两个字符串T和P，将他们相连（T在P前面，P在T前面均可），首先要求尽可能多的覆盖住重复部分，其次满足按字典序输出；


思路：
用KMP分别求出两种情况下的匹配数，选取匹配数多的那一种；
当两者的匹配数相等时，选取字典序小的字符串在前面；


#include
#i]]></description><category></category></item><item><title><![CDATA[KMP讲解]]></title><link>https://blog.csdn.net/L__emon/article/details/47726035</link><guid>https://blog.csdn.net/L__emon/article/details/47726035</guid><author>L__emon</author><pubDate>Mon, 17 Aug 2015 15:43:40 +0800</pubDate><description><![CDATA[【KMP算法简介】

 

         KMP算法是一种改进后的字符串匹配算法，由D.E.Knuth与V.R.Pratt和J.H.Morris同时发现，因此人们称它为克努特——莫里斯——普拉特操作（简称KMP算法）。通过一个辅助函数实现跳过扫描不必要的目标串字符，以达到优化效果。

 

 

 

【传统字符串匹配算法的缺憾】

 

         Bi]]></description><category></category></item><item><title><![CDATA[HDU 2203 — 亲和串]]></title><link>https://blog.csdn.net/L__emon/article/details/47725931</link><guid>https://blog.csdn.net/L__emon/article/details/47725931</guid><author>L__emon</author><pubDate>Mon, 17 Aug 2015 15:39:11 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=2203
思路：
将T串扩增成TT串，就相当于循环移位了一周；





#include
#include

const int maxn = 100005;
char T[maxn*2], P[maxn];
int f[maxn], n, m;

bool find()
{
    int]]></description><category></category></item><item><title><![CDATA[HDU 1711 — Number Sequence简单题]]></title><link>https://blog.csdn.net/L__emon/article/details/47724805</link><guid>https://blog.csdn.net/L__emon/article/details/47724805</guid><author>L__emon</author><pubDate>Mon, 17 Aug 2015 14:40:16 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1711
题意：
给出两个数字串，问b串在a串中第一次出现的位置；


KMP模板题




#include
#include
const int maxn = 1e6+5;
int a[maxn], b[maxn], f[maxn];
int n, m;

void getFail()]]></description><category></category></item><item><title><![CDATA[HDU 1671 — Phone List]]></title><link>https://blog.csdn.net/L__emon/article/details/47700407</link><guid>https://blog.csdn.net/L__emon/article/details/47700407</guid><author>L__emon</author><pubDate>Sun, 16 Aug 2015 10:31:51 +0800</pubDate><description><![CDATA[原题：http://acm.hdu.edu.cn/showproblem.php?pid=1671
题意：
给出一些号码，如果其中一个号码是另一个的前缀，则输出NO；


思路：
插入每个号码时，内部数字val = 0，最后一个数字val = 1；



#include
#include

#define MAX 26
const int maxnode = 4000*100]]></description><category></category></item></channel></rss>