自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(186)
  • 资源 (1)
  • 收藏
  • 关注

原创 LeetCode Sliding Window Maximum

Sliding Window Maximum题目DescriptionGiven an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the wind

2015-08-16 18:57:07 538

原创 LeetCode Search a 2D Matrix II

Search a 2D Matrix II题目DescriptionWrite an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from l

2015-08-16 00:57:39 475

原创 LeetCode Different Ways to Add Parentheses

Different Ways to Add ParenthesesGiven a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators

2015-08-16 00:29:19 496

原创 设计模式 - 建造者模式(Builder) C++实现

生成器模式(Builder)意图:将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示。

2015-06-21 18:09:16 1092

原创 设计模式 - 抽象工厂模式(Abstract Factory) C++实现

抽象工厂模式(Abstract Factory)意图:提供一个创建一系列相关或相互依赖对象的接口。之前的工厂方法模式,每增加一个产品,就需要增加一个具体产品类和一个对于工厂类。对于一些情况,比如设计一个UI库,有按钮、滚动条等组件,为了让程序更加个性化,需要实现程序可以换皮肤的功能,比如蓝色主题、红色主题等,而且要便于拓展新的主题。如果用工厂方法模式来实现的话,对每个组件都要一个相

2015-04-23 12:53:03 647

原创 设计模式 - 工厂方法(Factory Method) C++实现

工厂方法(Factory Method)意图:定义一个用于创建对象的接口,让子类决定实例化哪个类。解决简单工厂模式不支持开闭原则的缺点。实现:uml:ps 发现了一个Linux下面画UML很好用的软件 astah (community版免费)

2015-04-21 21:36:49 639

原创 设计模式 - 简单工厂模式/静态工厂模式(Static Factory Method) C++实现

简单工厂模式简单工厂模式又叫静态工厂方法,不属于23种GOF模式之一。适用场景:在程序的各个地方都需要new一些常用的对象,并且对new的对象要进行一些初始化,new操作散落在程序的各个地方,不便于管理和维护,因此引入简单工厂模式来统一管理常见对象的创建。客户调用工厂的方法,得到需要的产品,无需自己创建产品。工厂根据客户传入的参数或者配置文件来决定创建什么类型的产品。

2015-04-21 15:36:13 886

原创 设计模式 - 单例模式(Singleton) C++实现

创建型模式单例模式(Singleton)意图工厂方法模式(Factory Method)抽象工厂模式(Abstract Factory)原型模式(Prototype)生成器模式(Builder)

2015-04-20 23:41:01 474

原创 微软2016校园招聘在线笔试 - 第二题 Professor Q's Software

题目2 : Professor Q's Software时间限制:10000ms单点时限:1000ms内存限制:256MB描述Professor Q develops a new software. The software consists of N modules which are numbered from 1 to N. The

2015-04-03 22:39:42 846

原创 微软2016校园招聘在线笔试题目-第一题 Magic Box

题目1 : Magic Box时间限制:10000ms单点时限:1000ms内存限制:256MB描述The circus clown Sunny has a magic box. When the circus is performing, Sunny puts some balls into the box one by one. Th

2015-04-03 22:13:12 860

原创 C++知识点复习

staticstatic变量只能初始化一次:#include #include using namespace std;void fun(int i) { static int value = i; printf("%d\n", value);}int main() { fun(0); fun(1); fun(2);

2015-03-08 09:36:53 482

原创 UVa 10673 - Play with Floor and Ceil (扩展欧几里得)

UVA - 10673Play with Floor and CeilTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem APlay with Floor and Ceil

2014-10-22 12:40:50 602

原创 UVa 10883 - Supermean (杨辉三角 通过取对数解决大数除大数)

UVA - 10883SupermeanTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem FSupermeanTime Limit: 2 s

2014-10-20 17:56:49 703

原创 UVa 11038 - How Many O's? (组合数学 数位统计)

UVA - 11038How Many O's?Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem E: How many 0's?A Bened

2014-10-19 17:56:27 722

原创 HDU 4080 UVaLive 4513 - Stammering Aliens (字符串hash)

Stammering AliensTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 745    Accepted Submission(s): 283Problem DescriptionDr. E

2014-10-16 16:57:07 1001

原创 HDU 1890 UVaLive 3961 - Robotic Sort (Splay)

Robotic SortTime Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2478    Accepted Submission(s): 1105Problem DescriptionSomewhere

2014-10-14 16:19:10 962

原创 UVa 11922 - Permutation Transformer (Splay)

UVA - 11922Permutation TransformerTime Limit: 2000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  Description

2014-10-14 11:47:32 554

原创 POJ 1890 - A Simple Problem with Integers (线段树 Splay)

A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 64159 Accepted: 19757Case Time Limit: 2000MSDescriptionYou have N i

