随笔分类 -  PAT甲级

上一页 1 2 3 4 5 下一页

1113 Integer Set Partition (25 分)集合分割
摘要:1113 Integer Set Partition (25 分) Given a set of NNN (>1> 1>1) positive integers, you are supposed to partition them into two disjoint sets A1A_1A​1​​ 阅读全文

posted @ 2019-01-22 14:47 ZhangのBlog 阅读(587) 评论(0) 推荐(0)

1120 Friend Numbers (20 分)set的使用
摘要:1120 Friend Numbers (20 分) Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For 阅读全文

posted @ 2019-01-22 14:19 ZhangのBlog 阅读(173) 评论(0) 推荐(0)

1099 Build A Binary Search Tree (30 分)
摘要:1099 Build A Binary Search Tree (30 分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left 阅读全文

posted @ 2019-01-22 14:05 ZhangのBlog 阅读(321) 评论(0) 推荐(0)

1092 To Buy or Not to Buy (字符串删除)
摘要: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. Ther 阅读全文

posted @ 2019-01-22 13:24 ZhangのBlog 阅读(109) 评论(0) 推荐(0)

1127 ZigZagging on a Tree (30 分)树的层次遍历
摘要:1127 ZigZagging on a Tree (30 分) Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by 阅读全文

posted @ 2019-01-22 12:46 ZhangのBlog 阅读(340) 评论(0) 推荐(0)

1155 Heap Paths (30 分)判断是否是一个堆
摘要:1155 Heap Paths (30 分) In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node 阅读全文

posted @ 2019-01-21 21:06 ZhangのBlog 阅读(347) 评论(0) 推荐(0)

1032 Sharing (25 分)使用set实现
摘要: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 wo 阅读全文

posted @ 2019-01-21 16:49 ZhangのBlog 阅读(166) 评论(0) 推荐(0)

1032 Sharing (25 分)(PAT甲级,静态链表)
摘要: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 wo 阅读全文

posted @ 2019-01-21 16:25 ZhangのBlog 阅读(489) 评论(0) 推荐(0)

1031 Hello World for U (不等式计算)
摘要:1031 Hello World for U (20 分) Given any string of NNN (≥5\ge 5≥5) characters, you are asked to form the characters into the shape of U. For example, h 阅读全文

posted @ 2019-01-21 14:28 ZhangのBlog 阅读(134) 评论(0) 推荐(0)

1030 Travel Plan (DFS)
摘要: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 su 阅读全文

posted @ 2019-01-21 14:00 ZhangのBlog 阅读(173) 评论(0) 推荐(0)

1029 Median
摘要: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 阅读全文

posted @ 2019-01-21 11:46 ZhangのBlog 阅读(220) 评论(0) 推荐(0)

1027 Colors in Mars (20 分)进制转换
摘要: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 represente 阅读全文

posted @ 2019-01-20 20:03 ZhangのBlog 阅读(204) 评论(0) 推荐(0)

1028 List Sorting 排序
摘要:1028 List Sorting (25 分) Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each inpu 阅读全文

posted @ 2019-01-20 19:36 ZhangのBlog 阅读(134) 评论(0) 推荐(0)

1025 PAT Ranking
摘要:1025 PAT Ranking (25 分) Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each tes 阅读全文

posted @ 2019-01-20 16:54 ZhangのBlog 阅读(302) 评论(0) 推荐(0)

1024 Palindromic Number(大数加法)
摘要: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, 阅读全文

posted @ 2019-01-20 15:21 ZhangのBlog 阅读(299) 评论(0) 推荐(0)

1023 Have Fun with Numbers
摘要:Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2469135 阅读全文

posted @ 2019-01-20 14:02 ZhangのBlog 阅读(179) 评论(0) 推荐(0)

1022 Digital Library
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years 阅读全文

posted @ 2019-01-20 12:07 ZhangのBlog 阅读(134) 评论(0) 推荐(0)

1021 Deepest Root (25 分)
摘要:A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the 阅读全文

posted @ 2019-01-06 18:16 ZhangのBlog 阅读(1431) 评论(0) 推荐(0)

1019 General Palindromic Number
摘要: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 阅读全文

posted @ 2019-01-06 14:03 ZhangのBlog 阅读(139) 评论(0) 推荐(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 ou 阅读全文

posted @ 2019-01-06 13:31 ZhangのBlog 阅读(402) 评论(0) 推荐(0)

上一页 1 2 3 4 5 下一页