自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1087 All Roads Lead to Rome (30 point(s))

1087 All Roads Lead to Rome (30 point(s))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:Each input file conta

2021-03-06 22:56:29 118

原创 1072 Gas Station (30 point(s))

1072 Gas Station (30 point(s))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 houses are in its service ra

2021-03-06 20:00:35 92

原创 1030 Travel Plan (30 point(s))

1030 Travel Plan (30 point(s))A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path between his/her starting c

2021-03-05 21:19:55 116

原创 1018 Public Bike Management (30 point(s))

1018 Public Bike Management (30 point(s))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 station and return it to any other stations in the city.The Publ

2021-03-04 22:45:29 85 1

原创 1003 Emergency (25 point(s))

1003 Emergency (25 point(s))As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between

2021-03-03 18:30:03 98 1

原创 1076 Forwards on Weibo (30 point(s))

1076 Forwards on Weibo (30 point(s))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 user makes a post o

2021-03-02 21:43:28 42

原创 1034 Head of a Gang (30 point(s))

1034 Head of a Gang (30 point(s))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 relation is defined to be the total time length o

2021-03-02 16:43:17 91

原创 1021 Deepest Root (25 point(s))

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 tree. Such a root is called the deepest root.Input Specification:Each in

2021-03-01 21:30:10 80

原创 1013 Battle Over Cities (25 point(s))

It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of the c

2021-03-01 16:47:46 74 1

原创 1098 Insertion or Heap Sort (25 point(s))

1098 Insertion or Heap Sort (25 point(s))According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the loca

2021-02-28 22:48:14 52

原创 1107 Social Clusters (30 point(s))

1107 Social Clusters (30 point(s))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 their hobbies in common.

2021-02-28 20:48:32 64

原创 1066 Root of AVL Tree (25 point(s))

1066 Root of AVL Tree (25 point(s))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 differ by more than one, rebalancing is done to restore thi

2021-02-28 19:26:03 71

原创 1099 Build A Binary Search Tree (30 point(s))

1099 Build A Binary Search Tree (30 point(s))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 subtree of a n

2021-02-28 16:55:46 84

原创 1064 Complete Binary Search Tree (30 point(s))

1064 Complete Binary Search Tree (30 point(s))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 subtree of a

2021-02-28 16:31:05 62

原创 1053 Path of Equal Weight (30point(s))

1053 Path of Equal Weight (30point(s))Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​ . 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 any

2021-01-11 00:05:28 74

原创 1004 Counting Leaves (30point(s))

1004 Counting Leaves (30point(s))A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing

2021-01-10 22:59:24 83

原创 1094 The Largest Generation (25point(s))

1094 The Largest Generation (25point(s))A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Input Specification:E

2021-01-10 22:23:22 80

原创 1106 Lowest Price in Supply Chain (25point(s))

1106 Lowest Price in Supply Chain (25point(s))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 the chain bu

2021-01-10 21:55:35 82

原创 1079 Total Sales of Supply Chain (25point(s))

1079 Total Sales of Supply Chain (25point(s))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 the chain buy

2021-01-10 21:18:33 98

原创 1090 Highest Price in Supply Chain (25point(s))

1090 Highest Price in Supply Chain (25point(s))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 the chain b

2021-01-10 20:48:39 82

原创 1102 Invert a Binary Tree (25point(s))

1102 Invert a Binary Tree (25point(s))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 to prove that YOU CAN i

2021-01-09 17:50:32 79

原创 1087 有多少不同的值 (20point(s))

1087 有多少不同的值 (20point(s))当自然数 n 依次取 1、2、3、……、N 时,算式 ⌊n/2⌋+⌊n/3⌋+⌊n/5⌋ 有多少个不同的值?(注:⌊x⌋ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。)输入格式:输入给出一个正整数 N(2≤N≤10​4​​ )。输出格式:在一行中输出题面中算式取到的不同值的个数。输入样例:2017输出样例:1480#include<bits/stdc++.h>using namespace std;i

2021-01-06 15:42:22 93

原创 1052 卖个萌 (20point(s))

1052 卖个萌 (20point(s))萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的:左手[右手]现给出可选用的符号集合,请你按用户的要求输出表情。输入格式:输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号 []内。题目保证每个集合都至少有一个符号,并不超过 10 个符号;每个符号包含 1 到 4 个非空字符。之后一行给出一个正整数 K,为用户请求的个数。随后 K 行,每行给出一个用户的符号选择,顺序为左

