HDU 3910 (13.10.31)
Description
Let me introduce this game to you. Unlike “San Guo Sha” with its complicated rules, “Liang Guo Sha” is a simple game, it consists only four cards, two cards named “Sha”, and the other named “Shan”.
Alice and Bob are good friends, and they’re playing “Liang Guo Sha” now.
Everyone has two cards: a “Sha” and a “Shan”. Each round, everyone choose a card of his/her own, and show it together(Just show the selected card, do not need to put it away). If both of them choose “Sha”,
then Alice gets A points,
and Bob loses A points; if both of them choose “Shan”,
then Alice gets B points,
and Bob loses B points; otherwise,
Bob gets C points,
and Alice loses C points.
Both Alice and Bob wants to get points as many as possible, they thought a optimal strategy: Calculating a percentage of choosing card “Sha” in order to ensure that even the opponent uses the optimal strategy, he/she can still get a highest point exceptation.
Here is the question, if both Alice and Bob use the optimal strategy to make their points higher, what is the expectation point which Alice can get in a round?
Input
Each test case has only a line, consists three positive integers: A, B, C respectively.
1 <= A, B, C <= 100000
Output
Sample Input
3 3 3
Sample Output
0.000000
Hint
In test case 1, both Alice and Bob calculated the best percentage of choosing “Sha”, and the their percentage are the same: 70%.
If Bob do not choose the best percentage, his strategy might be targetd. For example, if Bob choose 100%, then Alice can change her percentage to 100%, Bob might lose many points. Bob is clever, so he won’t do that.
参考题解:http://blog.csdn.net/ivan_zjj/article/details/7927970
AC代码
#include<stdio.h>
int main() {
double a, b, c;
while(scanf("%lf %lf %lf", &a, &b, &c) == 3) {
double ans = (a*b - c*c) / (a + b + 2*c);
printf("%.6lf\n", ans);
}
return 0;
}
HDU 3910 (13.10.31)的更多相关文章
- HDU 1232 (13.10.31)
畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submi ...
- TMemo.Text 回车键会变成#$D#$A,而非#13#10
mmoComplain: TMemo;//cxmComplain.Text 会造成回车键 转换成十六进制的字符串 #$D#$A,而非#13#10 //cxmComplain.Text范例:'风发的是' ...
- 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButton, AppBarButton, AppBarToggleButton
[源码下载] 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButt ...
- ubuntu 13.10 mono asp.net服务 安装
ubuntu 13.10 从官方文档http://www.mono-project.com/Mod_mono 可看到 Mod_Mono is an Apache 2.0/2.2/2.4.3 modul ...
- ubuntu 13.10 monodevelop3 安装
版本 ubuntu 13.10 桌面模式默认:unity :文件管理器:nautilus
- ubuntu 13.10 svn工具 rabbitvcs 安装
ubuntu 版本:13.10:桌面模式默认:unity :文件管理器:nautilus
- Fix catalyst driver in Ubuntu 13.04 / 13.10
Fix catalyst driver in Ubuntu 13.04 / 13.10(墙外文章备份) 1. Introduction I found lots of people strugglin ...
- ubuntu 13.10 skype登不上问题
首先打开sources.list sudo gedit /etc/apt/sources.list 如果是13.10添加源: deb http://archive.canonical.com/ubun ...
- ubuntu 13.10 Ralink RT3290 无线与蓝牙4.0的驱动安装
我的本是hp envy15, 蓝牙与无线的型号是Ralink RT3290, 装了Ubuntu 13.10 64bit后,蓝牙无法使用,无线几秒钟就会断开,查知,是因为驱动问题. ## 准备工作 首先 ...
随机推荐
- php匹配邮箱正则
php匹配邮箱正则 '/[a-z0-9&\-_.]+@[\w\-_]+([\w\-.]+)?\.[\w\-]+/is'
- Codeforces Round #441 (Div. 2, by Moscow Team Olympiad) E. National Property(2-sat)
E. National Property time limit per test 1 second memory limit per test 512 megabytes input standard ...
- Web应用扫描工具Wapiti
Web应用扫描工具Wapiti Wapiti是Kali Linux预置的一款Web应用扫描工具.该工具执行黑盒扫描,用户只需要输入要扫描的网址即可.该工具可以探测文件包含.数据库注入.XSS.CR ...
- LCT维护子树信息
有些题目,在要求支持link-cut之外,还会在线询问某个子树的信息.LCT可以通过维护虚边信息完成这个操作. 对于LCT上每个节点,维护两个两sz和si,后者维护该点所有虚儿子的信息,前者维护该点的 ...
- 【set】【multiset】Codeforces Round #484 (Div. 2) D. Shark
题意:给你一个序列,让你找一个k,倘若把大于等于k的元素都标记为不可用,那么剩下的所有元素形成的段的长度相同,并且使得段的数量尽量大.如果有多解,输出k尽量小的. 把元素从大到小排序插回原位置,用一个 ...
- gradle/maven/eclipse工程相互转化
原文: gradle/maven/eclipse工程相互转化 gradle/maven/eclipse工程相互转化:前提安装好相应的工具和插件.1.Maven->eclipse mvn ecl ...
- NOIP2018 RP++
飞吧,不用看向地面. NOIP,RP++.
- SPOJ 10234. Here Be Dragons
The Triwizard Tournament's third task is to negotiate a corridor of many segments, and reach the oth ...
- HTML的各个标签的默认样式
head{ display: none } body{ margin: 8px;line-height: 1.12 } button, textarea,input, object,select { ...
- SQL 死锁进程查询
use master go declare @spid int,@bl int DECLARE s_cur CURSOR FOR ,blocked ) a ) b where a.blocked=sp ...