PAT
文章平均质量分 79
walter1990
菜鸟
展开
-
pat 1085 Perfect Sequence
Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M Now given a sequence and a parameter p, you are supposed to find from the原创 2015-10-27 17:32:05 · 277 阅读 · 0 评论 -
pat 1019
1019. General Palindromic Number (20)时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueA number that will be the same when it is writte原创 2014-03-06 19:18:31 · 548 阅读 · 0 评论 -
pat 1024
1024. Palindromic Number (25)时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueA number that will be the same when it is written forwar原创 2014-03-06 14:41:39 · 594 阅读 · 0 评论 -
pat 1022
1022. Digital Library (30)时间限制 1000 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueA Digital Library contains millions of books, stored accor原创 2014-03-06 10:09:49 · 610 阅读 · 0 评论 -
pat 1028
1028. List Sorting (25)时间限制 200 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueExcel can sort records according to any column. Now you are su原创 2014-03-05 20:10:03 · 547 阅读 · 0 评论 -
pat 1030
1030. Travel Plan (30)时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueA traveler's map gives the distances between cities along the h原创 2014-03-05 19:38:18 · 560 阅读 · 0 评论 -
pat 1013
1013. Battle Over Cities (25)时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueIt is vitally important to have all the cities connected原创 2014-03-05 09:24:44 · 659 阅读 · 0 评论 -
pat 1023
1023. Have Fun with Numbers (20)时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueNotice that the number 123456789 is a 9-digit number原创 2014-03-04 12:56:09 · 540 阅读 · 0 评论 -
pat 1025
1025. PAT Ranking (25)时间限制 200 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueProgramming Ability Test (PAT) is organized by the College of C原创 2014-03-04 12:48:16 · 677 阅读 · 0 评论 -
pat 1017
#include #include #include #include using namespace std;struct Customer{ int hours; int minutes; int seconds; int process; int totalTime;} ctm[10010];struct Window{ int time; Custom原创 2014-03-03 19:44:06 · 701 阅读 · 0 评论 -
pat 1015
#include #include int num[25];bool isPrime(int n){ for(int i = 2; i < n; i++) if(n % i == 0) return false; return true;}int main(){ int n, radix; while(scanf("%d", &n) != EOF) {原创 2014-03-03 20:41:03 · 599 阅读 · 0 评论 -
pat 1004
#include #include struct Node{ int parent; int level; int update; int isYeZi;} node[110];int n, m;int level[110];bool judge(){ int count = 0, i; for(i = 1; i <= 100; i++) if(node[i原创 2014-02-27 15:49:30 · 568 阅读 · 0 评论 -
pat 1001
#include #include int main(){int a, b, sum;char ans[30];while(scanf("%d%d", &a, &b) != EOF){memset(ans, 0, sizeof(ans));sum = a + b;if(sum == 0) printf("0\n");else{if(sum < 0){printf("-");sum = -sum;}原创 2014-02-26 11:40:57 · 611 阅读 · 0 评论 -
pat 1003
1003. Emergency (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAs an emergency rescue team leader of a city, yo原创 2016-03-03 23:45:28 · 185 阅读 · 0 评论 -
pat 1004 Counting Leaves
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 contains one test case. Each case starts with a原创 2016-03-04 11:14:34 · 378 阅读 · 0 评论 -
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原创 2016-03-06 10:24:00 · 275 阅读 · 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.Input Specification:E原创 2016-03-06 14:09:14 · 487 阅读 · 0 评论 -
pat 1018
1018. Public Bike Management (30)时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard作者 CHEN, YueThere is a public bike service in Hangzhou City whic原创 2014-03-06 19:21:36 · 640 阅读 · 0 评论 -
pat 1068 Find More Coins (30)
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,原创 2015-12-04 20:49:19 · 256 阅读 · 0 评论 -
pat 1102 Invert a Binary Tree
The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so fuck off.Now it's your turn原创 2015-09-27 14:00:12 · 582 阅读 · 0 评论 -
pat 1082 Read Number in Chinese
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 B原创 2015-10-28 14:40:33 · 395 阅读 · 0 评论 -
pat 1083 List Grades
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原创 2015-10-28 12:41:50 · 369 阅读 · 0 评论 -
pat 1096 Consecutive Factors
Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the three consecutive numbers. Now given原创 2015-09-29 10:14:57 · 373 阅读 · 0 评论 -
pat 1097 Deduplication on a Linked List
Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, only the first node of which the value or a原创 2015-09-29 23:25:40 · 320 阅读 · 0 评论 -
pat1093 Count PAT's
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.No原创 2015-10-19 17:11:44 · 281 阅读 · 0 评论 -
pat1094 The Largest Generation
A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Inpu原创 2015-10-19 00:04:14 · 571 阅读 · 0 评论 -
pat 1098 Insertion or Heap Sort
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 dat原创 2015-09-30 19:59:26 · 272 阅读 · 0 评论 -
pat 1079 Total Sales of Supply Chain
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原创 2015-10-29 13:58:10 · 359 阅读 · 0 评论 -
pat 1103 Integer Factorization
The K-P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K-P factorization of N for any positive原创 2015-09-27 14:04:51 · 608 阅读 · 0 评论 -
pat 1099 Build A Binary Search Tree
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key.The right原创 2015-09-27 23:53:48 · 359 阅读 · 0 评论 -
pat 1080 Graduate Admission
It is said that in 2013, there were 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 admissio原创 2015-10-30 17:02:01 · 302 阅读 · 0 评论 -
pat 1078 Hashing
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 %原创 2015-10-31 20:21:51 · 331 阅读 · 0 评论 -
pat 1071 Speech Patterns
1071. Speech Patterns (25)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者HOU, QimingPeople often have a preference among syn原创 2015-11-20 23:23:50 · 345 阅读 · 0 评论 -
pat 1072 Gas Station
1072. Gas Station (30)时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA gas station has to be built at such a locati原创 2015-11-21 23:20:05 · 353 阅读 · 0 评论 -
pat1070 Mooncake
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now原创 2015-11-27 22:07:30 · 257 阅读 · 0 评论 -
pat 1067 Sort with Swap(0,*) (25)
Given any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2原创 2016-03-06 20:12:19 · 245 阅读 · 0 评论