
PAT
文章平均质量分 80
ysc_ysc
这个作者很懒,什么都没留下…
展开
-
1015. 德才论
这一题来自http://pat.zju.edu.cn/contests/pat-b-practise/1015题目如下:宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。”现给出一批考生的德才分数,请根据司马光的理论给出录取排名。原创 2014-09-13 14:04:48 · 1220 阅读 · 1 评论 -
1034. Head of a Gang (30)
One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a relation is defined to be t原创 2014-11-15 10:07:05 · 435 阅读 · 0 评论 -
1017. Queueing at Bank (25)
题目要求:时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose a bank has K windows open for service. There is a yel原创 2014-10-09 19:01:48 · 1037 阅读 · 0 评论 -
1025. PAT Ranking (25)
题目要求:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the原创 2014-10-30 15:44:02 · 395 阅读 · 0 评论 -
1027. Colors in Mars (20)
People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 dig原创 2014-11-01 18:57:48 · 370 阅读 · 0 评论 -
1013. Battle Over Cities (25)
题目要求:It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediatel原创 2014-10-04 22:18:54 · 408 阅读 · 0 评论 -
1014. Waiting in Line (30)
题目要求:Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:原创 2014-10-05 20:43:22 · 453 阅读 · 0 评论 -
1020. Tree Traversals (25)
题目如下:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequen原创 2014-10-18 21:15:44 · 457 阅读 · 0 评论 -
1036. Boys vs Girls (25)
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Each input file contains o原创 2014-11-21 22:31:50 · 436 阅读 · 0 评论 -
1037. Magic Coupon (25)
The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product b原创 2014-11-28 22:13:33 · 451 阅读 · 0 评论 -
1030. Travel Plan (30)
A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path b原创 2014-11-08 14:17:31 · 436 阅读 · 0 评论 -
1018. Public Bike Management (30)
题目要求:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other sta原创 2014-10-09 22:32:30 · 678 阅读 · 0 评论 -
1033. To Fill or Not to Fill (25)
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different ga原创 2014-11-12 20:22:29 · 439 阅读 · 0 评论 -
全局变量与 *** glibc detected *** ./1: free(): invalid pointer错误
以前上课的时候,老师总是说全局变量不要随便用,原创 2014-09-27 13:28:44 · 2741 阅读 · 0 评论 -
1021. Deepest Root (25)
题目要求:原创 2014-10-21 20:43:57 · 468 阅读 · 0 评论 -
1029. Median (25)
题目要求Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17}原创 2014-11-07 21:11:00 · 491 阅读 · 0 评论 -
1028. List Sorting (25)
题目如下:Excel can sort records according to any column. Now you are supposed to imitate this function.InputEach input file contains one test case. For each case, the first line contains two原创 2014-11-07 16:41:11 · 526 阅读 · 0 评论 -
1004. Counting Leaves (30)
PAT题目:1004. Counting Leaves (30)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file conta原创 2014-09-28 20:19:56 · 544 阅读 · 0 评论 -
1031. Hello World for U (20)
Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed as:h de ll rlowoThat is, the characters must be pr原创 2014-11-08 15:44:01 · 394 阅读 · 0 评论 -
1022. Digital Library (30)
题目如下:原创 2014-10-23 12:53:24 · 449 阅读 · 0 评论 -
1016. Phone Bills (25)
题目:A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is原创 2014-10-07 19:31:47 · 449 阅读 · 0 评论 -
1024. Palindromic Number (25)
A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers原创 2014-10-25 11:05:38 · 405 阅读 · 0 评论 -
1032. Sharing (25)
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example,原创 2014-11-10 16:53:49 · 495 阅读 · 0 评论 -
1038. Recover the Smallest Number (30)
Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given {32, 321, 3214, 0229, 87}, we can recover many numbers such like 32-321-3214-0229-8原创 2014-12-03 21:51:34 · 442 阅读 · 0 评论