#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <iostream>
using namespace std;
bool fun(double l1,double r1,double l2,double r2){
return (l1 <= r2 && l1 >= l2) || (l2 >= l1 && l2 <= r1);
}
int main() {
double a,b,c,d;
cin >> a >> b >> c >> d; double r = 1000000000.0;
double l = 0; for(int i = 0;i < 1000;i++){ double m = l + (r - l) /2.0;
double a1 = (a-m)*(d-m);
double a2 = (a-m)*(d+m);
double a3 = (a+m)*(d-m);
double a4 = (a+m)*(d+m);
double l1 = min(min(a1,a2),min(a3,a4));
double r1 = max(max(a1,a2),max(a3,a4));
a1 = (c-m)*(b-m);
a2 = (c-m)*(b+m);
a3 = (c+m)*(b-m);
a4 = (c+m)*(b+m);
double l2 = min(min(a1,a2),min(a3,a4));
double r2 = max(max(a1,a2),max(a3,a4));
if(fun(l1,r1,l2,r2)){
r = m;
}
else{
l = m;
}
}
printf("%.10f\n",l);
return 0; }

codeforces Looksery Cup 2015 H Degenerate Matrix 二分 注意浮点数陷阱的更多相关文章

  1. codeforces Looksery Cup 2015 H Degenerate Matrix

    The determinant of a matrix 2 × 2 is defined as follows: A matrix is called degenerate if its determ ...

  2. Looksery Cup 2015 H. Degenerate Matrix 数学

    H. Degenerate Matrix Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/549/ ...

  3. codeforces Looksery Cup 2015 D. Haar Features

    The first algorithm for detecting a face on the image working in realtime was developed by Paul Viol ...

  4. codeforces Looksery Cup 2015 C. The Game Of Parity

    There are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play t ...

  5. Codeforces 549H. Degenerate Matrix 二分

    二分绝对值,推断是否存在对应的矩阵 H. Degenerate Matrix time limit per test 1 second memory limit per test 256 megaby ...

  6. Looksery Cup 2015 Editorial

    下面是题解,做的不好.下一步的目标是rating涨到 1800,没打过几次cf A. Face Detection Author: Monyura One should iterate through ...

  7. Codeforces VK CUP 2015 D. Closest Equals(线段树+扫描线)

    题目链接:http://codeforces.com/contest/522/problem/D 题目大意:  给你一个长度为n的序列,然后有m次查询,每次查询输入一个区间[li,lj],对于每一个查 ...

  8. Looksery Cup 2015 A. Face Detection 水题

    A. Face Detection Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/549/pro ...

  9. Looksery Cup 2015 B. Looksery Party 暴力

    B. Looksery Party Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/549/pro ...

随机推荐

  1. AWR系列之中的一个——AWR简单介绍

    AWR的全称是Automatic Workload Repository(自己主动负载知识库). 它是通过对照两次快照的方式收集到统计信息.来生成txt或者html页面形式的报告. 通常,通过AWR报 ...

  2. HDU - 4054 Hexadecimal View (2011 Asia Dalian Regional Contest)

    题意:按要求输出.第一列是表示第几行.每行仅仅能有16个字节的字母,第二列是16进制的ASCII码.第三列大写和小写转换 思路:纯模拟,注意字母的十六进制是2位 #include <iostre ...

  3. kafka windows安装 命令行下使用测试

    1.zookeeper安装:   (https://zookeeper.apache.org/releases.html) ①进入zookeeper的相关设置所在的文件目录,例如本文的:D:\bigd ...

  4. 多元一次方程解法 C++

    #include<iostream> #include<math.h> #include<fstream> #include<stdlib.h> usi ...

  5. USACO 保护花朵 Protecting the Flowers, 2007 Jan

    Description 约翰留下了 N 只奶牛呆在家里,自顾自地去干活了,这是非常失策的.他还在的时候,奶牛像 往常一样悠闲地在牧场里吃草.可是当他回来的时候,他看到了一幕惨剧:他的奶牛跑进了他的花园 ...

  6. golang vue nginx

    https://segmentfault.com/a/1190000012780963 https://blog.csdn.net/qq_32340877/article/details/790321 ...

  7. 【原创】spring中的事务传播特性

    关于spring的传播特性,我对其进行了详细的叙述了下: PROPAGATION_REQUIRED--支持当前事务,如果当前没有事务,就新建一个事务.这是最常见的选择. 比如方法A调用方法B,如果方法 ...

  8. How an Event Enters a Cocoa Application

    How an Event Enters a Cocoa Application An event is a low-level record of a user action that is usua ...

  9. ZBrush中关于标记的特殊情况

    在ZBrush®中使用Marker标记调控板来记忆物体属性,因此能在任何时间回到标记并使用它给其他物体或改变物体作为参考点,在使用Marker标记调控板时回出现很多特殊情况,本文小编就这些特殊情况做一 ...

  10. IDEA创建Maven工程依赖jar包爆红问题

    使用IDEA创建maven工程后,在pom.xml文件中添加jar包坐标依赖后报错, 如图: