自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

hg_zhh

莫道君行早,更有早行人。全心敲代码,天道自酬勤。

  • 博客(29)
  • 资源 (5)
  • 收藏
  • 关注

原创 1057. Stack (30)(树状数组)

Stack (30)Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top positi

2017-11-30 21:23:57 170

转载 1131. Subway Map (30)

In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help people with y

2017-11-28 20:59:41 257

原创 28. Queue

time limit per test: 2 seconds memory limit per test: 256 megabytesThere are n walruses standing in a queue in an airport. They are numbered starting from the queue’s tail: the 1-st walrus stands at

2017-11-28 12:18:52 298

原创 25. Binary Number

Binary Number time limit per test: 1 seconds memory limit per test: 256 megabytesLittle walrus Fangy loves math very much. That’s why when he is bored he plays with a number performing some operat

2017-11-27 16:01:37 380

原创 13. Lucky Numbers (easy)

Lucky Numbers (easy) time limit per test: 2 seconds memory limit per test: 256 megabytesPetya loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation

2017-11-26 13:47:20 353

原创 10. Leaders

Leaders time limit per test: 2 seconds memory limit per test: 256 megabytesAfter a revolution in Berland the new dictator faced an unexpected challenge: the country has to be somehow ruled. The di

2017-11-25 20:34:57 288

原创 4. Running Student

Running Student time limit per test: 1 seconds memory limit per test: 64 megabytesAnd again a misfortune fell on Poor Student. He is being late for an exam.Having rushed to a bus stop that is in p

2017-11-21 15:54:57 488

原创 1135. Is It A Red-Black Tree (30)(判断红黑树)

There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties:(1) Every node is either red or black.(2) The root is black.(3) Every lea

2017-11-21 10:31:15 484

原创 1344 走格子

有编号1-n的n个格子,机器人从1号格子顺序向后走,一直走到n号格子,并需要从n号格子走出去。机器人有一个初始能量,每个格子对应一个整数A[i],表示这个格子的能量值。如果A[i] > 0,机器人走到这个格子能够获取A[i]个能量,如果A[i] < 0,走到这个格子需要消耗相应的能量,如果机器人的能量 < 0,就无法继续前进了。问机器人最少需要有多少初始能量,才能完成整个旅程。例如:n = 5。{1

2017-11-19 21:49:53 184

原创 1347 旋转字符串

1347 旋转字符串 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 收藏 关注 S[0…n-1]是一个长度为n的字符串,定义旋转函数Left(S)=S[1…n-1]+S[0].比如S=”abcd”,Left(S)=”bcda”.一个串是对串当且仅当这个串长度为偶数,前半段和后半段一样。比如”abcabc”是对串,”aabbcc”则不是。 现在问题是给定一个

2017-11-19 13:43:20 152

原创 1127. ZigZagging on a Tree (30) (中序,后序,求层序)

Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple stan

2017-11-16 22:05:48 278

原创 1129. Recommendation System (25)

Recommendation System (25)Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user’s prefer

2017-11-16 21:23:19 234

原创 1126. Eulerian Path (25)

Eulerian Path (25)In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which starts and ends on the same vert

2017-11-15 21:28:28 120

原创 1125. Chain the Ropes (25)

Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting cha

2017-11-15 20:10:06 194

原创 1124. Raffle for Weibo Followers (20)

Raffle for Weibo Followers (20)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo – that is, he would select winners from every N followers wh

2017-11-15 19:56:57 138

原创 1130. Infix Expression (25)

Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specification:Each input file contains o

2017-11-14 20:08:27 124

原创 1128. N Queens Puzzle (20)

The “eight queens puzzle” is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, c

2017-11-13 09:12:42 197

原创 1064. Complete Binary Search Tree (30)

Complete Binary Search Tree (30)时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Binary Search Tree (BST) is recursively defined as a binary tree which has the following

2017-11-12 19:24:18 221

原创 10531053. Path of Equal Weight (30)

Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R to

2017-11-11 00:41:23 247

原创 1043. Is It a Binary Search Tree (25)(判断二叉树)

Is It a Binary Search Tree (25)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than

2017-11-09 19:10:16 1192

原创 1024. Palindromic Number (25)

Palindromic Number (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A number that will be the same when it is written forwards or backwards is known as a Palindromic N

2017-11-09 17:17:16 95

原创 1021. Deepest Root (25)(图的直径)

Deepest Root (25)A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest t

2017-11-08 23:45:21 236

原创 1122. Hamiltonian Cycle (25)(哈密顿)

Hamiltonian Cycle (25)The “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a “Hamiltonian cycle”.In this problem, you are supposed to te

2017-11-07 20:05:20 757

原创 1121. Damn Single (25)(单身狗)

Damn Single (25)时间限制 300 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue “Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find thos

2017-11-07 19:45:16 204

原创 1120. Friend Numbers (20)(朋友数)

Friend Numbers (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Two integers are called “friend numbers” if they share the same sum of their digits, and the sum is the

2017-11-07 19:36:07 519

原创 1115. Counting Nodes in a BST (30)(建立二叉搜索树)

Counting Nodes in a BST (30)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Binary Search Tree (BST) is recursively defined as a binary tree which has the following pro

2017-11-07 19:28:40 166

原创 1134. Vertex Cover (25)(最小点集覆盖)

Vertex Cover (25)时间限制 600 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least o

2017-11-07 19:19:59 322

原创 1133. Splitting A Linked List (25)(结构体)

Splitting A Linked List (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a singly linked list, you are supposed to rearrange its elements so that all the negativ

2017-11-06 20:52:43 236

原创 计蒜客—八皇后问题

努比亚和苏丹没有子女,所以他要从一些有集成资格的继承者中挑选一个出来继承王位。他希望这个继承者足够聪明,所以他准备了一个西洋棋盘,上面的每个格子中均有一个 1-991−99 的数字。他又准备了 88 个皇后棋子。88 皇后的规则就是不能有任何棋子同行或者同列或者同斜线,在满足这个规则的同时,王位继承者还需要让 88 个皇后所在的位置的数字的和是最大的。输入格式输入一个数字 k(k\leq 20)k(

2017-11-01 23:56:52 749

耶鲁人脸数据集

本资源是耶鲁人脸数据集,本来下载的格式乱了,鄙人手动修改的

2019-04-03

上海交大ACM模板

此模板为上海交通大学ACM模板。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

2017-10-23

OpenGL配置文件及方法

本压缩包,包含了OpenGL的安装方法,及相应的文件

2017-08-23

ACM解题模板

本模板适用于C/C++ACMer,对于基本的题目类型归纳总结

2017-06-03

matlab综合编程

MATLAB5.X程序设计语言.pdf、 MATLAB5.X入门与提高.pdf、 MATLAB5手册.pdf、

2016-09-30

空空如也

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

TA关注的人

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