
刷题记录
rebornyp
人生如狗翁之马
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT-Java-1002-A+B for Polynomials (25)
1002. A+B for Polynomials (25)题目阐述 This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case. Each case occupies 2 lines原创 2018-01-10 15:45:03 · 350 阅读 · 0 评论 -
PAT-Java-Is It a Complete AVL Tree (30)
Is It a Complete AVL Tree题目阐述 An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they d...原创 2018-03-14 17:12:27 · 316 阅读 · 3 评论 -
C/C++语言学习记录
C/C++语言学习笔记及简单程序Demo记录1- 判别素数小程序#include <iostream>#include <stdio.h>using namespace std;int isPrime(int);int main() { int a; cin >> a; while (a != -1) {...原创 2018-03-26 09:51:10 · 301 阅读 · 0 评论 -
1099. Build A Binary Search Tree (30)
Build A Binary Search Tree题目阐述 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 k...原创 2018-04-01 11:56:08 · 257 阅读 · 4 评论 -
1021. Deepest Root (25)
Deepest Root题目阐述 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 h...原创 2018-03-27 18:28:49 · 171 阅读 · 0 评论 -
1024. Palindromic Number (25)
Palindromic Number A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers ...原创 2018-03-28 19:09:43 · 148 阅读 · 0 评论 -
1022. Digital Library (30)
Digital Library题目阐述 A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned ...原创 2018-03-29 16:40:28 · 135 阅读 · 0 评论 -
1091. Acute Stroke (30)
Acute Stroke题目阐述 One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MR...原创 2018-04-24 17:49:19 · 825 阅读 · 0 评论 -
1086. Tree Traversals Again (25)
Tree Traversals Again题目阐述 An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered f...原创 2018-04-25 18:34:13 · 361 阅读 · 0 评论 -
1076. Forwards on Weibo (30)
题目阐述 Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations...原创 2018-04-29 10:52:09 · 200 阅读 · 0 评论 -
PAT-Java-Head of a Gang(30)
Head of a Gang题目描述 One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a ...原创 2018-03-12 09:57:39 · 194 阅读 · 0 评论 -
PAT-Java-1033. To Fill or Not to Fill (25)
To Fill or Not to Fill题目描述 With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the ...原创 2018-03-14 22:41:26 · 259 阅读 · 0 评论 -
PAT-Java-First Contact (30)
First Contact题目阐述 Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually no原创 2018-02-05 16:24:03 · 559 阅读 · 0 评论 -
PAT-Java-1001-A+B Format (20)
1001. A+B Format (20)题目阐述 Calculate a + b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).原创 2018-01-10 14:12:51 · 385 阅读 · 1 评论 -
PAT-Java-1018-Public Bike Management (30)
1018. Public Bike Management (30)题目阐述 There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any stati原创 2018-01-13 11:39:38 · 455 阅读 · 0 评论 -
PAT-Java-1004-Counting Leaves (30)
1004. Counting Leaves (30)题目阐述 A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contains one原创 2018-01-13 15:54:18 · 327 阅读 · 0 评论 -
PAT-Java-1006-Sign In and Sign Out (25)
1006. Sign In and Sign Out题目阐述 At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the r原创 2018-01-13 16:18:50 · 384 阅读 · 0 评论 -
PAT-Java-1007. Maximum Subsequence Sum (25)
1007. Maximum Subsequence Sum (25)题目阐述 Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 Now you are supposed to find原创 2018-01-13 17:24:24 · 499 阅读 · 3 评论 -
PAT-Java-1005-Spell It Right (20)
1005. Spell It Right (20)题目阐述 Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification:原创 2018-01-13 16:23:28 · 285 阅读 · 0 评论 -
PAT-Java-1009-Product of Polynomials (25)
1009. Product of Polynomials (25)题目阐述 This time, you are supposed to find A*B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case原创 2018-01-14 10:38:52 · 289 阅读 · 0 评论 -
PAT-Java-All Roads Lead to Rome (30)
All Roads Lead to Rome题目描述 题目描述 Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the mo原创 2018-02-03 09:51:59 · 445 阅读 · 0 评论 -
PAT-Java-Final Grading(25)
Final Grading题目阐述 For a student taking the online course “Data Structures” on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain no原创 2018-02-04 20:16:48 · 235 阅读 · 0 评论 -
送快递的最短路径
题目描述:某物流派送员p,需要给a、b、c、d4个快递点派送包裹,请问派送员需要选择什么的路线,才能完成最短路程的派送。假设如图派送员的起点坐标(0,0),派送路线只能沿着图中的方格边行驶,每个小格都是正方形,且边长为1,如p到d的距离就是4。随机输入n个派送点坐标,求输出最短派送路线值(从起点开始完成n个点派送并回到起始点的距离)。题目分析 首先应该想到的是最笨最常见的做法,那就是枚...原创 2018-08-07 16:26:11 · 6230 阅读 · 1 评论