/** \brief poj 2388 insert sorting 2015 6 12
*
* \param
* \param
* \return
*
*/ #include <iostream>
#include <cstdio>
#include <cstring> using namespace std; const int N=10000;
int Arr[N]; void insertSort(int len)
{
for(int j=1;j<len;j++)
{
int key=Arr[j];
int i=j-1;
while(i>=0 && Arr[i]>key)
{
Arr[i+1]=Arr[i];
i=i-1;
}
Arr[i+1]=key;
}
} int main()
{
//cout << "Hello world!" << endl;
int n;
scanf("%d",&n);
//while(scanf("%d",&n))
//{
memset(Arr,0,sizeof(Arr));
for(int i=0;i<n;i++)
//scanf("%d",Arr[i]);
cin>>Arr[i];
insertSort(n);
cout<<Arr[n/2]<<endl;
//}
return 0;
}

poj 2388 insert sorting的更多相关文章

  1. POJ 2388 Who's in the Middle(水~奇数个数排序求中位数)

    题目链接:http://poj.org/problem?id=2388 题目大意: 奇数个数排序求中位数 解题思路:看代码吧! AC Code: #include<stdio.h> #in ...

  2. POJ 2388(排序)

    http://poj.org/problem?id=2388 题意:就N个数的中位数. 思路:用快排就行了.但我没用快排,我自己写了一个堆来做这个题.主要还是因为堆不怎么会,这个拿来练练手. #inc ...

  3. Poj/OpenJudge 1094 Sorting It All Out

    1.链接地址: http://poj.org/problem?id=1094 http://bailian.openjudge.cn/practice/1094 2.题目: Sorting It Al ...

  4. [POJ 1007] DNA Sorting C++解题

        DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 77786   Accepted: 31201 ...

  5. poj 1007:DNA Sorting(水题,字符串逆序数排序)

    DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 80832   Accepted: 32533 Des ...

  6. poj 1007 DNA Sorting 解题报告

    题目链接:http://poj.org/problem?id=1007 本题属于字符串排序问题.思路很简单,把每行的字符串和该行字符串统计出的字母逆序的总和看成一个结构体.最后把全部行按照这个总和从小 ...

  7. [POJ] #1007# DNA Sorting : 桶排序

    一. 题目 DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 95052   Accepted: 382 ...

  8. poj 1007 DNA Sorting

    DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 95437   Accepted: 38399 Des ...

  9. POJ 2388&&2299

    排序(水题)专题,毕竟如果只排序不进行任何操作都是极其简单的. 事实上,排序算法十分常用,在各类高级的算法中往往扮演着一个辅助的部分. 它看上去很普通,但实际的作用却很大.许多算法在失去排序后将会无法 ...

随机推荐

  1. Apache -- 利用.htaccess防盗链

    在Apache服务器的前提下利用.htaccess文件来防盗链的原理是通过检查图片或文件请求头信息中的Referer属性(也就是请求的来源),判断它是否属于你所规定的合法的请求来源,从而实现让合法来源 ...

  2. [转]在eclipse打开的android虚拟手机,打开File Explorer,下面是空的没有data、mnt、system三个文件

    在eclipse打开的android虚拟手机,打开File Explorer,下面是空的没有data.mnt.system三个文件 这是因为模拟器没有选择打开的缘故,必须首先打开一个模拟器(AVD), ...

  3. 2015 UESTC 搜索专题A题 王之迷宫 三维bfs

    A - 王之迷宫 Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/contest/show/61 Des ...

  4. WEB安全扫描器Netsparker推荐给大家

    Netsparker是一款综合型的web应用安全漏洞扫描工具,它分为专业版和免费版,免费版的功能也比较强大. Netsparker与其他综合 性的web应用安全扫描工具相比的一个特点是它能够更好的检测 ...

  5. iframe里面的页面调用父窗口,左右窗口js函数的方法

      iframe里面的页面调用父窗口,左右窗口js函数的方法 实现iframe内部页面直接调用该iframe所属父窗口自定义函数的方法. 比如有A窗口,A内有个IFRAME B,B里面的装载的是C页面 ...

  6. Simple microcontroller-temperature measurement uses only a diode and a capacitor

    Using a PN-junction diode for temperature measurement usually depends on its 2‑mV/K temperature  coe ...

  7. 15KW电动机380V及220V时的电流分别为多少

    15KW电动机380V及220V时的电流分别为多少 当用电电压为380V时:P=UICOSφ/1.72,此时电流为: I=15KW/380V/0.83(COSφ,功率因数)/1.72x1000=27. ...

  8. 简化delegate写法

    标准的写法 空 简化后的宏 /**************************************************************/ // delegate 托付 /* #de ...

  9. mormot解析天气预报JSON数据

    mormot解析天气预报JSON数据 uses SynCommons; constjson2 = '{' + #13#10 +'"error":0,' + #13#10 +'&qu ...

  10. Setup SS5 Socks Proxy

    Install and configure ss5 socks proxy with simple authentication SS5 is a high performance socks pro ...