自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(89)
  • 收藏
  • 关注

转载 1108. Finding Average (20)

转自:https://www.liuchuo.net/archives/19241108. Finding Average (20)The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated i

2017-07-31 22:14:16 223

原创 1107. Social Clusters (30) 并查集

When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A "social cluster" is a set of people who have some of th

2017-07-31 22:05:37 177

原创 1106. Lowest Price in Supply Chain (25) DFS,BFS

A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on

2017-07-31 21:07:58 206

原创 1105. Spiral Matrix (25)

This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the upper-left corner, then move in

2017-07-31 10:00:57 166

原创 1104. Sum of Number Segments (20)

Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence {0.1, 0.2, 0.3, 0.4}, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3)

2017-07-30 22:56:57 182

原创 1103. Integer Factorization (30)

The K-P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K-P factorization of N for any positive

2017-07-30 22:22:31 161

原创 1102. Invert a Binary Tree (25)<反转二叉树>

The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so fuck off.Now it's your turn

2017-07-30 21:37:36 229

原创 1101. Quick Sort (25)

There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its le

2017-07-30 20:58:28 167

原创 1100. Mars Numbers (20)<map>

People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars.The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Ma

2017-07-29 18:15:27 196

原创 1099. Build A Binary Search Tree (30) <BST树>

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 the node's key.The right

2017-07-29 17:49:53 332

原创 1097. Deduplication on a Linked List (25)

Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value or a

2017-07-29 15:50:48 208

原创 1096. Consecutive Factors (20)

Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the three consecutive numbers. Now given

2017-07-29 15:06:28 152

原创 1095. Cars on Campus (30) <结构体排序>

Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available, you a

2017-07-27 21:55:09 227

原创 1093. Count PAT's (25)

The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.No

2017-07-27 21:00:32 146

原创 1092. To Buy or Not to Buy (20)

Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sel

2017-07-27 20:35:08 186

原创 1091. Acute Stroke (30)

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 MRI slice, your job is to c

2017-07-27 15:48:16 188

原创 1090. Highest Price in Supply Chain (25)<BFS,DFS>

A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on

2017-07-27 15:34:22 233

原创 1087. All Roads Lead to Rome (30) <Dijkstra优先队列>

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 most happiness.Input Specification:E

2017-07-27 14:37:48 329

原创 1086. Tree Traversals Again (25) <二叉树的建立>

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 from 1 to 6) is traversed, the stac

2017-07-27 12:47:04 245

原创 1085. Perfect Sequence (25)

Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M <= m * p where M and m are the maximum and minimum numbers in the sequence,

2017-07-27 11:15:59 130

原创 1084. Broken Keyboard (20)

On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed

2017-07-27 10:54:24 239

原创 1083. List Grades (25)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades

2017-07-26 19:22:01 147

原创 1081. Rational Sum (20)

Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positi

2017-07-26 19:13:01 255

原创 1080. Graduate Admission (30)<28分>

It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admissio

2017-07-26 18:00:43 338

原创 1079. Total Sales of Supply Chain (25)<BFS,DFS,并查集>

A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on

2017-07-26 16:08:09 232

原创 1078. Hashing (25)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be "H(key) = key %

2017-07-26 15:16:36 164 1

原创 1077. Kuchiguse (20)

The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is called

2017-07-26 11:45:14 141

原创 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. When a

2017-07-26 11:32:51 148

原创 1075. PAT Judge (25)

The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input fil

2017-07-25 19:04:48 122

转载 1073. Scientific Notation (20)

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9]"."[0-9]+E[+-][0-9]+ which means that the in

2017-07-25 17:15:52 120

原创 1072. Gas Station (30)

A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the hou

2017-07-25 16:47:58 138

原创 1071. Speech Patterns (25)

People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker

2017-07-25 15:20:41 137

原创 1070. Mooncake (25)

Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now

2017-07-25 14:59:57 125

原创 1069. The Black Hole of Numbers (20)

For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by takin

2017-07-25 14:57:02 129

原创 1068. Find More Coins (30)

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,

2017-07-25 14:30:41 133

原创 1067. Sort with Swap(0,*) (25)

Given any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2

2017-07-25 11:43:31 232 1

原创 1065. A+B and C (64bit) (20)

Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Specification:The first line of the input gives the positive number of test cases, T (Output

2017-07-25 09:42:52 168

原创 1064. Complete Binary Search Tree (30)

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 the node's key.The righ

2017-07-25 09:42:41 154

原创 1063. Set Similarity (25)<set>

Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the total number of distinct n

2017-07-23 20:20:20 272

原创 1062. Talent and Virtue (25)

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virt

2017-07-23 19:34:26 156

空空如也

空空如也

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

TA关注的人

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