A1 = ?Problem Description 有如下方程：Ai = (Ai-1 + Ai+1)/2 - Ci (i = 1, 2, 3, …. n). 若给出A0, An+1, 和 C1, C2, …..Cn. 请编程计算A1 = ?Input 输入包括多个测试实例。 对于每个实例，首先是一个正整数n,(n <= 3000); 然后是2个数a0, an+1.接下来的n行每行有

66阅读
# include <iostream># include <cstdio>using namespace std;int main(){int n,i,j;double a[2],b[50000],k;while(cin>>n){cin>>a[0]>>a[1];for(i=0;i<n;i++){cin>>b[i];}

46阅读
The Hardest Problem Ever​​http://acm.hdu.edu.cn/showproblem.php?pid=1048​​Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping

49阅读

47阅读
A Mathematical CuriosityProblem Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer.This problem c

33阅读
Uniform GeneratorProblem Description Computer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the formseed(x+1) = [seed(x) + STEP] % MODwhere

38阅读
The 3n + 1 problemProblem Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be anal

36阅读
Rightmost DigitProblem Description Given a positive integer N, you should output the most right digit of N^N.Input The input contains several test cases. The first line of the input is a single inte

36阅读
Humble Numbers​​http://acm.hdu.edu.cn/showproblem.php?pid=1058​​​ Problem Description A 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,

30阅读

30阅读

27阅读

6阅读

36阅读
# include <iostream># include <set>using namespace std;/* set(集)-->不重复 multiset(多集) -->允许重复 红黑数(熟读快) 大数据使用方便,自动排序 缺点:插入慢 不能通过find进行修改 *///声明一个函数模板 template <

42阅读
# include <iostream># include <map># include <string>using namespace std;/* map(映射)-->键不允许重读 multimap(多映射) -->键允许重复 红黑树 自动依靠key排序 基本操作 insert coun

35阅读
# include <iostream># include <set>using namespace std;//宏定义 typedef set<int> SETINT;int main(){ SETINT a; a.insert(23); a.insert(-1); a.insert(78); a.insert(100);

5阅读
# include <iostream># include <list>using namespace std; void PrintListContents(const list<int> & listInput);int main(){ list<int> a; a.push_front(4); a.push_front

10阅读
# include <iostream># include <set>using namespace std;typedef multiset<int> MSETINT;int main(){ MSETINT a; a.insert(67); a.insert(88); a.insert(88); a.insert(123);

40阅读
# include <iostream># include <stack># include <vector># include <list># include <deque> using namespace std;/* 栈(stack) 后进先出 自适应容器 操作: empry-->

28阅读
# include <iostream># include <vector># include <list># include <algorithm>using namespace std;//class absInt{// public :// int operator() (int val){//// }//};//与上面的等价struct

23阅读
# include <iostream># include <queue># include <list># include <deque> using namespace std;/* 队列(queue): 先进先出 定义: queue<int,deque<int> > q;

5阅读
# include <iostream># include <queue># include <vector># include <deque> using namespace std;/* 优先级队列(priority_queue) 最大值优先级队列,最小值优先级队列 自适应容器 priority_queue

22阅读

26阅读
​​http://acm.hdu.edu.cn/showproblem.php?pid=2079​​选课时间(题目已修改,注意读题)Problem Description 又到了选课的时间了，xhd看着选课表发呆，为了想让下一学期好过点，他想知道学n个学分共有多少组合。你来帮帮他吧。（xhd认为一样学分的课没区别）Input 输入数据的第一行是一个数据T，表示有T组数据。 每组数据的第一行是

23阅读
​​http://acm.hdu.edu.cn/showproblem.php?pid=2072​​单词数lily的好朋友xiaoou333最近很空，他想了一件没有什么意义的事情，就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input 有多组数据，每组一行，每组就是一篇小文章。每篇小文章都是由小写字母和空格组成，没有标点符号，遇到#时表示输入结束。Outp

23阅读

5阅读
=

23阅读

32阅读
Square CoinsProblem Description People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=1

32阅读

58阅读