2021-01-04 22:03:28 65

原创 1051 复数乘法 (15point(s))

1051 复数乘法 (15point(s))复数可以写成 (A+Bi) 的常规形式,其中 A 是实部,B 是虚部,i 是虚数单位,满足 i​2​​ =−1;也可以写成极坐标下的指数形式 (R×e​(Pi)​​ ),其中 R 是复数模,P 是辐角,i 是虚数单位,其等价于三角形式 R(cos§+isin§)。现给定两个复数的 R 和 P,要求输出两数乘积的常规形式。输入格式:输入在一行中依次给出两个复数的 R​1​​ , P​1​​ , R​2​​ , P​2​​ ,数字间以空

2021-01-04 20:51:48 146

原创 1086 Tree Traversals Again (25point(s))

1086 Tree Traversals Again (25point(s))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 stack operations are

2021-01-01 23:03:32 58

原创 1020 Tree Traversals (25point(s))

1020 Tree Traversals (25point(s))Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree

2021-01-01 22:33:06 79

原创 1091 Acute Stroke (30point(s))

1091 Acute Stroke (30point(s))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 calculate the volume of th

2021-01-01 21:20:17 63

原创 1103 Integer Factorization (30point(s))

1103 Integer Factorization (30point(s))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 integers N, K a

2021-01-01 19:43:41 71

原创 1050 螺旋矩阵 (25point(s))

1050 螺旋矩阵 (25point(s))本题要求将给定的 N 个正整数按非递增的顺序,填入“螺旋矩阵”。所谓“螺旋矩阵”,是指从左上角第 1 个格子开始,按顺时针螺旋方向填充。要求矩阵的规模为 m 行 n 列,满足条件:m×n 等于 N;m≥n;且 m−n 取所有可能值中的最小值。输入格式:输入在第 1 行中给出一个正整数 N,第 2 行给出 N 个待填充的正整数。所有数字不超过 10​4​​ ,相邻数字以空格分隔。输出格式:输出螺旋矩阵。每行 n 个数字,共 m 行。相邻数字以 1 个空

2020-12-30 22:51:50 66

原创 1024 Palindromic Number (25point(s))

1024 Palindromic Number (25point(s))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 are palindromic numbers.Non-palindromic n

2020-12-30 21:29:44 123

原创 1023 Have Fun with Numbers (20point(s))

1023 Have Fun with Numbers (20point(s))Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number consisting exactly

2020-12-30 21:00:43 62

原创 1097 Deduplication on a Linked List (25point(s))

1097 Deduplication on a Linked List (25point(s))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 absolute

2020-12-28 21:33:09 47

原创 1056 Mice and Rice (25point(s))

1056 Mice and Rice (25point(s))Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice as possible in order to

2020-12-28 19:37:06 54

原创 1051 Pop Sequence (25point(s))

1051 Pop Sequence (25point(s))Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M

2020-12-27 22:24:57 68

原创 1022 Digital Library (30point(s))

1022 Digital Library (30point(s))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 an unique 7-digit number as its ID. Given any qu

2020-12-27 21:48:36 74

原创 1071 Speech Patterns (25point(s))

1071 Speech Patterns (25point(s))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’s identity, which is

2020-12-27 20:59:19 52

原创 1100 Mars Numbers (20point(s))

1100 Mars Numbers (20point(s))People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.For the next

2020-12-26 19:56:10 50

原创 1060 Are They Equal (25point(s))

1060 Are They Equal (25point(s))If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10​5​​ with simple chopping. Now given the number of significant digits on a ma

2020-12-26 19:07:44 49

原创 1063 Set Similarity (25point(s))

1063 Set Similarity (25point(s))Given two sets of integers, the similarity of the sets is defined to be N​c​​ /N​t​​ ×100%, where N​c​​ is the number of distinct common numbers shared by the two sets, and N​t​​ is the total number of distinct nu

2020-12-26 18:30:24 75

原创 1047 Student List for Course (25point(s))

1047 Student List for Course (25point(s))Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:E

2020-12-25 22:40:43 62

空空如也

空空如也

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

TA关注的人

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