上一页 1 2 3 4 5 6 7 8 9 ··· 14 下一页
摘要: Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space 阅读全文
posted @ 2017-04-10 13:44 aiterator 阅读(99) 评论(0) 推荐(0) 编辑
摘要: A robot is located at the top left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2017-04-10 13:41 aiterator 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given a set of digits S, and an integer n, you have to find how many n digit integers are there, which contain digits that belong to S and the differe 阅读全文
posted @ 2017-04-09 19:21 aiterator 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 描述 在8x8的国际象棋棋盘上给定一只骑士(俗称“马”)棋子的位置(R, C),小Hi想知道从(R, C)开始移动N步一共有多少种不同的走法。 输入 第一行包含三个整数,N,R和C。 对于40%的数据, C++ include using namespace std; typedef vector 阅读全文
posted @ 2017-04-09 19:12 aiterator 阅读(581) 评论(0) 推荐(0) 编辑
摘要: 描述 小Hi写程序时习惯用蛇形命名法( )为变量起名字,即用下划线将单词连接起来,例如: 、 。 小Ho写程序时习惯用驼峰命名法(camel case)为变量起名字,即第一个单词首字母小写,后面单词首字母大写,例如:fileName、lineNumber。 为了风格统一,他们决定邀请公正的第三方来编 阅读全文
posted @ 2017-04-09 15:34 aiterator 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 描述 给定一个NxM的矩阵A和一个整数K,小Hi希望你能求出其中最大(元素数目最多)的子矩阵,并且该子矩阵中所有元素的和不超过K。 输入 第一行包含三个整数N、M和K。 以下N行每行包含M个整数,表示A。 对于40%的数据, 1 using namespace std; int main() { i 阅读全文
posted @ 2017-04-09 15:22 aiterator 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 3.5.1 TCP连接 + tcp 是因特网运输层的面向连接的可靠的运输协议。 + tcp 只工作在两个端系统中,不在中间的网络元素(路由器和交换机)中运行。即中间路由器完全看不见tcp连接,它们看到的只有数据报。 + tcp 是全双工的工作状态,即两个端系统A,B一旦建立tcp连接,端系统A向端系 阅读全文
posted @ 2017-04-09 10:41 aiterator 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non negative. For example: Given and , return . 题目意思就是将链表后面k个数,放到链表前面。 那么只需要一次循环就可以 阅读全文
posted @ 2017-04-08 23:16 aiterator 阅读(158) 评论(0) 推荐(0) 编辑
摘要: The set contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following sequence (ie, for n 阅读全文
posted @ 2017-04-06 21:00 aiterator 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 作用: + 1.知道一个序列的所有成员,可以很快得到这个序列的第k大序列(按字典序排序) + 2.给定一个序列,很快可以算出所给序列的大小(按字典序排序),常用于状态压缩 将含有n个元素的序列转换成一个数字(字典序大小) 公式 。 对于 ,代表当前元素在所有元素中是第 大的数字。(下标从 开始) 例 阅读全文
posted @ 2017-04-06 20:58 aiterator 阅读(162) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 14 下一页