pta A
题目
zyk618
这个作者很懒,什么都没留下…
展开
-
1085 Perfect Sequence (25 分)
1085 A 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×p where M and m are the maximum and minimum nu...原创 2019-09-12 17:13:53 · 53 阅读 · 0 评论 -
PTA A1101 Quick Sort (25 分)
PTA A1101 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 tha...原创 2019-09-13 15:23:03 · 179 阅读 · 0 评论 -
1017 A除以B (20 分)
1017 A除以B (20 分) 题意 本题要求计算 A/B,其中 A 是不超过 1000 位的正整数,B 是 1 位正整数。你需要输出商数 Q 和余数 R,使得 A=B×Q+R 成立。 输入格式: 输入在一行中依次给出 A 和 B,中间以 1 空格分隔。 输出格式: 在一行中依次输出 Q 和 R,中间以 1 空格分隔。 输入样例: 123456789050987654321 7 输出样例: 1...原创 2019-09-14 13:23:15 · 78 阅读 · 0 评论 -
1023 Have Fun with Numbers (20 分)
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 hap...原创 2019-09-15 09:51:31 · 77 阅读 · 0 评论 -
PTA A1039 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 ...原创 2019-09-15 11:24:02 · 114 阅读 · 0 评论 -
1056 Mice and Rice (25 分) queue的运用
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...原创 2019-09-18 09:46:05 · 123 阅读 · 0 评论 -
PTA1064 A Complete Binary Search Tree (30 分)关于完美二叉排序树的实现练习
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 ...原创 2019-09-21 22:10:36 · 124 阅读 · 0 评论 -
1034 Head of a Gang (30 分)
1034 Head of a Gang (30 分) 题干 One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of...原创 2019-09-26 17:22:33 · 114 阅读 · 1 评论 -
1030 Travel Plan (30 分) //Dijkstra练习
题干 A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest pat...原创 2019-09-27 19:26:48 · 183 阅读 · 1 评论