hdu2309ICPC Score Totalizer Software
One of the unique features of this contest is the great number of judges that sometimes counts up to one hundred. The number of judges may differ from one contestant to another, because judges with any relationship whatsoever with a specific contestant are temporarily excluded for scoring his/her performance.
Basically, scores given to a contestant's performance by the judges are averaged to decide his/her score. To avoid letting judges with eccentric viewpoints too much influence the score, the highest and the lowest scores are set aside in this calculation. If the same highest score is marked by two or more judges, only one of them is ignored. The same is with the lowest score. The average, which may contain fractions, are truncated down to obtain final score as an integer.
You are asked to write a program that computes the scores of performances, given the scores of all the judges, to speed up the event to be suited for a TV program.
A dataset begins with a line with an integer n, the number of judges participated in scoring the performance (3 ≤ n ≤ 100). Each of the n lines following it has an integral score s (0 ≤ s ≤ 1000) marked by a judge. No other characters except for digits to express these numbers are in the input. Judges' names are kept secret.
The end of the input is indicated by a line with a single zero in it.
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
353
242
402
274
283
132
402
523
0
7
300
326
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath> using namespace std; int main()
{
int n,i,j,k;
int sum;
while(scanf("%d",&n)!=EOF,n)
{
sum = ;
int mx = ,mi = ;
for(i = ;i<n;i++)
{
int a;
scanf("%d",&a);
mi = min(mi,a);
mx = max(mx,a);
sum += a;
}
cout<<(sum-mx-mi)/(n-)<<endl;
}
return ;
}
hdu2309ICPC Score Totalizer Software的更多相关文章
- HDOJ(HDU) 2309 ICPC Score Totalizer Software(求平均值)
Problem Description The International Clown and Pierrot Competition (ICPC), is one of the most disti ...
- OJ题解记录计划
容错声明: ①题目选自https://acm.ecnu.edu.cn/,不再检查题目删改情况 ②所有代码仅代表个人AC提交,不保证解法无误 E0001 A+B Problem First AC: 2 ...
- Software Project Management hw1
I just want to say something about my java project that I did last year. Our task is to finish a lin ...
- Jabber Software:Jabber-NET、agsXMPP与Wilefire[转]
本篇介绍两个使用.NET技术,确切的说是使用C#写的Jabber Code Libraries – Jabber.NET.agsXMPP,以及一个Java写的跨平台Jabber Server – Wi ...
- Software Engineering-HW3 264&249
title: Software Engineering-HW3 date: 2017-10-05 10:04:08 tags: HW --- 小组成员 264 李世钰 249 王成科 项目地址 htt ...
- SENG201 (Software Engineering I) Project
SENG201 (Software Engineering I) ProjectSpace ExplorerFor project admin queries:For project help, hi ...
- How can I perform the likelihood ratio, Wald, and Lagrange multiplier (score) test in Stata?
http://www.ats.ucla.edu/stat/stata/faq/nested_tests.htm The likelihood ratio (lr) test, Wald test, ...
- Software Engineer’s path to the best annual performance review
http://michaelscodingspot.com/2017/06/04/software-engineers-path-best-annual-performance-review/ How ...
- Software Engineering at Google
Google的Fergus Henderson在Software Engineering at Google中介绍了Google的软件工程实践. 软件开发 源码仓库 单一源代码仓库,除了核心配置和安全 ...
随机推荐
- Xcode 中添加 .pch文件
1 新建工程 2 创建 .pch文件 3 在setting里面进行设置:
- 常用网站--前端开发类+网页设计类+平面素材类+flash类
前端开发类 animate CSS 前端开发网 我爱CSS 大家网 W3School jQuery开发技术详解教程视频 jQuery中文社区 jQueryChina 网页设计类 禅意花园 CSS Do ...
- CSS 设计彻底研究(四)盒子的浮动与定位
第四章 盒子的浮动与定位 本章的重点和难点是深刻地理解”浮动“和”定位“这两个重要的性质,对于复杂页面的排版至关重要. 4.1 盒子的浮动 在标准流中,一个块级元素在水平方向会自动伸张,直到包含它的元 ...
- js数组小结
1.js数组使用sort()排序 var a = ["1","12","3","4","0"]; d ...
- 关于PS里图层样式的全局光
勾选“使用全局光”,则各个图层样式的光源角度都会相同. 我在“内阴影”效果里勾选了“使用全局光”,然后我发现当我在“投影”效果和“斜面和浮雕”效果里选择使用全局光时,它们的光源角度自动变成120度, ...
- poj 1177 picture
题目链接:http://poj.org/problem?id=1177 分析:这道题主要用到了线段树.扫描线以及离散化的相关算法. 离散化 离散化是当数字不多但是范围很大时采用的一种方法,将大区间的数 ...
- MSP430F149模拟IIC读写24C02程序
板子上设置了EEPROM存储器,型号为AT24C02.板子的硬件连接为:SCL--->P2.4,SDA--->P2.5.直接了当,贴上程序! ======================= ...
- jQuery开发经验实例笔记
jQuery获取文件选择输入框的扩展名 var file=$("input[name='file']").val() var filename=file.replace(/.*(\ ...
- Linux系统目录/bin /sbin /usr/bin /usr/sbin和/lib /usrlib的一些分析
其实就是相当于转载了. /bin,/sbin,/usr/sbin,/usr/bin 目录 这些目录都是存放命令的,首先区别下/sbin和/bin: 从命令功能来看,/sbin 下的命令属于基本的系统命 ...
- HTTP协议及HTTP包
HTTP协议用于在Internet上发送和接收消息.HTTP协议是一种请求-应答式的协议 ——客户端发送一个请求,服务器返回该请求的应答,所有的请求与应答都是HTTP包.HTTP协议使用可靠的TCP连 ...