原创 PAT甲級1049 Counting Ones (30分) ***感覺不簡單,使用遞歸

1049 Counting Ones (30分) The task is simple: given any positive integer N, you are supposed to count the total numb

原创 PAT甲級1109 Group Photo (25分) 和乙級的1055 集體照 (25分) 模擬,稍微麻煩點

1109 Group Photo (25分) Formation is very important when taking a group photo. Given the rules of forming K rows wit

原创 PAT甲級1147 Heaps (30分) 層數遍歷快速構建二叉樹,深搜判斷大堆 小堆

1147 Heaps (30分) In computer science, a heap is a specialized tree-based data structure that satisfies the heap pro

原创 PAT甲級1114 Family Property (25分) 題不難,麻煩點 ,並查集變形, map 我是左箭頭 int,node 我是右箭頭 mapp

Sample Input: 10 6666 5551 5552 1 7777 1 100 1234 5678 9012 1 0002 2 300 8888 -1 -1 0 1 1000 2468 0001 0004 1 2222

原创 PAT甲級1148 Werewolf - Simple Version (20分) 和乙級狼人殺-簡單版(20 分) 關鍵是思考切入的角度

1148 Werewolf - Simple Version (20分) Werewolf(狼人殺) is a game in which the players are partitioned into two parties:

原创 PAT甲級1108 Finding Average (20分) sscanf sprintf****

1108 Finding Average (20分) The basic task is simple: given N real numbers, you are supposed to calculate their aver

原创 PAT甲級1149 Dangerous Goods Packaging (25分) 和乙級1090 危險品裝箱 (25分) 盡力簡化思路減少時間

1149 Dangerous Goods Packaging (25分) When shipping goods with containers, we have to be careful not to pack some in

原创 PAT甲級1096 Consecutive Factors (20分) ****不算簡單的題 ,測試點1分析,因式分解

1096 Consecutive Factors (20分) Among all the factors of a positive integer N, there may exist several consecutive n

原创 PAT甲級1128 N Queens Puzzle (20分) 判重

Sample Input: 4 8 4 6 8 2 7 1 3 5 9 4 6 7 2 8 1 9 5 3 6 1 5 2 6 4 3 5 1 3 5 2 4 Sample Output: YES NO NO YES 就是皇

原创 PAT甲級1121 Damn Single (25分) 簡單題,注意輸出就好

1121 Damn Single (25分) “Damn Single (單身狗)” is the Chinese nickname for someone who is being single. You are suppose

原创 PAT甲級1104 Sum of Number Segments (20分) 測試點2感覺不太對,兩位數字不同加法有區別

1104 Sum of Number Segments (20分) Given a sequence of positive numbers, a segment is defined to be a consecutive su

原创 PAT甲級1134 Vertex Cover (25分) 英語捉急。。。。 優化時間

1134 Vertex Cover (25分) A vertex cover of a graph is a set of vertices such that each edge of the graph is incident

原创 PAT甲級1112 Stucked Keyboard (20分) 測試點3,小細節多點

1112 Stucked Keyboard (20分) On a broken keyboard, some of the keys are always stucked. So when you type some senten

原创 PAT甲級1146 Topological Order (25分) 拓撲排序

1146 Topological Order (25分) This is a problem given in the Graduate Entrance Exam in 2018: Which of the following

原创 PAT甲級1125 Chain the Ropes (25分) 簡單題,但是實現時候需要注意點

1125 Chain the Ropes (25分) Given some segments of rope, you are supposed to chain them into one rope. Each time you