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的软件工程实践. 软件开发 源码仓库 单一源代码仓库,除了核心配置和安全 ...
随机推荐
- sqlserver 执行远程数据库代码
1.启用Ad Hoc Distributed Queries: exec sp_configure 'show advanced options',1reconfigureexec sp_config ...
- Java IO6 :IO总结
字节流.字符流继承关系 前几篇文章讲解了字节流.字符流的使用,不过Java提供给用户的流类远不止此,限于篇幅原因,没办法一一讲解,而且也没有必要一一讲解,就像我在写博客的时候多次提到的,有问题的时候学 ...
- CF 13E Holes 【块状链表】
题目描述: 一条直线上n个点,每个点有个“弹力”,可以把当前位置x上面的ball弹到x+a[x]上面. 两种操作 0. 修改a处的弹力值,编程b 1. 询问a点的ball经过多少次能跳出n个点外(就是 ...
- 为什么要web语义化
为什么要web语义化 其实wiki的定义里面说得非常清晰了.语义化的好处有三点 有利于搜索 容易兼容不同设备 结构清晰,利于团队的开发.维护
- [Head First Python]4. summary
1- strip()方法可以从字符串去除不想要的空白符 (role, line_spoken) = each_line.split(":", 1) line_spoken = li ...
- nginx+keepalived+tomcat之tomcat性能调优
body{ font-family: Nyala; font-size: 10.5pt; line-height: 1.5;}html, body{ color: ; background-color ...
- ISBN-10和ISBN-13有什么区别?
ISBN扩升至13位 1. 现有ISBN的结构 国际标准书号ISBN是英文International Standard Book Number的缩写,1971年国际标准化组织ISO(Internati ...
- Unix/Linux环境C编程入门教程(37) shell常用命令演练
cat命令 cat命令可以用来查看文件内容. cat [参数] 文件名. grep-指定文件中搜索指定字符内容. Linux的目录或文件. -path '字串' 查找路径名匹配所给字串的所有文件 ...
- UESTC_酱神的旅行 2015 UESTC Training for Dynamic Programming<Problem M>
M - 酱神的旅行 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit ...
- 【POJ 3279 Fliptile】开关问题,模拟
题目链接:http://poj.org/problem?id=3279 题意:给定一个n*m的坐标方格,每个位置为黑色或白色.现有如下翻转规则:每翻转一个位置的颜色,与其四连通的位置都会被翻转,但注意 ...