- 博客(145)
- 资源 (7)
- 收藏
- 关注
原创 『杭电1720』A+B Coming
Problem DescriptionMany classmates said to me that A+B is must needs.If you can’t AC this problem, you would invite me for night meal. ^_^InputInput may contain multiple test cases. Each case contains A and B in one line.A, B are hexadecimal num
2020-09-30 06:08:24 157
原创 『杭电1719』Friend
Problem DescriptionFriend number are defined recursively as follows.(1) numbers 1 and 2 are friend number;(2) if a and b are friend numbers, so is ab+a+b;(3) only the numbers defined in (1) and (2) are friend number.Now your task is to judge whether
2020-09-30 06:06:51 125
原创 『杭电1718』Rank
Problem DescriptionJackson wants to know his rank in the class. The professor has posted a list of student numbers and marks. Compute Jackson’s rank in class; that is, if he has the top mark(or is tied for the top mark) his rank is 1; if he has the seco
2020-09-30 06:04:54 109
原创 『杭电1717』小数化分数2
Problem DescriptionRay 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢?请你写一个程序不但可以将普通小数化成最简分数,也可以把循环小数化成最简分数。Input第一行是一个整数N,表示有多少组数据。每组数据只有一个纯小数,也就是整数部分为0。小数的位数不超过9位,循环部分用()括起来。Output对每一个对应的小数化成最简分数后输出,占一行。Sample Inpu
2020-09-30 06:02:21 133
原创 『杭电1716』排列2
Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。Input每组数据占一行,代表四张卡片上的数字(0<=数字<=9),如果四张卡片都是0,则输入结束。Output对每组卡片按从小到大的顺序输出所有能由这四张卡片组成的4位数,千位数字相同的在同一行,同一行中每个四位数间用空格分隔。每组输出数据间空一行,最后一组数据后面没有空行。Sample Input
2020-09-30 05:59:59 249
原创 题701. 二叉搜索树中的插入操作
Javapublic class Solution { public TreeNode insertIntoBST(TreeNode root, int val) { if(root == null) { return new TreeNode(val); } if(root.val < val) { root.right = insertIntoBST(root.right, val);...
2020-09-30 05:55:07 122
原创 『杭电1715』大菲波数
Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。Output输出为N行,每行为对应的f(Pi)。Sample Input512345Sample Output11235Source
2020-09-29 06:59:23 138
原创 『杭电1714』RedField
Problem DescriptionAs the graph you see below, we named the red part "RedField".The read part is the intersection of an ellipse and a triangle.Now, 8600's not good at math, so he wants you to help him calculate the area of the "RedField".InputTh
2020-09-29 06:57:20 121
原创 『杭电1713』相遇周期
Problem Description2007年3月26日,在中俄两国元首的见证下,中国国家航天局局长孙来燕与俄罗斯联邦航天局局长别尔米诺夫共同签署了《中国国家航天局和俄罗斯联邦航天局关于联合探测火星-火卫一合作的协议》,确定中俄双方将于2009年联合对火星及其卫星“火卫一”进行探测。而卫星是进行这些探测的重要工具,我们的问题是已知两颗卫星的运行周期,求它们的相遇周期。Input输入数据的第一行为一个正整数T, 表示测试数据的组数. 然后是T组测试数据. 每组测试数据包含两组正整数,用空
2020-09-29 06:55:00 163
原创 『杭电1712』ACboy needs your help
Problem DescriptionACboy 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 course depending on the days he spend on it.How to arrange the M days for the N courses to maximize the prof
2020-09-29 06:52:12 173
原创 『杭电1711』Number Sequence
Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1] = b[2], ...... , a[K + M - 1]
2020-09-29 06:49:32 128
原创 题145. 二叉树的后序遍历
Javaclass Solution { public List<Integer> postorderTraversal(TreeNode root) { List<Integer> list = new ArrayList<>(); postOrder(root,list); return list; } public void postOrder(TreeNode ...
2020-09-29 06:45:42 102
原创 『杭电1710』Binary Tree Traversals
Problem DescriptionA 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 left and right subtrees. There are three most important ways in which the vertices of a binary tree can be
2020-09-28 07:23:44 164
原创 『杭电1709』The Balance
Problem DescriptionNow you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you should find out the qualities which cannot be measured from the range [1,S]. S is the total quality
2020-09-28 07:21:36 160
原创 『杭电1708』Fibonacci String
Problem DescriptionAfter little Jim learned Fibonacci Number in the class , he was very interest in it.Now he is thinking about a new thing -- Fibonacci String .He defines : str[n] = str[n-1] + str[n-2] ( n > 1 )He is so crazying that if someone g
2020-09-28 07:19:26 166
原创 『杭电1707』Spring-outing Decision
Problem DescriptionNow 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 a spring-outing.But we all select courses ourselves. We don't have classes at the same time.Now our monito
2020-09-28 07:16:21 151
原创 题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(); // 拓展新节点 if (f->left) { q.push(f->left); } if (f->ri...
2020-09-28 07:12:22 103
原创 『杭电1705』Count the grid
Problem DescriptionA lattice point is an ordered pair (x, y) where x and y are both integers. Given the coordinates of the vertices of a triangle (which happen to be lattice points), you are to count the number of lattice points which lie completely ins
2020-09-27 07:00:38 190
原创 『杭电1704』Rank
Problem Descriptionthere are N ACMers in HDU team.ZJPCPC Sunny Cup 2007 is coming, and lcy want to select some excellent ACMers to attend the contest. There have been M matches since the last few days(No two ACMers will meet each other at two matches,
2020-09-27 06:58:19 125
原创 『杭电1703』PBD
Problem DescriptionPrisonBreak is a popular TV programme in HDU. ACboy likes it very much, and he join a PrisonBreak discussing team called "PBD".Every Tuesday night, a lot of PBDers will contact with each other to discuss the newest plot of PrisonBreak
2020-09-27 06:55:36 178
原创 题235. 二叉搜索树的最近公共祖先
JavaScript/** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } *//** * @param {TreeNode} root * @param {TreeNode} p * @param {TreeNode} q * @return {TreeNode}...
2020-09-27 06:50:42 114
原创 『杭电1700』Points on Cycle
Problem DescriptionThere 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 it, to maximize the sum of the distance between each otheryou may assume that the radius of the cycle will
2020-09-26 07:07:28 144
原创 『杭电1698』Just a Hook
Problem DescriptionIn 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 several consecutive metallic sticks which are of the same length.Now Pudge wants to do some operations on.
2020-09-26 07:04:28 212
原创 题113. 路径总和 II
C++/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public: vector<vector<int..
2020-09-26 06:59:30 102
原创 『杭电1695』GCD
Problem DescriptionGiven 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 common divisor of x and y. Since the number of choices may be very large, you're only required to output the total
2020-09-25 07:24:07 376
原创 『杭电1693』Eat the Trees
Problem DescriptionMost 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. When the game goes to end however, Pudge is not a strong hero any more.So Pudge’s teammates give him a new
2020-09-25 07:20:53 219
原创 『杭电1692』Destroy the Well of Life
Problem DescriptionIn the game of DotA (Defense of the Ancient), there are two opposite legions called The Sentinel and The Scourage.Now The Scourage has made a big success and The Sentinel is at stake!So The Sentinel must destroy the Well of Life o
2020-09-25 07:18:25 208
原创 『杭电1691』Chinese Chess
Problem DescriptionChinese chess, or Xiangqi is an extremely popular game in the Eastern Hemisphere. It is currently played by millions (or tens of millions) in China's mainland, Taiwan, Thailand, Singapore, Vietnam, Hong Kong and other Asian countries.
2020-09-25 07:15:58 242
原创 题106. 从中序与后序遍历序列构造二叉树
Javaclass Solution { public TreeNode buildTree(int[] inorder, int[] postorder) { if(postorder.length>0) { TreeNode root =new TreeNode(postorder[postorder.length-1]); List<Integer> order=new ArrayList<...
2020-09-25 07:10:46 112
原创 『杭电1690』Bus System
Problem DescriptionBecause of the huge population of China, public transportation is very important. Bus is an important transportation method in traditional public transportation system. And it’s still playing an important role even now.The bus system
2020-09-24 07:19:34 111
原创 『杭电1689』Alien’s Necklace
Problem DescriptionJYY is taking a trip to Mars. To get accepted by the Martians, he decided to make a magic necklace for their king. (Otherwise, JYY will be eaten) Now, he has collected many magic balls, and he is going to string them up.Unfortunately
2020-09-24 07:16:06 152
原创 『杭电1688』Sightseeing
Problem DescriptionTour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one city S to another city F. On this way, the tourists in the bus can see the sights alongside the route travelled. Moreo
2020-09-24 07:12:58 138
原创 『杭电1687』Lucky Light
Problem DescriptionWe have a (point) light source at position (xL, yL) with yL > 0, and a finite series of line segments, all of finite non-zero length, given by the coordinates of their two endpoints. These endpoints are all different. The line segm
2020-09-24 07:10:19 117
原创 『杭电1686』Oulipo
Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais tout s’affirmait faux. Tout avait Fair nor
2020-09-24 07:07:54 116 1
原创 题501. 二叉搜索树中的众数
C++/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public: vector<int...
2020-09-24 07:05:15 117
原创 『杭电1685』Booksort
Problem DescriptionThe Leiden University Library has millions of books. When a student wants to borrow a certain book, he usually submits an online loan form. If the book is available, then the next day the student can go and get it at the loan counter.
2020-09-23 07:31:50 171
原创 『杭电1684』Projects
Problem DescriptionIn a certain week, a company wants to finish m projects. To this end, the company can employ at most n people from the unemployment agency for a period of one week. Each external employee will cost the company salary euro, unless the
2020-09-23 07:29:20 69
原创 『杭电1683』Colour sequence
Problem DescriptionWe have a pile of cards consisting of 100 cards that are coloured on both sides. There is a finite number of colours (at most 26). In addition there are special cards called jokers. Jokers have a joker sign on both sides, which can as
2020-09-23 07:26:23 194
原创 『杭电1681』Frobenius
Problem DescriptionThe Frobenius problem is an old problem in mathematics, named after the German mathematician G. Frobenius (1849–1917).Let a1, a2, …, an be integers larger than 1, with greatest common divisor (gcd) 1. Then it is known that there are
2020-09-23 07:24:00 255
原创 题617. 合并二叉树
C++class Solution {public: TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2) { if (t1==NULL) {//两树的值比较,以一个为基准 return t2; } if (t2==NULL) { return t1; } t1->val+=t2->val;//合并...
2020-09-23 07:21:40 123
51单片机竞赛设计实例程序44例(Proteus仿真资料).zip
2020-06-09
《单片机C语言程序设计实训100例——基于8051+Proteus仿真》案例压缩包.zip
2020-06-09
单片机原理与应用实验.zip
2020-06-08
计算机网络实验1.docx
2020-04-30
floor light_19.11.1.mix
2020-04-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人