PAT 甲级 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 example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2→1→5→6.输入Each input file co
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1075 PAT Judge (25 分)

题目描述The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.输入Each input file contains one test case. For each case, the first line contains 3 positive
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1076 Forwards on Weibo (30 分)

题目描述Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on Weibo, all his/her followers c
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1077 Kuchiguse (20 分)

题目描述The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exaggerated artistically i
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1078 Hashing (25 分)

题目描述The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be H(key)=key%TSize where TSize is the maximum size of the hash table
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1079 Total Sales of Supply Chain (25 分)

题目描述A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys products from one’s supplier in a price
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1080 Graduate Admission (30 分)

题目描述It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.Each applicant will have to provide two
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1081 Rational Sum (20 分)

题目描述Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.输入Each input file contains one test case. Each case starts with a positive integer N (≤100), followed in the next line N rational numbers a1/b1 a2/b2
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 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 first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu. Note: zer
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 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 grade in non-increasing order, and output those student records of which the grades are in a given interval.输入Each input file contain
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 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 those keys will not appear on screen.Now given a string that you are supposed to type, and the string that you actually type out, pl
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

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 M≤m×p where M and m are the maximum and minimum numbers in the sequence, respectively.Now given a sequence and a parameter p, you a
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1086 Tree Traversals Again (25 分)

题目描述An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop();
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1087 All Roads Lead to Rome (30 分)

题目描述Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.输入Each input file contains one test case. For each case, the first line contai
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1088 Rational Arithmetic (20 分)

题目描述For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.输入Each input file contains one test case, which gives in one line the two rational numbers in the format a1/
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1089 Insert or Merge (25 分)

题目描述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 belongs within the sorted lis
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1090 Highest Price in Supply Chain (25 分)

题目描述A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys products from one’s supplier in a price
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1091 Acute Stroke (30 分)

题目描述One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core.输入Each inp
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1092 To Buy or Not to Buy (20 分)

题目描述Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell the strings in whole pieces. Hence Eva must check
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0

PAT 甲级 1093 Count PAT‘s (25 分)

题目描述The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now given any string, you are supposed to tell the numbe
分类: 其他 发布时间: 11-28 07:07 阅读次数: 0