03 2015 档案

摘要:stoi函数默认要求输入的参数字符串是符合int范围的[-2147483648, 2147483647],否则会runtime error。atoi函数则不做范围检查,若超过int范围,则显示-2147483648(溢出下界)或者2147483647(溢出上界)。 阅读全文
posted @ 2015-03-28 18:07 陆草纯 阅读(1271) 评论(0) 推荐(0) 编辑
摘要:Rotate ArrayRotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note... 阅读全文
posted @ 2015-03-27 22:49 陆草纯 阅读(1249) 评论(0) 推荐(0) 编辑
摘要:Reverse BitsReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as000000101001010000011110100111... 阅读全文
posted @ 2015-03-21 12:18 陆草纯 阅读(581) 评论(0) 推荐(0) 编辑
摘要:Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl... 阅读全文
posted @ 2015-03-21 11:57 陆草纯 阅读(216) 评论(0) 推荐(0) 编辑
摘要:#include // std::cout#include // std::vectorusing namespace std;int main () { vector > theta; theta.resize(1, vector(2, 1)); thet... 阅读全文
posted @ 2015-03-02 15:57 陆草纯 阅读(1105) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示