随笔分类 -  PAT 甲级

1 2 3 4 5 ··· 7 下一页
摘要:Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th 阅读全文
posted @ 2019-07-02 19:18 王清河 阅读(283) 评论(0) 推荐(0) 编辑
摘要:In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is supe 阅读全文
posted @ 2019-03-01 21:25 王清河 阅读(293) 评论(0) 推荐(0) 编辑
摘要: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 s 阅读全文
posted @ 2019-03-01 21:10 王清河 阅读(425) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-03-01 20:52 王清河 阅读(692) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-03-01 20:24 王清河 阅读(280) 评论(0) 推荐(0) 编辑
摘要:After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the rank 阅读全文
posted @ 2019-03-01 20:23 王清河 阅读(323) 评论(0) 推荐(0) 编辑
摘要:Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s 阅读全文
posted @ 2019-03-01 20:22 王清河 阅读(404) 评论(0) 推荐(0) 编辑
摘要:Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that 阅读全文
posted @ 2019-03-01 20:21 王清河 阅读(268) 评论(0) 推荐(0) 编辑
摘要:For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/ 阅读全文
posted @ 2019-03-01 20:21 王清河 阅读(320) 评论(0) 推荐(0) 编辑
摘要:Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0 for all i and a​k​​>0. Then N is palindrom 阅读全文
posted @ 2019-02-28 22:01 王清河 阅读(263) 评论(0) 推荐(0) 编辑
摘要:The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard so that no two queens threaten each other. Thus, a solution 阅读全文
posted @ 2019-02-28 22:00 王清河 阅读(372) 评论(0) 推荐(0) 编辑
摘要:John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from 阅读全文
posted @ 2019-02-28 21:59 王清河 阅读(138) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-02-28 21:59 王清河 阅读(239) 评论(0) 推荐(0) 编辑
摘要:"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 阅读全文
posted @ 2019-02-28 21:58 王清河 阅读(223) 评论(0) 推荐(0) 编辑
摘要:"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of th 阅读全文
posted @ 2019-02-28 21:57 王清河 阅读(325) 评论(0) 推荐(0) 编辑
摘要:Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2019-02-28 21:57 王清河 阅读(226) 评论(0) 推荐(0) 编辑
摘要:British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- tha 阅读全文
posted @ 2019-02-27 22:32 王清河 阅读(452) 评论(0) 推荐(0) 编辑
摘要:Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each 阅读全文
posted @ 2019-02-27 22:31 王清河 阅读(337) 评论(0) 推荐(0) 编辑
摘要:On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep 阅读全文
posted @ 2019-02-27 22:31 王清河 阅读(401) 评论(0) 推荐(0) 编辑
摘要:The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n 阅读全文
posted @ 2019-02-27 22:30 王清河 阅读(140) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 7 下一页
点击右上角即可分享
微信分享提示