上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 90 下一页
摘要: After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the rank 阅读全文
posted @ 2019-03-01 20:23 王清河 阅读(327) 评论(0) 推荐(0)
摘要: Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s 阅读全文
posted @ 2019-03-01 20:22 王清河 阅读(415) 评论(0) 推荐(0)
摘要: Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that 阅读全文
posted @ 2019-03-01 20:21 王清河 阅读(272) 评论(0) 推荐(0)
摘要: For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/ 阅读全文
posted @ 2019-03-01 20:21 王清河 阅读(325) 评论(0) 推荐(0)
摘要: 划拳是古老中国酒文化的一个有趣的组成部分。酒桌上两人划拳的方法为:每人口中喊出一个数字,同时用手比划出一个数字。如果谁比划出的数字正好等于两人喊出的数字之和,谁就赢了,输家罚一杯酒。两人同赢或两人同输则继续下一轮,直到唯一的赢家出现。 下面给出甲、乙两人的划拳记录,请你统计他们最后分别喝了多少杯酒。 阅读全文
posted @ 2019-02-28 22:08 王清河 阅读(134) 评论(0) 推荐(0)
摘要: 给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段。例如,给定数列 { 0.1, 0.2, 0.3, 0.4 },我们有 (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4) (0.2) (0.2, 0.3) (0.2, 0.3, 0 阅读全文
posted @ 2019-02-28 22:08 王清河 阅读(457) 评论(0) 推荐(0)
摘要: 著名的快速排序算法里有一个经典的划分过程:我们通常采用某种方法取一个元素作为主元,通过交换,把比主元小的元素放到它的左边,比主元大的元素放到它的右边。 给定划分后的 N 个互不相同的正整数的排列,请问有多少个元素可能是划分前选取的主元? 例如给定 $N = 5$, 排列是1、3、2、4、5。则: 1 阅读全文
posted @ 2019-02-28 22:07 王清河 阅读(193) 评论(0) 推荐(0)
摘要: 火星人是以 13 进制计数的: 地球人的 0 被火星人称为 tret。 地球人数字 1 到 12 的火星文分别为:jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec。 火星人将进位以后的 12 个高位数字分别称为:tam, hel, 阅读全文
posted @ 2019-02-28 22:06 王清河 阅读(187) 评论(0) 推荐(0)
摘要: Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0 for all i and a​k​​>0. Then N is palindrom 阅读全文
posted @ 2019-02-28 22:01 王清河 阅读(270) 评论(0) 推荐(0)
摘要: The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard so that no two queens threaten each other. Thus, a solution 阅读全文
posted @ 2019-02-28 22:00 王清河 阅读(390) 评论(0) 推荐(0)
上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 90 下一页