- 博客(14)
- 收藏
- 关注
原创 1063 Set Similarity (25 分)
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 the number of distinct common numbers shared by the two sets, and N**t is the total number of distinct numbers in the two sets.
2021-05-08 19:41:38
164
原创 1039 Course List for Student (25 分)
1039 Course List for Student (25 分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.Input S
2021-05-02 20:27:48
129
原创 1096 Consecutive Factors (20 分)
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 any positive N, you are
2021-04-28 19:20:58
201
原创 1059 Prime Factors (25 分)(质因子分解)
1059 Prime Factors (25 分)Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1k1×p2k2×⋯×pmk**m.Input Specification:Each input file contains one test case which gives a positive integer N in
2021-04-28 19:04:58
197
原创 1078 Hashing (25 分)
1078 Hashing (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be H(key)=key%TSize where TSize is the maximum size of
2021-04-27 20:05:31
300
原创 1015 Reversible Primes (20 分)(素数+进制转换)
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 prime.Now given any two pos
2021-04-26 20:43:34
102
原创 1088 Rational Arithmetic (20 分)
1088 Rational Arithmetic (20 分)For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each input file contains one test case, which gives in one li
2021-04-26 19:15:20
78
原创 1038 Recover the Smallest Number (30 分)
1038 Recover the Smallest Number (30 分)Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229-87 or 0229-32-8
2021-04-26 18:59:27
100
原创 1067 Sort with Swap(0, i) (贪心)
1067 Sort with Swap(0, i) (贪心)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 use? For example, to sort {4, 0, 2, 1, 3} we may apply the sw
2021-04-25 19:32:33
220
原创 1033 To Fill or Not to Fill (25 分)(贪心)
1033 To Fill or Not to Fill (25 分)(贪心)With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different gas station may giv
2021-04-25 19:04:59
140
原创 1101 Quick Sort (25 分)
1101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its left and those larger than the pivo
2021-04-21 20:15:15
65
原创 B1033 旧键盘打字(测试点2,3)
B1033 旧键盘打字(测试点2,3)题目:1033 旧键盘打字 (20 分)旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及坏掉的那些键,打出的结果文字会是怎样?输入格式:输入在 2 行中分别给出坏掉的那些键、以及应该输入的文字。其中对应英文字母的坏键以大写给出;每段文字是不超过 105 个字符的串。可用的字符包括字母 [a-z, A-Z]、数字 0-9、以及下划线 _(代表空格)、,、.、-、+(代表上档键)。题目保证第 2 行输入的文字串非空
2021-03-29 23:12:46
325
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人