九度oj 1002 Grading 2011年浙江大学计算机及软件工程研究生机试真题
#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年浙江大学计算机及软件工程研究生机试真题的更多相关文章
- 九度oj 1004 Median 2011年浙江大学计算机及软件工程研究生机试真题
题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:14162 解决:3887 题目描述: Given an increasing sequence S of N i ...
- 九度oj 1032 ZOJ 2009年浙江大学计算机及软件工程研究生机试真题
题目1032:ZOJ 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:4102 解决:2277 题目描述: 读入一个字符串,字符串中包含ZOJ三个字符,个数不一定相等,按ZOJ的顺序输出,当 ...
- 九度oj 1468 Sharing 2012年浙江大学计算机及软件工程研究生机试真题
题目1468:Sharing 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:2687 解决:550 题目描述: To store English words, one method is ...
- 九度oj 1001 A+B for Matrices 2011年浙江大学计算机及软件工程研究生机试真题
题目1001:A+B for Matrices 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:15235 解决:6172 题目描述: This time, you are supposed ...
- 九度oj 1034 寻找大富翁 2009年浙江大学计算机及软件工程研究生机试真题
题目1034:寻找大富翁 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5323 解决:2123 题目描述: 浙江桐乡乌镇共有n个人,请找出该镇上的前m个大富翁. 输入: ...
- 九度oj 1031 xxx定律 2009年浙江大学计算机及软件工程研究生机试真题
题目1031:xxx定律 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5153 解决:3298 题目描述: 对于一个数n,如果是偶数,就把n砍掉一半:如果是奇数,把n变成 3*n ...
- 九度oj 1006 ZOJ问题 2010年浙江大学计算机及软件工程研究生机试真题
题目1006:ZOJ问题 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:16244 解决:2742 题目描述: 对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC.是 ...
- 九度oj 1437 To Fill or Not to Fill 2012年浙江大学计算机及软件工程研究生机试真题
题目1437:To Fill or Not to Fill 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:1488 解决:345 题目描述: With highways availabl ...
- 九度oj 1464 Hello World for U 2012年浙江大学计算机及软件工程研究生机试真题
题目1464:Hello World for U 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:3872 解决:1082 题目描述: Given any string of N (> ...
随机推荐
- Backup--完整备份会打破现有的日志备份链么?
--问题描述: --对数据库有一个周期性数据库备份和事务日志备份的维护计划,在维护计划外有工作人员对数据库进行完整备份,该备份会打乱现有的日志备份链么? --===================== ...
- ASP.NET MVC ActionFilterAttribute用法
- c#进阶之浅析委托和事件
何为委托 加了delegate关键字,没有方法体{}的方法模版(方法列表);委托是一种类型 public void Write() { //TODO } //加上关键字delegate,去掉方法体{} ...
- pageadmin自助建站 网站目录权限的设置方法
在用pageadmin网页设计的时候遇到各种问题可以参考官网教程网站目录权限的设置方法 网站目录必须设置读取和写入权限,否则后台解压,删除文件,在线上传等功能都无法正常使用,下面讲解本机和服务器配置目 ...
- HAOI2014 遥感监测
题目链接:戳我 比较水的一个题,直接处理点,找在直线上的可以覆盖到它的区间,然后做最小线段覆盖即可: 代码如下: #include<iostream> #include<cstdio ...
- Oracle-利用解析函数计算连续、回流
---最大连续交易天数 select t2.customer_no,max(t2.co) from (select t1.customer_no,t1.yp) co from (select ctd. ...
- 【程序】必看干货:Photon多人游戏开发教程
PUN介绍 http://vibrantlink.com/ 入门 Photon Unity Networking(首字母缩写PUN)是一个Unity多人游戏插件包.它提供了身份验证选项.匹配,以及快速 ...
- 【maven】---初识
前言 最近在研究自动化测试,其中的一个研究点儿就是maven,去download了一本书,看了看.下面是自己的从书中摘录的一些关于maven的概念性的东西. 内容 maven是什么? Maven是一个 ...
- web渗透-sql注入
何为sql注入 所谓SQL注入,就是通过把SQL命令插入到Web表单提交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令,得到想要得到的信息. OWASPTop 10 此处的注 ...
- 浅谈Android选项卡(二)
前面简单介绍了选项卡,下面以及后面的几篇文章介绍下Android选项卡的几种简单实现方法. http://blog.csdn.net/xia215266092/article/details/9613 ...