码迷,mamicode.com
首页 > 其他好文
[leetcode 236]Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two node...
分类:其他好文   时间:2015-08-08 18:18:38    阅读次数:110
Topcoder SRM 663 Div2 Hard: CheeseRolling(状压DP)
Problem Statement   N people (where N is a power of 2) are taking part in a single-elimination tournament in cheese rolling. The diagram below illustrates the structure of the tournament br...
分类:其他好文   时间:2015-08-08 18:18:27    阅读次数:159
【NOI2012】【BZOJ2875】随机数生成器
BZOJ题面不正常我贴一下别的OJ题面把 【问题描述】栋栋最近迷上了随机算法,而随机数是生成随机算法的基础。栋栋准备使用线性同余法(Linear Congruential Method)来生成一个随机数列,这种方法需要设置四个非负整数参数m,a,c,X[0],按照下面的公式生成出一系列随机数{Xn}: X[n+1]=(aX[n]+c) mod m 其中m...
分类:其他好文   时间:2015-08-08 18:19:52    阅读次数:143
根据地名检索该地名的经纬度等信息
问题描述:在地图中根据一个地名来检索该地名的经纬度信息 准备工作:相应的地图服务支持,包括地图数据的支持,arcgis的api包 代码展示: //需要引入arcgis的api require([ "esri.task.FindTask", "esri.task.FindParameters", "esri.task.QueryTask", "esri.task...
分类:其他好文   时间:2015-08-08 18:18:02    阅读次数:171
Ignatius and the Princess IV 水
B - Ignatius and the Princess IV Time Limit:1000MS     Memory Limit:32767KB     64bit IO Format:%I64d & %I64u Submit Status Description "OK, you are not too bad, em... But you can neve...
分类:其他好文   时间:2015-08-08 18:17:41    阅读次数:120
pat-advanced(1073-1076)
1073. Scientific Notation (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HOU, Qiming Scientific notation is the way that...
分类:其他好文   时间:2015-08-08 18:18:20    阅读次数:109
[leetcode 235]Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw...
分类:其他好文   时间:2015-08-08 18:16:58    阅读次数:132
_DataStructure_C_Impl:稀疏矩阵十字链表存储
#include #include typedef int DataType; typedef struct OLNode{ int i,j; DataType e; struct OLNode *right,*down; }OLNode,*OLink; typedef struct{ OLink *rowhead,*colhead; int m,n,len; }CrossList; /...
分类:其他好文   时间:2015-08-08 18:19:16    阅读次数:144
_DataStructure_C_Impl:广义表头尾链表存储
#include #include #include #include"SeqString.h" typedef char AtomType; typedef enum{ATOM,LIST} ElemTag;//ATOM=0,表示原子,LIST=1,表示子表 typedef struct Node { ElemTag tag; /*标志位tag用于区分元素是原子还是子表*/ union...
分类:其他好文   时间:2015-08-08 18:18:16    阅读次数:119
Hdu oj 1004 Let the Balloon Rise
分析:用二维数组存放字符串,另外在比较count[i]的大小时,注意保留数组的下标。 #include #include char str[1010][16]; int count[1010]; int main() { int m; while(scanf("%d",&m),m) { int i,j; int max,k; for(i=0;i<m...
分类:其他好文   时间:2015-08-08 18:18:27    阅读次数:96
_DataStructure_C_Impl:广义表的扩展线性链表存储
#include #include #include #include"SeqString.h" typedef char AtomType; typedef enum{ATOM,LIST} ElemTag;//ATOM=0,表示原子,LIST=1,表示子表 typedef struct GLNode{ ElemTag tag; //标志位tag用于区分元素是原子还是子表 union{ ...
分类:其他好文   时间:2015-08-08 18:18:27    阅读次数:122
9.9递归和动态规划(一)——小孩上楼梯的方式的种类
/**  * 功能:有个小孩正在上楼梯,楼梯有n阶台阶,小孩一次可以上1阶、2阶或3阶。计算小孩上楼梯的方式有多少种。  */ 两种方法: 方法一: //递归法 /** * 思路:自上而下的方式。 * 最后一步可能是从第n-1阶往上走1阶、从第n-2阶往上走2阶或从第n-3阶往上走3阶。 * 因此,抵达最后一阶的走法,抵达这最后三阶的方式的综合。 * ...
分类:其他好文   时间:2015-08-08 18:16:50    阅读次数:2006
《小强升职记》 读书笔记
《无压工作的艺术》是时间管理的圣经,这本书则是《无压工作的艺术》的本土版;  作者用讲故事的方式描述了一个职场新手成长的过程,又可谓是圣经的实践版;   本人评分 5分;  唯一的缺点,就是这本书的名字太俗;不过话说回来,正是大俗,才带来了世俗中的广泛传播; 书的章节命名也挺有意思,从一个种子发芽说起,直到开花结果; 寻找种子 时间管理方法的执行,是一个锻炼自我的过程,...
分类:其他好文   时间:2015-08-08 18:17:40    阅读次数:206
ZOJ 题目3228 Searching the String(AC自动机)
Searching the String Time Limit: 7 Seconds      Memory Limit: 129872 KB Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often giv...
分类:其他好文   时间:2015-08-08 18:16:40    阅读次数:107
Tcl学习之--命名空间
Tcl解释器将所有的命令和全局变量分组管理。这些小组称为命名空间,一个命名空间中的命令和变量不会影响到另一个命名空间。这些命名空间呈树形组织,一个命名空间的命令可以被另一个命名空间引入。命名空间树的根就是全局命名空间,它包含了没有明确在其他命名空间中创建的所有命令和变量。 任何已经存在的命名空间中的命令和变量,都可以从命名空间内部或外部创建。在命令或变量的名称前面加上命名空间前缀就可以完成这一点...
分类:其他好文   时间:2015-08-08 18:15:40    阅读次数:365
Direct-X学习笔记--Alpha颜色混合
Alpha混合技术是灰常有用的东东。待我好好学习一下。 一.简介 首先看一下Alpha通道,Alpha通道是计算机中存储图片透明度信息的通道,它是一个8位灰度的通道,用256级灰度记录图像中的透明信息,定义透明,不透明,半透明等,其中黑色表示完全透明,白色表示不透明,灰色为半透明。 如果不用Alpha混合,我们绘制图形的颜色总是替换当前颜色缓冲区中存在的颜色,这样后面的物体总是覆盖在原有的物...
分类:其他好文   时间:2015-08-08 18:15:12    阅读次数:180
cheerio返回数据格式
通读cheerio API{ options: { decodeEntities: false, withDomLvl1: true, normalizeWhitespace: false, xmlMode: false }, ...
分类:其他好文   时间:2015-08-08 18:14:57    阅读次数:170
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!