题目1002:Grading

题目链接:http://ac.jobdu.com/problem.php?pid=1002

详解连接:https://github.com/Pacsiy/JobDu

参考代码:

//
// Created by AlvinZH on 2017/4/24.
// Copyright (c) AlvinZH. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int main()
{
    double P,T,G1,G2,G3,GJ,ans;
    while(~scanf("%lf %lf %lf %lf %lf %lf",&P,&T,&G1,&G2,&G3,&GJ))
    {
        if(fabs(G1-G2)<=T) ans=(G1+G2)/2;
        else if(fabs(G3-G1)<=T&&fabs(G3-G2)>T) ans=(G3+G1)/2;
        else if(fabs(G3-G2)<=T&&fabs(G3-G1)>T) ans=(G3+G2)/2;
        else if(fabs(G3-G1)<=T&&fabs(G3-G2)<=T) ans=max(G1,max(G2,G3));
        else ans=GJ;

        printf("%.1lf\n",ans);
    }
    return 0;
}
时间: 2024-08-11 03:35:21

题目1002:Grading的相关文章

题目1002:Grading(题目背景基于高考打分的简单判断)

题目链接:http://ac.jobdu.com/problem.php?pid=1002 详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: // // 1002 Grading.cpp // Jobdu // // Created by PengFei_Zheng on 2017/4/14. // Copyright © 2017年 PengFei_Zheng. All rights reserved. // #include <st

九度OJ 1002 Grading

题目1002:Grading 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:15686 解决:4053 题目描述: 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 pro

九度oj 1002 Grading 2011年浙江大学计算机及软件工程研究生机试真题

1 #include<iostream> 2 #include<queue> 3 #include<cstdio> 4 #include<cstring> 5 #include<cmath> 6 #include<algorithm> 7 using namespace std; 8 int map[15][15]; 9 int main(){ 10 int P,T,G1,G2,G3,GJ; 11 while(cin>>P

九度OJ刷题——1002:Grading

题目描述: 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 eac

1002.Grading

题目描述: 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 eac

HDUOj Ignatius and the Princess III 题目1002

?? 母函数  组合数学 #include<stdio.h> int c1[125]; int c2[125]; int main() { int n,i,j,k; while(scanf("%d",&n)!=EOF) { for(i=0;i<=n;i++) { c1[i]=1; c2[i]=0; } for(i=2;i<=n;i++) { for(j=0;j<=n;j++) for(k=0;k+j<=n;k=k+i) c2[k+j]=c2[

编译原理的一些练习题

这里收集了sicily的陈炬桦老师编译原理实验课程的题目,曝上代码以供参考. (如果这里的代码对您的思路有些许启发的话,请您点击一下推荐,给予作者写作的鼓励,不胜感谢!) 1-词法分析 题目1000: 1 1000. 词法分析程序设计 2 总提交数量: 183 通过数量: 138 3 4 时间限制:1秒 内存限制:256兆 5 题目描述 6 设一语言的关键词.运算符.分界符的个数与单词如下: 7 struct { int number; string str[10]; } keywords={3

PAT1002 写出这个数 (C++实现)

PAT乙级考试题目 1002 写出这个数 (20 分) 题目要求: 读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字. 输入格式: 每个测试输入包含 1 个测试用例,即给出自然数 n 的值.这里保证 n 小于 10?100??. 输出格式: 在一行内输出 n 的各位数字之和的每一位,拼音数字间有 1 空格,但一行中最后一个拼音数字后没有空格. 输入样例: 1234567890987654321123456789 输出样例: yi san wu 我的答案(C++实现): 本程序

HOJ 题目分类

转自:http://blog.sina.com.cn/s/blog_65f3869301011a1o.html ******************************************************************************* 简单题(包括枚举,二分查找,(复杂)模拟,基础数据结构(栈.队列),杂题等 ****************************************************************************