上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
摘要: 1. 定义 sizeof 是一个操作符 operator ,不是一个函数, 其作用是返回一个对象或类型所占的内存字节数 \ 2. 语法 sizeof object; //sizeof 对象 sizeof(object); sizeof(type_name); // 例如 sizeof(int) 对象 阅读全文
posted @ 2018-09-01 16:53 默写年华 阅读(8010) 评论(0) 推荐(1) 编辑
摘要: "原题:885. Spiral Matrix III" On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east. Here, the north west corner of the gr 阅读全文
posted @ 2018-08-31 10:43 默写年华 阅读(223) 评论(0) 推荐(0) 编辑
摘要: find命令 "参考" 语法: find pathname option [ print] [ exec ok command] {} \\; 功能:用于在文件树中查找文件,并做出相应的处理 参数: pathname: 命令所查找的目录路径,其中 表示当前目录, 表示系统根目录 : 经匹配的文件输出 阅读全文
posted @ 2018-08-30 21:55 默写年华 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1. 说明 相当于动态数组,其大小可以预先不指定,并且可以自动扩展,在创建 变量后,它会在内存中自动分配一块连续的内存空间来保存数据,初始内存空间可以预先指定,也可以由 默认指定大小。当存储的数据超过分配的空间时, 会重新分配一块内存,但是这样的分配比较耗时,重新分配的步骤如下: 1) 申请一块更大 阅读全文
posted @ 2018-08-30 18:00 默写年华 阅读(361) 评论(0) 推荐(0) 编辑
摘要: "553. Optimal Division" 题目大意:a/b/c/d...,在上面式子中加括号使得值最大 解题思路: 无论怎么加括号,a肯定是分子,b肯定是分母,要使值最大,分子a是定的,那么应该让分母最小,由于a,b...均是正整数,所以应该让b一直除,所以应当把括号加在a/(b/c/d... 阅读全文
posted @ 2018-08-21 21:37 默写年华 阅读(79) 评论(0) 推荐(0) 编辑
摘要: "原题: 343. Integer Break" 题目大意:给你一个数(2 57), 将这个数拆成若干项(和不变),使其乘积最大。 解题思路: 我们知道,一个数,无论拆成多少项,当每一项都相等时,其乘积最大;假设我们将N拆成N/x个x,于是其乘积就是 x^(N/x),我们对这个乘积求导: 可知,当x 阅读全文
posted @ 2018-08-21 21:37 默写年华 阅读(115) 评论(0) 推荐(0) 编辑
摘要: "413. Arithmetic Slices" 题目大意:找出数组中存在多少等差序列(该序列在原数组是连续的) 解题思路: 1,2,3 → 存在一个即1,2,3 1,2,3,4 →存在3个,即1,2,3;1,2,3,4; 2,3,4;在原来1,2,3的基础上多了2个 1,2,3,4,5 → 存在6 阅读全文
posted @ 2018-08-21 21:35 默写年华 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 原题: "672. Bulb Switcher II" There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown 阅读全文
posted @ 2018-08-21 21:34 默写年华 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 题目大意 "Bulb Switcher" There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third rou 阅读全文
posted @ 2018-08-21 21:32 默写年华 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 原题: "728.Self Dividing Numbers" A self dividing number is a number that is divisible by every digit it contains. For example, 128 is a self dividing n 阅读全文
posted @ 2018-08-21 21:31 默写年华 阅读(130) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页