2011年浙江大学计算机及软件工程研究生机试真题(2)

使用 LUT 实现 Color Grading 后处理效果 LUT 可以用于后处理中的颜色矫正,它能将一个 RGB 颜色唯一地映射到另 一个颜色。它是一个三维的颜色查找表,但图形渲染中,由于图形 API 通常并不支持三维纹理的查找,所以我们会将三维 LUT 展开成二维的形式。 阅读详情
题目描述:

    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

AC代码:

#include<stdio.h>
#include <stdlib.h>
//using namespace std;

int main(){
	int p,t,g1,g2,g3,gj;
	float max;

	while(scanf("%d%d%d%d%d%d",&p,&t,&g1,&g2,&g3,&gj)!=EOF){
		if(abs(g1-g2)<=t){
			max=(float)(g1+g2)/2;
			printf("%.1f\n",max);
			continue;
		}
		else if(abs(g3-g1)<=t&&abs(g3-g2)<=t)
		{
			g3=g3>g1?g3:g1;
			g3=g3>g2?g3:g2;
			max=(float)g3;
			printf("%.1f\n",max);
			continue;
		}
		else if(abs(g3-g1)<=t||abs(g3-g2)<=t){
			max=(float)((abs(g3-g1)>abs(g3-g2)?g2:g1)+g3)/2;
			printf("%.1f\n",max);
			continue;
		}
		else {
			max=(float)gj;
			printf("%.1f\n",max);
			continue;
		}
	}
	return 0;
}

感觉代码写的很乱,一开始就搞错了一步,虽然给出的例子能运行,但是提交老是WA,但一直没有发现这个错误,一直改来改去,最后认真验证数据时才发现问题所在,懒得去优化了,就这样看吧!

王道机试指南(第二版)——题目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 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.

九度OJ-1002

题目1002:Grading 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:10155 解决:2591 题目描述:     Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a

blankpro的专栏 992

别再傻傻全盘暴力破解了!Passware Kit Forensic 2019.4.1 已知部分密码的精准爆破实战(附RAR案例)

本文详细介绍了如何利用Passware Kit Forensic的模式匹配功能,实现高效精准的密码破解,避免全盘暴力破解的资源浪费。通过RAR加密破解实战案例,展示了模式匹配技术的核心优势与操作步骤,帮助安全工程师大幅提升破解效率。

weixin_42524171的博客 408

九度OJ 1002 Grading

九度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 assig

starryxsky的博客 328

单细胞monocle3分析流程再整理

定义root cell, 推断拟时方向# 结合先验知识自定(示例数据)# 可视化示例数据,起点是随便点的。

zfyyzhys的博客 2101

从零到一:在RK3588 Android12上实战RTL8723DU WiFi蓝牙双模驱动移植

本文详细介绍了在RK3588 Android12系统上实战RTL8723DU WiFi蓝牙双模驱动移植的全过程。从驱动源码获取与修改、系统级集成与编译,到调试与性能优化,提供了完整的解决方案。特别针对USB接口适配、电源管理和蓝牙共存等关键问题给出了具体代码示例,帮助开发者快速完成驱动适配并提升设备稳定性。

weixin_28703489的博客 325

2011年浙江大学计算机及软件工程研究生机试真题(1)

题目描述:     This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns. 输入:     The input consists of several test cases, eac

windowsshaking的专栏 2166

YOLO系列训练时出现loss出现nan值或者测试时P\R\map全部为0值的解决办法(GTX16xx系列显卡大坑)

YOLO系列训练时出现loss出现nan值或者测试时P\R\map全部为0值的解决办法(GTX16xx系列显卡大坑)

weixin_55249340的博客 3万+

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

题目1001:A+B for Matrices 题目描述:     This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns. 输入:     The input consists of

acm_JL的博客 2574

基于STM32的电子琴音乐播放器设计

​ 本设计以实际电路为最后的结果,实现了所有与其功能,具有重要的现实意义。件,在Proteus中进行原理图绘制,然后把 .hex文件下载到STM32F103RBT6中 进行仿真。由于网络上 下载的 Proteus中 没有 STM32F103RBT6这个芯片型号,我们又从网上 下载芯片 进行仿真。​ 本设计以实际电路为最后的结果,实现了所有与其功能,具有重要的现实意义。

TMMXA的博客 2万+

nRF52840 低功耗蓝牙开发指南:从硬件架构到物联网应用实战

本文深入解析nRF52840低功耗蓝牙芯片的硬件架构与开发实践,涵盖从开发环境搭建到BLE协议栈开发的详细指南。通过实战案例分享低功耗优化技巧,帮助开发者高效实现物联网应用,特别适合智能家居和工业场景。

