自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

有礼貌的程序员

最好走的路越走越难,最难走的路越走越容易。

  • 博客(63)
  • 收藏
  • 关注

原创 hadoop hdfs 灾备、动态扩容测试

听说hadoop以灾备能力、动态扩展能力著称。我的集群部署方案见 http://blog.csdn.net/a775700879/article/details/20692259今天做几个简单的试验:实验一: 模拟一块硬盘突然挂掉假设datanode的数据存储目录有两个,分别是/data1/hadoop-dn 和 /data2/hadoop-dn我们直接强行删除掉任意一个datan

2014-03-07 11:34:20 4495

原创 hadoop 2.3.0 搭建指南

一. 准备工作(搭建环境:Ubuntu 12.04) 假设我们有三台机器。一台做master,另外两台做slave。所有的操作都先只在master上操作,然后scp同步到slaves。1、创建hadoop用户,建立master到两台slaves的信任关系(如何建立,可以百度一下)adduser hadoopusermod hadoop -G sudo -a # 添加到超级

2014-03-07 10:17:41 2869

原创 mongodb中索引对range查询和sort操作的影响

mongodb中索引对range查询和sort操作的影响,一个有代表性的试验和一些结论。

2014-02-07 00:31:02 2751 1

原创 [leetcode]Best Time to Buy and Sell Stock I, II, III

这三道与股票相关的题目很有意思,有一些常用的小tricky和代码简洁技巧都用到了。第一题Say you have an array for which the ith element is the price of a given stock on dayi.If you were only permitted to complete at most one transacti

2014-01-23 16:20:16 1121

原创 [leetcode]Binary Tree Maximum Path Sum

原题目:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.

2014-01-23 00:39:34 1251

原创 poj 2115(数论)

C LooooopsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15678 Accepted: 4006DescriptionA Compiler Mystery: We are given a C-language style for loop of t

2013-11-17 10:58:16 941

原创 poj 1845(快速幂+二分计算等比数列和+大数因子分解+因子和计算+模除溢出)

SumdivTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12755 Accepted: 3100DescriptionConsider two natural numbers A and B. Let S be the sum of all natural

2013-11-17 10:57:55 1855

原创 poj 3292(筛法+两两组合)

Semi-prime H-numbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6924 Accepted: 2959DescriptionThis problem is based on an exercise of David Hilbert,

2013-11-17 10:57:29 1081

原创 poj 2635(筛素数+同模余定理+缩位)

The Embarrassed CryptographerTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 11525 Accepted: 3074DescriptionThe young and very promising cryptographer Odd

2013-11-17 10:56:57 1192

原创 poj 1942(裸组合数+隐式类型转换)

Paths on a GridTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 20134 Accepted: 4890DescriptionImagine you are attending your math lesson at school. Once a

2013-11-17 10:56:08 1129

原创 poj 1019(组外偏移->组内偏移)

Number SequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31916 Accepted: 9075DescriptionA single positive integer i is given. Write a program to fin

2013-11-17 10:55:30 1029

原创 poj 1850(以字符a开始长度为len的个数+数字本身)

CodeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 7265 Accepted: 3398DescriptionTransmitting and memorizing information is a task that requires differen

2013-11-17 10:54:59 844

原创 poj 3252(细心+组合数溢出+边界条件计算+算上数据本身)

Round NumbersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7756 Accepted: 2674DescriptionThe cows, as you know, have no fingers or thumbs and thus are

2013-11-17 10:54:10 1178

转载 sqrt原理(原标题《sqrt引发的血案》)

好吧,我承认我标题党了,不过既然你来了,就认真看下去吧,保证你有收获。我们平时经常会有一些数据运算的操作,需要调用sqrt,exp,abs等函数,那么时候你有没有想过:这个些函数系统是如何实现的?就拿最常用的sqrt函数来说吧,系统怎么来实现这个经常调用的函数呢?虽然有可能你平时没有想过这个问题,不过正所谓是“临阵磨枪,不快也光”,你“眉头一皱,计上心来”,这个不是太简单了嘛,用二分的方法

2013-11-12 12:40:37 1670 2

原创 poj 1159(回文串dp)

PalindromeTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 49315 Accepted: 16937DescriptionA palindrome is a symmetrical string, that is, a string read i

2013-11-10 16:03:36 849

原创 poj 1080(sum初始化&数组下标i&最长公共自序列类型)

Human Gene FunctionsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15979 Accepted: 8886DescriptionIt is well known that a human gene can be considered

2013-11-10 16:01:24 804

原创 poj 3176(简单杨辉三角n*(n+1)/2)

ow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12423 Accepted: 8189DescriptionThe cows don't use actual bowling balls when they go bowling. T

2013-11-10 16:00:49 1168

原创 poj 2533(裸的LIS,很少见的水题)

Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 29448 Accepted: 12812DescriptionA numeric sequence of ai is ordered if a1 a2

2013-11-10 16:00:14 796

原创 poj 1260(购买且是最后一个购买的dp问题)

PearlsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6786 Accepted: 3317DescriptionIn Pearlania everybody is fond of pearls. One company, called The Ro

