77阅读
Reverse NumberProblem Description Welcome to 2006’4 computer college programming contest!Specially, I give my best regards to all freshmen! You are the future of HDU ACM! And now, I must tell you tha

55阅读
Piggy-BankProblem Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (

70阅读

52阅读
Basically Speaking​​http://acm.hdu.edu.cn/showproblem.php?pid=1335​​Problem Description The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I

69阅读
A Simple TaskProblem Description Given a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p.ExampleFor n = 24, o = 3 and p = 3.TaskWrite a program which for eac

53阅读

108阅读
Big Event in HDUProblem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer Col

34阅读
# include <cstdio> # include <cstdlib># include <iostream># include <ctime>using namespace std; /* 生成n个不同的数 min代表最小值 max生成的最大值 */ int CreateData(int arr[],int n,int

65阅读

57阅读

63阅读
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

32阅读
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

39阅读
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阅读

29阅读

27阅读

4阅读

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

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

37阅读
# 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);

3阅读
# 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

11阅读
# 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-->

26阅读