描述: A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = ...
分类:
其他好文 时间:
2015-08-21 23:08:07
阅读次数:
160
///已知各点的度,推断是否为一个简单图#include#include#includeusing namespace std;int a[1010];bool cmp(int x,int y){ return x>y;}int main(){ int t,n,i,j; scanf...
分类:
其他好文 时间:
2015-08-21 20:54:02
阅读次数:
114
Frequent values
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 15134
Accepted: 5519
Description
You are given a sequence of n integers a1 , a2 , ... , an ...
分类:
其他好文 时间:
2015-08-21 17:12:56
阅读次数:
141
One day, Twilight Sparkle is interested in how to sort a sequence of integers
a1,?a2,?...,?an in non-decreasing order. Being a young unicorn, the only operation she can perform is a unit shift. That...
分类:
其他好文 时间:
2015-08-20 20:53:05
阅读次数:
169
Humble NumbersProblem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 1...
分类:
其他好文 时间:
2015-08-20 13:00:27
阅读次数:
184
题意:
首先,现在给出三个数字n,d1,d2。然后第二行给出n个数字。
然后题目要求的是求这个序列中有几个区间满足一下条件之一:
1)这个区间是一个等差数列,且公差为d1或d2;
2)若一个区间为[l,r],那么有l
*注意,这里单个数字一定是满足等差数列的。而且这里数字最好都使用__int64来保存,因为这个原因我们队WA了好几次。
思路:
这里我设了头和尾两个指针,分别用l和r表...
分类:
其他好文 时间:
2015-08-20 06:48:50
阅读次数:
92
Problem DescriptionFollowing is the recursive definition of Fibonacci sequence:Fi=???01Fi?1+Fi?2i = 0i = 1i > 1Now we need to check whether a number c...
分类:
其他好文 时间:
2015-08-20 01:11:35
阅读次数:
133
Problem DescriptionXinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very ...
分类:
其他好文 时间:
2015-08-20 01:01:59
阅读次数:
189
click here~~ ***Arithmetic Sequence***Problem DescriptionA sequence b1,b2,?,bn are called (d1,d2)-arithmetic sequence if and only if there exist i(1≤i≤n) such that for every j(1...
分类:
其他好文 时间:
2015-08-19 23:44:34
阅读次数:
169
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5400
题意:给定等差数列的差值d1,d2,问长度为n的数列中有多少个满足条件的子序列,条件为子序列中存在一个xi满足前半段是差值为d1的等差数列,后半段是差值为d2的等差数列
思路:
首先预处理出来出ii这个位置向前d_1d?1??的等差序列和向后d_2d?2??的等差数列能延续到多长,记作...
分类:
其他好文 时间:
2015-08-19 20:47:04
阅读次数:
104