2014-10-13 21:10:42 580

原创 UVaLive 4847 - Binary Search Tree (与BST有关的计数问题)

UVALive - 4847Binary Search TreeTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionA bin

2014-10-07 13:24:25 1128

原创 UVaLive 3490 - Generator (AC自动机 期望DP 高斯消元)

UVALive - 3490GeneratorTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionWe can generat

2014-10-05 20:16:17 749

原创 UVa 10829 - L-Gap Substrings (后缀数组)

UVA - 10829L-Gap SubstringsTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem JL-Gap Substri

2014-10-04 14:21:28 902

原创 POJ 3693 - Maximum repetition substring (后缀数组)

Maximum repetition substringTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7099 Accepted: 2118DescriptionThe repetition number of a string is defined a

2014-10-04 10:39:17 701

原创 UVaLive 4126 - Password Suspects (AC自动机 DP)

UVALive - 4126Password SuspectsTime Limit: 9000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionYou are

2014-10-01 20:36:37 1340 2

原创 UVa 11488 - Hyper Prefix Sets (Trie)

UVA - 11488Hyper Prefix SetsTime Limit: 2000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionHHyper

2014-10-01 18:37:01 998

原创 UVa 11525 - Permutation (线段树 树状数组 康托展开式)

UVA - 11525PermutationTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem FPermutationInput

2014-09-28 21:15:41 901

原创 HDU 5029 - Relief grain (树链剖分 很巧妙的离线标记法)

Relief grainTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 100000/100000 K (Java/Others)Total Submission(s): 745    Accepted Submission(s): 182Problem DescriptionThe soil is

2014-09-28 19:35:57 685

原创 UVa 12299 - RMQ with Shifts (简单线段树)

UVA - 12299RMQ with ShiftsTime Limit: 1000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  Description  R

2014-09-28 12:49:02 620

原创 UVaLive 4108 - SKYLINE (线段树)

UVALive - 4108SKYLINETime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionThe skyline of Sin

2014-09-28 11:07:30 994

原创 HDU 5044 - Tree (树链剖分)

TreeTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 567    Accepted Submission(s): 121Problem DescriptionYou are given a tree (

2014-09-28 09:18:38 565

原创 UVALive 2191 - Potentiometers (树状数组)

A potentiometer, or potmeter for short, is an electronic device with a variable electric resistance. Ithas two terminals and some kind of control mechanism (often a dial, a wheel or a slide) with wh

2014-09-27 00:24:33 681

原创 UVa 11987 - Almost Union-Find (并查集 需要一点技巧)

Almost Union-FindTime Limit: 1000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem AAlmost Unio

2014-09-26 23:40:53 558

原创 HDU 3234 | UValive 4487 - Exclusive-OR (加权并查集)

Exclusive-ORTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2270    Accepted Submission(s): 634Problem DescriptionYou are not gi

2014-09-26 14:07:19 698

原创 UVa - 11136 Hoax or what (水题 最大最小堆 set)

UVA - 11136Hoax or whatTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem H: Hoax

2014-09-25 10:38:44 777

原创 UVa 11988 - Broken Keyboard (a.k.a. Beiju Text) (简单链表)

UVA - 11988Broken Keyboard (a.k.a. Beiju Text)Time Limit: 1000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  Description

2014-09-24 23:21:32 921

原创 HDU 4777 - Rabbit Kingdom (树状数组 区间互素数)

Rabbit KingdomTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1037    Accepted Submission(s): 343Problem Description  Long long

2014-09-23 15:11:42 536

原创 UVa 11107 - Life Forms (后缀数组 求出现K次的串 根据height分组)

UVA - 11107Life FormsTime Limit: 6666MS Memory Limit: Unknown 64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem C: Life

2014-09-23 10:21:46 900

原创 UVa 10828 - Back to Kernighan-Ritchie (概率DP 期望 高斯消元)

UVA - 10828Back to Kernighan-RitchieTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem IBack t

2014-09-20 23:50:17 591

原创 UVa 11762 - Race to 1 (概率 期望 DP 马尔可夫过程)

UVA - 11762Race to 1Time Limit: 10000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionBRace to 1Inpu

2014-09-18 10:32:39 860

原创 UVA 11427 - Expect the Expected (概率DP 期望)

UVA - 11427Expect the ExpectedTime Limit: 2000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit]   [Go Back]   [Status]  DescriptionProblem AExpect the

2014-09-17 21:13:02 617

原创 HDU 5015 - 233 Matrix (矩阵构造 矩阵快速幂)

233 MatrixTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 644    Accepted Submission(s): 386Problem DescriptionIn our daily lif

2014-09-17 19:02:07 506

算法导论中文版

算法导论中文版

2013-12-30

空空如也

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

TA关注的人

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