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

建议使用的浏览器:

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

3937:Parlay Wagering

题目描述
Parlay wagering offers sports bettors the opportunity to win a large sum of money from a small initial wager. A parlay wager is a combination of individual independent wagers that only pays if no individual wager loses. The payout from each wager is applied or “parlayed” to the next wager in turn. If any individual wager loses, the bettor receives nothing. If any individual wager is a tie or “push”, that wager is effectively ignored, reducing the ultimate payout.
The sports book quotes the payout rate for an individual wager as a “money line”, a non-zero integer in the range -2000 to 2000. To compute the payout for a successful wager, the money line is converted to a decimal multiplier as follows: if the money line is positive, it is divided by 100 to obtain the multiplier. If the money line is negative, the absolute value is divided into 100 to obtain the multiplier. The multiplier is always truncated to three digits after the decimal point. The wager is multiplied by this multiplier to determine the amount won. The amount won is truncated to the cent (the sports book keeps the fractional cents).
Consider the following example for a five-way parlay wager:



The maximum payout for any parlay wager is $1 million. If the calculated total exceeds that amount, the actual total returned will be $1 million.
Write a program that will calculate the total amount returned for a series of parlay wagers.
For each parlay wager, your program is to print the total amount returned in dollars and cents on a single line starting in the first column without embedded or trailing whitespace. Print the leading dollar sign and insert commas at the millions and thousands positions as needed.
输入解释
Input will consist of several wagers. The first line of input to your program will contain the total number of parlay wagers as a single positive integer.
Each wager that follows will be represented by a series of lines.
The first line of each parlay wager contains the initial bet and the count of individual wagers as integers separated from each other by a single space.
The following lines represent the individual wagers, one per line. Each individual wager is given as its money line followed by a single space and the result of the wager (“Win”, “Tie”, or “Loss”).
输出解释
For each parlay wager, your program should print one line containing the total amount returned in dollars and cents. Print the leading dollar sign and insert commas at the millions and thousands positions as needed.
输入样例
3
10 5
-170 Win
-160 Win
125 Win
-135 Win
-140 Win
15 8
100 Win
-100 Tie
-250 Win
135 Tie
265 Tie
1500 Win
120 Win
130 Win
10 2
100 Loss
300 Tie
输出样例
$173.11
$3,400.32
$0.00

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

源链接: POJ-3937

最后修改于 2020-10-29T07:16:08+00:00 由爬虫自动更新

共提交 0

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