参考地址:https://www.ibm.com/developerworks/cn/linux/l-cn-gpb/
转载请注明:Imekaku-Blog » [转]Google Protocol Buffer 的使用和原理...
imekaku
4年前 (2017-08-14) 1182℃ 0评论
0喜欢
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.
Example:
Given a = 1 and b = 2, return 3.
...
admin
4年前 (2016-10-08) 1114℃ 0评论
0喜欢
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.
Note:
1All letters...
admin
4年前 (2016-10-07) 1025℃ 0评论
0喜欢
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those le...
admin
4年前 (2016-10-07) 1243℃ 0评论
0喜欢
Find the sum of all left leaves in a given binary tree.
Example:
3
/ \
9 20
/ \
15 7
There are two left leaves in the bi...
admin
4年前 (2016-10-07) 1059℃ 0评论
0喜欢
给定一个长度为n的整数数组a,元素均不相同,问数组是否存在这样一个片段,只将该片段翻转就可以使整个数组升序排列。其中数组片段[l,r]表示序列a[l], a[l+1], …, a[r]。原始数组为
a[1], a[2], …, a[l-2], a[l-1]...
admin
4年前 (2016-10-06) 1267℃ 0评论
0喜欢
在N*M的草地上,提莫种了K个蘑菇,蘑菇爆炸的威力极大,兰博不想贸然去闯,而且蘑菇是隐形的.只 有一种叫做扫描透镜的物品可以扫描出隐形的蘑菇,于是他回了一趟战争学院,买了2个扫描透镜,一个 扫描透镜可以扫描出(3*3)方格中所有的蘑菇,然后兰博就可以清理掉一些隐形的蘑菇. 问:兰...
admin
4年前 (2016-09-22) 1235℃ 0评论
0喜欢
一场考试包含3道开放性题目,假设他们的难度从小到大分别为a, b, c,我们希望这3道题能满足下列条件:
a ≤ b ≤ c
b – a ≤ 10
c – b ≤ 10
所有出题人一共出了n道开放性题目。现在我们想把这n道题分布到若干场考试中(1场或多场...
admin
4年前 (2016-09-21) 1403℃ 0评论
0喜欢
输入为两行内容,第一行是正整数number,注意可能是很大的。第二行是希望去掉的数字数量。
输出
输出保留下来的结果。
样例输入
325
1
样例输出
35
Python
Python
import sys
def...
admin
4年前 (2016-09-21) 1145℃ 0评论
0喜欢
有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或者二级,要走上m级,共有多少走法?注:规定从一级到一级有0种走法。
给定一个正整数int n,请返回一个数,代表上楼的方式数。保证n小于等于100。为了防止溢出,请返回结果Mod 1000000007的值。
测试样例:
3
...
admin
5年前 (2016-09-21) 945℃ 0评论
0喜欢