bzoj 1753: [Usaco2005 qua]Who's in the Middle【排序】
生活随笔
收集整理的這篇文章主要介紹了
bzoj 1753: [Usaco2005 qua]Who's in the Middle【排序】
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
……這可能是早年Pascal盛行的時候考排序的吧居然還是Glod……
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; int n,a[N]; int read() {int r=0,f=1;char p=getchar();while(p>'9'||p<'0'){if(p=='-')f=-1;p=getchar();}while(p>='0'&&p<='9'){r=r*10+p-48;p=getchar();}return r*f; } int main() {n=read();for(int i=1;i<=n;i++)a[i]=read();sort(a+1,a+1+n);printf("%d\n",a[(1+n)>>1]);return 0; }轉載于:https://www.cnblogs.com/lokiii/p/8998985.html
總結
以上是生活随笔為你收集整理的bzoj 1753: [Usaco2005 qua]Who's in the Middle【排序】的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 透明明兼容
- 下一篇: 数据结构——逆波兰式