题意:在[-a, a]*[-b, b]区域内随机取一个点P,求以(0, 0)和P为对角线的长方形面积大于S的概率(a,b>0, S>=0)。

分析:

1、若长方形面积>S,则选取的P(x,y)满足xy>S,xy=S是双曲线,P取双曲线上方,[-a, a]*[-b, b]区域内的某点则满足条件。

2、(双曲线上方,[-a, a]*[-b, b]区域内)这块区域的面积w/(a*b)则为答案。

3、面积w求法:ab - 双曲线下方面积(S + S*ln(a*b/S))。

#pragma comment(linker, "/STACK:102400000, 102400000")
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<list>
#define Min(a, b) ((a < b) ? a : b)
#define Max(a, b) ((a < b) ? b : a)
const double eps = 1e-8;
inline int dcmp(double a, double b){
if(fabs(a - b) < eps) return 0;
return a > b ? 1 : -1;
}
typedef long long LL;
typedef unsigned long long ULL;
const int INT_INF = 0x3f3f3f3f;
const int INT_M_INF = 0x7f7f7f7f;
const LL LL_INF = 0x3f3f3f3f3f3f3f3f;
const LL LL_M_INF = 0x7f7f7f7f7f7f7f7f;
const int dr[] = {0, 0, -1, 1, -1, -1, 1, 1};
const int dc[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const int MOD = 1e9 + 7;
const double pi = acos(-1.0);
const int MAXN = 10000 + 10;
const int MAXT = 10000 + 10;
using namespace std;
int main(){
int T;
scanf("%d", &T);
while(T--){
double a, b, S;
scanf("%lf%lf%lf", &a, &b, &S);
double m = a * b;
if(S >= a * b){
printf("0.000000%%\n");
continue;
}
if(fabs(S) < eps){
printf("100.000000%%\n");
continue;
}
double ans = (m - S - S * log(m / S)) * 100 / m;
printf("%.6lf%%\n", ans);
}
return 0;
}

  

UVA - 11346 Probability(概率)(连续概率)的更多相关文章

  1. UVa 11346 Probability (转化+积分+概率)

    题意:给定a,b,s,在[-a, a]*[-b, b]区域内任取一点p,求以原点(0,0)和p为对角线的长方形面积大于s的概率. 析:应该明白,这个和高中数学的东西差不多,基本就是一个求概率的题,只不 ...

  2. uva 11346 - Probability(概率)

    option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321">题目链接:uva 11346 - ...

  3. uva 11346 - Probability(可能性)

    题目链接:uva 11346 - Probability 题目大意:给定x,y的范围.以及s,问说在该范围内选取一点,和x,y轴形成图形的面积大于s的概率. 解题思路:首先达到方程xy ≥ s.即y ...

  4. ●UVa 11346 Probability

    题链: https://vjudge.net/problem/UVA-11346题解: 连续概率,积分 由于对称性,我们只用考虑第一象限即可. 如果要使得面积大于S,即xy>S, 那么可以选取的 ...

  5. UVA 11346 Probability 概率 (连续概率)

    题意:给出a和b,表示在直角坐标系上的x=[-a,a] 和 y=[-b,b]的这样一块矩形区域.给出一个数s,问在矩形内随机选择一个点p=(x,y),则(0.0)和p点组成的矩形面积大于s的概率是多少 ...

  6. UVA - 11346 Probability (概率)

    Description Probability Time Limit: 1 sec  Memory Limit: 16MB Consider rectangular coordinate system ...

  7. UVA 11181 Probability|Given (离散概率)

    题意:有n个人去商场,其中每个人都有一个打算买东西的概率P[i].问你最后r个人买了东西的情况下每个人买东西的概率 题解:一脸蒙蔽的题,之前的概率与之后的概率不一样??? 看了白书上的题解才知道了,其 ...

  8. UVa 11346 - Probability(几何概型)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  9. UVA 11346 - Probability 数学积分

    Consider rectangular coordinate system and point L(X, Y ) which is randomly chosen among all pointsi ...

随机推荐

  1. redis学习笔记-01:redis简介

    1.redis是一个高性能的Nosql数据库,遵守BSD协议,使用c语言编写.支持网络.可基于内存亦可持久化,是一种日志型.Key-Value数据库,也可看做是一个分布式的.基于内存的缓存工具. 2. ...

  2. Python—处理Excel表格

    一.使用xlrd和xlwt这两个库来处理excel,即xlrd是读excel的库,xlwt是写excel的库 1.使用 xlrd 读取Excel数据 # -*- coding:utf-8 -*- im ...

  3. Myeclipse 安装时候android adt, android sdk常见问题

    离线版adt安装  可以随意百度adt下载 安装时候注意断网模式,否则会连接到服务器耗费很长时间:如果安装报错,可能是adt与Myeclipse版本不匹配,如我用的是Myeclipse8.6,安装AD ...

  4. MyEclipse Hibernate逆向工程的使用

    简介MyEclipse自带很多非常实用的工具,本次将介绍Hibernate工具的使用.1.首先打开MyEclipse的Hibernate视图 2.然后在左上角的DB Browser视图中,右键,新建数 ...

  5. Java得到一个整数的绝对值,不使用任何判断和比较语句,包括API.

    /** * Java得到一个整数的绝对值,不使用任何判断和比较语句,包括API. <br> * 1.不得使用任何API,如Math.abs()等.<br> * 2.不得使用判断 ...

  6. bootstrap fileinput控件上传文件大小限制

    部分js: language: "zh",//设置语言 showCaption: true,//是否显示标题 showUpload: true, //是否显示上传按钮 showPr ...

  7. Arm-Linux 移植 Ubuntu

    前言: 这篇文章介绍如何构建一个完整基于ARM的Ubuntu系统. 由于改文章当初写的时候是发表在国外产品论坛上面,故保留了原文内容. 使用到的硬件平台:Geekbox 补充说明: 虽然Geekbox ...

  8. POJ 1027:The Same Game 较(chao)为(ji)复(ma)杂(fan)的模拟

    The Same Game Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5168   Accepted: 1944 Des ...

  9. BVS安全检测之检查Linux是否口令生存周期

    口令生存周期的配置文件为 /etc/login.defs vim 打开该文件,命令模式下输入 /PASS_MAX_DAYS 找到该配置信息的位置 我的Linux操作系统默认显示的是99999,说明我当 ...

  10. windows清理命令

    总是有一些设备需要清理,第三方的软件有不可以安装,那么,就需要这两条命令来做: cleanmgr /sageset:99 #设置要被清理的东西 cleanmgr /sagerun:99 #执行清理操作 ...