d3e4f的博客 417

2010年浙江大学计算机及软件工程研究生机试真题

http://ac.jobdu.com/problem.php?pid=1006 ZOJ问题 /* 若azbjc 能AC,则azbojac也能AC,其中a,b,c为N个'o'或者为空; 这里azbojac和azbjc相比 z和j中间+了一个o j后面就+了一个a 而z前面也有一个a 以此类推 如果再执行一次这个规定 那么z和j中间就+了2个o 后面也+了2个前面的a ... 所以z前面

Hackbuteer1的专栏 3238

自动驾驶系统架构解析:从传感器到决策控制的完整链路(附实际案例)

本文深入解析了自动驾驶系统从感知、决策到控制的完整架构链路。通过对比摄像头、毫米波雷达、激光雷达等核心传感器的特性与选型策略,阐述了多传感器融合的必要性。文章结合行为决策、运动规划及控制执行的实际案例,揭示了系统集成、数据闭环与功能安全等工程化落地的关键挑战,为理解自动驾驶技术提供了清晰的蓝图。

weixin_29051811的博客 339

大一计算机考试ppt题乌镇,九度oj 1006 ZOJ问题 2010年浙江大学计算机及软件工程研究生机试真题...

题目1006:ZOJ问题时间限制:1 秒内存限制:32 兆特殊判题:否提交:16244解决:2742题目描述:对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC。是否AC的规则如下: 1. zoj能AC; 2. 若字符串形式为xzojx,则也能AC,其中x可以是N个'o' 或者为空; 3. 若azbjc 能AC,则azbojac也能AC,其中a,b,c为N个'o'或者为空;输...

weixin_42400518的博客 380

【CAD】【手把手带你写一个DXF&JAVA解析框架】02——整理DXF元数据实体类,涵盖重要属性与对照组码

本文系统梳理了DXF文件解析中的核心元数据类,重点分析了Tables段(图层、块记录)、Blocks段和Entities段的关键数据结构。通过详细的组码说明和对照代码实现,阐述了图层定义(DXFLayer)、块记录(DXFBlockRecord)、应用程序标识(DXFAppId)等表对象的属性构成;同时解析了直线(DXFLine)、多段线(DXFLwPolyLine)、圆弧(DXFArc)、文字(DXFText)等实体类的几何特征与属性定义。文章还构建了顶点(Vertex)、基类(DXFEntity、DXF

Wonder ZH 268

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

zju2011 Median

http://ac.jobdu.com/problem.php?pid=1004#include int a[1100005],b[1100005]; int main() { int n,m,i,j,num,mid,ans; while (scanf("%d",&n)!=EOF) { for (i=0;i<n;i++) { scanf("%d",&a[i]);

zz的专栏 563

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

题目1007:奥运排序问题 2010年浙江大学计算机及软件工程研究生机试真题

题目描述: 按要求,给国家进行排名。 输入: 有多组数据。 第一行给出国家数N,要求排名的国家数M,国家号从0到N-1。 第二行开始的N行给定国家或地区的奥运金牌数,奖牌数,人口数(百万)。 接下来一行给出M个国家号。 输出: 排序有4种方式: 金牌总数 奖牌总数 金牌人口比例 奖牌人口比例  对每个国家给出最佳排名排名方式 和 最终排名 格式为: 排名:排

ZJFCLH的专栏 1216

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

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

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

Sunshine 1338

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

Grading 2011年浙江大学计算机及软件工程研究生机试真题 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 the

ZJFCLH的专栏 1510

zju2011:grade

http://ac.jobdu.com/problem.php?pid=1002 2011年浙江大学计算机及软件工程研究生机试真题 1、fabs------求浮点数的绝对值 2、求几个值得最大值的小技巧,max函数嵌套 #include #include double max1(double a,double b) { return a>b?a:b; } double

zz的专栏 576

2011年浙江大学计算机及软件工程研究生机试真题(3)

题目描述:     Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 1

windowsshaking的专栏 1469

1004 Median(2011年浙江大学计算机及软件工程研究生机试真题)

题目描述:     Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 1

Sunshine 1248

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

题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:14162 解决:3887 题目描述: Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median o...

weixin_30711917的博客 105
上一篇: 2011年浙江大学计算机及软件工程研究生机试真题(1)
下一篇: 2010年浙江大学计算机及软件工程研究生机试真题(1)
windowsshaking
博客等级 码龄16年 11粉丝 27原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值