11 2019 档案

摘要:昨天看了一下广度意义上的深度遍历(dfs) 今天接着学到了广度意义上的广度优先遍历(bfs) 这种广度优先遍历在实际意义上与图中深度遍历优先是类似的 dfs隐含的利用了栈(递归),bfs则是利用了队列 这道题便是利用bfs的一道题 每次从栈中弹出元素 都会把它上下左右四个方向检测将未访问可达的元素入 阅读全文
posted @ 2019-11-29 23:30 57one 阅读(200) 评论(0) 推荐(0) 编辑
摘要:题目分析:这是利用深度优先遍历的题(dfs) 我原来以为dfs只是特指图中的深度优先遍历 没想到其实更能代表一种思想 : 从最开始的状态出发 遍历所有可以到达的状态 也由此可以对所有状态进行操作 就这道题而言 要做出需要2种思想 1.得把计算水洼转化 首先当我们分析过某个水洼后就把它置为‘.' 以防 阅读全文
posted @ 2019-11-28 21:26 57one 阅读(142) 评论(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, with no duplication 阅读全文
posted @ 2019-11-26 18:12 57one 阅读(134) 评论(0) 推荐(0) 编辑
摘要:1022 Digital Library (30 分) A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, pub 阅读全文
posted @ 2019-11-26 16:52 57one 阅读(146) 评论(0) 推荐(0) 编辑
摘要:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the 阅读全文
posted @ 2019-11-25 20:50 57one 阅读(129) 评论(0) 推荐(0) 编辑
摘要: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-11-25 17:17 57one 阅读(166) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-11-24 23:01 57one 阅读(122) 评论(0) 推荐(0) 编辑
摘要:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any s 阅读全文
posted @ 2019-11-24 16:19 57one 阅读(668) 评论(0) 推荐(0) 编辑
摘要: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-11-24 13:47 57one 阅读(248) 评论(0) 推荐(0) 编辑
摘要: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-11-23 16:42 57one 阅读(131) 评论(0) 推荐(0) 编辑
摘要: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-11-23 14:55 57one 阅读(213) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-11-23 14:19 57one 阅读(519) 评论(0) 推荐(0) 编辑
摘要: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-11-23 13:23 57one 阅读(202) 评论(0) 推荐(0) 编辑
摘要: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-11-23 11:24 57one 阅读(135) 评论(0) 推荐(0) 编辑
摘要:With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing ba 阅读全文
posted @ 2019-11-15 16:11 57one 阅读(112) 评论(0) 推荐(0) 编辑
摘要: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-11-15 15:32 57one 阅读(193) 评论(0) 推荐(0) 编辑
摘要:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev 阅读全文
posted @ 2019-11-14 20:24 57one 阅读(175) 评论(0) 推荐(0) 编辑
摘要:1007 Maximum Subsequence Sum (25 分) Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​ 阅读全文
posted @ 2019-11-14 20:22 57one 阅读(156) 评论(0) 推荐(0) 编辑
摘要:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door 阅读全文
posted @ 2019-11-14 17:42 57one 阅读(154) 评论(0) 推荐(0) 编辑
摘要:Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
posted @ 2019-11-14 17:00 57one 阅读(107) 评论(0) 推荐(0) 编辑
摘要:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each inp 阅读全文
posted @ 2019-11-14 16:35 57one 阅读(148) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示