PAT_甲
SineyCoder
以算法和JAVA为主
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT (Advanced Level) Practice 1015
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a pr...原创 2018-06-03 09:04:31 · 288 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1065
1065 A+B and C (64bit) (20)(20 point(s))Given three integers A, B and C in [-2^63^, 2^63^], you are supposed to tell whether A+B > C.Input Specification:The first line of the input gives the positi...原创 2018-06-09 18:26:41 · 347 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1020
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 orde...原创 2018-08-26 10:05:46 · 214 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1144
1144 The Missing Number(20 分)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 one test case. Fo...原创 2018-08-26 10:23:02 · 218 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1024
1024 Palindromic Number (25)(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 d...原创 2018-08-22 16:28:13 · 156 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1004
1004 Counting Leaves (30)(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 contains one test case...原创 2018-08-23 17:24:37 · 188 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1140
1140 Look-and-say Sequence(20 分)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)st number is ...原创 2018-08-31 08:26:26 · 203 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1141
1141 PAT Ranking of Institutions(25 分)After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist.Inp...原创 2018-08-31 10:31:35 · 210 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1142
1142 Maximal Clique(25 分)A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extende...原创 2018-09-01 08:50:17 · 149 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1086
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 f...原创 2018-09-01 09:26:54 · 187 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1085
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×pwhere M and m are the maximum and minimum numbe...原创 2018-09-01 10:27:31 · 213 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1032
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 ...原创 2018-09-02 11:12:50 · 216 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1064
1064 Complete Binary Search Tree(30 分)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...原创 2018-09-03 13:36:40 · 305 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1067
1067 Sort with Swap(0, i)(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 u...原创 2018-09-03 20:08:37 · 239 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1117
1117 Eddington Number(25 分)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 -- that is, the maximum inte...原创 2018-09-07 11:55:48 · 182 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1046
1046 Shortest Distance (20)(20 point(s))The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input...原创 2018-06-09 18:23:31 · 199 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1041
1041 Be Unique (20)(20 point(s))Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1, ...原创 2018-06-09 18:16:40 · 242 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1019
1019 General Palindromic Number (20)(20 point(s))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....原创 2018-06-03 09:20:21 · 223 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1023
1023 Have Fun with Numbers (20)(20 point(s))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 246913578, wh...原创 2018-06-03 09:30:59 · 171 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1027
1027 Colors in Mars (20)(20 point(s))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...原创 2018-06-03 09:39:11 · 236 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1008
1008 Elevator (20)(20 point(s))The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in ...原创 2018-05-28 15:26:17 · 209 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1011
1011 World Cup Betting (20)(20 point(s))With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for ...原创 2018-05-28 16:52:54 · 243 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1007
1007 Maximum Subsequence Sum (25)(25 point(s))Given a sequence of K integers { N~1~, N~2~, ..., N~K~ }. A continuous subsequence is defined to be { N~i~, N~i+1~, ..., N~j~ } where 1 <= i <= j &l...原创 2018-06-15 13:15:36 · 206 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1025
1025 PAT Ranking (25)(25 point(s))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 s...原创 2018-06-15 13:20:33 · 224 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1036
1036 Boys vs Girls (25)(25 point(s))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 Specificatio...原创 2018-06-15 13:23:41 · 203 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1042
1042 Shuffling Machine (20)(20 point(s))Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" ...原创 2018-06-15 13:26:53 · 250 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1050
1050 String Subtraction (20)(20 point(s))Given two strings S~1~ and S~2~, S = S~1~ - S~2~ is defined to be the remaining string after taking all the characters in S~2~ from S~1~. Your task is simply t...原创 2018-06-15 13:30:25 · 424 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1054
1054 The Dominant Color (20)(20 point(s))Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the ...原创 2018-06-15 13:32:29 · 172 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1022
1022 Digital Library (30)(30 point(s))A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book ...原创 2018-06-15 13:35:23 · 185 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1006
1006 Sign In and Sign Out (25)(25 point(s))At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given...原创 2018-06-09 18:05:46 · 296 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1035
1035 Password (20)(20 point(s))To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to...原创 2018-06-09 18:08:57 · 230 阅读 · 0 评论 -
PAT (Advanced Level) Practice 1116
1116 Come on! Let's C(20 分)"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 the contest is for fun,...原创 2018-09-07 11:59:06 · 197 阅读 · 0 评论
分享