
算法
boywgw
这个作者很懒,什么都没留下…
展开
-
【算法】Processing Management
问题描述:Assistant Manager Lee is on a visit to a factory run by a partner company. A machine is cutting steel plates that are different in length and width. However, a closer look found that the原创 2015-08-24 15:58:49 · 925 阅读 · 0 评论 -
线性循环链表
templatestruct LNode{ T data; struct LNode *next;};templateclass CircularLinkList{private: LNode* m_pList; int m_ListLength;private: bool InitList(); bool GetNode(int position, LNode**原创 2017-06-20 15:38:33 · 330 阅读 · 0 评论 -
strcpy memcpy strcmp strcat strlen实现源码
strcpy和memcpy都是标准C库函数,它们有下面的特点。strcpy提供了字符串的复制。即strcpy只用于字符串复制,并且它不仅复制字符串内容之外,还会复制字符串的结束符。strcpy函数的原型是:char* strcpy(char* dest, const char* src);memcpy提供了一般内存的复制。即memcpy对于需要复制的内容没有限制,因转载 2017-06-19 11:02:31 · 449 阅读 · 0 评论 -
C++实现线性链表
templatestruct LNode{ T data; struct LNode *next;};templateclass LinkList{private: LNode* m_pList; int m_ListLength;private: bool InitList(); bool GetNode(int position, LNode** node);原创 2017-06-19 15:12:18 · 610 阅读 · 0 评论 -
Stack 的C++实现
templateclass Stack{public: Stack(int s = 10); ~Stack();public: T top(); void push(T t); T pop(); bool empty(); int size();private: int count; int capacity; T* array;};templateStac原创 2017-06-19 10:41:31 · 460 阅读 · 0 评论 -
并查集详解
并查集:(union-find sets)一种简单的用途广泛的集合. 并查集是若干个不相交集合,能够实现较快的合并和判断元素所在集合的操作,应用很多,如其求无向图的连通分量个数等。最完美的应用当属:实现Kruskar算法求最小生成树。并查集的精髓(即它的三种操作,结合实现代码模板进行理解):1、Make_Set(x) 把每一个元素初始化为一个集合初始化后每一原创 2016-08-17 16:26:47 · 301 阅读 · 0 评论 -
【算法】Sky Map
问题描述:You are making “sky map” to represent constellation (group of starts) in the sky.In each element, 1 means star, 0 means empty.And in a constellation, each start should have at least on原创 2015-08-21 09:47:31 · 864 阅读 · 0 评论 -
【算法】【动态规划】Domino Tiling
问题描述:A domino means a shape in which sides of two unit rectangles are put together to each other.Domino tilting means to make a mosaic by filling a certain area of a flat plate with dominoes,原创 2015-08-25 13:49:26 · 1775 阅读 · 0 评论 -
【算法】【动态规划】Subset Sum
问题描述: When you divide numbers from 1 to N into two subsets, you can make each subset sum equal. For example, if N is 3, elements of the entire set are {1, 2, & 3}. In case each set sum is equal,原创 2015-08-27 15:58:00 · 3025 阅读 · 1 评论 -
【算法】【动态规划】Coin Exchange
算法描述:Korean coins consist of 6 levels of 1 won, 5 won, 10 won, 50 won, 100 won, and 500 won. If you make 256 won change, you need 5 coins: two coins of 100 won, one coin of 50 won, one coin of 5 w原创 2015-08-28 10:42:09 · 1354 阅读 · 0 评论 -
【算法】【动态规划】 邮票问题
题目描述: 已知一个 N 枚邮票的面值集合(如,{1 分,3 分})和一个上限 K —— 表示信封上能够贴 K 张邮票。计算从 1 到 M 的最大连续可贴出的邮资。 例如,假设有 1 分和 3 分的邮票;你最多可以贴 5 张邮票。很容易贴出 1 到 5 分的邮资(用 1 分邮票贴就行了),接下来的邮资也不难: 6 = 3 + 3 7 = 3 + 3 + 1 8 =原创 2015-08-13 14:04:24 · 3580 阅读 · 0 评论 -
【算法】【动态规划】装配线调度
1 问题描述某个汽车工厂共有两条装配线,每条有 n 个装配站。装配线 i 的第 j个装配站表示为 Si,j ,在该站的装配时间为 ai,j 。一个汽车底盘进入工厂,然后进入装配线 i(i 为 1 或 2),花费时间为 ei 。在通过一条线的第 j 个装配站后,这个底盘来到任一条装配线的第(j+1)个装配站。如果它留在相同的装配线,则没有移动开销。但是,如果它移动到另一条线上,则花费时间为 ti转载 2015-08-18 14:02:00 · 2984 阅读 · 0 评论 -
【算法】Maximum Continuous Partial Sum
问题描述:Given any sequence, the sequence of a contiguous area as the sum of the sum is part of a continuousFor example, let’s the following sequence was given In the above sequence, the sum原创 2015-08-25 11:09:17 · 775 阅读 · 0 评论 -
【算法】Symmetric Matrix
算法描述:In contemporary business administration, mathematical tools are frequently applied in order to develop the business theory.Numerical approaches are widely applied in the most of business ch原创 2015-08-25 10:49:49 · 1027 阅读 · 0 评论 -
由poj 1067引发的——取石子游戏【各类取石子总结】
上次做poj 1067的取石子游戏,只用到了whthoff博弈,未涉及到取石子的异或方法,今天重新搜索,整理了一遍。搜罗各种资料,加上自己整理,终于成篇啦!……噼里啪啦 取石子问题有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可。两个人轮流从堆中取物体若干,规定最后取光物体者取胜。这是我国民间很古老的一个游戏,别看这游戏极其简单,却蕴含着深刻的数学原理转载 2017-06-21 15:13:14 · 382 阅读 · 0 评论