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 ou 阅读全文
posted @ 2019-01-06 13:31 ZhangのBlog 阅读(391) 评论(0) 推荐(0) 编辑

1017 Queueing at Bank (我自己写的模拟时间的版本)

摘要: Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c 阅读全文
posted @ 2019-01-05 21:36 ZhangのBlog 阅读(159) 评论(0) 推荐(0) 编辑

1016 Phone Bills ( vector的使用)

摘要: A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, dependi 阅读全文
posted @ 2019-01-05 18:34 ZhangのBlog 阅读(170) 评论(0) 推荐(0) 编辑

1015 Reversible Primes

摘要: 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 re 阅读全文
posted @ 2019-01-04 18:46 ZhangのBlog 阅读(205) 评论(0) 推荐(0) 编辑

1014 Waiting in Line 队列

摘要: Suppose a bank has NNN windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rul 阅读全文
posted @ 2019-01-02 21:33 ZhangのBlog 阅读(383) 评论(0) 推荐(0) 编辑

1013 Battle Over Cities (DFS求图的连通分量个数)

摘要: It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that c 阅读全文
posted @ 2019-01-02 19:26 ZhangのBlog 阅读(547) 评论(0) 推荐(0) 编辑

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 - Mat 阅读全文
posted @ 2019-01-01 23:02 ZhangのBlog 阅读(442) 评论(0) 推荐(0) 编辑

1010 Radix (25 分)

摘要: Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a 阅读全文
posted @ 2019-01-01 20:35 ZhangのBlog 阅读(789) 评论(2) 推荐(0) 编辑

1009 Product of Polynomials

摘要: This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu 阅读全文
posted @ 2018-12-31 17:06 ZhangのBlog 阅读(151) 评论(0) 推荐(0) 编辑

递归求解全排列

摘要: import java.util.Arrays; public class Main { public static void main(String[] args) { char [] data = {'A','B','C'}; f(data,0); } private static void f(char [] data,int k)... 阅读全文
posted @ 2018-03-31 20:06 ZhangのBlog 阅读(106) 评论(0) 推荐(0) 编辑