2012湖南大学第八届程序设计竞赛 Incredible[公式]

本文介绍了一道关于足球比赛积分预测的问题,通过算法计算确保球队晋级所需的最低分数。输入包括队伍数量、晋级名额及胜场得分,输出为晋级所需最低分数。

题目地址:http://acm.hnu.cn/online/?action=problem&type=show&id=12312&courseid=215 

Incredible
Time Limit: 2000ms, Special Time Limit:5000ms, Memory Limit:65536KB
Total submit users: 9, Accepted users: 8
Problem 12312 : No special judgement
Problem description
Zhuge Liang, a person?of?great?wisdom?and?resourcefulness, who is capable of knowing things 500 years ago and predicting things 500 years later. What's incredible! He must could make large amounts of money if he still alive today because he could forecast everything. Now, we want invite him to help us to forecast the result of football matches. The Olympic Games of this year will hold in London, England. Assume that the rule of football in Olympic Games is as same as group stage. That's to say, there are n teams in a group and k teams which have higher scores will be promoted. Each team will play a match against each other teams of that group. For a match, the winner team will get A scores and the loser will get zero scores. Both two teams will get A/2(real number) scores if the result is tie. At last, each team will have a score and we will choose the k-highest teams as promoted teams. Now, can you calculate the least score that can ensure one team for promotion?

Input
There are several test cases end with EOF. For each test case, the first line is three integers n ( 0 < n ≤ 50 ), k ( 0 < k ≤ n ) and A ( 0 < A < 10000 ), which are described as above.


Output
For each the case, just output a real number rounded to two decimal places which means the least score that one team can be promoted.


Sample Input
4 2 3
3 1 2
Sample Output
7.50
4.00
Problem Source
The 2012 8th Hunan University Programming Contest

Submit   Discuss   Judge Status  Problems  Ranklist 

 

 

解体报告:

         题目大意:  

               给出N个球队,球队之间两两会进行一场比赛,赢的球队得A分,输的球队不得分,两个球队打平的话各得A/2分。现在在最开始一场球赛都没有打过的前提下,问球队需要至少多少分使得在任意情况下该球队都能排在前K名之内。

        

code:

 1 #include<iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     int n,k;
 6     double A;
 7     double score;
 8     while(~scanf("%d%d%lf",&n,&k,&A))
 9     {
10         if(k==n)
11             score=0;
12         else
13         {
14             score=(n-1)*A;
15             while(--k)
16                 score-=(A/2.0);
17         }        
18         printf("%.2f\n",score);
19     }
20     return 0; 
21 }

 

 

 

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/XBWer/archive/2012/07/20/2600490.html

多源数据接入 支持校园各业务系统数据接入:包括教务系统(学生成绩、课程信息)、学工系统(奖惩记录、资助信息)、后勤系统(宿舍分配、能耗数据)、图书馆系统(借阅记录、馆藏信息)、一卡通系统(消费数据、门禁记录)等。 接入方式:提供数据库直连(MySQL、SQL Server)、文件导入(CSV、Excel、JSON)、API 接口调用等多种方式,支持实时同步与定时批量同步。 数据标准化与治理 建立校园数据标准体系:统一数据格式(如日期格式、学号编码规则)、定义核心数据元(如 “学生” 包含学号、姓名、专业等必选字段)、规范代码集(如性别代码 “1 - 男,2 - 女”)。 数据清洗:自动检测并处理缺失值、重复值、异常值(如成绩 > 100 分),通过规则引擎实现数据校验(如 “学生年龄需在 16-30 岁之间”)。 元数据管理:记录数据来源、格式、更新频率、负责人等信息,生成数据血缘图谱,追踪数据从产生到应用的全生命周期。 二、数据共享与交换核心功能 分布式数据存储 基于 Hadoop HDFS 实现海量数据存储:结构化数据(成绩、消费记录)存入 HBase,非结构化数据(文档、图片、视频)直接存储于 HDFS,日志类数据通过 Flume 采集至 HDFS。 支持数据分片与副本机制,确保数据高可用(默认 3 副本存储),满足校园 PB 级数据存储需求。 数据交换引擎 构建点对点数据交换通道:各部门系统可通过交换引擎向平台上传数据或申请获取授权数据,支持同步 / 异步交换模式。 交换流程管理:定义数据交换规则(如 “学工系统每日向平台同步新增学生信息”),记录交换日志(成功 / 失败状态、数据量),失败时自动重试。 数据脱敏:对敏感数据(如身份证号、银行卡号)在交换过程中进行脱敏处理(如显示 “110********5678”),兼顾共享与隐私保护。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值