原创 PAT (Advanced Level) 1073. Scientific Notation (20) 科學計數法

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation m

原创 PAT (Advanced Level) 1079. Total Sales of Supply Chain (25) 總疊加售價 BFS

A supply chain is a network of retailers(零售商), distributors(經銷商), and suppliers(供應商)-- everyone involved in moving a p

原创 PAT (Advanced level) 1077. Kuchiguse (20) 最長共同後綴

The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be con

原创 PAT (Advanced Level) 1075. PAT Judge (25) PAT排名 結構體排序

The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are su

原创 PAT (Advanced Level) 1074. Reversing Linked List (25) 翻轉鏈表

Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For ex

原创 PAT (Advanced Level) 1078. Hashing (25) 哈希,二次探測法

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the

原创 移動拼圖遊戲(八數碼問題)A*版

小時候玩過的移動拼圖遊戲。有一個3*3的棋盤,其中有0-8這9個數字,0表示空格,每次移動只能把空格旁邊的數字移到空格,即與0相鄰的數字可以和0交換位置。 求從初始狀態 2 3 0 7 1 6 5 8 4 變到目標狀態 1

原创 PAT (Advanced Level) 1082. Read Number in Chinese (25) 數字轉漢字大寫

Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output "Fu" f

原创 PAT (Advanced Level) 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

原创 PAT (Advanced Level) 1085. Perfect Sequence (25) 貪心算法

Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence"

原创 PAT (Advanced Level) 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 gr

原创 PAT (Advanced Level) 1072. Gas Station (30) Dijkstra最短路徑+剪枝

A gas station has to be built at such a location that the minimum distance between the station and any of the resident

原创 PAT (Advanced Level) 1080. Graduate Admission (30) 模擬高考錄取,結構體排序

It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang P

原创 PAT (Advanced Level) 1081. Rational Sum (20) 分數求和,輾轉相除法求gcd

Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specific

原创 PAT (Advanced Level) 1088. Rational Arithmetic (20) 分數四則運算

For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, differenc