- 博客(348)
- 收藏
- 关注

原创 ACM动态规划总结(by utobe67)
动态规划一直是ACM竞赛中的重点, 也是难点(对于我这种水平),因为该算法时间效率高,代码量少,多元性强、灵活度高,主要考察思维能力、建模抽象能力。学了这么久动态规划,虽然还只是个菜菜= =,但还是想总结一下,总得给学弟学妹留下一些什么吧。
2015-01-17 15:19:57
8646
原创 storm集群搭建
可参考:http://aperise.iteye.com/blog/2295227或者极客学院http://www.jikexueyuan.com/course/724.html极客学院讲解的较为详细,我使用三台虚拟机搭建环境,在搭建过程中主要遇到的问题总结一下:1.zookeeper启动不了。检查每台机器zkdata目录下是否设置了myid。检查端口是否被
2017-12-27 21:12:52
413
原创 leetcode 76. Minimum Window Substring
76. Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T =
2017-03-26 13:05:19
523
原创 leetcode 456. 132 Pattern
456. 132 PatternGiven a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i j k and ai < ak j. Design an algorithm that takes a list of n numb
2017-03-26 11:19:25
614
原创 leetcode 432. All O`one Data Structure
432. All O`one Data StructureImplement a data structure supporting the following operations:Inc(Key) - Inserts a new key with value 1. Or increments an existing key by 1. Key is guarante
2017-03-26 11:14:45
624
原创 leetcode 146. LRU Cache 460. LFU Cache
146. LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be po
2017-03-15 23:05:45
580
原创 leetcode 4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 =
2017-03-12 13:25:56
331
原创 Kickstart Round A 2017 Problem A. Square Counting Problem B. Patterns Overlap
感想:Kickstart Round A小计,第一次打Kickstart,据说是进google的必经之路,难度确实还比较难,更可怕的是前面厉害的人太多,第三题是计算几何碰都没怎么碰过的题,AK的人还是那么多= =,可见进google是有多么大的竞争。比赛时只能做出A和b的small,比赛完后想想B的big也是可以做的,然后就做了。ps:第一次打这个比赛,有些规则不是很清楚,原来每次给出
2017-03-05 22:07:04
1495
原创 leetcode 两道交换问题
41. First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should ru
2017-01-10 11:18:30
557
原创 hadoop环境配置 windows+eclipse
hadoop安装参考给力星我安装的版本是2.7.0在linux下开发会有一些不方便,非mac档只能尝试在win上远程连接了,幸好有大神写了eclipse的hadoop插件,并且支持远程连接,于是来折腾这一环境。插件安装还是参考给力星由于他的文章是给出的linux+eclipse,改成windos需要将localhost换成linux机器的ip即可,注意hadoop环境的配置文件co
2016-10-10 19:22:10
590
转载 Ubuntu下添加开机启动脚本(转载)
转载于王恒's Blog1、方法一,编辑rc.loacl脚本 Ubuntu开机之后会执行/etc/rc.local文件中的脚本,所以我们可以直接在/etc/rc.local中添加启动脚本。当然要添加到语句:exit 0 前面才行。如:sudo vi /etc/rc.local然后在 exit 0 前面添加好脚本代码。 2、方法二,
2016-09-13 16:16:00
2407
原创 python numpy笔记
numpy笔记,包含常用操作,参考http://www.dataivy.cn/blog/python基础数据处理库-numpy/import numpy as np #创建createarr=np.arange(1,13,1) #开始值 终值(不包括)步长print arrprint np.linspace(1,13,8) #开始值 终值(包括)步长 个数 形成等差
2016-09-01 20:25:31
469
原创 递归转循环的通用方法
1.递归定义:程序调用自身的编程技巧称为递归。栈与递归的关系:递归是借助于系统栈来实现的。每次递归调用,系统都要为该次调用分配一系列的栈空间用于存放此次调用的相关信息:返回地址,局部变量等。当调用完成时,就从栈空间内释放这些单元,在该函数没有完成前,分配的这些单元将一直保存着不被释放。2.递归转化为循环记得有人说过“所有递归都能转化为循环”,某晚睡不着思考了一下这个问题
2016-04-18 20:49:59
23117
原创 phpExcel实现表格之间的转换
1.问题描述现在有一个总表staff.xls,每一行代表一个人的数据,要求将该表转换为若干个表people.xls,每一个人为一个表。或者问题反过来,要求将若干个表汇总。2.思路将问题简单化,仔细想想,也就几个步骤:(0)我们知道staff.xls和people.xls的格式布局,有两个这样的模板文件,知道两个表转换时数据是怎样对应的,比如staff的‘BS
2016-03-30 21:53:05
1723
原创 phpExcel常用方法
include 'PHPExcel.php';include 'PHPExcel/Writer/Excel2007.php';//或者include 'PHPExcel/Writer/Excel5.php'; 用于输出.xls的创建一个excel$objPHPExcel = new PHPExcel();保存excel—2007格式$objWriter = new PHPExcel_W
2016-03-30 21:17:35
542
原创 C#编程 井字游戏
一、需求分析游戏规则:两人轮流下棋,谁先将3颗棋子摆成横竖斜一条直线即获胜。界面温馨,支持人机对战、双人对战,电脑难度有简单和困难。二、运行界面
2015-07-14 23:13:07
2685
2
原创 网页抓取信息(php正则表达式、php操作excel)
1.问题描述实现对固定网页上自己需要的信息抓取,以表格形式存储。我是拿wustoj上的一个排行榜来练习的,地址:wustoj2.思路网页自己就简单学习了一下php,刚好用它来做点事情吧,我的想法是这样的:(1)查看网页源代码并保存在文件中。(2)根据需要的信息写出正则表达式,读文件,根据正则表达式来提取需要的信息。写正则表达式的时候最好分组,这样提取起来就方便了很多。
2015-06-08 23:46:07
1493
原创 poj 3691 DNA repair(AC自动机+dp)
DNA repairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5877 Accepted: 2760DescriptionBiologists finally invent techniques of repairing DNA that conta
2015-06-07 22:54:47
830
原创 hdu 2222 Keywords Search(AC自动机入门)
Keywords SearchTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 42138 Accepted Submission(s): 13289Problem DescriptionIn the m
2015-06-07 22:41:31
803
原创 LightOJ 1356 Prime Independence (素数 二分图)
Prime IndependenceTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1356DescriptionA set of integers is called prime independ
2015-06-01 23:38:53
2355
原创 whu oj 1579 - Big data
Problem 1579 - Big data Time Limit: 1000MS Memory Limit: 65536KB Total Submit: 73 Accepted: 12 Special Judge: NoDescriptionThe data scientists of CVTE declared that they had di
2015-05-23 11:27:08
1000
原创 poj 2777 Count Color (线段树区间更新)
Count ColorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 37647 Accepted: 11315DescriptionChosen Problem Solving and Program design as an optional cour
2015-04-14 19:20:05
1256
1
原创 poj 3468 A Simple Problem with Integers (线段树区间更新入门)
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 70442 Accepted: 21723Case Time Limit: 2000MSDescriptionYou have N i
2015-04-14 19:13:33
743
原创 Codeforces Round #157 (Div. 1) C. Little Elephant and LCM (数学、dp)
C. Little Elephant and LCMtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Little Elephant loves the LC
2014-11-05 22:53:22
1458
原创 zoj 3820 Building Fire Stations (二分+树的直径)
Building Fire StationsTime Limit: 5 Seconds Memory Limit: 131072 KB Special JudgeMarjar University is a beautiful and peaceful place. There are N buildings andN - 1 bidirection
2014-10-24 20:39:52
1417
原创 hdu 4249 A Famous Equation (dp 细节)
A Famous EquationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 514 Accepted Submission(s): 153Problem DescriptionMr. B wr
2014-10-23 21:45:41
921
原创 uva live 6190 Beautiful Spacing (二分+dp检验 根据特有性质优化)
I - Beautiful SpacingTime Limit:8000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionText is a sequence of words, and a word consists of character
2014-10-04 15:50:34
1694
原创 hdu 1814 Peaceful Commission (2-sat 输出字典序最小路径)
Peaceful CommissionTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1948 Accepted Submission(s): 560Problem DescriptionThe
2014-10-01 23:01:52
1156
原创 hdu 4089 Activation (概率dp 手动消元)
ActivationTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1562 Accepted Submission(s): 592Problem DescriptionAfter 4 year
2014-10-01 22:07:20
1063
原创 cug oj 1479 Treasure Chest Lock (区间dp 思维)
1479: Treasure Chest LockTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 7 Solved: 5[Submit][Status][Web Board]Description Vic has a treasure chest. And there is a lock on the treasure c
2014-10-01 15:12:49
1113
原创 bnu oj 34985 Elegant String (矩阵+dp)
Elegant StringWe define a kind of strings as elegant string: among all the substrings of an elegant string, none of them is a permutation of "0, 1,…, k".Let function(n, k) be the numbe
2014-09-30 16:14:43
1273
原创 poj 1390 Blocks (经典区间dp 方块消除)
BlocksTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4250 Accepted: 1704DescriptionSome of you may have played a game called 'Blocks'. There are n bloc
2014-09-28 19:49:45
2618
原创 hdu 4412 Sky Soldiers (区间dp 单调性)
Sky SoldiersTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 556 Accepted Submission(s): 179Problem DescriptionAn airplane car
2014-09-25 15:59:28
1249
原创 hdu 3844 Mining Your Own Business (点双连通分量)
Mining Your Own BusinessTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1392 Accepted Submission(s): 219Problem DescriptionJo
2014-09-23 15:34:56
1356
原创 hdu 5036 Explosion (bitset优化的传递闭包求解概率)
ExplosionTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 142 Accepted Submission(s): 25Problem DescriptionEveryone knows Ma
2014-09-22 16:15:08
2190
转载 bitset 用法
出处:点击打开链接bitset 类简化了位集的处理,有些程序要使用二进制位的有序集来保存一组项或条件的标志位,可以考虑使用bitset。需要的文件:#include Using std::bitsetl bitset 对象的定义和初始化定义bitset时,要明确bitset有多少位:bitset
2014-09-22 16:00:24
2458
原创 hdu 4779 Tower Defense (思维+组合数学)
Tower DefenseTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 474 Accepted Submission(s): 126Problem Description DRD loves
2014-09-17 17:30:13
1709
原创 hdu 4035 Maze (树上的概率dp)
MazeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 1672 Accepted Submission(s): 635Special JudgeProblem DescriptionWhen
2014-09-17 11:29:50
1061
原创 hdu 4661 Message Passing (思维 dp求拓扑排序数)
Message PassingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1184 Accepted Submission(s): 420Problem DescriptionThere ar
2014-09-16 23:46:41
1237
原创 zoj 3816 Generalized Palindromic Number (根据对称性来搜)
Generalized Palindromic NumberTime Limit: 2 Seconds Memory Limit: 65536 KB A number that will be the same when it is written forwards or backwards is known as a palindromic number. For
2014-09-12 11:08:10
1047
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人