PAT 三月 29, 2020

### PAT甲级 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 left and those larger than the pivot to its right. Given N distinct positive integers after a run of partition, could you tell how many elements could be the selected pivot for this partition?

For example, given N=5 and the numbers 1, 3, 2, 4, and 5. We have:

• 1 could be the pivot since there is no element...

PAT 三月 29, 2020

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...

PAT 三月 28, 2020

### PAT甲级 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 Mm×p where M and m are the maximum and minimum numbers in the sequence, respectively.

Now given a sequence and a parameter p, you ...

PAT 三月 28, 2020

### PAT甲级 1038 Recover the Smallest Number (30分)

Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229-87 or 0229-32-87-321-3214 with respect to different...

PAT 三月 27, 2020

### PAT甲级 1067 Sort with Swap(0, i) (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, 1, 3} we may apply the swap operations in the following...

PAT 三月 26, 2020

### PAT乙级 1033 旧键盘打字 (20分)

DUBBO 三月 22, 2020

### Dubbo微服务影院系列（6）：Dubbo服务开发（影片模块开发）

• 掌握 API 网关服务聚合功能的实现
• 掌握 Mybatis-plus 自定义 SQL 实现
• 掌握 Dubbo 异步调用
• 服务聚合就是将多个服务调用封装
• 服务聚合可以简化前端调用方式
• 服务聚合提供更好的安全性、可扩展性
• 根据接口文档思考功能列表
• 实现 API 接口和实体
• 服务提供者实现

• 优点
1. 六个接口，一次请求，同一时刻节省了5次HTTP请求
2. 同一个接口对外暴露，降低了前后端分离开发的难度和复杂度
• 缺点：...

PAT 三月 22, 2020

### PAT甲级 1095 Cars on Campus (30分)

Zhejiang University has 8 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 are supposed to tell, at any specific time point, the...

PAT 三月 22, 2020

### PAT甲级 1033 To Fill or Not to Fill (25分)

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 way from time to time. Different gas station may give different price. You are asked ...

PAT 三月 20, 2020

### PAT甲级 1016 Phone Bills (25分)

A long-distance telephone company charges its customers by the following rules:

Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a customer starts connecting a long-distance call,...

0%