E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
poj2388
poj2388
快速排序 模板题
/**\briefpoj2388**\paramdate2014/8/5*\paramstateAC*\returnmemorytime*qsort784K110ms*ksort780K172ms*/#include#include#include#includeusingnamespacestd;constintMAXN=10000;intArr[MAXN];/*boolComp(constin
greenapple_shan
·
2020-09-17 02:23
排序
poj2388
Who'sintheMiddleTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:18274Accepted:10380DescriptionFJissurveyinghisherdtofindthemostaveragecow.Hewantstoknowhowmuchmilkthis'median'cowgives:halfofthecowsg
weixin_34029680
·
2020-09-14 05:33
poj2388
Who's in the Middle
见到水题就高兴…不过好像这样也没什么提高题解就直接写在前面了,题意就是给你n个数然后让你找出中间的那个数,直接用sort排起来输出中间的就好了或者我记得以前接触stl的时候有个可以只排一部分的函数,可以节省点时间不过对这个题来说全排就足够了Who'sintheMiddleTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:40851Accepted
艾尔森
·
2020-07-04 20:07
poj
MaxHeap (
poj2388
)
//by zxfx100 //(sizeof a = n) && (heap = a[1..n]) && (a[0] is null) && (range is int) class MaxHeap { public: int a[32768], n; void build() { n = 0; } void insert
·
2015-11-13 14:42
heap
MinHeap (
poj2388
)
//by zxfx100 //(sizeof a = n) && (heap = a[1..n]) && (a[0] is null) && (range is int) class MinHeap { public: int a[32768], n; void build() { n = 0; } void insert
·
2015-11-13 14:41
heap
poj2388
Who's in the Middle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18274 Accepted: 10380 Description FJ is surveying his herd to find the most average
·
2015-10-31 10:10
poj
poj2388
水题,排序 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; const int maxn = 10001; in
·
2015-10-21 10:42
poj
poj2388
排序
Who'sintheMiddleTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 35246 Accepted: 20582DescriptionFJissurveyinghisherdtofindthemostaveragecow.Hewantstoknowhowmuchmilkthis'median'cowgives:halfofth
became_a_wolf
·
2015-08-22 20:00
Who's in the Middle
poj2388
vector 水题
Who'sintheMiddleTimeLimit: 1000MSMemoryLimit: 65536KTotalSubmissions: 33021Accepted: 19238DescriptionFJissurveyinghisherdtofindthemostaveragecow.Hewantstoknowhowmuchmilkthis'median'cowgives:halfofthec
wr132
·
2015-01-31 21:00
vector
in
STL
水题
middle
the
Whos
poj2388
POJ2388
POJ2388
中位数本题如其名,输入一个n,然后是n行,每行一个数,找所有数里面的中位数。
u013480600
·
2014-01-15 00:00
ACM
poj2388
为什么这能出现在训练计划里面而不是水题里面!据说水题能赚访问量?#include #include #include using namespace std;int main(){ int n; while (cin >> n) { vectorv; for (int i = 0; i > temp; v.push_back(t
zhengnanlee
·
2013-11-24 00:00
ACM题解报告
poj解题报告
www.java3z.com/cwbwebhome/acm_report.jspJAVA解北大百练2756(递归):二叉树JAVA解北大POJ2287(贪心解法):田忌赛马JAVA解北大POJ2092(计数排序)JAVA解北大
POJ2388
liang0000zai
·
2013-09-25 23:00
C++
ACM
poj2388
排序中位数
#include #include #include usingnamespacestd; intmain() { intn,f[10005],i; while(~scanf("%d",&n)) { for(i=0;i<n;i++) scanf("%d",&f[i]); sort(f,f+n); cout<<f[n/2]<<endl; } return0; }
u011538668
·
2013-07-30 10:00
poj2388
――Who's in the Middle
原题:DescriptionFJissurveyinghisherdtofindthemostaveragecow. Hewantstoknowhowmuchmilkthis'median'cowgives:halfofthecowsgiveasmuchormorethanthemedian;halfgiveasmuchorless.GivenanoddnumberofcowsN(1#includ
bingsanchun
·
2013-05-07 19:00
java
开发技术
直接插入排序练习:POJ 2388
关于直接插入排序请参看: http://128kj.iteye.com/blog/1662280
POJ2388
题意: 【输入】第一行为n,接下来n行分别为一个数;  
128kj
·
2012-12-26 09:00
java
数据结构
编程
算法
堆排序练习:POJ 2388
关于堆排序请参看: http://128kj.iteye.com/blog/1679094
POJ2388
题意: 【输入】第一行为n,接下来n行分别为一个数; 【输出
128kj
·
2012-12-26 09:00
java
数据结构
编程
算法
poj2388
寻找中位数--冒泡排序,堆排序,线性时间选择
poj2388
寻找中位数--冒泡排序,堆排序,线性时间选择奇数个数寻找中位数,有O(N)复杂度的算法,这里采用的方式是先排序,然后找出中间那一个,等写到快排时在写线性时间的算法吧。
HooLee
·
2012-07-16 15:00
poj2388
(堆排序)
#include usingnamespacestd; #defineswap(a,b){intt=a;a=b;b=t;} intA[10001],size; intparent(inti){ returni/2; } intleft(inti){ returni*2; } intright(inti){ returni*2+1; } voidmax_heapify(inti) { in
einstein991225
·
2011-10-14 00:00
Build
include
poj2388
水题 各种排序
//插入排序79ms #include usingnamespacestd; voidInsertSort(inta[],intn) { inti,j,tmp; for(i=1;i0&&a[j-1]>tmp;j--) a[j]=a[j-1]; a[j]=tmp; } } intmain() { intn,i; inta[10002]; scanf("%d
Non_Cease
·
2011-07-19 00:00
null
PIVOT
merge
POJ2388
Who's in the Middle 快排
ProblemAddress:http://poj.org/problem?id=2388 第一次写快排,一次AC。 Memory:176K Time:0MS 由于是要求出中间数,所以每次快排的时候只需对中间数所在的区间进行快排即可。 以下贴代码: #includeusingnamespacestd;intmilk[10005],n,mid;voidqs(ints,intt){inti,j,t
Human_CK
·
2011-03-11 09:00
pku上的数据结构题
数据结构(1)串 (poj1035,poj3080,poj1936)(2)排序(快排、归并排(与逆序数有关)、堆排) (
poj2388
,poj2299)(3)简单并查集的应用.
kenby
·
2010-12-09 19:00
数据结构
算法
POJ2388
解题报告
求中间数,先对数据使用快速排序法进行排序,然后输出下标为n/2的元素则可,代码如下#includeusingnamespacestd;#defineMax10000voidQuickSort(inta[],intlow,intheigh){if(low>heigh)return;inti;intj;inttemp;i=low;j=heigh;temp=a[i];while(itemp)j--;if
kangquan2008
·
2010-07-15 21:00
poj2388
package easy; import java.io.BufferedInputStream; import java.util.Scanner; /** *
poj2388
200830740306
·
2010-02-26 11:00
poj
上一页
1
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他