04 2020 档案

摘要:1071 Speech Patterns (25分) People often have a preference among synonyms of the same word. For example, some may prefer "the polic... 阅读全文
posted @ 2020-04-22 12:10 Hu_YaYa 阅读(20) 评论(0) 推荐(0)
摘要:1054 The Dominant Color (20分) Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of i... 阅读全文
posted @ 2020-04-21 20:47 Hu_YaYa 阅读(19) 评论(0) 推荐(0)
摘要:1100 Mars Numbers (20分) People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars.The numbers 1 to 1... 阅读全文
posted @ 2020-04-21 20:19 Hu_YaYa 阅读(33) 评论(0) 推荐(0)
摘要:1060 Are They Equal (25分) If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equa... 阅读全文
posted @ 2020-04-20 22:22 Hu_YaYa 阅读(23) 评论(0) 推荐(0)
摘要:1063 Set Similarity (25分) Given two sets of integers, the similarity of the sets is defined to be N​c​​/N​t​​×100%, where N​c​​ is... 阅读全文
posted @ 2020-04-19 21:39 Hu_YaYa 阅读(17) 评论(0) 推荐(0)
摘要:1047 Student List for Course (25分) Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered co... 阅读全文
posted @ 2020-04-19 15:53 Hu_YaYa 阅读(20) 评论(0) 推荐(0)
摘要:1039 Course List for Student (25分) Zhejiang University has 40000 students and provides 2500 courses. Now given the student name li... 阅读全文
posted @ 2020-04-18 21:31 Hu_YaYa 阅读(22) 评论(0) 推荐(0)
摘要:1024 Palindromic Number (25分) A number that will be the same when it is written forwards or backwards is known as a Palindromic Nu... 阅读全文
posted @ 2020-04-15 15:37 Hu_YaYa 阅读(20) 评论(0) 推荐(0)
摘要:1023 Have Fun with Numbers (20分) Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, ... 阅读全文
posted @ 2020-04-15 12:30 Hu_YaYa 阅读(26) 评论(0) 推荐(0)
摘要:1059 Prime Factors (25分) Given any positive integer N, you are supposed to find all of its prime factors, and write them in the fo... 阅读全文
posted @ 2020-04-15 11:37 Hu_YaYa 阅读(29) 评论(0) 推荐(0)
摘要:1096 Consecutive Factors (20分) Among all the factors of a positive integer N, there may exist several consecutive numbers. For exa... 阅读全文
posted @ 2020-04-15 10:01 Hu_YaYa 阅读(12) 评论(0) 推荐(0)
摘要:1078 Hashing (25分) The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and outp... 阅读全文
posted @ 2020-04-14 20:39 Hu_YaYa 阅读(20) 评论(0) 推荐(0)
摘要:1088 Rational Arithmetic (20分) For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate th... 阅读全文
posted @ 2020-04-14 12:45 Hu_YaYa 阅读(15) 评论(0) 推荐(0)
摘要:1081 Rational Sum (20分) Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input... 阅读全文
posted @ 2020-04-13 17:22 Hu_YaYa 阅读(15) 评论(0) 推荐(0)
摘要:1049 Counting Ones (30分) The task is simple: given any positive integer N, you are supposed to count the total number of 1's in th... 阅读全文
posted @ 2020-04-13 16:07 Hu_YaYa 阅读(13) 评论(0) 推荐(0)
摘要:1104 Sum of Number Segments (20分) Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For ... 阅读全文
posted @ 2020-04-13 13:40 Hu_YaYa 阅读(19) 评论(0) 推荐(0)
摘要:1069 The Black Hole of Numbers (20分) For any 4-digit integer except the ones with all the digits being the same, if we sort the di... 阅读全文
posted @ 2020-04-13 12:27 Hu_YaYa 阅读(28) 评论(0) 推荐(0)
摘要:1101 Quick Sort (25分) There is a classical process named partition in the famous quick sort algorithm. In this process we typicall... 阅读全文
posted @ 2020-04-11 19:30 Hu_YaYa 阅读(25) 评论(0) 推荐(0)
摘要:1093 Count PAT's (25分) The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6t... 阅读全文
posted @ 2020-04-11 17:41 Hu_YaYa 阅读(1) 评论(0) 推荐(0)
摘要:1029 Median (25分) Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the ... 阅读全文
posted @ 2020-04-11 16:25 Hu_YaYa 阅读(23) 评论(0) 推荐(0)
摘要:1089 Insert or Merge (25分) According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growi... 阅读全文
posted @ 2020-04-10 17:40 Hu_YaYa 阅读(18) 评论(0) 推荐(0)
摘要:1.扩展欧几里得算法 贝祖定理:若a,b是整数,且gcd(a,b)=d,那么对于任意的整数x,y,ax+by=m中的m一定是d的倍数。(特别地,如果a、b是整数,那么一定存在整数x、y使得ax+by=gcd(a,b)。) 那么贝祖定理的一个直接应用就是:如果ax+by=1有解,那么gcd(a,b)= 阅读全文
posted @ 2020-04-07 20:05 Hu_YaYa 阅读(604) 评论(0) 推荐(0)