循环语句 for语法结构:for target in sequences :statementstatementetc...sequences的数据类型listtuple (元组)stringsfiles循环for遍历 string 和 list循环体for遍历文件 和 元组list 每个数据项可以...
分类:
编程语言 时间:
2015-04-12 17:22:17
阅读次数:
118
【题目链接】click here~~
【题目大意】
Jzzhu has invented a kind of sequences, they meet the following property:
You are given x and
y, please calculate fn modulo
1000000007(109?+?7).
【解题思路】...
分类:
其他好文 时间:
2015-04-11 22:39:36
阅读次数:
179
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to ...
分类:
其他好文 时间:
2015-04-11 19:22:05
阅读次数:
98
Bessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform n operations. Each operation is one of the following:A...
分类:
其他好文 时间:
2015-04-10 18:03:44
阅读次数:
164
Repeated DNA Sequences
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated s...
分类:
其他好文 时间:
2015-04-10 15:35:15
阅读次数:
242
D. Little Girl and Maximum XOR
A little girl loves problems on bitwise operations very much. Here's one of them.
You are given two integers
l and r. Let's consider the values of
for all pa...
分类:
其他好文 时间:
2015-04-10 09:40:40
阅读次数:
147
问题描述一个盒子里有n个黑球和m个白球。现在DZY每次随机从盒子里取走一个球,取了n+m次后,刚好取完。DZY用这种奇怪的方法生成了一个随机的01串S[1?(n+m)]。如果DZY第i次取出的球是黑色的,那么S[i]=1,如果是白色的,那么S[i]=0。DZY现在想知道,'01'在S串中出现的期望次...
分类:
其他好文 时间:
2015-04-10 06:47:16
阅读次数:
161
Little penguin Polo loves his home village. The village has n houses, indexed by integers from 1 to n. Each house has a plaque containing an integer, the i-th house has a plaque containing integer pi (...
分类:
其他好文 时间:
2015-04-09 09:04:20
阅读次数:
177
/*
充分利用了菲波那切数列的两条定理:
①定义F[1] = a, F[2] = b, F[n] = F[n - 1] + F[n - 2](n≥3)。
有F[n] = b * fib[n - 1] + a * fib[n - 2](n≥3),其中fib[i]为斐波那契数列的第 i 项。
②定义F[1] = a, F[2] = b, F[n] = F[n -...
分类:
其他好文 时间:
2015-04-08 18:12:38
阅读次数:
116
DescriptionGiven a sequence, {A1, A2, …, An} which is guaranteed A1 > A2, …, An, you are to cut it into three sub-sequences and reverse them separately to form a new one which is the smallest possible...
分类:
编程语言 时间:
2015-04-08 16:28:10
阅读次数:
195