![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
----杂题
这个好玩吗
Offer已在路上请耐心等待,准备入职的新人
展开
-
PAT(A)- 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 example, 123 and 51 are friend numbers since 1+2+3 = 5+1 = 6, and 6 is their原创 2016-12-18 19:59:14 · 464 阅读 · 0 评论 -
PAT(A) - 1042. Shuffling Machine (20)
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" where employees collaborate with gambler原创 2016-09-16 21:41:29 · 273 阅读 · 0 评论 -
PAT(A) - 1023. Have Fun with Numbers (20)
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, which happens to be another 9-digit number con原创 2016-09-14 20:54:47 · 259 阅读 · 0 评论 -
PAT(A) - 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 integers N原创 2016-09-14 18:00:47 · 228 阅读 · 0 评论 -
PAT(A) - 1035. Password (20)
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 distinguish 1 (one) from l (L原创 2016-09-14 12:59:51 · 358 阅读 · 0 评论 -
PAT(B) - 1057. 数零壹(20)
给定一串长度不超过105的字符串,本题要求你将其中所有英文字母的序号(字母a-z对应序号1-26,不分大小写)相加,得到整数N,然后再分析一下N的二进制表示中有多少0、多少1。例如给定字符串“PAT (Basic)”,其字母序号之和为:16+1+20+2+1+19+9+3=71,而71的二进制是1000111,即有3个0、4个1。输入格式:输入在一行中给出长度不超过105、以回车结原创 2016-09-13 00:32:39 · 951 阅读 · 0 评论 -
PAT(B) - 1056. 组合数的和(15)
给定N个非0的个位数字,用其中任意2个数字都可以组合成1个2位的数字。要求所有可能组合出来的2位数字的和。例如给定2、5、8,则可以组合出:25、28、52、58、82、85,它们的和为330。输入格式:输入在一行中先给出N(1输出格式:输出所有可能组合出来的2位数字的和。输入样例:3 2 8 5输出样例:330#include #de原创 2016-09-13 00:09:44 · 2177 阅读 · 0 评论 -
PAT(B) - 1060. 爱丁顿数(25)
英国天文学家爱丁顿很喜欢骑车。据说他为了炫耀自己的骑车功力,还定义了一个“爱丁顿数”E,即满足有E天骑车超过E英里的最大整数E。据说爱丁顿自己的E等于87。现给定某人N天的骑车距离,请你算出对应的爱丁顿数E(输入格式:输入第一行给出一个正整数N(5),即连续骑车的天数;第二行给出N个非负整数,代表每天的骑车距离。输出格式:在一行中给出N天的爱丁顿数。输入原创 2016-09-12 21:16:26 · 1775 阅读 · 0 评论 -
PAT(A) - 1144. The Missing Number (20)
1144. The Missing Number (20)时间限制150 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Spec...原创 2018-03-23 09:31:11 · 533 阅读 · 0 评论 -
PAT(A) - 1141. PAT Ranking of Institutions (25)
1141. PAT Ranking of Institutions (25)时间限制500 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAfter each PAT, the PAT Center will announce the ranking of institutions based on their students' perfor...原创 2018-03-24 19:55:49 · 376 阅读 · 0 评论 -
PAT(A) - 1140. Look-and-say Sequence (20)
1140. Look-and-say Sequence (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueLook-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...wh...原创 2018-03-24 20:09:58 · 298 阅读 · 1 评论 -
PAT(A) - 1132. Cut Integer (20)
1132. Cut Integer (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueCutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long integers A and B. For e...原创 2018-03-24 20:48:15 · 149 阅读 · 0 评论 -
PAT(A) - 1128. N Queens Puzzle (20)
1128. N Queens Puzzle (20)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens th...原创 2018-03-25 20:02:30 · 176 阅读 · 0 评论 -
PAT(A) - 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原创 2016-09-17 15:25:20 · 278 阅读 · 0 评论 -
PAT(A) - 1063. Set Similarity (25)
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the total number of distinct n原创 2016-09-21 23:19:58 · 280 阅读 · 0 评论 -
PAT(A) - 1015. Reversible Primes (20)
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原创 2016-11-03 19:46:52 · 272 阅读 · 0 评论 -
PAT(A) - 1089. Insert or Merge (25)
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原创 2016-11-02 23:13:04 · 293 阅读 · 0 评论 -
PAT(A) - 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:The s原创 2016-10-21 00:12:04 · 336 阅读 · 0 评论 -
PAT(A) - 1060. Are They Equal (25)
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 with simple chopping. Now given the number of significa原创 2016-10-15 18:48:29 · 333 阅读 · 0 评论 -
PAT(A) - 1096. Consecutive Factors (20)
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原创 2016-10-10 19:05:36 · 261 阅读 · 0 评论 -
PAT(A) - 1080. Graduate Admission (30)
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原创 2016-10-06 11:43:53 · 317 阅读 · 0 评论 -
PAT(A) - 1022. Digital Library (30)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a原创 2016-09-29 19:45:53 · 249 阅读 · 0 评论 -
PAT(A) - 1012. The Best Rank (25)
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algebra), and E - Eng原创 2016-09-28 17:12:42 · 264 阅读 · 0 评论 -
PAT(A) - 1056. Mice and Rice (25)
Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice原创 2016-09-28 16:50:30 · 341 阅读 · 0 评论 -
PAT(A) - 1075. PAT Judge (25)
The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input fil原创 2016-09-28 16:45:58 · 287 阅读 · 0 评论 -
PAT(A) - 1019. General Palindromic Number (20)
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原创 2016-09-25 15:46:05 · 256 阅读 · 0 评论 -
PAT(A) - 1058. A+B in Hogwarts (20)
1058. A+B in Hogwarts (20)时间限制50 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIf you are a fan of Harry Potter, you would原创 2016-09-23 21:08:12 · 243 阅读 · 0 评论 -
PAT(A) - 1129. Recommendation System (25)
1129. Recommendation System (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueRecommendation system predicts the p原创 2018-03-27 11:58:46 · 277 阅读 · 0 评论