上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: You are given two strings ss and tt, both consisting only of lowercase Latin letters. The substring s[l..r]s[l..r] is the string which is obtained by 阅读全文
posted @ 2018-09-24 09:10 Daybreaking 阅读(261) 评论(0) 推荐(0) 编辑
摘要: Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positiv 阅读全文
posted @ 2018-09-22 20:38 Daybreaking 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Description 考虑在下面被显示的数字金字塔。 写一个程序来计算从最高点开始在底部任意处结束的路径经过数字的和的最大。 每一步可以走到左下方的点也可以到达右下方的点。 在上面的样例中,从7 到 3 到 8 到 7 到 5 的路径产生了最大和:30 Input 第一个行包含 R(1<= R<= 阅读全文
posted @ 2018-09-08 11:54 Daybreaking 阅读(570) 评论(0) 推荐(0) 编辑
摘要: Description 排序是一种很频繁的计算任务。现在考虑最多只有三值的排序问题。一个实际的例子是,当我们给某项竞赛的优胜者按金银铜牌序的时候。 在这个任务中可能的值只有三种1,2和3。我们用交换的方法把他排成升序的。 写一个程序计算出,给定的一个1,2,3组成的数字序列,排成升序所需的最少交换次 阅读全文
posted @ 2018-09-08 10:35 Daybreaking 阅读(387) 评论(0) 推荐(0) 编辑
摘要: Description 一块N x N(1<=N<=10)正方形的黑白瓦片的图案要被转换成新的正方形图案。写一个程序来找出将原始图案按照以下列转换方法转换成新图案的最小方式: 1:转90度:图案按顺时针转90度。 2:转180度:图案按顺时针转180度。 3:转270度:图案按顺时针转270度。 4 阅读全文
posted @ 2018-09-08 10:16 Daybreaking 阅读(625) 评论(0) 推荐(0) 编辑
摘要: Description The most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this 阅读全文
posted @ 2018-09-01 19:34 Daybreaking 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 算法思想:失之东隅,收之桑隅 对于一个序列,它正向最长上升子序列的长度就是它反向最长下降子序列的个数。 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #include<math.h> 5 #include<algori 阅读全文
posted @ 2018-08-09 21:31 Daybreaking 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 8891 阅读全文
posted @ 2018-08-09 18:53 Daybreaking 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 我感觉划分树的基本思想是二分和归并排序,分为建树和查询两个部分。 1、建树 递归建树,以中值为界,将序列划分成左右两部分,直到分到每个点为止。同时,在建树的过程中,记录下每一层进入左区间的数的个数,方便查询时使用。 注意:保持左右区间中数的相对顺序。 (1)、中值唯一的情况。将小于等于中值的数放到左 阅读全文
posted @ 2018-08-09 18:49 Daybreaking 阅读(270) 评论(0) 推荐(0) 编辑
摘要: People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numb 阅读全文
posted @ 2018-08-07 08:27 Daybreaking 阅读(245) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页