自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 资源 (2)
  • 收藏
  • 关注

原创 [微软]题目4 : Image Encryption

时间限制:10000ms单点时限:1000ms内存限制:256MB描述A fancy square image encryption algorithm works as follow:0. consider the image as an N x N matrix1. choose an integer k∈ {0, 1, 2, 3}2. rotate the square image k

2015-09-29 21:27:28 818 2

原创 [微软]题目3 : Fibonacci

时间限制:10000ms单点时限:1000ms内存限制:256MB描述Given a sequence {an}, how many non-empty sub-sequence of it is a prefix of fibonacci sequence.A sub-sequence is a sequence that can be derived from another seque

2015-09-29 21:26:30 661

原创 [微软]题目2 : Total Highway Distance

时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Hi and Little Ho are playing a construction simulation game. They build N cities (numbered from 1 to N) in the game and connect them by N-1 highways. It is

2015-09-29 21:25:48 1130 2

原创 [微软]题目1 : Farthest Point

题目1 : Farthest Point时间限制:5000ms单点时限:1000ms内存限制:256MB描述Given a circle on a two-dimentional plane.Output the integral point in or on the boundary of the circle which has the largest distance from th

2015-09-29 21:24:20 989

原创 [LeetCode]Validate Binary Search Tree

Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.The right

2015-09-29 11:10:23 236

原创 [LeetCode] Unique Binary Search Trees(!!DP)

Unique Binary Search Trees Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example, Given n = 3, there are a total of 5 unique BST’s. 1 3

2015-09-27 13:38:08 253

原创 [LeetCode] Binary Tree Inorder Traversal

Binary Tree Inorder Traversal My Submissions Question Solution Total Accepted: 85535 Total Submissions: 232962 Difficulty: Medium Given a binary tree, return the inorder traversal of its nodes’

2015-09-26 22:58:56 256

原创 [LeetCode]Restore IP Addresses(!!!!BackTrace)

Restore IP Addresses My Submissions Question Solution Total Accepted: 41299 Total Submissions: 192823 Difficulty: Medium Given a string containing only digits, restore it by returning all

2015-09-26 22:08:57 380

原创 统计硬币

题目描述 假设一堆由1分、2分、5分组成的n个硬币总面值为m分,求一共有多少种可能的组合方式(某种面值的硬币可以数量可以为0)。 输入格式 输入数据第一行有一个正整数T,表示有T组测试数据。接下来的T行,每行有两个数n,m,n和m的含义同上。 输出 对于每组测试数据,请输出可能的组合方式数,每组输出占一行。 样例输入 2 3 5 4 8 样例输出 1 2

2015-09-16 23:06:25 2397

原创 [LeetCode] Gray Code

Gray Code My Submissions Question Solution Total Accepted: 41835 Total Submissions: 125744 Difficulty: Medium The gray code is a binary numeral system where two successive values differ in only

2015-09-16 20:42:05 306

原创 [LeetCode] Decode Ways(!!!DP)

Decode Ways My Submissions Question Solution Total Accepted: 47576 Total Submissions: 290697 Difficulty: Medium A message containing letters from A-Z is being encoded to numbers using the follow

2015-09-16 13:24:11 314

原创 [C++]C++11新特性

1、for 遍历数据的几种方式 第一个不好,万一numSet[i]不是O(1)的呢,容器可不止vector一种。 第二个太长了。 第三个是推荐的。 第四个是VC++的C++/CLI或C++/CX扩展,不过他跟第三个其实完全没有区别,因为互相都可以用。 第五个很难讲,主要是你要把整个程序写成函数式或响应式的,用这个才有额外的好处。

2015-09-14 09:45:12 299

原创 [C++]函数调用栈

函数调用时发生栈内存上的,这里主要涉及几个元素,函数调用,被调函数,函数参数。 涉及的过程主要有使用堆栈传递函数参数、保存返回地址、临时保存寄存器原有值(即函数调用的上下文)以备恢复以及存储本地局部变量。程序的内存可以参考进程内存 对于程序,编译器会对其分配一段内存,在逻辑上可以分为代码段,数据段,堆,栈 代码段:保存程序文本,指令指针EIP就是指向代码段,可读可执行不可写 数据段:保存初始

2015-09-12 16:40:16 2356 1

原创 [C++] volatie关键字

volatie关键字在嵌入式系统中这个关键字用的比较多,主要的用途是避免的编译器的优化。提醒它所声明的这个变量随时可能改变,所以,编译后的程序每次需要存储或读取这变量的时候,都会直接从变量地址中读取数据。比如一个信号量是某个 io口的高低电平,由于访问寄存器的速度要快于RAM,所以编译器一般都会作减少存取外部RAM的优化。一般来说,volatile用在如下的几个地方 1、中断服务程序中修改的供其

2015-09-11 15:10:57 640

原创 [LeetCode] Clone Graph(!!!!graph&dfs&bfs)

Clone Graph Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ’s undirected graph serialization: Nodes are labeled uniquely. We use # a

2015-09-10 22:37:06 329

原创 [LeetCode] Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given

2015-09-09 21:13:12 267

原创 [LeetCode] Reverse Linked List II(!!!)

Reverse Linked List II Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL.

2015-09-05 14:58:09 266

原创 [C++]模板与泛型编程(3)

成员模板普通(非模板)类的成员模板 我们设计一个类,包含一个重载的函数调用运算符,它接受一个指针并对此指针执行delete。与默认删除器不同,我们还在删除器被执行时打印一条信息。class DebugDelet{public: DebugDelet(std::ostream &s =std::cerr):os(s){} //与任何函数模板一样,T的类型有编译器推断 tem

2015-09-04 21:43:30 267

原创 [C++] 模板与泛型编程(2)

类模板类模板(class template)是用来生成类的蓝图的。与函数模板的不同之处是,编译器不能为类模板推断模板参数类型实现strblob的模板版本,提供对元素的共享(且核查过的)访问能力。template <typename T> class Blob{public: typedef T value_type; typedef typename std::vector<T>:

2015-09-04 14:53:07 348

原创 [C++] 模板与泛型编程(1)

面向对象编程(OOP)和泛型编程都能处理在编写程序时不知道类型的情况。不同之处在于,OOP能处理类型在程序运行之前都未知的情况;而在泛型编程中,在编译时就能获知类型了。STL中典型的容器、迭代器和算法都是泛型编程的例子。模板是泛型编程的基础。函数模板先说明下函数重载,重载就是函数名相同但实参的类型或数量不同的函数的调用。注意有两种:实参是类型不同或数量不同。(为什么不说形参,因为会有默认值的存在)如

2015-09-03 22:54:43 367

原创 [LeetCode] Largest Rectangle in Histogram

Largest Rectangle in Histogram Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.

2015-09-01 10:51:00 300

C 大型程序欣赏

c语言的大型程序 建议已经学过C 语言的人看 刚学的不适合

2010-10-11

c语言上机操作指导(tc和bc)

详细讲解TC和BC在windows下的上机操作

2010-03-26

空空如也

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

TA关注的人

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