2013-11-10 15:59:42 1022

原创 poj 1836(简单DP+两边lis)

AlignmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11750 Accepted: 3746DescriptionIn the army, a platoon is composed by n soldiers. During the mor

2013-11-10 15:59:05 787

原创 poj 3267(匹配最近的单词)

The Cow LexiconTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7445 Accepted: 3480DescriptionFew know that the cows have their own dictionary with W (1

2013-11-10 15:57:43 747

原创 poj 1276(背包问题,二进制优化技巧)

Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24663 Accepted: 8645DescriptionA Bank plans to install a machine for cash withdrawal. The ma

2013-11-10 15:56:53 731

原创 poj 1837(背包weight可能为负数的情况)

BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 9452 Accepted: 5815DescriptionGigel has a strange "balance" and he wants to poise it. Actually, t

2013-11-10 15:56:12 801

原创 poj 1129(ID-DFS四色定理)

Channel AllocationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11099 Accepted: 5700DescriptionWhen a radio station is broadcasting over a very large ar

2013-11-01 22:01:54 981

原创 poj 2676(dfs求解数独问题,对行列和格子分别加bool数组优化搜索)

SudokuTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12350 Accepted: 6163 Special JudgeDescriptionSudoku is a very simple task. A square table with 9

2013-11-01 22:01:04 1038

原创 poj 1416(水dfs搜索题,整数预先转化为字符串)

Shredding CompanyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3696 Accepted: 2099DescriptionYou have just been put in charge of developing a new shredd

2013-11-01 22:00:48 809

原创 poj 2531(按位暴力枚举2^20很easy)

Network SaboteurTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8492 Accepted: 3928DescriptionA university network is composed of N computers. System admi

2013-11-01 21:59:59 845

原创 poj 2418(trie树其实用map可能水过)

Hardwood SpeciesTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 16461 Accepted: 6564DescriptionHardwoods are the botanical group of trees that have broad

2013-11-01 21:56:02 683

原创 poj 2513(trie树+并查集+欧拉回路条件)(记得要初始化指针数组)

Colored SticksTime Limit: 5000MS Memory Limit: 128000KTotal Submissions: 28302 Accepted: 7481DescriptionYou are given a bunch of wooden sticks. Each endpoint of eac

2013-11-01 21:52:49 626

原创 poj 1442(两个优先队列)

Black BoxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6109 Accepted: 2476DescriptionOur Black Box represents a primitive database. It can save an integ

2013-11-01 21:51:59 832

原创 poj 2442(堆的stl实现)

SequenceTime Limit: 6000MS Memory Limit: 65536KTotal Submissions: 6281 Accepted: 1962DescriptionGiven m sequences, each contains n non-negative integer. Now we may

2013-11-01 21:51:40 714

原创 poj 3253(哈夫曼树priority_queue实现)

Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 21011 Accepted: 6697DescriptionFarmer John wants to repair a small length of the fence aroun

2013-11-01 21:49:49 654

原创 理解字符乱码问题

我们在平时编程序时,经常会遇到乱码问题。往往会让我们措手不及。经常是百度谷歌了一通,依然不能很好解决。想从根源上理解乱码问题是如何产生的,就应该去深刻理解乱码问题产生的根本原因:首先,任何字符在计算机系统中的存储都一定是01序列。这一点我们一定要时刻认识到。如果你什么都不告诉计算机,计算机自然会以01序列的方式读取文件。至于如何理解这些01序列到底代表人类语言中的哪个字

2013-10-31 21:52:28 731

原创 poj 2503(scanf和gets读取字符串)

BabelfishTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 29101 Accepted: 12590DescriptionYou have just moved from Waterloo to a big city. The people here

2013-10-26 19:26:07 667

原创 poj 2002(全等三角形计算正方形另外两个点坐标)

SquaresTime Limit: 3500MS Memory Limit: 65536KTotal Submissions: 14689 Accepted: 5564DescriptionA square is a 4-sided polygon whose sides have equal length and adja

2013-10-26 19:25:42 751

原创 poj 1840(移动几项到等式另外一边减少循环深度)

EqsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 11220 Accepted: 5480DescriptionConsider equations having the following form:a1x13+ a2x23+ a3x33+ a4x4

2013-10-26 19:25:13 635

原创 poj 2151(概率dp)

Check the difficulty of problemsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 4081 Accepted: 1807DescriptionOrganizing a programming contest is not an e

2013-10-26 19:24:03 758

原创 poj 3274(sum矩阵+sort)

Gold Balanced LineupTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 11195 Accepted: 3305DescriptionFarmer John's N cows (1 ≤ N ≤ 100,000) share many sim

2013-10-26 19:23:53 613

原创 poj 3349(重载比较操作符+排序)

SnowflakeSnowSnowflakesTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 27955 Accepted: 7393DescriptionYou may have heard that no two snowflakes are alik

2013-10-26 19:23:24 837

原创 poj1611(简单并查集)

The SuspectsTime Limit: 1000MS Memory Limit: 20000KTotal Submissions: 19335 Accepted: 9377DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia

2013-10-26 19:14:30 654

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除