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;
}
bzoj 1753: [Usaco2005 qua]Who's in the Middle【排序】的更多相关文章
- 1753: [Usaco2005 qua]Who's in the Middle
1753: [Usaco2005 qua]Who's in the Middle Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 290 Solved: ...
- BZOJ 1754: [Usaco2005 qua]Bull Math
Description Bulls are so much better at math than the cows. They can multiply huge integers together ...
- bzoj 1755: [Usaco2005 qua]Bank Interest【模拟】
原来强行转int可以避免四舍五入啊 #include<iostream> #include<cstdio> using namespace std; int r,y; doub ...
- bzoj 1754: [Usaco2005 qua]Bull Math【高精乘法】
高精乘法板子 然而WA了两次也是没救了 #include<iostream> #include<cstdio> #include<cstring> using na ...
- bzoj1753 [Usaco2005 qua]Who's in the Middle
Description FJ is surveying his herd to find the most average cow. He wants to know how much milk th ...
- 1755: [Usaco2005 qua]Bank Interest
1755: [Usaco2005 qua]Bank Interest Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 187 Solved: 162[Su ...
- BZOJ1754: [Usaco2005 qua]Bull Math
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 374 Solved: 227[Submit ...
- bzoj1751 [Usaco2005 qua]Lake Counting
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec Memory Limit: 64 MB Submit: 168 Solved: 130 [ ...
- 1754: [Usaco2005 qua]Bull Math
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 398 Solved: 242[Submit ...
随机推荐
- C51 中断 个人笔记
总架构图 IE寄存器 控制各个中断源的屏蔽与允许 TCON寄存器 各个中断源的请求标志位&有效信号的规定 中断源及其优先级 中断号写程序的时候要用 CPU处理中断三原则 1.CPU同时接收到几 ...
- java发送短信验证码的功能实现
总结一下发送短信验证码的功能实现 (题外话:LZ是在腾讯云买的第三方(山东鼎信)短信服务平台的接口,1块钱20次的套餐来练手,哈哈,给他们打个广告,有需要的可以去购买哈,下面是购买链接短信服务平台购买 ...
- BNUOJ 7178 病毒侵袭持续中
病毒侵袭持续中 Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 30 ...
- HDU-2817,同余定理+快速幂取模,水过~
A sequence of numbers Time Limit: 2000/1 ...
- [codeforces494B]Obsessive String
[codeforces494B]Obsessive String 试题描述 Hamed has recently found a string t and suddenly became quite ...
- poj_2524_Ubiquitous Religions_201407211506
Ubiquitous Religions Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 23390 Accepted: ...
- 洛谷 P3984 高兴的津津
P3984 高兴的津津 题目描述 津津上高中了.她在自己的妈妈的魔鬼训练下,成为了一个神犇,每次参加一次OI比赛必拿Au虐全场.每次她拿到一个Au后就很高兴.假设津津不会因为其它事高兴,并且她的高兴会 ...
- Spring Boot多数据源连接8小时后断开的问题解决(MySQL)
这个问题涉及的方面很多,需要一步步去排查,可能环境有问题,数据库有问题,但是网上最多的应该是如下的方式去解决. 以单个数据源为主,多个数据源基本方法一致. 1.MySQL 5版本之前可以通过在URL后 ...
- JAVA OO之 类、对象、包
类 类是具有相同属性和行为的一组对象的集合. public class HomeWork1 { public static void main(String[] args) { MyPhone mp= ...
- 关于android中的单位(dp、sp)
android让人头疼的适配问题. --------- Android 中的单位大概有这些: 经常使用的dip.sp.有时候用到px. --------- 介绍两个类: TypedValue:有一些单 ...