自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 PAT-A-1011 World Cup Betting (20分) C/C++实现(数学题)

With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money.

2020-12-21 11:21:28 102

原创 PAT-A-1010 Radix (25分) C/C++实现(二分查找)

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number. Now for any pair of positive integers N1 and N2, your task is to find the radix of one nu.

2020-12-17 15:30:39 83

原创 PAT-A-1009 Product of Polynomials (25分) C/C++实现(模拟)

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 occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 … Nn aNn where .

2020-12-17 11:23:51 154

原创 #PAT-A-1008 Elevator (20分) C/C++实现(简单题)

The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds t.

2020-12-16 16:06:29 96

原创 PAT-A-1007 Maximum Subsequence Sum (25分) C/C++实现(动态规划)

Given a sequence of K integers { N1 , N2 , … ,Nk }. A continuous subsequence is defined to be { Ni , Ni + 1 , … ,Nj } where 1 ≤ i ≤ j ≤ K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For example, given .

2020-12-15 16:49:09 66

原创 PAT-A-1006 Sign In and Sign Out (25分) C/C++实现(字符串处理)

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 records of signing in’s and out’s, you are supposed to find the ones who have unlocked and lo.

2020-12-15 14:22:14 51

原创 PAT-A-1005 Spell It Right (20分) C/C++实现(字符串处理)

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: Each input file contains one test case. Each case occupies one line which contains an N (≤ 10​10.

2020-12-15 11:39:23 108

原创 PAT-A-1004 Counting Leaves (30分) C/C++实现(dfs,树的遍历)

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 0 < N < 100, the number.

2020-12-15 11:19:35 68

原创 PAT-A-1003 Emergency (25分) C/C++实现(最短路径,Dijkstra算法)

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 any pair of cities are marke.

2020-12-15 10:29:17 131

原创 PAT-A-1002 A+B for Polynomials (25分) C/C++实现(模拟)

#PAT-A-1002 A+B for Polynomials (25分) C/C++实现(模拟) 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 occupies 2 lines, and each line contains the informatio

2020-12-14 15:49:42 64

原创 PAT-A-1001 A+B Format (20分) C/C++实现(简单题)

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). Input Specification: Each input file contains one test case. Each case contains a pair.

2020-12-14 15:00:00 101

原创 PAT-A-1154 Vertex Coloring (25分) C/C++实现(图论)

A proper vertex coloring is a labeling of the graph’s vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most k colors is called a (proper) k-coloring. Now you are supposed to tell if a given co.

2020-09-09 20:27:48 119

原创 PAT-A-1155.Heap Paths(30) C/C++实现(完全二叉树,递归,DFS)

In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (in a max heap) or less than or equal to (in a min heap) .

2020-09-08 16:36:24 79

空空如也

空空如也

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

TA关注的人

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