摘要: Manholes, which interconnect underground sewerage pipes, and serve as a point of entry for cleaning the pipes, are located at every major sewer pipe j... 阅读全文
posted @ 2014-06-05 22:18 linyx 阅读(411) 评论(0) 推荐(0) 编辑
摘要: 来HK之后,锻炼的时间就少了许多。以后还是要抓紧啊。 计划,两天一次。 1.热身3~5min。2.无氧运动30~60min。(200俯卧撑、300仰卧起坐)3.有氧运动30~60min。(跑步、游泳、羽毛球) 现在一些观点表明仰卧起坐的训练效果不大,而且有可能损伤脊柱,因此很多训练计划都改为使用卷腹 阅读全文
posted @ 2014-06-05 21:47 linyx 阅读(308) 评论(0) 推荐(0) 编辑
摘要: You are given a function rand(a, b) which generates equiprobable random numbers between [a, b] inclusive. Generate 3 numbers x, y, z with probability ... 阅读全文
posted @ 2014-06-05 19:50 linyx 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 随机生成[0,n)中不重复的m个数。 1 class Random { 2 public: 3 Random(int n, int m):n(n), m(m) {} 4 void generate() { 5 srand(time(NULL)); 6 ... 阅读全文
posted @ 2014-06-05 15:43 linyx 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 花了半天把二分查找的几种都写了一遍。验证了一下。二分查找的正确编写的关键就是,确保循环的初始、循环不变式能够保证一致。 可以先从循环里面确定循环不变式,然后再推导初始条件,最后根据循环不变式的内容推导出结果。 1. 普通的二分查找 第一版本: 循环内部有三次比较,一般来说,相等的操作只需要判断一次, 阅读全文
posted @ 2014-06-05 13:58 linyx 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Bubble sortBubble sort, sometimes incorrectly referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the... 阅读全文
posted @ 2014-06-05 12:35 linyx 阅读(615) 评论(0) 推荐(0) 编辑