POJ - 2388 Who's in the Middle解题报告
2017-02-16 16:55
344 查看
题目大意:
给你n(10000)个数,让你找出一个数,这个是要满足,至少有一半的数大于等于它,并且也有一半的数小于等于它。
给你n(10000)个数,让你找出一个数,这个是要满足,至少有一半的数大于等于它,并且也有一半的数小于等于它。
#include<iostream> #include<stdio.h> #include<algorithm> #define N 10500 using namespace std; int a ={0}; int main() { int n; cin>>n; for(int i=0;i<n;i++) { scanf("%d",&a[i]); } sort(a,a+n); cout<<a[n/2]; }
相关文章推荐
- 【原】 POJ 2388 Who's in the Middle 中位数 解题报告
- Pku acm 2388 Who's in the Middle 排序算法解题报告(二)----计数排序
- POJ 2388 Who's in the Middle(排序)
- poj-2388 Who's in the Middle
- POJ 2388 Who's in the Middle 排序
- poj 2388 Who's in the Middle【sort排序】
- POJ 2388 Who's in the Middle(堆排序)
- poj 2388 Who's in the Middle
- Poj 2388 Who's in the Middle
- (STL自带的排序功能的使用7.1.2)POJ 2388 Who's in the Middle(sort()函数的使用)
- Who's in the Middle--POJ 2388
- POJ 2388 Who's in the Middle (快速选择算法:O(N)求数列第K大)
- POJ 2388 Who's in the Middle
- 解题报告Who's in the Middle
- POJ--2388 Who's in the Middle
- POJ 一 2388 Who's in the Middle
- poj 2388 Who's in the Middle
- POJ-2388 who's in the middle
- POJ_2388 Who's in the Middle
- 2388 -- Who's in the Middle(解题报告)