自定义博客皮肤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 539

原创 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 476

原创 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 497

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

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

2015-06-21 18:09:16 1092

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

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

2015-04-23 12:53:03 651

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

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

2015-04-21 21:36:49 641

原创 设计模式 - 简单工厂模式/静态工厂模式(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 479

原创 微软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 862

原创 C++知识点复习

static static变量只能初始化一次: #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 486

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

UVA - 10673 Play with Floor and Ceil Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description Problem A Play with Floor and Ceil

2014-10-22 12:40:50 602

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

UVA - 10883 Supermean Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description Problem F Supermean Time Limit: 2 s

2014-10-20 17:56:49 705

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

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

2014-10-19 17:56:27 723

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

Stammering Aliens Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 745    Accepted Submission(s): 283 Problem Description Dr. E

2014-10-16 16:57:07 1001

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

Robotic Sort Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2478    Accepted Submission(s): 1105 Problem Description Somewhere

2014-10-14 16:19:10 962

原创 UVa 11922 - Permutation Transformer (Splay)

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

2014-10-14 11:47:32 555

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

A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 64159   Accepted: 19757 Case Time Limit: 2000MS Description You have N i

2014-10-13 21:10:42 580

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

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

2014-10-07 13:24:25 1131

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

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

2014-10-05 20:16:17 749

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

UVA - 10829 L-Gap Substrings Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description Problem J L-Gap Substri

2014-10-04 14:21:28 904

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

Maximum repetition substring Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7099   Accepted: 2118 Description The repetition number of a string is defined a

2014-10-04 10:39:17 701

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

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

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

原创 UVa 11488 - Hyper Prefix Sets (Trie)

UVA - 11488 Hyper Prefix Sets Time Limit: 2000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description H Hyper

2014-10-01 18:37:01 999

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

UVA - 11525 Permutation Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description Problem F Permutation Input

2014-09-28 21:15:41 903

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

Relief grain Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 100000/100000 K (Java/Others) Total Submission(s): 745    Accepted Submission(s): 182 Problem Description The soil is

2014-09-28 19:35:57 685

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

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

2014-09-28 12:49:02 621

原创 UVaLive 4108 - SKYLINE (线段树)

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

2014-09-28 11:07:30 994

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

Tree Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 567    Accepted Submission(s): 121 Problem Description You 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. It has 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-Find Time Limit: 1000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description Problem A Almost Unio

2014-09-26 23:40:53 558

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

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

2014-09-26 14:07:19 699

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

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

2014-09-25 10:38:44 784

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

UVA - 11988 Broken 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 922

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

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

2014-09-23 15:11:42 538

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

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

2014-09-23 10:21:46 901

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

UVA - 10828 Back to Kernighan-Ritchie Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description Problem I Back t

2014-09-20 23:50:17 592

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

UVA - 11762 Race to 1 Time Limit: 10000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description B Race to 1 Inpu

2014-09-18 10:32:39 861

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

UVA - 11427 Expect the Expected Time Limit: 2000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status]   Description Problem A Expect the

2014-09-17 21:13:02 618

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

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

2014-09-17 19:02:07 507

算法导论中文版

算法导论中文版

2013-12-30

空空如也

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

TA关注的人

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