PAT
文章平均质量分 77
heihuide
考研 ing~
展开
-
PAT刷题之旅 1125-Chain the Ropes-甲级
题目Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another segment of rope and can原创 2022-01-06 11:31:40 · 104 阅读 · 0 评论 -
PAT刷题之旅 1122-Hamiltonian Cycle-甲级
题目The “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a “Hamiltonian cycle”.In this problem, you are supposed to tell if a given cycle is a Hamiltonian cycle.Input Specification:Each inpu原创 2022-01-06 11:09:30 · 406 阅读 · 0 评论 -
PAT刷题之旅 1121-Damn Single-甲级
题目“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input Specification:Each input file contains one test case. For each case, the first原创 2022-01-05 18:27:32 · 438 阅读 · 0 评论 -
PAT刷题之旅 1113-Integer Set Partition-甲级
题目Given a set of N (> 1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respectively. Let S1 and S2 denote the sums of all the numbers in A1 and A2, respectively. You are supposed to make th原创 2022-01-05 16:59:19 · 276 阅读 · 0 评论 -
PAT刷题之旅 1144-The Missing Number-甲级
题目Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (<= 105). Then N integers ar原创 2022-01-04 11:47:31 · 250 阅读 · 0 评论 -
PAT刷题之旅 1151-LCA in a Binary Tree-甲级
题目The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you are supposed to find their LCA.Input Specification:Each input file contains one test ca原创 2022-01-03 17:12:24 · 414 阅读 · 0 评论 -
PAT刷题之旅 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 flammable liquid (易燃液体), or原创 2022-01-03 16:13:13 · 67 阅读 · 0 评论 -
PAT刷题之旅 1148-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 is a human.”;player #3 said: “Player #4 i原创 2022-01-03 10:52:58 · 9693 阅读 · 0 评论