题目链接题意:给一个n个数的序列a1, a2, ..., an ,这些数的范围是0~n-1, 可以把前面m个数移动到后面去,形成新序列:a1, a2, ..., an-1, an (where m = 0 - the initial seqence)a2, a3, ..., an, a1 (wher...
分类:
其他好文 时间:
2014-08-16 21:00:01
阅读次数:
188
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-08-16 17:03:50
阅读次数:
174
Problem Description
Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the U...
分类:
其他好文 时间:
2014-08-16 16:28:10
阅读次数:
185
已知n,k,操作k次,每次操作求大于n且能被次数i整除的最小的数
已知x*i,所以(i+1)*y>=x*i,y>=x-[x/(i+1)],当x
#include
int main()
{
long long n,k;
long long i;
int time=0;
while(scanf("%I64d%I64d",&n,&k)!=-1)
{
...
分类:
其他好文 时间:
2014-08-16 15:07:40
阅读次数:
162
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