hdu 1040】的更多相关文章

As Easy As A+B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53368    Accepted Submission(s): 22939 Problem Description These days, I am thinking about a question, how can I get a problem as…
As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.Give you some integers, your task is to so…
题意:给定n个数,让你从小到大排序. 析:不说什么了. 代码如下: #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> using namespace std; const int maxn = 1000 + 5; int a[maxn]; int main(){ int T, n; cin >>…
题意:裸排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namespace std; ]; int main(){ int t,n,i; scanf("%d",&t); while(t--){ scanf("%d",&n); ;i<n;++i) scanf("%d",&a[i]); so…
今天去老校区找她,不想带电脑了,所以没时间A题了 /*******************************************************************/ As Easy As A+B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45926    Accepted Submission(s): 196…
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 70286    Accepted Submission(s): 29895 Problem Description These days, I am thinking about a question, how can I get a problem as e…
As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. Give you some integers, your task is to s…
HDU 1000 A + B Problem  I/O HDU 1001 Sum Problem  数学 HDU 1002 A + B Problem II  高精度加法 HDU 1003 Maxsum  贪心 HDU 1004 Let the Balloon Rise  字典树,map HDU 1005 Number Sequence  求数列循环节 HDU 1007 Quoit Design  最近点对 HDU 1008 Elevator  模拟 HDU 1010 Tempter of th…
基本思想: 1)选择一个基准元素,通常选择第一个元素或者最后一个元素, 2)通过一趟排序讲待排序的记录分割成独立的两部分,其中一部分记录的元素值均比基准元素值小.另一部分记录的 元素值比基准值大. 3)此时基准元素在其排好序后的正确位置 4)然后分别对这两部分记录用同样的方法继续进行排序,直到整个序列有序. 快速排序的示例: (a)一趟排序的过程: (b)排序的全过程 算法的实现: 递归实现: 测试用的是杭电HDU  1040题  亲测AC啦 #include<iostream> using…
基本思想: 在要排序的一组数中,对当前还未排好序的范围内的全部数,自上而下对相邻的两个数依次进行比较和调整,让较大的数往下沉,较小的往上冒.即:每当两相邻的数比较后发现它们的排序与排序要求相反时,就将它们互换. 算法实现:(HDU 1040 亲测 AC) #include<iostream> using namespace std; ; void BubbleSort(int a[],int ); void print(int a[],int num); void swap(int &…