自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 『杭电1720』A+B Coming

Problem Description Many classmates said to me that A+B is must needs. If you can’t AC this problem, you would invite me for night meal. ^_^ Inpu...

2020-09-30 06:08:24 39 0

原创 『杭电1719』Friend

Problem Description Friend number are defined recursively as follows. (1) numbers 1 and 2 are friend number; (2) if a and b are friend numbers, so ...

2020-09-30 06:06:51 17 0

原创 『杭电1718』Rank

Problem Description Jackson wants to know his rank in the class. The professor has posted a list of student numbers and marks. Compute Jackson’s ra...

2020-09-30 06:04:54 16 0

原创 『杭电1717』小数化分数2

Problem Description Ray 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢? 请你写一个程序不但可以将普通小数化成最简分数,也可以把循环小数化成最简分数。 Input 第一行是一个...

2020-09-30 06:02:21 10 0

原创 『杭电1716』排列2

Problem Description Ray又对数字的列产生了兴趣: 现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。 Input 每组数据占一行,代表四张卡片上的数字(0<=数字<=9),如果四张卡片都是0,则输入结束。 Ou...

2020-09-30 05:59:59 10 0

原创 题701. 二叉搜索树中的插入操作

Java public class Solution { public TreeNode insertIntoBST(TreeNode root, int val) { if(root == null) { return new TreeNode(...

2020-09-30 05:55:07 15 0

原创 『杭电1715』大菲波数

Problem Description Fibonacci数列,定义如下: f(1)=f(2)=1 f(n)=f(n-1)+f(n-2) n>=3。 计算第n项Fibonacci数值。 Input 输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)...

2020-09-29 06:59:23 15 0

原创 『杭电1714』RedField

Problem Description As the graph you see below, we named the red part "RedField".The read part is the intersection of an ellipse and a tr...

2020-09-29 06:57:20 18 0

原创 『杭电1713』相遇周期

Problem Description 2007年3月26日,在中俄两国元首的见证下,中国国家航天局局长孙来燕与俄罗斯联邦航天局局长别尔米诺夫共同签署了《中国国家航天局和俄罗斯联邦航天局关于联合探测火星-火卫一合作的协议》,确定中俄双方将于2009年联合对火星及其卫星“火卫一”进行探测。 而卫...

2020-09-29 06:55:00 14 0

原创 『杭电1712』ACboy needs your help

Problem Description ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different c...

2020-09-29 06:52:12 11 0

原创 『杭电1711』Number Sequence

Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <...

2020-09-29 06:49:32 9 0

原创 题145. 二叉树的后序遍历

Java class Solution { public List<Integer> postorderTraversal(TreeNode root) { List<Integer> list = new ArrayList<>()...

2020-09-29 06:45:42 12 0

原创 『杭电1710』Binary Tree Traversals

Problem Description A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the...

2020-09-28 07:23:44 43 0

原创 『杭电1709』The Balance

Problem Description Now you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. ...

2020-09-28 07:21:36 14 0

原创 『杭电1708』Fibonacci String

Problem Description After little Jim learned Fibonacci Number in the class , he was very interest in it. Now he is thinking about a new thing -- Fi...

2020-09-28 07:19:26 17 0

原创 『杭电1707』Spring-outing Decision

Problem Description Now is spring ! The sunshine is warm , the flowers is coming out . How lovely it is! So my classmates and I want to go out for ...

2020-09-28 07:16:21 15 0

原创 题117. 填充每个节点的下一个右侧节点指针 II

C++ q.push(root); while(!q.empty()) { int n = q.size(); for (int i = 1; i <= n; ++i) { auto f = q.front(); q.pop(); ...

2020-09-28 07:12:22 10 0

原创 『杭电1705』Count the grid

Problem Description A lattice point is an ordered pair (x, y) where x and y are both integers. Given the coordinates of the vertices of a triangle ...

2020-09-27 07:00:38 21 0

原创 『杭电1704』Rank

Problem Description there are N ACMers in HDU team. ZJPCPC Sunny Cup 2007 is coming, and lcy want to select some excellent ACMers to attend the con...

2020-09-27 06:58:19 14 0

原创 『杭电1703』PBD

Problem Description PrisonBreak is a popular TV programme in HDU. ACboy likes it very much, and he join a PrisonBreak discussing team called "...

2020-09-27 06:55:36 15 0

原创 题235. 二叉搜索树的最近公共祖先

JavaScript /** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } ...

2020-09-27 06:50:42 20 0

原创 『杭电1700』Points on Cycle

Problem Description There is a cycle with its center on the origin. Now give you a point on the cycle, you are to find out the other two points on ...

2020-09-26 07:07:28 15 0

原创 『杭电1698』Just a Hook

Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of sever...

2020-09-26 07:04:28 75 0

原创 题113. 路径总和 II

C++ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(i...

2020-09-26 06:59:30 13 0

原创 『杭电1695』GCD

Problem Description Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest co...

2020-09-25 07:24:07 17 0

原创 『杭电1693』Eat the Trees

Problem Description Most of us know that in the game called DotA(Defense of the Ancient), Pudge is a strong hero in the first period of the game. W...

2020-09-25 07:20:53 73 0

原创 『杭电1692』Destroy the Well of Life

Problem Description In the game of DotA (Defense of the Ancient), there are two opposite legions called The Sentinel and The Scourage. Now The Sco...

2020-09-25 07:18:25 77 0

原创 『杭电1691』Chinese Chess

Problem Description Chinese chess, or Xiangqi is an extremely popular game in the Eastern Hemisphere. It is currently played by millions (or tens o...

2020-09-25 07:15:58 11 0

原创 题106. 从中序与后序遍历序列构造二叉树

Java class Solution { public TreeNode buildTree(int[] inorder, int[] postorder) { if(postorder.length>0) { TreeNode roo...

2020-09-25 07:10:46 12 0

原创 『杭电1690』Bus System

Problem Description Because of the huge population of China, public transportation is very important. Bus is an important transportation method in ...

2020-09-24 07:19:34 13 0

原创 『杭电1689』Alien’s Necklace

Problem Description JYY is taking a trip to Mars. To get accepted by the Martians, he decided to make a magic necklace for their king. (Otherwise, ...

2020-09-24 07:16:06 14 0

原创 『杭电1688』Sightseeing

Problem Description Tour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one city S to a...

2020-09-24 07:12:58 12 0

原创 『杭电1687』Lucky Light

Problem Description We have a (point) light source at position (xL, yL) with yL > 0, and a finite series of line segments, all of finite non-zer...

2020-09-24 07:10:19 10 0

原创 『杭电1686』Oulipo

Problem Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a membe...

2020-09-24 07:07:54 13 0

原创 题501. 二叉搜索树中的众数

C++ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(i...

2020-09-24 07:05:15 8 0

原创 『杭电1685』Booksort

Problem Description The Leiden University Library has millions of books. When a student wants to borrow a certain book, he usually submits an onlin...

2020-09-23 07:31:50 27 0

原创 『杭电1684』Projects

Problem Description In a certain week, a company wants to finish m projects. To this end, the company can employ at most n people from the unemploy...

2020-09-23 07:29:20 13 0

原创 『杭电1683』Colour sequence

Problem Description We have a pile of cards consisting of 100 cards that are coloured on both sides. There is a finite number of colours (at most 2...

2020-09-23 07:26:23 8 0

原创 『杭电1681』Frobenius

Problem Description The Frobenius problem is an old problem in mathematics, named after the German mathematician G. Frobenius (1849–1917). Let a1, ...

2020-09-23 07:24:00 22 0

原创 题617. 合并二叉树

C++ class Solution { public: TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2) { if (t1==NULL) {//两树的值比较,以一个为基准 return t2; ...

2020-09-23 07:21:40 17 0

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