1056 Mice and Rice (25 分)分组求最大值

在名为'Mice and Rice'的编程竞赛中,参赛者的代码控制着老鼠在地图上的行动,目标是吃最多的米。比赛通过分组决出最重的老鼠获胜。给定程序员数量、每组最大老鼠数及初始顺序,计算所有程序员的排名。输入包括程序员数量、每组老鼠数和各老鼠的体重及初始顺序。输出是各程序员的排名。解题关键在于正确分组并计算排名。
摘要由CSDN通过智能技术生成

题目

Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice as possible in order to become a FatMouse.

First the playing order is randomly decided for N P N_P NP programmers. Then every N G N_G NG programmers are grouped in a match. The fattest mouse in a group wins and enters the next turn. All the losers in this turn are ranked the same. Every N G N_G NG winners are then grouped in the next match until a final winner is determined.

For the sake of simplicity, assume that the weight of each mouse is fixed once the programmer submits his/her code. Given the weights of all the mice and the initial playing order, you are supposed to output the ranks for the programmers.

Input Specification:
Each input file contains one test case. For each case, the first line contains 2 positive integers: N P N_P NP and N G ( ≤ 1000 ) N_G(≤1000) NG

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值