<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[游刃有余则成的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/macalyou</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; macalyou]]></copyright><item><title><![CDATA[Lua5.2.3源码阅读(2)-Table]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/46885355</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/46885355</guid><author>macalyou</author><pubDate>Tue, 14 Jul 2015 23:28:12 +0800</pubDate><description><![CDATA[table在lua中是一个重要的数据结构，使用起来非常灵活，可以用它表示通常的array，map，set等结构。在分析源码之前，先看看table的一些特性。 
(1). table是个key-value数组，索引key可以是数字，也可以是字符串。 
(2). Key为数字时，默认下表从1开始(c/c++从0开始) 
(3). table大小可以动态变化 
(4). Lua5.2.3中tab]]></description><category></category></item><item><title><![CDATA[Lua5.2.3源码阅读(1)-TValue，TString]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/46864247</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/46864247</guid><author>macalyou</author><pubDate>Mon, 13 Jul 2015 16:32:21 +0800</pubDate><description><![CDATA[转载：http://blog.youkuaiyun.com/murisly/article/details/46848897
Lua是一个弱类型语言，类型可以在使用的时候变化。对应在源码中，TVable就充当了这个角色，lua中的所有数据类型都可以放在这个结构中。TValue是实现Lua数据类型的主要结构，不仅在脚本中使用了TValue，其他的一些数据结构也依赖于它。首先看看Lua的整个数据类型(lua.h]]></description><category></category></item><item><title><![CDATA[Lua5.3 注册表 _G _ENV]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/46523315</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/46523315</guid><author>macalyou</author><pubDate>Tue, 16 Jun 2015 20:53:30 +0800</pubDate><description><![CDATA[注册表的描述，借用PIL中的一段话：

registry 一直位于一个由 LUA_REGISTRYINDEX 定义的值所对应的假索引(pseudo-index)的位置。一个假索引除了他对应的值不在栈中之外，其他都类似于栈中的索引。Lua API 中大部分接受索引作为参数的函数，也都可以接受假索引作为参数—除了那些操作栈本身的函数，比如 lua_remove，lua_insert。例如，为了获取]]></description><category></category></item><item><title><![CDATA[WaitForSingleObject等待核心对象激活]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/37599107</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/37599107</guid><author>macalyou</author><pubDate>Wed, 09 Jul 2014 15:14:42 +0800</pubDate><description><![CDATA[#include 
#include "windows.h"
using namespace std;
int j=0;
DWORD WINAPI MyThreadOne(LPVOID lp)
{
	int *i = (int*)lp;
	*i = *i + 1;
	//int j=0;
	while (j<20)
	{
		cout<<++j<<endl;
		Sleep(500);
	}
	/]]></description><category></category></item><item><title><![CDATA[判断是不是PE文件]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/37569037</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/37569037</guid><author>macalyou</author><pubDate>Tue, 08 Jul 2014 18:33:02 +0800</pubDate><description><![CDATA[#include 
#include "assert.h"
#include 
#include "TCHAR.H"

#ifdef UNICODE
#define IsPEFile  IsPEFileW
#define IsDigiSig IsDigiSigW
#else
#define IsPEFile  IsPEFileA
#define IsDigiSig IsDigiSigA
#endi]]></description><category></category></item><item><title><![CDATA[输入一个整数n，求从1 到n 这n 个整数的十进制表示中1 出现的次数)]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/10270679</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/10270679</guid><author>macalyou</author><pubDate>Sat, 24 Aug 2013 15:37:53 +0800</pubDate><description><![CDATA[题目：

输入一个整数n，求从1 到n 这n 个整数的十进制表示中1 出现的次数。
例如输入12，从1 到12 这些整数中包含1 的数字有1，10，11 和12，1 一共出现了5 次。
注：这是一道广为流传的google 面试题。

 

思路一：

我们每次判断整数的个位数字是不是1。如果这个数字大于10，除以10 之后再判断个位数字是不是1。（对每一个数x，x先与10取余，]]></description><category></category></item><item><title><![CDATA[多柱汉诺塔最优算法设计探究]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8932232</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8932232</guid><author>macalyou</author><pubDate>Wed, 15 May 2013 20:35:49 +0800</pubDate><description><![CDATA[引言
汉诺塔算法一直是算法设计科目的最具代表性的研究问题，本文关注于如何设计多柱汉诺塔最优算法的探究。最简单的汉诺塔是三个柱子（A、B、C），因此多柱汉诺塔的柱子个数M≥3。下面从三柱汉诺塔说起，慢慢深入我们要关心的问题。
1. 三柱汉诺塔
三柱汉诺塔是经典的汉诺塔问题，在算法设计中是递归算法的典型问题。其算法是这样的: 首先把A 柱上面的n- 1 个碟子通过C 柱移到B 柱上【T(n-1)]]></description><category></category></item><item><title><![CDATA[字符串之间的转化]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8923349</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8923349</guid><author>macalyou</author><pubDate>Tue, 14 May 2013 00:03:31 +0800</pubDate><description><![CDATA[#include 
#include 
#include 		//非MFC工程下包含
#include 

int main()
{
	using namespace std;
	 USES_CONVERSION;				//转化字节需要
	int age[3] = {0} ;					//数组初始化

	/**********************************]]></description><category></category></item><item><title><![CDATA[c调用约定]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8876238</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8876238</guid><author>macalyou</author><pubDate>Thu, 02 May 2013 15:39:35 +0800</pubDate><description><![CDATA[在C语言中，假设我们有这样的一个函数：

int function(int a,int b)


调用时只要用result = function(1,2)这样的方式就可以使用这个函数。但是，当高级语言被编译成计算机可以识别的机器码时，有一个问题就凸现出来：在CPU中，计算机没有办法知道一个函数调用需要多少个、什么样的参数，也没有硬件可以保存这些参数。也就是说，计算机不知道怎么给这个函数传]]></description><category></category></item><item><title><![CDATA[卡特兰数]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8838251</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8838251</guid><author>macalyou</author><pubDate>Tue, 23 Apr 2013 09:49:34 +0800</pubDate><description><![CDATA[什么是Catalan数
说到Catalan数，就不得不提及Catalan序列，Catalan序列是一个整数序列，其通项公式是我们从中取出的就叫做第n个Catalan数，前几个Catalan数是：1,
 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670,]]></description><category></category></item><item><title><![CDATA[01背包问题]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8804143</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8804143</guid><author>macalyou</author><pubDate>Mon, 15 Apr 2013 15:23:22 +0800</pubDate><description><![CDATA[动态规划的基本思想：

将一个问题分解为子问题递归求解，且将中间结果保存以避免重复计算。通常用来求最优解，且最优解的局部也是最优的。求解过程产生多个决策序列，下一步总是依赖上一步的结果，自底向上的求解。


动态规划算法可分解成从先到后的4个步骤：

1. 描述一个最优解的结构，寻找子问题，对问题进行划分。

2. 定义状态。往往将和子问题相关的各个变量的一组取值定义为一个状态。]]></description><category></category></item><item><title><![CDATA[2586 How far away ？]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8762644</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8762644</guid><author>macalyou</author><pubDate>Fri, 05 Apr 2013 21:50:17 +0800</pubDate><description><![CDATA[Problem Description

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house]]></description><category></category></item><item><title><![CDATA[1013 Digital Roots]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8727781</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8727781</guid><author>macalyou</author><pubDate>Wed, 27 Mar 2013 18:05:31 +0800</pubDate><description><![CDATA[Problem Description

The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the result]]></description><category></category></item><item><title><![CDATA[1010 Tempter of the Bone]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8727014</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8727014</guid><author>macalyou</author><pubDate>Wed, 27 Mar 2013 16:01:33 +0800</pubDate><description><![CDATA[Tempter of the Bone

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 39780    Accepted Submission(s): 10761

原题链接：点击打开链接


Problem Desc]]></description><category></category></item><item><title><![CDATA[1009 FatMouse' Trade]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8722697</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8722697</guid><author>macalyou</author><pubDate>Tue, 26 Mar 2013 17:09:16 +0800</pubDate><description><![CDATA[Problem Description

FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.
The warehouse has N rooms. The i-th room con]]></description><category></category></item><item><title><![CDATA[1003]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8716228</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8716228</guid><author>macalyou</author><pubDate>Mon, 25 Mar 2013 11:38:46 +0800</pubDate><description><![CDATA[Problem Description
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +]]></description><category></category></item><item><title><![CDATA[1002 A + B Problem II]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8715522</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8715522</guid><author>macalyou</author><pubDate>Mon, 25 Mar 2013 09:46:20 +0800</pubDate><description><![CDATA[Problem Description
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.

 

Input
The first line of the input contains an integer T(1<=T<]]></description><category></category></item><item><title><![CDATA[Lowest Bit]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8711577</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8711577</guid><author>macalyou</author><pubDate>Sat, 23 Mar 2013 23:48:18 +0800</pubDate><description><![CDATA[Problem Description
Given an positive integer A (1 

For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.

Another example g]]></description><category></category></item><item><title><![CDATA[ASCII]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8711569</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8711569</guid><author>macalyou</author><pubDate>Sat, 23 Mar 2013 23:45:44 +0800</pubDate><description><![CDATA[Problem Description
Since all we know the ASCII code, your job is simple: input numbers and output corresponding messages.
 




Input
The first line contains one integer T (1
The input will]]></description><category></category></item><item><title><![CDATA[Buildings]]></title><link>https://blog.youkuaiyun.com/macalyou/article/details/8711427</link><guid>https://blog.youkuaiyun.com/macalyou/article/details/8711427</guid><author>macalyou</author><pubDate>Sat, 23 Mar 2013 23:06:46 +0800</pubDate><description><![CDATA[Input
Standard input will contain multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.

The first line of each test case co]]></description><category></category></item></channel></rss>