P2942 [USACO09MAR] Moon Mooing G

这是一道关于计算机算法的问题,描述了在满月时牛的哞叫行为。每头牛的初始叫声时长由整数c决定(1 <= c <= 100),接着通过两个公式f1(c) = floor(a1 * c / d1) + b1和f2(c) = floor(a2 * c / d2) + b2生成更多时长。给定c和N,任务是找出第N次叫声的时长。题目提供了输入输出格式和样例,并指出内存限制为64MB。
摘要由CSDN通过智能技术生成

题目描述

A full moon casts some sort of spell on the cows and, like their cousins the wolves and coyotes, they bay at the moon -- mooing instead of howling, of course.

Each 'moo' lasts a certain amount of time. A short 'moo' might last time 1; a longer one might last time 24 or even 1,000,000,000 or longer (cows can really moo when they want to). No 'moo' will last more than or equal to 2^63.

It should come as no surprise that the cows have a pattern to their moos. Bessie will choose an integer c (1 <= c <= 100) that is the initial length of a moo.

After Bessie moos for length c, the cows calculate times for

subsequent moos. They apply two formulae to each moo time to yield even more moo times. The two formulae

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值