英语题翻译28

该文旨在通过分析一组小鼠的数据,展示体重增加并不一定伴随速度提升。输入包含多只小鼠的体重和速度信息,程序需找出一组序列,使得体重递增而速度递减,最大化序列长度。输出序列应严格满足条件,证明FatMouse的观点错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

FatMouse's Speed | JXNUOJ

FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the speeds are decreasing.

Input contains data for a bunch of mice, one mouse per line, terminated by end of file.
The data for a particular mouse will consist of a pair of integers: the first representing its size in grams and the second representing its speed in centimeters per second. Both integers are between 1 and 10000. The data in each test case will contain information for at most 1000 mice.
Two mice may have the same weight, the same speed, or even the same weight and speed.

Your program should output a sequence of lines of data; the first line should contain a number n; the remaining n lines should each contain a single positive integer (each one representing a mouse). If these n integers are m[1], m[2],..., m[n] then it must be the case that
W[m[1]] < W[m[2]] < ... < W[m[n]]  and  S[m[1]] > S[m[2]] > ... > S[m[n]]
In order for the answer to be correct, n should be as large as possible.
All inequalities are strict: weights must be strictly increasing, and speeds must be strictly decreasing. There may be many correct outputs for a given input, your program only needs to find one.

翻译:

FatMouse 认为老鼠越胖,它跑得越快。为了反驳这一点,你需要获取一组小鼠的数据,并将尽可能大的数据子集放入一个序列中,以便权重增加,但速度降低。

输入包含一组小鼠的数据,每行一个小鼠,以文件结尾终止。特定小鼠的数据将由一对整数组成:第一个表示其大小(以克为单位),第二个表示其速度(以厘米/秒为单位)。这两个整数都在 1 到 10000 之间。每个测试用例中的数据最多包含 1000 只老鼠的信息。两只老鼠可能具有相同的重量、相同的速度,甚至相同的重量和速度。

你的程序应该输出一系列数据;第一行应该包含一个数字 n;剩下的 n 行每行都应该包含一个正整数(每行代表一只小鼠)。如果这 n 个整数是 m[1], m[2],..., m[n] 那么它一定是这样的W[m[1]] < W[m[2]] < ... < W[m[n]] 和 S[m[1]] > S[m[2]] > ... > S[米[n]]。为了使答案正确,n 应尽可能大。所有的不等式都是严格的:重量必须严格增加,速度必须严格减少。对于给定的输入,可能有许多正确的输出,你的程序只需要找到一个。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值