Archer

Time Limit: 2000ms
Memory Limit: 262144KB

This problem will be judged on CodeForces. Original ID: 312B
64-bit integer IO format: %I64d      Java class name: (Any)

 
SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The probability of shooting the target each time is for SmallR while  for Zanoes. The one who shoots in the target first should be the winner.

Output the probability that SmallR will win the match.

 

Input

A single line contains four integers .

 

Output

Print a single real number, the probability that SmallR will win the match.

The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6.

 

Sample Input

Input
1 2 1 2
Output
0.666666666667

Source

 
解题:等比数列求和的极限
 
 #include <bits/stdc++.h>
using namespace std;
int a,b,c,d;
int main(){
while(~scanf("%d%d%d%d",&a,&b,&c,&d))
printf("%.8f\n",(double)a*d/(a*d+b*c-c*a));
return ;
}

CodeForces 312B Archer的更多相关文章

  1. 【CodeForces 312B】BUPT 2015 newbie practice #3A Archer

    题 SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the targ ...

  2. CodeForces 78D Archer's Shot

    二分. 统计过程如下图: 先统计红线上的个数,然后统计绿线上的个数,然后统计咖啡色线上的个数......一个一个往下统计就可以了. #pragma comment(linker, "/STA ...

  3. Codeforces Round #185 (Div. 2) B. Archer 水题

    B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B D ...

  4. Codeforces Round #330 (Div. 1) A. Warrior and Archer 贪心 数学

    A. Warrior and Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/594 ...

  5. Codeforces 595C - Warrior and Archer

    595C - Warrior and Archer 思路:设最后答案的区间为[l,r],那么r-l等于n/2,因为在(l,r)中的点都是其中一个人挖掉的,[0,l)和(r,n]中的点是另一个人挖掉的, ...

  6. Codeforces 594A - Warrior and Archer

    题目大意:给你在一条线上的n(偶数)个点,mike和alice 开始禁点,他们轮流开始,直到最后只剩下两个点, mike希望剩下的两个点距离尽可能小,alice希望剩下的两个点距离尽可能大,他们都采用 ...

  7. 【Codeforces Round #185 (Div. 2) B】Archer

    [链接] 链接 [题意] 在这里输入题意 [题解] 概率水题. 枚举它是第几轮成功的. 直到满足精度就好 [错的次数] 1 [反思] long double最让人安心. [代码] #include & ...

  8. Codeforces Beta Round #6 (Div. 2 Only) D. Lizards and Basements 2 dp

    题目链接: http://codeforces.com/problemset/problem/6/D D. Lizards and Basements 2 time limit per test2 s ...

  9. Codeforces Beta Round #6 (Div. 2 Only) D. Lizards and Basements 2 dfs

    D. Lizards and Basements 2 题目连接: http://codeforces.com/contest/6/problem/D Description This is simpl ...

随机推荐

  1. C# 对象初始化器和集合初始化器

    /// <summary>/// 图书类/// </summary>public class Book {     /// <summary>     /// 图书 ...

  2. firewall 实现数据的端口转发

    端口转发:firewall-cmd --add-port=80/tcp firewall-cmd --add-port=10050/tcp firewall-cmd --add-forward-por ...

  3. 马云谈AI:未来10-15年传统制造业的痛苦将远超今天的想象

    马云谈AI:未来10-15年传统制造业的痛苦将远超今天的想象 “未来10到15年,传统制造业面临的痛苦将会远远超过今天的想象,企业如果不能从规模化.标准化向个性化和智慧化转型,将很难生存下去.” 9月 ...

  4. requests 后续1

    发送带数据post请求 import requests # 发送post请求 data = { } response = requests.post(url, data=data) # 内网 需要 认 ...

  5. IE模式下EasyUI Combobox无效问题

    近期开发过程中遇到IE浏览器Combobox无法正常加载问题. 经过一番百度说IE渲染过快导致页面渲染完了easyUI Combobox还没有加载.设置延迟加载后依旧无效. 后将input标签的Cla ...

  6. [NOIP2012提高组]疫情控制

    题目:洛谷P1084.codevs1218.Vijos P1783. 题目大意:有一棵n个节点的,根为1的带权树和m支军队.每支军队可以在一个点上停下,那么从1开始就不能经过这个点了.现在有m支军队已 ...

  7. Maven学习总结(22)——Maven常用插件介绍

    我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完成,例如编译源代码是由maven- compiler-plugin完成的.进一步说,每个任务对应 ...

  8. 【Android】把外部文件拷贝的AVD安卓模拟器上的sdcard上,而且在AVD中浏览sdcard的文件

    首先.实现这一切的大前提是.你的AVD安卓模拟器,在启动之前.有设置好sdcard的大小,例如以下图.同一时候,你的AVD安卓模拟器,要处于启动状态.否则无法运行例如以下的操作. 这里以<[An ...

  9. Elasticsearch中的CRUD

    在<玩玩儿Elasticsearch>中简介了一下elasticsearch.这篇文章.我们还是做些基础的学习.在Elasticsearch怎样进行CRUD? 如果我们正在创建的一个类似微 ...

  10. jsp学习-分页功能的实现

    <%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"%> < ...