Given two binary strings, return their sum
(also a binary string).For example,a ="11"b
="1"Return"100".思路:一个二进制字符串相加;首先从字符串的末尾开始,先二进制字符转化为数字,然后再相加;然后将...
分类:
其他好文 时间:
2014-05-05 23:10:15
阅读次数:
319
-a:显示所有文件,包括隐藏文件-d:只显示目录-f:显示完整的文件名,包含路径-L:显示目录树的深度[root@rusky
/]# tree -L 2 -a -f /home/home|-- /home/99user.ldif|-- /home/Legal| |--
/home/Legal/C.....
分类:
其他好文 时间:
2014-05-05 23:08:27
阅读次数:
402
# Definition for a binary tree node# class
TreeNode:# def __init__(self, x):# self.val = x# self.left = None# self.right
...
分类:
其他好文 时间:
2014-05-05 22:56:23
阅读次数:
419
c语言中的二进制输出是没有占位符的,不像八进制:%o; 和十六进制:x%;c中二进制的输出 1
//右移31位,从最高为开始和1做&运算,得到每一位的二进制数值 2 void printbinry(int num) 3 { 4 int count
= (sizeof(num)=0) { 6 ...
分类:
编程语言 时间:
2014-05-05 22:37:02
阅读次数:
431
#include #include #include using namespace std;int
n,leap;int vis[12];void dfs(int index,int num){ if(leap) return ; if(index>n)
{ ...
分类:
其他好文 时间:
2014-05-05 22:01:05
阅读次数:
593
写了个objectpool,很简单,就是个线程安全的队列。
#pragma once
#include
#include
#include
#include
template
class ObjectPool
{
public:
ObjectPool(size_t chunk_size = kdefault_size, size_t chunk_num = 32)
: chun...
分类:
编程语言 时间:
2014-05-05 13:11:58
阅读次数:
446
实测机为联想A820T安卓4.1.2
一·准备工作
1·R.E管理器 (安卓)
2·获取root权限
3·十六进制编辑器(UltraEdit_SC17_PC版或者直接安卓版的编辑器也行)
二·步骤
1·用R.E管理器按路径data/nvram/APCFG/APRDEB/WIFI找到WiFi这个文件(路径可能各种手机不相同)
2·复制WiFi文件到/sdcard/下面的任意地方,...
分类:
其他好文 时间:
2014-05-04 12:44:05
阅读次数:
396
代码:
#include
#include
#include
#include
using namespace std;
const int maxn=10003;
const int inf=0x7fffffff;
int num[maxn];
int n;
int main()
{
while(scanf("%d",&n)!=EOF&&n)...
分类:
其他好文 时间:
2014-05-04 12:39:16
阅读次数:
331
通常情况下,在配置Tomcat生产环境时,通常会配置Tomcat以特定的身份运行(非root),这样有利于提高安全性,防止网站被黑后的进一步权限提升。...
分类:
其他好文 时间:
2014-05-04 00:05:00
阅读次数:
329
auto root = Dictionary::create();
auto string = String::create("string element value");
root->setObject(string, "string element key");
auto array = Array::create();
...
分类:
其他好文 时间:
2014-05-03 16:27:48
阅读次数:
380