#include<iostream>
#include<queue>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int map[][];
int main(){
int P,T,G1,G2,G3,GJ;
while(cin>>P>>T>>G1>>G2>>G3>>GJ){
if(abs(G1-G2)<=T){
printf("%.1lf\n",1.0*(G1+G2)/);
}
else{
int m1=abs(G1-G3);
int m2=abs(G3-G2);
if(m1<=T&&m2<=T){
int max=G1>G2?G1:G2;
max=max>G3?max:G3;
printf("%.1lf\n",max*1.0);
}
else{
if(m1<=T||m2<=T){
if(m1>m2){
printf("%.1lf\n",(G3+G2)*1.0/);
}
else{
printf("%.1lf\n",(G3+G1)*1.0/);
}
}
else{
printf("%.1lf\n",GJ*1.0);
}
}
}
}
return ;
}

时间限制:1 秒

内存限制:32 兆

特殊判题:

提交:16128

解决:4162

题目描述:

Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a process to make the results as fair as possible. One way is to assign each exam problem to 3 independent experts. If they do not agree to each other, a judge is invited to make the final decision. Now you are asked to write a program to help this process.
    For each problem, there is a full-mark P and a tolerance T(<P) given. The grading rules are:
    • A problem will first be assigned to 2 experts, to obtain G1 and G2. If the difference is within the tolerance, that is, if |G1 - G2| ≤ T, this problem's grade will be the average of G1 and G2.
    • If the difference exceeds T, the 3rd expert will give G3.
    • If G3 is within the tolerance with either G1 or G2, but NOT both, then this problem's grade will be the average of G3 and the closest grade.
    • If G3 is within the tolerance with both G1 and G2, then this problem's grade will be the maximum of the three grades.
    • If G3 is within the tolerance with neither G1 nor G2, a judge will give the final grade GJ.

输入:

Each input file may contain more than one test case.
    Each case occupies a line containing six positive integers: P, T, G1, G2, G3, and GJ, as described in the problem. It is guaranteed that all the grades are valid, that is, in the interval [0, P].

输出:

For each test case you should output the final grade of the problem in a line. The answer must be accurate to 1 decimal place.

样例输入:
20 2 15 13 10 18
样例输出:
14.0
来源:
2011年浙江大学计算机及软件工程研究生机试真题
分析:
读懂题意即可

九度oj 1002 Grading 2011年浙江大学计算机及软件工程研究生机试真题的更多相关文章

  1. 九度oj 1004 Median 2011年浙江大学计算机及软件工程研究生机试真题

    题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:14162 解决:3887 题目描述: Given an increasing sequence S of N i ...

  2. 九度oj 1032 ZOJ 2009年浙江大学计算机及软件工程研究生机试真题

    题目1032:ZOJ 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:4102 解决:2277 题目描述: 读入一个字符串,字符串中包含ZOJ三个字符,个数不一定相等,按ZOJ的顺序输出,当 ...

  3. 九度oj 1468 Sharing 2012年浙江大学计算机及软件工程研究生机试真题

    题目1468:Sharing 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:2687 解决:550 题目描述: To store English words, one method is ...

  4. 九度oj 1001 A+B for Matrices 2011年浙江大学计算机及软件工程研究生机试真题

    题目1001:A+B for Matrices 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:15235 解决:6172 题目描述: This time, you are supposed ...

  5. 九度oj 1034 寻找大富翁 2009年浙江大学计算机及软件工程研究生机试真题

    题目1034:寻找大富翁 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5323 解决:2123 题目描述:     浙江桐乡乌镇共有n个人,请找出该镇上的前m个大富翁. 输入:     ...

  6. 九度oj 1031 xxx定律 2009年浙江大学计算机及软件工程研究生机试真题

    题目1031:xxx定律 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5153 解决:3298 题目描述:     对于一个数n,如果是偶数,就把n砍掉一半:如果是奇数,把n变成 3*n ...

  7. 九度oj 1006 ZOJ问题 2010年浙江大学计算机及软件工程研究生机试真题

    题目1006:ZOJ问题 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:16244 解决:2742 题目描述: 对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC.是 ...

  8. 九度oj 1437 To Fill or Not to Fill 2012年浙江大学计算机及软件工程研究生机试真题

    题目1437:To Fill or Not to Fill 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:1488 解决:345 题目描述: With highways availabl ...

  9. 九度oj 1464 Hello World for U 2012年浙江大学计算机及软件工程研究生机试真题

    题目1464:Hello World for U 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:3872 解决:1082 题目描述: Given any string of N (> ...

随机推荐

  1. 一些参考网站 - Reference Documentation - Website Address

    Reference Documentation - Website Address MSDN Visual Studio 2015官方文档 https://msdn.microsoft.com/zh- ...

  2. jquery datepicker 中文

    <script type="text/javascript"> jQuery(function(){ $.datepicker.regional['zh-CN'] =  ...

  3. sql分组拼接字段

    --联查select n.*,t.Name from News n join Type_News tn on n.Id=tn.NId join Types t on t.Id=tn.TId --拼接并 ...

  4. Django_Restframwork_APIVIEW视图_源码分析

    Django _VIEW视图_源码分析

  5. numpy数组 拼接

    转载自:https://blog.csdn.net/zyl1042635242/article/details/43162031 数组拼接方法一 首先将数组转成列表,然后利用列表的拼接函数append ...

  6. c++实验3 链式存储线性表

    1.线性表链式存储结构及基本操作算法实现 (1)单链表存储结构类的定义: #include <iostream> using namespace std; template <cla ...

  7. 贪心——Prim算法(避圈法)

    1.简介 Prim算法是图论中的一种算法,可在带权连通图里搜索产生最小生成树. 该算法于1930年由捷克数学家沃伊捷赫·亚尔尼克(Vojtěch Jarník)发现:并在1957年由美国计算机科学家罗 ...

  8. 【SSO单点系列】开篇

    年底将至,忙碌了好几个月的项目也接近尾声了.在这个项目中,由于要和其他外系统做单点登录(SSO),整合其他系统的功能.在网上查询了相关资料后,最终选取了Yale大学发起的一个开源项目 CAS, 作为项 ...

  9. jquery源码解析:jQuery扩展方法extend的详解

    jQuery中要扩展方法或者属性都是通过extend方法实现的.所谓的jQuery插件也是通过extend方法实现的. jQuery.extend扩展的是工具方法,也就是静态方法.jQuery.fn. ...

  10. windows 本地搭建 apache+mysql+php环境详细讲解

    1.mysql下载配置 可参考这篇文章:https://www.cnblogs.com/myIvan/p/9265645.html 2.php下载及配置 可参考这篇文章:https://www.cnb ...