The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of ...
分类:
其他好文 时间:
2014-08-16 12:37:20
阅读次数:
219
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th...
分类:
其他好文 时间:
2014-08-16 12:23:50
阅读次数:
221
/*找新朋友
Problem Description
新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。
Input
第一行是测试数据的组数CN(Case number,1
Outpu...
分类:
其他好文 时间:
2014-08-16 11:14:10
阅读次数:
243
Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-l...
分类:
其他好文 时间:
2014-08-16 00:59:09
阅读次数:
197
gameloft 笔试题目是英文的,前面全部是理论的,最后两道是编程题目。12345最后两道编程题目 其实还算简单:#include #include #include std::string itoa(int number){ char nstr[15]; sprintf(nstr,"%d",nu...
分类:
Web程序 时间:
2014-08-15 21:06:29
阅读次数:
266
Prime DistanceTime Limit:1000MSMemory Limit:65536KTotal Submissions:12303Accepted:3296DescriptionThe branch of mathematics called number theory is abo...
分类:
其他好文 时间:
2014-08-15 21:04:19
阅读次数:
327
Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m...
分类:
其他好文 时间:
2014-08-15 20:53:19
阅读次数:
240
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others)Memory Limi...
分类:
其他好文 时间:
2014-08-15 20:49:39
阅读次数:
227
Number Transformation
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 617 Accepted Submission(s): 313
Problem Description
Teache...
分类:
其他好文 时间:
2014-08-15 19:42:49
阅读次数:
210
题目:
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space to hold additional elements from B. The number of elements initia...
分类:
其他好文 时间:
2014-08-15 18:00:09
阅读次数:
194