当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2510:Tullia and Chocolate II

Special Judge 特殊评判
题目描述
It has been rumored that strange and unusual creatures inhabit exotic locations around the world. Edmonton features the Tullia, a person beyond any rational explanation. She has the peculiar ability to instantly become hyperactive at the mere mention of caffeine, endangering the safety of any unfortunate individuals in the vicinity.
Your task involves taking data that was secretly observed by some acquaintances of the subject -- namely how much coffee and particularly chocolate she received -- and use it to determine her hyperactivity level. Her hyperactivity level is defined as the minimum safe distance from the subject, measured in metres.

Extensive research has shown that the following formulae approximate the effects n units of coffee or chocolate have upon the subject at t time units (seconds) following consumption.
Chocolate: H(t) = 8*n - t/12
Coffee: H(t) = 2*n - t*t/79

It appears also that the Tullia is able to instantaneously imbibe such substances, and their effects are additive. Negative numbers provided by these formulae indicate the substance's effects have worn off and should not be considered. A minimum one metre safe distance from the Tullia must be maintained at all times.

输入解释
There are two types of lines that can appear in input.
A data line will have the format Type Time Quantity, where Type is either the string Chocolate or Coffee, Time is a nonnegative integer, and Quantity is a positive real number indicating the number of units imbibed by the Tullia.

A query line indicates a time the Tullia's hyperactivity level is requested. It consists of the string Query followed by a nonnegative integer indicating the time of the request.

You should process all lines appearing in input. There will be at most 100 data lines (for the safety of the observers).
输出解释
One line should be output for each query line appearing in input. Output lines should consist of the time of the request, and the subject's hyperactivity level at that time rounded to one decimal place. Output lines should be sorted in increasing order by request time.
输入样例
Query 0
Chocolate 1 1
Query 2
Coffee 3 1.5
Query 3
Query 10
输出样例
0 1.0
2 7.9
3 10.8
10 9.6

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2510

最后修改于 2020-10-29T06:34:30+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536