码迷,mamicode.com
首页 >  
搜索关键字:bits    ( 3873个结果
LeetCode 342 Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return fa ...
分类:其他好文   时间:2016-09-01 02:00:51    阅读次数:140
【再度图书馆】
/* 二叉树小练习子数组8皇后92种情况 */ #include<bits/stdc++.h> usingnamespacestd; #include<iostream> usingnamespacestd; typedefstructnode { intx; node*lc; node*rc; node(){} node(intxx){x=xx;lc=NULL;rc=NULL;} }*BiTree; intss[]={4,2,1,0,0,3,0,0,6,5..
分类:其他好文   时间:2016-09-01 00:36:18    阅读次数:126
231. Power of Two 342. Power of Four -- 判断是否为2、4的整数次幂
231. Power of Two Given an integer, write a function to determine if it is a power of two. 342. Power of Four Given an integer (signed 32 bits), write ...
分类:其他好文   时间:2016-09-01 00:08:30    阅读次数:103
LeetCode-Serialize and Deserialize Binary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or ...
分类:其他好文   时间:2016-08-30 12:09:35    阅读次数:160
hdu_2825_Wireless Password(AC自动机+状压DP)
题目链接:hdu_2825_Wireless Password 题意: 给你m个串,问长度为n至少含k个串的字符串有多少个 题解: 设dp[i][j][k]表示考虑到长度为i,第j个自动机的节点,含有k这个压缩状态的方案数,然后DP下去就行了 1 #include<bits/stdc++.h> 2 ...
分类:其他好文   时间:2016-08-29 17:33:26    阅读次数:189
hdu 1249 三角形
题意:用N个三角形最多可以把平面分成几个区域? idea:模拟简单数据,用已知数据加待定系数法确认,从高维降维即可。 代码: #include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { ...
分类:其他好文   时间:2016-08-26 18:04:44    阅读次数:210
iOS 字符串千位划分
/** * 格式化字符串3位一组(按位数取舍,没有入位) * * @param numberObject 需要处理的字符串(可以是nsnumber) * @param bits 保留的位数 * * @return 返回字符串 */+ (NSString *)numberDivision:(id)nu ...
分类:移动开发   时间:2016-08-23 18:59:05    阅读次数:412
【Leetcode 338】 Counting Bits
恢复内容开始 问题描述:给出一个非负整数num,对[0, num]范围内每个数都计算它的二进制表示中1的个数 Example:For num = 5 you should return [0,1,1,2,1,2] 思路:这种题适合归纳法,找出规律然后用编程语言描述,令i从0开始,设f(i)为i对应二 ...
分类:其他好文   时间:2016-08-23 01:30:09    阅读次数:128
string类里find的用法
#include<bits/stdc++.h> using namespace std; typedef long long ll; //int INF=(1<<31)-1; //int mi=-(1<<31)+1; #define read(x) scanf("%d",&x); #define f ...
分类:其他好文   时间:2016-08-22 02:12:28    阅读次数:288
手写 大整数
http://codevs.cn/problem/1166/ 区间dp, 手写大整数 1 #include<bits/stdc++.h> 2 #define mt(a,b) memset(a,b,sizeof(a)) 3 using namespace std; 4 typedef long lon ...
分类:其他好文   时间:2016-08-21 15:10:51    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!