Feature:PAT-甲级
@kidultff

PAT-A 真题 – 1150 Travelling Salesman Problem

The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the ori ...
  • 0
  • 0
@kidultff

PAT-A 真题 – 1149 Dangerous Goods Packaging

When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂) must not be packed with ...
  • 0
  • 0
@kidultff

PAT-A1148/B1089 Werewolf - Simple Version 狼人杀

Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: "Player #2 is a werewolf.";player #2 said: "Player #3 ...
  • 0
  • 0
@kidultff

PAT-A1101/B1045 真题 – 快速排序

著名的快速排序算法里有一个经典的划分过程:我们通常采用某种方法取一个元素作为主元,通过交换,把比主元小的元素放到它的左边,比主元大的元素放到它的右边。 给定划分后的 N 个互不相同的正整数的排列,请问有多少个元素可能是划分 ...
  • 0
  • 0
@kidultff

PAT-A 真题 – 1098 Insertion or Heap Sort

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 location it bel ...
  • 0
  • 0